diff options
Diffstat (limited to 'arch/x86_64')
-rw-r--r-- | arch/x86_64/kernel/time.c | 12 | ||||
-rw-r--r-- | arch/x86_64/kernel/vmlinux.lds.S | 3 | ||||
-rw-r--r-- | arch/x86_64/kernel/vsyscall.c | 3 |
3 files changed, 4 insertions, 14 deletions
diff --git a/arch/x86_64/kernel/time.c b/arch/x86_64/kernel/time.c index 7ea3bf2a858c..557e92af7bea 100644 --- a/arch/x86_64/kernel/time.c +++ b/arch/x86_64/kernel/time.c | |||
@@ -77,7 +77,6 @@ unsigned long long monotonic_base; | |||
77 | struct vxtime_data __vxtime __section_vxtime; /* for vsyscalls */ | 77 | struct vxtime_data __vxtime __section_vxtime; /* for vsyscalls */ |
78 | 78 | ||
79 | volatile unsigned long __jiffies __section_jiffies = INITIAL_JIFFIES; | 79 | volatile unsigned long __jiffies __section_jiffies = INITIAL_JIFFIES; |
80 | unsigned long __wall_jiffies __section_wall_jiffies = INITIAL_JIFFIES; | ||
81 | struct timespec __xtime __section_xtime; | 80 | struct timespec __xtime __section_xtime; |
82 | struct timezone __sys_tz __section_sys_tz; | 81 | struct timezone __sys_tz __section_sys_tz; |
83 | 82 | ||
@@ -119,7 +118,7 @@ unsigned int (*do_gettimeoffset)(void) = do_gettimeoffset_tsc; | |||
119 | 118 | ||
120 | void do_gettimeofday(struct timeval *tv) | 119 | void do_gettimeofday(struct timeval *tv) |
121 | { | 120 | { |
122 | unsigned long seq, t; | 121 | unsigned long seq; |
123 | unsigned int sec, usec; | 122 | unsigned int sec, usec; |
124 | 123 | ||
125 | do { | 124 | do { |
@@ -136,10 +135,7 @@ void do_gettimeofday(struct timeval *tv) | |||
136 | be found. Note when you fix it here you need to do the same | 135 | be found. Note when you fix it here you need to do the same |
137 | in arch/x86_64/kernel/vsyscall.c and export all needed | 136 | in arch/x86_64/kernel/vsyscall.c and export all needed |
138 | variables in vmlinux.lds. -AK */ | 137 | variables in vmlinux.lds. -AK */ |
139 | 138 | usec += do_gettimeoffset(); | |
140 | t = (jiffies - wall_jiffies) * USEC_PER_TICK + | ||
141 | do_gettimeoffset(); | ||
142 | usec += t; | ||
143 | 139 | ||
144 | } while (read_seqretry(&xtime_lock, seq)); | 140 | } while (read_seqretry(&xtime_lock, seq)); |
145 | 141 | ||
@@ -165,8 +161,7 @@ int do_settimeofday(struct timespec *tv) | |||
165 | 161 | ||
166 | write_seqlock_irq(&xtime_lock); | 162 | write_seqlock_irq(&xtime_lock); |
167 | 163 | ||
168 | nsec -= do_gettimeoffset() * NSEC_PER_USEC + | 164 | nsec -= do_gettimeoffset() * NSEC_PER_USEC; |
169 | (jiffies - wall_jiffies) * NSEC_PER_TICK; | ||
170 | 165 | ||
171 | wtm_sec = wall_to_monotonic.tv_sec + (xtime.tv_sec - sec); | 166 | wtm_sec = wall_to_monotonic.tv_sec + (xtime.tv_sec - sec); |
172 | wtm_nsec = wall_to_monotonic.tv_nsec + (xtime.tv_nsec - nsec); | 167 | wtm_nsec = wall_to_monotonic.tv_nsec + (xtime.tv_nsec - nsec); |
@@ -1071,7 +1066,6 @@ static int timer_resume(struct sys_device *dev) | |||
1071 | vxtime.last_tsc = get_cycles_sync(); | 1066 | vxtime.last_tsc = get_cycles_sync(); |
1072 | write_sequnlock_irqrestore(&xtime_lock,flags); | 1067 | write_sequnlock_irqrestore(&xtime_lock,flags); |
1073 | jiffies += sleep_length; | 1068 | jiffies += sleep_length; |
1074 | wall_jiffies += sleep_length; | ||
1075 | monotonic_base += sleep_length * (NSEC_PER_SEC/HZ); | 1069 | monotonic_base += sleep_length * (NSEC_PER_SEC/HZ); |
1076 | touch_softlockup_watchdog(); | 1070 | touch_softlockup_watchdog(); |
1077 | return 0; | 1071 | return 0; |
diff --git a/arch/x86_64/kernel/vmlinux.lds.S b/arch/x86_64/kernel/vmlinux.lds.S index f8aeccf105fa..b9df2ab6529f 100644 --- a/arch/x86_64/kernel/vmlinux.lds.S +++ b/arch/x86_64/kernel/vmlinux.lds.S | |||
@@ -101,9 +101,6 @@ SECTIONS | |||
101 | .vgetcpu_mode : AT(VLOAD(.vgetcpu_mode)) { *(.vgetcpu_mode) } | 101 | .vgetcpu_mode : AT(VLOAD(.vgetcpu_mode)) { *(.vgetcpu_mode) } |
102 | vgetcpu_mode = VVIRT(.vgetcpu_mode); | 102 | vgetcpu_mode = VVIRT(.vgetcpu_mode); |
103 | 103 | ||
104 | .wall_jiffies : AT(VLOAD(.wall_jiffies)) { *(.wall_jiffies) } | ||
105 | wall_jiffies = VVIRT(.wall_jiffies); | ||
106 | |||
107 | .sys_tz : AT(VLOAD(.sys_tz)) { *(.sys_tz) } | 104 | .sys_tz : AT(VLOAD(.sys_tz)) { *(.sys_tz) } |
108 | sys_tz = VVIRT(.sys_tz); | 105 | sys_tz = VVIRT(.sys_tz); |
109 | 106 | ||
diff --git a/arch/x86_64/kernel/vsyscall.c b/arch/x86_64/kernel/vsyscall.c index 07c086382059..a98b460af6a1 100644 --- a/arch/x86_64/kernel/vsyscall.c +++ b/arch/x86_64/kernel/vsyscall.c | |||
@@ -66,8 +66,7 @@ static __always_inline void do_vgettimeofday(struct timeval * tv) | |||
66 | sequence = read_seqbegin(&__xtime_lock); | 66 | sequence = read_seqbegin(&__xtime_lock); |
67 | 67 | ||
68 | sec = __xtime.tv_sec; | 68 | sec = __xtime.tv_sec; |
69 | usec = (__xtime.tv_nsec / 1000) + | 69 | usec = __xtime.tv_nsec / 1000; |
70 | (__jiffies - __wall_jiffies) * (1000000 / HZ); | ||
71 | 70 | ||
72 | if (__vxtime.mode != VXTIME_HPET) { | 71 | if (__vxtime.mode != VXTIME_HPET) { |
73 | t = get_cycles_sync(); | 72 | t = get_cycles_sync(); |