aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/clocksource.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/clocksource.h')
-rw-r--r--include/linux/clocksource.h43
1 files changed, 25 insertions, 18 deletions
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
index c37b21ad5a3b..18a1baf31f2d 100644
--- a/include/linux/clocksource.h
+++ b/include/linux/clocksource.h
@@ -159,42 +159,39 @@ extern u64 timecounter_cyc2time(struct timecounter *tc,
159 */ 159 */
160struct clocksource { 160struct clocksource {
161 /* 161 /*
162 * First part of structure is read mostly 162 * Hotpath data, fits in a single cache line when the
163 * clocksource itself is cacheline aligned.
163 */ 164 */
164 char *name;
165 struct list_head list;
166 int rating;
167 cycle_t (*read)(struct clocksource *cs); 165 cycle_t (*read)(struct clocksource *cs);
168 int (*enable)(struct clocksource *cs); 166 cycle_t cycle_last;
169 void (*disable)(struct clocksource *cs);
170 cycle_t mask; 167 cycle_t mask;
171 u32 mult; 168 u32 mult;
172 u32 shift; 169 u32 shift;
173 u64 max_idle_ns; 170 u64 max_idle_ns;
174 unsigned long flags; 171
175 cycle_t (*vread)(void);
176 void (*suspend)(struct clocksource *cs);
177 void (*resume)(struct clocksource *cs);
178#ifdef CONFIG_IA64 172#ifdef CONFIG_IA64
179 void *fsys_mmio; /* used by fsyscall asm code */ 173 void *fsys_mmio; /* used by fsyscall asm code */
180#define CLKSRC_FSYS_MMIO_SET(mmio, addr) ((mmio) = (addr)) 174#define CLKSRC_FSYS_MMIO_SET(mmio, addr) ((mmio) = (addr))
181#else 175#else
182#define CLKSRC_FSYS_MMIO_SET(mmio, addr) do { } while (0) 176#define CLKSRC_FSYS_MMIO_SET(mmio, addr) do { } while (0)
183#endif 177#endif
184 178 const char *name;
185 /* 179 struct list_head list;
186 * Second part is written at each timer interrupt 180 int rating;
187 * Keep it in a different cache line to dirty no 181 cycle_t (*vread)(void);
188 * more than one cache line. 182 int (*enable)(struct clocksource *cs);
189 */ 183 void (*disable)(struct clocksource *cs);
190 cycle_t cycle_last ____cacheline_aligned_in_smp; 184 unsigned long flags;
185 void (*suspend)(struct clocksource *cs);
186 void (*resume)(struct clocksource *cs);
191 187
192#ifdef CONFIG_CLOCKSOURCE_WATCHDOG 188#ifdef CONFIG_CLOCKSOURCE_WATCHDOG
193 /* Watchdog related data, used by the framework */ 189 /* Watchdog related data, used by the framework */
194 struct list_head wd_list; 190 struct list_head wd_list;
191 cycle_t cs_last;
195 cycle_t wd_last; 192 cycle_t wd_last;
196#endif 193#endif
197}; 194} ____cacheline_aligned;
198 195
199/* 196/*
200 * Clock source flags bits:: 197 * Clock source flags bits::
@@ -341,4 +338,14 @@ static inline void update_vsyscall_tz(void)
341 338
342extern void timekeeping_notify(struct clocksource *clock); 339extern void timekeeping_notify(struct clocksource *clock);
343 340
341extern cycle_t clocksource_mmio_readl_up(struct clocksource *);
342extern cycle_t clocksource_mmio_readl_down(struct clocksource *);
343extern cycle_t clocksource_mmio_readw_up(struct clocksource *);
344extern cycle_t clocksource_mmio_readw_down(struct clocksource *);
345
346extern int clocksource_mmio_init(void __iomem *, const char *,
347 unsigned long, int, unsigned, cycle_t (*)(struct clocksource *));
348
349extern int clocksource_i8253_init(void);
350
344#endif /* _LINUX_CLOCKSOURCE_H */ 351#endif /* _LINUX_CLOCKSOURCE_H */