diff options
author | Paul Mackerras <paulus@samba.org> | 2007-09-19 20:09:27 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-09-19 20:09:27 -0400 |
commit | 0ce49a3945474fc942ec37c0c0efece60f592f80 (patch) | |
tree | f42b821b2d9e2d8775bc22f56d444c2cc7b7b7dd /arch/powerpc/kernel/time.c | |
parent | 9e4859ef5462193643fd2b3c8ffb298e5a4a4319 (diff) | |
parent | a88a8eff1e6e32d3288986a9d36c6a449c032d3a (diff) |
Merge branch 'linux-2.6'
Diffstat (limited to 'arch/powerpc/kernel/time.c')
-rw-r--r-- | arch/powerpc/kernel/time.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c index b5944d8e3802..d95e68c0a6b3 100644 --- a/arch/powerpc/kernel/time.c +++ b/arch/powerpc/kernel/time.c | |||
@@ -238,7 +238,7 @@ static void snapshot_tb_and_purr(void *data) | |||
238 | struct cpu_purr_data *p = &__get_cpu_var(cpu_purr_data); | 238 | struct cpu_purr_data *p = &__get_cpu_var(cpu_purr_data); |
239 | 239 | ||
240 | local_irq_save(flags); | 240 | local_irq_save(flags); |
241 | p->tb = mftb(); | 241 | p->tb = get_tb_or_rtc(); |
242 | p->purr = mfspr(SPRN_PURR); | 242 | p->purr = mfspr(SPRN_PURR); |
243 | wmb(); | 243 | wmb(); |
244 | p->initialized = 1; | 244 | p->initialized = 1; |
@@ -316,7 +316,7 @@ static void snapshot_purr(void) | |||
316 | */ | 316 | */ |
317 | void snapshot_timebase(void) | 317 | void snapshot_timebase(void) |
318 | { | 318 | { |
319 | __get_cpu_var(last_jiffy) = get_tb(); | 319 | __get_cpu_var(last_jiffy) = get_tb_or_rtc(); |
320 | snapshot_purr(); | 320 | snapshot_purr(); |
321 | } | 321 | } |
322 | 322 | ||
@@ -683,6 +683,8 @@ void timer_interrupt(struct pt_regs * regs) | |||
683 | 683 | ||
684 | write_seqlock(&xtime_lock); | 684 | write_seqlock(&xtime_lock); |
685 | tb_next_jiffy = tb_last_jiffy + tb_ticks_per_jiffy; | 685 | tb_next_jiffy = tb_last_jiffy + tb_ticks_per_jiffy; |
686 | if (__USE_RTC() && tb_next_jiffy >= 1000000000) | ||
687 | tb_next_jiffy -= 1000000000; | ||
686 | if (per_cpu(last_jiffy, cpu) >= tb_next_jiffy) { | 688 | if (per_cpu(last_jiffy, cpu) >= tb_next_jiffy) { |
687 | tb_last_jiffy = tb_next_jiffy; | 689 | tb_last_jiffy = tb_next_jiffy; |
688 | do_timer(1); | 690 | do_timer(1); |
@@ -976,7 +978,7 @@ void __init time_init(void) | |||
976 | tb_to_ns_scale = scale; | 978 | tb_to_ns_scale = scale; |
977 | tb_to_ns_shift = shift; | 979 | tb_to_ns_shift = shift; |
978 | /* Save the current timebase to pretty up CONFIG_PRINTK_TIME */ | 980 | /* Save the current timebase to pretty up CONFIG_PRINTK_TIME */ |
979 | boot_tb = get_tb(); | 981 | boot_tb = get_tb_or_rtc(); |
980 | 982 | ||
981 | tm = get_boot_time(); | 983 | tm = get_boot_time(); |
982 | 984 | ||