diff options
Diffstat (limited to 'kernel/time.c')
-rw-r--r-- | kernel/time.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/kernel/time.c b/kernel/time.c index d226c6a3fd28..f8342a41efa6 100644 --- a/kernel/time.c +++ b/kernel/time.c | |||
@@ -115,6 +115,12 @@ SYSCALL_DEFINE2(gettimeofday, struct timeval __user *, tv, | |||
115 | } | 115 | } |
116 | 116 | ||
117 | /* | 117 | /* |
118 | * Indicates if there is an offset between the system clock and the hardware | ||
119 | * clock/persistent clock/rtc. | ||
120 | */ | ||
121 | int persistent_clock_is_local; | ||
122 | |||
123 | /* | ||
118 | * Adjust the time obtained from the CMOS to be UTC time instead of | 124 | * Adjust the time obtained from the CMOS to be UTC time instead of |
119 | * local time. | 125 | * local time. |
120 | * | 126 | * |
@@ -135,6 +141,8 @@ static inline void warp_clock(void) | |||
135 | struct timespec adjust; | 141 | struct timespec adjust; |
136 | 142 | ||
137 | adjust = current_kernel_time(); | 143 | adjust = current_kernel_time(); |
144 | if (sys_tz.tz_minuteswest != 0) | ||
145 | persistent_clock_is_local = 1; | ||
138 | adjust.tv_sec += sys_tz.tz_minuteswest * 60; | 146 | adjust.tv_sec += sys_tz.tz_minuteswest * 60; |
139 | do_settimeofday(&adjust); | 147 | do_settimeofday(&adjust); |
140 | } | 148 | } |
@@ -232,7 +240,7 @@ EXPORT_SYMBOL(current_fs_time); | |||
232 | * Avoid unnecessary multiplications/divisions in the | 240 | * Avoid unnecessary multiplications/divisions in the |
233 | * two most common HZ cases: | 241 | * two most common HZ cases: |
234 | */ | 242 | */ |
235 | inline unsigned int jiffies_to_msecs(const unsigned long j) | 243 | unsigned int jiffies_to_msecs(const unsigned long j) |
236 | { | 244 | { |
237 | #if HZ <= MSEC_PER_SEC && !(MSEC_PER_SEC % HZ) | 245 | #if HZ <= MSEC_PER_SEC && !(MSEC_PER_SEC % HZ) |
238 | return (MSEC_PER_SEC / HZ) * j; | 246 | return (MSEC_PER_SEC / HZ) * j; |
@@ -248,7 +256,7 @@ inline unsigned int jiffies_to_msecs(const unsigned long j) | |||
248 | } | 256 | } |
249 | EXPORT_SYMBOL(jiffies_to_msecs); | 257 | EXPORT_SYMBOL(jiffies_to_msecs); |
250 | 258 | ||
251 | inline unsigned int jiffies_to_usecs(const unsigned long j) | 259 | unsigned int jiffies_to_usecs(const unsigned long j) |
252 | { | 260 | { |
253 | #if HZ <= USEC_PER_SEC && !(USEC_PER_SEC % HZ) | 261 | #if HZ <= USEC_PER_SEC && !(USEC_PER_SEC % HZ) |
254 | return (USEC_PER_SEC / HZ) * j; | 262 | return (USEC_PER_SEC / HZ) * j; |