-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
x86, vdso: Make vsyscall_gtod_data handling x86 generic
This patch move the vsyscall_gtod_data handling out of vsyscall_64.c into an additonal file vsyscall_gtod.c to make the functionality available for x86 32 bit kernel. It also adds a new vsyscall_32.c which setup the VVAR page. Reviewed-by: Andy Lutomirski <luto@amacapital.net> Signed-off-by: Stefani Seibold <stefani@seibold.net> Link: http://lkml.kernel.org/r/1395094933-14252-2-git-send-email-stefani@seibold.net Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
- Loading branch information
Stefani Seibold
authored and
H. Peter Anvin
committed
Mar 18, 2014
1 parent
1f2cbcf
commit d2312e3
Showing
10 changed files
with
72 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* | ||
* Copyright (C) 2001 Andrea Arcangeli <andrea@suse.de> SuSE | ||
* Copyright 2003 Andi Kleen, SuSE Labs. | ||
* | ||
* Modified for x86 32 bit architecture by | ||
* Stefani Seibold <stefani@seibold.net> | ||
* | ||
* Thanks to hpa@transmeta.com for some useful hint. | ||
* Special thanks to Ingo Molnar for his early experience with | ||
* a different vsyscall implementation for Linux/IA32 and for the name. | ||
* | ||
*/ | ||
|
||
#include <linux/timekeeper_internal.h> | ||
#include <asm/vgtod.h> | ||
|
||
DEFINE_VVAR(struct vsyscall_gtod_data, vsyscall_gtod_data); | ||
|
||
void update_vsyscall_tz(void) | ||
{ | ||
vsyscall_gtod_data.sys_tz = sys_tz; | ||
} | ||
|
||
void update_vsyscall(struct timekeeper *tk) | ||
{ | ||
struct vsyscall_gtod_data *vdata = &vsyscall_gtod_data; | ||
|
||
write_seqcount_begin(&vdata->seq); | ||
|
||
/* copy vsyscall data */ | ||
vdata->clock.vclock_mode = tk->clock->archdata.vclock_mode; | ||
vdata->clock.cycle_last = tk->clock->cycle_last; | ||
vdata->clock.mask = tk->clock->mask; | ||
vdata->clock.mult = tk->mult; | ||
vdata->clock.shift = tk->shift; | ||
|
||
vdata->wall_time_sec = tk->xtime_sec; | ||
vdata->wall_time_snsec = tk->xtime_nsec; | ||
|
||
vdata->monotonic_time_sec = tk->xtime_sec | ||
+ tk->wall_to_monotonic.tv_sec; | ||
vdata->monotonic_time_snsec = tk->xtime_nsec | ||
+ (tk->wall_to_monotonic.tv_nsec | ||
<< tk->shift); | ||
while (vdata->monotonic_time_snsec >= | ||
(((u64)NSEC_PER_SEC) << tk->shift)) { | ||
vdata->monotonic_time_snsec -= | ||
((u64)NSEC_PER_SEC) << tk->shift; | ||
vdata->monotonic_time_sec++; | ||
} | ||
|
||
vdata->wall_time_coarse.tv_sec = tk->xtime_sec; | ||
vdata->wall_time_coarse.tv_nsec = (long)(tk->xtime_nsec >> tk->shift); | ||
|
||
vdata->monotonic_time_coarse = timespec_add(vdata->wall_time_coarse, | ||
tk->wall_to_monotonic); | ||
|
||
write_seqcount_end(&vdata->seq); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters