Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 65041
b: refs/heads/master
c: c27da33
h: refs/heads/master
i:
  65039: 408bf1e
v: v3
  • Loading branch information
Benjamin Herrenschmidt authored and Paul Mackerras committed Sep 19, 2007
1 parent 0f53de6 commit 7e932a8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7b5acbaac3f94ab810a977c0ec4e5fcabbf51bed
refs/heads/master: c27da339698145a9383e052c1070a950d30da478
8 changes: 5 additions & 3 deletions trunk/arch/powerpc/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ static void snapshot_tb_and_purr(void *data)
struct cpu_purr_data *p = &__get_cpu_var(cpu_purr_data);

local_irq_save(flags);
p->tb = mftb();
p->tb = get_tb_or_rtc();
p->purr = mfspr(SPRN_PURR);
wmb();
p->initialized = 1;
Expand Down Expand Up @@ -317,7 +317,7 @@ static void snapshot_purr(void)
*/
void snapshot_timebase(void)
{
__get_cpu_var(last_jiffy) = get_tb();
__get_cpu_var(last_jiffy) = get_tb_or_rtc();
snapshot_purr();
}

Expand Down Expand Up @@ -684,6 +684,8 @@ void timer_interrupt(struct pt_regs * regs)

write_seqlock(&xtime_lock);
tb_next_jiffy = tb_last_jiffy + tb_ticks_per_jiffy;
if (__USE_RTC() && tb_next_jiffy >= 1000000000)
tb_next_jiffy -= 1000000000;
if (per_cpu(last_jiffy, cpu) >= tb_next_jiffy) {
tb_last_jiffy = tb_next_jiffy;
do_timer(1);
Expand Down Expand Up @@ -977,7 +979,7 @@ void __init time_init(void)
tb_to_ns_scale = scale;
tb_to_ns_shift = shift;
/* Save the current timebase to pretty up CONFIG_PRINTK_TIME */
boot_tb = get_tb();
boot_tb = get_tb_or_rtc();

tm = get_boot_time();

Expand Down
5 changes: 5 additions & 0 deletions trunk/include/asm-powerpc/time.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@ static inline u64 get_tb(void)
}
#endif /* !CONFIG_PPC64 */

static inline u64 get_tb_or_rtc(void)
{
return __USE_RTC() ? get_rtc() : get_tb();
}

static inline void set_tb(unsigned int upper, unsigned int lower)
{
mtspr(SPRN_TBWL, 0);
Expand Down

0 comments on commit 7e932a8

Please sign in to comment.