diff options
author | Andy Lutomirski <luto@mit.edu> | 2011-07-13 09:24:13 -0400 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2011-07-13 14:23:12 -0400 |
commit | 433bd805e5fd2c731b3a9025b034f066272d336e (patch) | |
tree | 3c319294f98d048146ba1b082241aee197c7d0cf /include | |
parent | 7f79ad15f33cf4968cafb0e3d2beba427de01d3a (diff) |
clocksource: Replace vread with generic arch data
The vread field was bloating struct clocksource everywhere except
x86_64, and I want to change the way this works on x86_64, so let's
split it out into per-arch data.
Cc: x86@kernel.org
Cc: Clemens Ladisch <clemens@ladisch.de>
Cc: linux-ia64@vger.kernel.org
Cc: Tony Luck <tony.luck@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: John Stultz <johnstul@us.ibm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andy Lutomirski <luto@mit.edu>
Link: http://lkml.kernel.org/r/3ae5ec76a168eaaae63f08a2a1060b91aa0b7759.1310563276.git.luto@mit.edu
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-generic/clocksource.h | 4 | ||||
-rw-r--r-- | include/linux/clocksource.h | 10 |
2 files changed, 12 insertions, 2 deletions
diff --git a/include/asm-generic/clocksource.h b/include/asm-generic/clocksource.h new file mode 100644 index 000000000000..0a462d3fb05e --- /dev/null +++ b/include/asm-generic/clocksource.h | |||
@@ -0,0 +1,4 @@ | |||
1 | /* | ||
2 | * Architectures should override this file to add private userspace | ||
3 | * clock magic if needed. | ||
4 | */ | ||
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h index d4646b48dc4a..0fb83c224471 100644 --- a/include/linux/clocksource.h +++ b/include/linux/clocksource.h | |||
@@ -22,6 +22,8 @@ | |||
22 | typedef u64 cycle_t; | 22 | typedef u64 cycle_t; |
23 | struct clocksource; | 23 | struct clocksource; |
24 | 24 | ||
25 | #include <asm/clocksource.h> | ||
26 | |||
25 | /** | 27 | /** |
26 | * struct cyclecounter - hardware abstraction for a free running counter | 28 | * struct cyclecounter - hardware abstraction for a free running counter |
27 | * Provides completely state-free accessors to the underlying hardware. | 29 | * Provides completely state-free accessors to the underlying hardware. |
@@ -153,7 +155,7 @@ extern u64 timecounter_cyc2time(struct timecounter *tc, | |||
153 | * @shift: cycle to nanosecond divisor (power of two) | 155 | * @shift: cycle to nanosecond divisor (power of two) |
154 | * @max_idle_ns: max idle time permitted by the clocksource (nsecs) | 156 | * @max_idle_ns: max idle time permitted by the clocksource (nsecs) |
155 | * @flags: flags describing special properties | 157 | * @flags: flags describing special properties |
156 | * @vread: vsyscall based read | 158 | * @archdata: arch-specific data |
157 | * @suspend: suspend function for the clocksource, if necessary | 159 | * @suspend: suspend function for the clocksource, if necessary |
158 | * @resume: resume function for the clocksource, if necessary | 160 | * @resume: resume function for the clocksource, if necessary |
159 | */ | 161 | */ |
@@ -175,10 +177,14 @@ struct clocksource { | |||
175 | #else | 177 | #else |
176 | #define CLKSRC_FSYS_MMIO_SET(mmio, addr) do { } while (0) | 178 | #define CLKSRC_FSYS_MMIO_SET(mmio, addr) do { } while (0) |
177 | #endif | 179 | #endif |
180 | |||
181 | #ifdef __ARCH_HAS_CLOCKSOURCE_DATA | ||
182 | struct arch_clocksource_data archdata; | ||
183 | #endif | ||
184 | |||
178 | const char *name; | 185 | const char *name; |
179 | struct list_head list; | 186 | struct list_head list; |
180 | int rating; | 187 | int rating; |
181 | cycle_t (*vread)(void); | ||
182 | int (*enable)(struct clocksource *cs); | 188 | int (*enable)(struct clocksource *cs); |
183 | void (*disable)(struct clocksource *cs); | 189 | void (*disable)(struct clocksource *cs); |
184 | unsigned long flags; | 190 | unsigned long flags; |