--- ./kernel/timer.c 2006-11-09 15:44:58.000000000 +0100 +++ ./kernel/timer.c 2006-11-09 16:39:42.000000000 +0100 @@ -109,7 +109,37 @@ #define NOOF_TVECS (sizeof(tvecs) / sizeof(tvecs[0])) -static inline void init_jiffieswrap_timer(void); +#ifdef NEEDS_JIFFIES_64 + +#define CHECK_JIFFIESWRAP_INTERVAL (1ul << (BITS_PER_LONG-2)) +static struct timer_list jiffieswrap_timer; + +/* + * Use a timer to periodically check for jiffies wraparounds. + * Instead of overflows we count flips of the highest bit so + * that we can easily check whether the latest flip is already + * accounted for. + * Not racy as invocations are several days apart in time and + * jiffies_flips is not modified elsewhere. + */ + +static void check_jiffieswrap(unsigned long data) +{ + mod_timer(&jiffieswrap_timer, jiffies + CHECK_JIFFIESWRAP_INTERVAL); + + jiffies_msb_flips += 1 & (jiffies_msb_flips + ^ (jiffies>>(BITS_PER_LONG-1))); +} + +static inline void init_jiffieswrap_timer(void) +{ + init_timer(&jiffieswrap_timer); + jiffieswrap_timer.expires = jiffies + CHECK_JIFFIESWRAP_INTERVAL; + jiffieswrap_timer.function = check_jiffieswrap; + add_timer(&jiffieswrap_timer); +} + +#endif void init_timervecs (void) { @@ -124,7 +154,9 @@ for (i = 0; i < TVR_SIZE; i++) INIT_LIST_HEAD(tv1.vec + i); +#ifdef NEEDS_JIFFIES_64 init_jiffieswrap_timer(); +#endif } static unsigned long timer_jiffies; @@ -736,40 +768,6 @@ return ((u64) f << (BITS_PER_LONG-1)) | j; } -/* - * Use a timer to periodically check for jiffies wraparounds. - * Instead of overflows we count flips of the highest bit so - * that we can easily check whether the latest flip is already - * accounted for. - * Not racy as invocations are several days apart in time and - * jiffies_flips is not modified elsewhere. - */ - -static struct timer_list jiffieswrap_timer; -#define CHECK_JIFFIESWRAP_INTERVAL (1ul << (BITS_PER_LONG-2)) - -static void check_jiffieswrap(unsigned long data) -{ - mod_timer(&jiffieswrap_timer, jiffies + CHECK_JIFFIESWRAP_INTERVAL); - - jiffies_msb_flips += 1 & (jiffies_msb_flips - ^ (jiffies>>(BITS_PER_LONG-1))); -} - -static inline void init_jiffieswrap_timer(void) -{ - init_timer(&jiffieswrap_timer); - jiffieswrap_timer.expires = jiffies + CHECK_JIFFIESWRAP_INTERVAL; - jiffieswrap_timer.function = check_jiffieswrap; - add_timer(&jiffieswrap_timer); -} - -#else - -static inline void init_jiffieswrap_timer(void) -{ -} - #endif /* NEEDS_JIFFIES_64 */