mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-22 14:41:27 +00:00
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
This commit is contained in:
commit
03d3602a83
20 changed files with 288 additions and 264 deletions
|
@ -51,31 +51,17 @@
|
|||
#define SH_DIV(NOM,DEN,LSH) ( (((NOM) / (DEN)) << (LSH)) \
|
||||
+ ((((NOM) % (DEN)) << (LSH)) + (DEN) / 2) / (DEN))
|
||||
|
||||
#ifdef CLOCK_TICK_RATE
|
||||
/* LATCH is used in the interval timer and ftape setup. */
|
||||
# define LATCH ((CLOCK_TICK_RATE + HZ/2) / HZ) /* For divider */
|
||||
#define LATCH ((CLOCK_TICK_RATE + HZ/2) / HZ) /* For divider */
|
||||
|
||||
/*
|
||||
* HZ is the requested value. However the CLOCK_TICK_RATE may not allow
|
||||
* for exactly HZ. So SHIFTED_HZ is high res HZ ("<< 8" is for accuracy)
|
||||
*/
|
||||
# define SHIFTED_HZ (SH_DIV(CLOCK_TICK_RATE, LATCH, 8))
|
||||
#else
|
||||
# define SHIFTED_HZ (HZ << 8)
|
||||
#endif
|
||||
extern int register_refined_jiffies(long clock_tick_rate);
|
||||
|
||||
/* TICK_NSEC is the time between ticks in nsec assuming SHIFTED_HZ */
|
||||
#define TICK_NSEC (SH_DIV(1000000UL * 1000, SHIFTED_HZ, 8))
|
||||
#define TICK_NSEC ((NSEC_PER_SEC+HZ/2)/HZ)
|
||||
|
||||
/* TICK_USEC is the time between ticks in usec assuming fake USER_HZ */
|
||||
#define TICK_USEC ((1000000UL + USER_HZ/2) / USER_HZ)
|
||||
|
||||
/*
|
||||
* TICK_USEC_TO_NSEC is the time between ticks in nsec assuming SHIFTED_HZ and
|
||||
* a value TUSEC for TICK_USEC (can be set bij adjtimex)
|
||||
*/
|
||||
#define TICK_USEC_TO_NSEC(TUSEC) (SH_DIV(TUSEC * USER_HZ * 1000, SHIFTED_HZ, 8))
|
||||
|
||||
/* some arch's have a small-data section that can be accessed register-relative
|
||||
* but that can only take up to, say, 4-byte variables. jiffies being part of
|
||||
* an 8-byte variable may not be correctly accessed unless we force the issue
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue