Merge branch 'x86-cpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[firefly-linux-kernel-4.4.55.git] / include / linux / clocksource.h
index c37b21ad5a3b5c16dcc6c838ce0cb652682362f2..c918fbd33ee58e33f9560adbcc61c9901048ca78 100644 (file)
@@ -159,42 +159,38 @@ extern u64 timecounter_cyc2time(struct timecounter *tc,
  */
 struct clocksource {
        /*
-        * First part of structure is read mostly
+        * Hotpath data, fits in a single cache line when the
+        * clocksource itself is cacheline aligned.
         */
-       char *name;
-       struct list_head list;
-       int rating;
        cycle_t (*read)(struct clocksource *cs);
-       int (*enable)(struct clocksource *cs);
-       void (*disable)(struct clocksource *cs);
+       cycle_t cycle_last;
        cycle_t mask;
        u32 mult;
        u32 shift;
        u64 max_idle_ns;
-       unsigned long flags;
-       cycle_t (*vread)(void);
-       void (*suspend)(struct clocksource *cs);
-       void (*resume)(struct clocksource *cs);
+
 #ifdef CONFIG_IA64
        void *fsys_mmio;        /* used by fsyscall asm code */
 #define CLKSRC_FSYS_MMIO_SET(mmio, addr)      ((mmio) = (addr))
 #else
 #define CLKSRC_FSYS_MMIO_SET(mmio, addr)      do { } while (0)
 #endif
-
-       /*
-        * Second part is written at each timer interrupt
-        * Keep it in a different cache line to dirty no
-        * more than one cache line.
-        */
-       cycle_t cycle_last ____cacheline_aligned_in_smp;
+       const char *name;
+       struct list_head list;
+       int rating;
+       cycle_t (*vread)(void);
+       int (*enable)(struct clocksource *cs);
+       void (*disable)(struct clocksource *cs);
+       unsigned long flags;
+       void (*suspend)(struct clocksource *cs);
+       void (*resume)(struct clocksource *cs);
 
 #ifdef CONFIG_CLOCKSOURCE_WATCHDOG
        /* Watchdog related data, used by the framework */
        struct list_head wd_list;
        cycle_t wd_last;
 #endif
-};
+} ____cacheline_aligned;
 
 /*
  * Clock source flags bits::
@@ -341,4 +337,6 @@ static inline void update_vsyscall_tz(void)
 
 extern void timekeeping_notify(struct clocksource *clock);
 
+extern int clocksource_i8253_init(void);
+
 #endif /* _LINUX_CLOCKSOURCE_H */