Skip to content

Commit acc9a9d

Browse files
john stultzLinus Torvalds
authored andcommitted
[PATCH] generic: vsyscall-gtod support for GENERIC_TIME
Provides generic infrastructure for vsyscall-gtod. [akpm@osdl.org: cleanup] Signed-off-by: John Stultz <johnstul@us.ibm.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Andi Kleen <ak@muc.de> Cc: Roman Zippel <zippel@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 88ad0bf commit acc9a9d

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

‎include/linux/clocksource.h‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ struct clocksource;
4747
* @mult: cycle to nanosecond multiplier
4848
* @shift: cycle to nanosecond divisor (power of two)
4949
* @flags: flags describing special properties
50+
* @vread: vsyscall based read
5051
* @cycle_interval: Used internally by timekeeping core, please ignore.
5152
* @xtime_interval: Used internally by timekeeping core, please ignore.
5253
*/
@@ -59,6 +60,7 @@ struct clocksource {
5960
u32 mult;
6061
u32 shift;
6162
unsigned long flags;
63+
cycle_t (*vread)(void);
6264

6365
/* timekeeping specific data, ignore */
6466
cycle_t cycle_last, cycle_interval;
@@ -197,4 +199,12 @@ extern int clocksource_register(struct clocksource*);
197199
extern struct clocksource* clocksource_get_next(void);
198200
extern void clocksource_change_rating(struct clocksource *cs, int rating);
199201

202+
#ifdef CONFIG_GENERIC_TIME_VSYSCALL
203+
extern void update_vsyscall(struct timespec *ts, struct clocksource *c);
204+
#else
205+
static inline void update_vsyscall(struct timespec *ts, struct clocksource *c)
206+
{
207+
}
208+
#endif
209+
200210
#endif /* _LINUX_CLOCKSOURCE_H */

‎kernel/timer.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1174,6 +1174,7 @@ static void update_wall_time(void)
11741174

11751175
/* check to see if there is a new clocksource to use */
11761176
change_clocksource();
1177+
update_vsyscall(&xtime, clock);
11771178
}
11781179

11791180
/*

0 commit comments

Comments
 (0)