diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-12 09:17:48 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-12 09:17:48 -0400 |
commit | 03d3602a833715f83ea53b9feb078b9c4c5f6c1a (patch) | |
tree | 7b63ec6753dd65e61392017e1aba2ee1e6b4bcd1 /include/linux/jiffies.h | |
parent | 0588f1f934791b79d0a1e9b327be9b6eb361d2b8 (diff) | |
parent | 5b3900cd409466c0070b234d941650685ad0c791 (diff) |
Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull timer core update from Thomas Gleixner:
- Bug fixes (one for a longstanding dead loop issue)
- Rework of time related vsyscalls
- Alarm timer updates
- Jiffies updates to remove compile time dependencies
* 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
timekeeping: Cast raw_interval to u64 to avoid shift overflow
timers: Fix endless looping between cascade() and internal_add_timer()
time/jiffies: bring back unconditional LATCH definition
time: Convert x86_64 to using new update_vsyscall
time: Only do nanosecond rounding on GENERIC_TIME_VSYSCALL_OLD systems
time: Introduce new GENERIC_TIME_VSYSCALL
time: Convert CONFIG_GENERIC_TIME_VSYSCALL to CONFIG_GENERIC_TIME_VSYSCALL_OLD
time: Move update_vsyscall definitions to timekeeper_internal.h
time: Move timekeeper structure to timekeeper_internal.h for vsyscall changes
jiffies: Remove compile time assumptions about CLOCK_TICK_RATE
jiffies: Kill unused TICK_USEC_TO_NSEC
alarmtimer: Rename alarmtimer_remove to alarmtimer_dequeue
alarmtimer: Remove unused helpers & defines
alarmtimer: Use hrtimer per-alarm instead of per-base
alarmtimer: Implement minimum alarm interval for allowing suspend
Diffstat (limited to 'include/linux/jiffies.h')
-rw-r--r-- | include/linux/jiffies.h | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h index 05e3c2c7a8cf..6b87413da9d6 100644 --- a/include/linux/jiffies.h +++ b/include/linux/jiffies.h | |||
@@ -51,31 +51,17 @@ | |||
51 | #define SH_DIV(NOM,DEN,LSH) ( (((NOM) / (DEN)) << (LSH)) \ | 51 | #define SH_DIV(NOM,DEN,LSH) ( (((NOM) / (DEN)) << (LSH)) \ |
52 | + ((((NOM) % (DEN)) << (LSH)) + (DEN) / 2) / (DEN)) | 52 | + ((((NOM) % (DEN)) << (LSH)) + (DEN) / 2) / (DEN)) |
53 | 53 | ||
54 | #ifdef CLOCK_TICK_RATE | ||
55 | /* LATCH is used in the interval timer and ftape setup. */ | 54 | /* LATCH is used in the interval timer and ftape setup. */ |
56 | # define LATCH ((CLOCK_TICK_RATE + HZ/2) / HZ) /* For divider */ | 55 | #define LATCH ((CLOCK_TICK_RATE + HZ/2) / HZ) /* For divider */ |
57 | 56 | ||
58 | /* | 57 | extern int register_refined_jiffies(long clock_tick_rate); |
59 | * HZ is the requested value. However the CLOCK_TICK_RATE may not allow | ||
60 | * for exactly HZ. So SHIFTED_HZ is high res HZ ("<< 8" is for accuracy) | ||
61 | */ | ||
62 | # define SHIFTED_HZ (SH_DIV(CLOCK_TICK_RATE, LATCH, 8)) | ||
63 | #else | ||
64 | # define SHIFTED_HZ (HZ << 8) | ||
65 | #endif | ||
66 | 58 | ||
67 | /* TICK_NSEC is the time between ticks in nsec assuming SHIFTED_HZ */ | 59 | /* TICK_NSEC is the time between ticks in nsec assuming SHIFTED_HZ */ |
68 | #define TICK_NSEC (SH_DIV(1000000UL * 1000, SHIFTED_HZ, 8)) | 60 | #define TICK_NSEC ((NSEC_PER_SEC+HZ/2)/HZ) |
69 | 61 | ||
70 | /* TICK_USEC is the time between ticks in usec assuming fake USER_HZ */ | 62 | /* TICK_USEC is the time between ticks in usec assuming fake USER_HZ */ |
71 | #define TICK_USEC ((1000000UL + USER_HZ/2) / USER_HZ) | 63 | #define TICK_USEC ((1000000UL + USER_HZ/2) / USER_HZ) |
72 | 64 | ||
73 | /* | ||
74 | * TICK_USEC_TO_NSEC is the time between ticks in nsec assuming SHIFTED_HZ and | ||
75 | * a value TUSEC for TICK_USEC (can be set bij adjtimex) | ||
76 | */ | ||
77 | #define TICK_USEC_TO_NSEC(TUSEC) (SH_DIV(TUSEC * USER_HZ * 1000, SHIFTED_HZ, 8)) | ||
78 | |||
79 | /* some arch's have a small-data section that can be accessed register-relative | 65 | /* some arch's have a small-data section that can be accessed register-relative |
80 | * but that can only take up to, say, 4-byte variables. jiffies being part of | 66 | * but that can only take up to, say, 4-byte variables. jiffies being part of |
81 | * an 8-byte variable may not be correctly accessed unless we force the issue | 67 | * an 8-byte variable may not be correctly accessed unless we force the issue |