diff options
author | john stultz <johnstul@us.ibm.com> | 2009-05-01 16:10:26 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2009-05-02 05:45:15 -0400 |
commit | 7d27558c4138ac6b3684dea35c2f4379b940a7dd (patch) | |
tree | c10f5cee4dda1e6bc7977d016db020377f97feab /include | |
parent | a25cbd045a2ffc42787d4dbcbb9c7118f5f42732 (diff) |
timekeeping: create arch_gettimeoffset infrastructure
Some arches don't supply their own clocksource. This is mainly the
case in architectures that get their inter-tick times by reading the
counter on their interval timer. Since these timers wrap every tick,
they're not really useful as clocksources. Wrapping them to act like
one is possible but not very efficient. So we provide a callout these
arches can implement for use with the jiffies clocksource to provide
finer then tick granular time.
[ Impact: ease the migration to generic time keeping ]
Signed-off-by: John Stultz <johnstul@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/time.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/time.h b/include/linux/time.h index 242f62499bb7..ea16c1a01d51 100644 --- a/include/linux/time.h +++ b/include/linux/time.h | |||
@@ -113,6 +113,21 @@ struct timespec current_kernel_time(void); | |||
113 | #define CURRENT_TIME (current_kernel_time()) | 113 | #define CURRENT_TIME (current_kernel_time()) |
114 | #define CURRENT_TIME_SEC ((struct timespec) { get_seconds(), 0 }) | 114 | #define CURRENT_TIME_SEC ((struct timespec) { get_seconds(), 0 }) |
115 | 115 | ||
116 | /* Some architectures do not supply their own clocksource. | ||
117 | * This is mainly the case in architectures that get their | ||
118 | * inter-tick times by reading the counter on their interval | ||
119 | * timer. Since these timers wrap every tick, they're not really | ||
120 | * useful as clocksources. Wrapping them to act like one is possible | ||
121 | * but not very efficient. So we provide a callout these arches | ||
122 | * can implement for use with the jiffies clocksource to provide | ||
123 | * finer then tick granular time. | ||
124 | */ | ||
125 | #ifdef CONFIG_ARCH_USES_GETTIMEOFFSET | ||
126 | extern u32 arch_gettimeoffset(void); | ||
127 | #else | ||
128 | static inline u32 arch_gettimeoffset(void) { return 0; } | ||
129 | #endif | ||
130 | |||
116 | extern void do_gettimeofday(struct timeval *tv); | 131 | extern void do_gettimeofday(struct timeval *tv); |
117 | extern int do_settimeofday(struct timespec *tv); | 132 | extern int do_settimeofday(struct timespec *tv); |
118 | extern int do_sys_settimeofday(struct timespec *tv, struct timezone *tz); | 133 | extern int do_sys_settimeofday(struct timespec *tv, struct timezone *tz); |