diff options
Diffstat (limited to 'arch/ppc/kernel/time.c')
-rw-r--r-- | arch/ppc/kernel/time.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/arch/ppc/kernel/time.c b/arch/ppc/kernel/time.c index 735866559199..bf4ddca5e853 100644 --- a/arch/ppc/kernel/time.c +++ b/arch/ppc/kernel/time.c | |||
@@ -89,6 +89,9 @@ unsigned long tb_to_ns_scale; | |||
89 | 89 | ||
90 | extern unsigned long wall_jiffies; | 90 | extern unsigned long wall_jiffies; |
91 | 91 | ||
92 | /* used for timezone offset */ | ||
93 | static long timezone_offset; | ||
94 | |||
92 | DEFINE_SPINLOCK(rtc_lock); | 95 | DEFINE_SPINLOCK(rtc_lock); |
93 | 96 | ||
94 | EXPORT_SYMBOL(rtc_lock); | 97 | EXPORT_SYMBOL(rtc_lock); |
@@ -170,7 +173,7 @@ void timer_interrupt(struct pt_regs * regs) | |||
170 | xtime.tv_sec - last_rtc_update >= 659 && | 173 | xtime.tv_sec - last_rtc_update >= 659 && |
171 | abs((xtime.tv_nsec / 1000) - (1000000-1000000/HZ)) < 500000/HZ && | 174 | abs((xtime.tv_nsec / 1000) - (1000000-1000000/HZ)) < 500000/HZ && |
172 | jiffies - wall_jiffies == 1) { | 175 | jiffies - wall_jiffies == 1) { |
173 | if (ppc_md.set_rtc_time(xtime.tv_sec+1 + time_offset) == 0) | 176 | if (ppc_md.set_rtc_time(xtime.tv_sec+1 + timezone_offset) == 0) |
174 | last_rtc_update = xtime.tv_sec+1; | 177 | last_rtc_update = xtime.tv_sec+1; |
175 | else | 178 | else |
176 | /* Try again one minute later */ | 179 | /* Try again one minute later */ |
@@ -286,7 +289,7 @@ void __init time_init(void) | |||
286 | unsigned old_stamp, stamp, elapsed; | 289 | unsigned old_stamp, stamp, elapsed; |
287 | 290 | ||
288 | if (ppc_md.time_init != NULL) | 291 | if (ppc_md.time_init != NULL) |
289 | time_offset = ppc_md.time_init(); | 292 | timezone_offset = ppc_md.time_init(); |
290 | 293 | ||
291 | if (__USE_RTC()) { | 294 | if (__USE_RTC()) { |
292 | /* 601 processor: dec counts down by 128 every 128ns */ | 295 | /* 601 processor: dec counts down by 128 every 128ns */ |
@@ -331,10 +334,10 @@ void __init time_init(void) | |||
331 | set_dec(tb_ticks_per_jiffy); | 334 | set_dec(tb_ticks_per_jiffy); |
332 | 335 | ||
333 | /* If platform provided a timezone (pmac), we correct the time */ | 336 | /* If platform provided a timezone (pmac), we correct the time */ |
334 | if (time_offset) { | 337 | if (timezone_offset) { |
335 | sys_tz.tz_minuteswest = -time_offset / 60; | 338 | sys_tz.tz_minuteswest = -timezone_offset / 60; |
336 | sys_tz.tz_dsttime = 0; | 339 | sys_tz.tz_dsttime = 0; |
337 | xtime.tv_sec -= time_offset; | 340 | xtime.tv_sec -= timezone_offset; |
338 | } | 341 | } |
339 | set_normalized_timespec(&wall_to_monotonic, | 342 | set_normalized_timespec(&wall_to_monotonic, |
340 | -xtime.tv_sec, -xtime.tv_nsec); | 343 | -xtime.tv_sec, -xtime.tv_nsec); |