Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 60694
b: refs/heads/master
c: fc9069f
h: refs/heads/master
v: v3
  • Loading branch information
Tony Breeds authored and Paul Mackerras committed Jul 10, 2007
1 parent 594b66a commit 16a56d2
Show file tree
Hide file tree
Showing 2 changed files with 7 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: 4bb092811c72685f5ba26340d393c0717f5a43b1
refs/heads/master: fc9069fe56d9594b7a6da0b9f9ca0eafd756260f
9 changes: 6 additions & 3 deletions trunk/arch/powerpc/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,9 @@ u64 ticklen_to_xs; /* 0.64 fraction */
DEFINE_SPINLOCK(rtc_lock);
EXPORT_SYMBOL_GPL(rtc_lock);

u64 tb_to_ns_scale;
unsigned tb_to_ns_shift;
static u64 tb_to_ns_scale __read_mostly;
static unsigned tb_to_ns_shift __read_mostly;
static unsigned long boot_tb __read_mostly;

struct gettimeofday_struct do_gtod;

Expand Down Expand Up @@ -755,7 +756,7 @@ unsigned long long sched_clock(void)
{
if (__USE_RTC())
return get_rtc();
return mulhdu(get_tb(), tb_to_ns_scale) << tb_to_ns_shift;
return mulhdu(get_tb() - boot_tb, tb_to_ns_scale) << tb_to_ns_shift;
}

int do_settimeofday(struct timespec *tv)
Expand Down Expand Up @@ -974,6 +975,8 @@ 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();

tm = get_boot_time();

Expand Down

0 comments on commit 16a56d2

Please sign in to comment.