Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 11742
b: refs/heads/master
c: 5f6b5b9
h: refs/heads/master
v: v3
  • Loading branch information
Paul Mackerras committed Oct 30, 2005
1 parent 14dc2bd commit 41261bc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 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: eb66ce6333742e32825f0294310ff53e284fa828
refs/heads/master: 5f6b5b973a125de0dbe236ce659a495787c81ff0
14 changes: 8 additions & 6 deletions trunk/arch/powerpc/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ int do_settimeofday(struct timespec *tv)
long wtm_nsec, new_nsec = tv->tv_nsec;
unsigned long flags;
long int tb_delta;
u64 new_xsec;
u64 new_xsec, tb_delta_xs;

if ((unsigned long)tv->tv_nsec >= NSEC_PER_SEC)
return -EINVAL;
Expand All @@ -541,8 +541,7 @@ int do_settimeofday(struct timespec *tv)
#endif
tb_delta = tb_ticks_since(tb_last_stamp);
tb_delta += (jiffies - wall_jiffies) * tb_ticks_per_jiffy;

new_nsec -= 1000 * mulhwu(tb_to_us, tb_delta);
tb_delta_xs = mulhdu(tb_delta, do_gtod.varp->tb_to_xs);

wtm_sec = wall_to_monotonic.tv_sec + (xtime.tv_sec - new_sec);
wtm_nsec = wall_to_monotonic.tv_nsec + (xtime.tv_nsec - new_nsec);
Expand All @@ -557,9 +556,12 @@ int do_settimeofday(struct timespec *tv)

ntp_clear();

new_xsec = (u64)new_nsec * XSEC_PER_SEC;
do_div(new_xsec, NSEC_PER_SEC);
new_xsec += (u64)new_sec * XSEC_PER_SEC;
new_xsec = 0;
if (new_nsec != 0) {
new_xsec = (u64)new_nsec * XSEC_PER_SEC;
do_div(new_xsec, NSEC_PER_SEC);
}
new_xsec += (u64)new_sec * XSEC_PER_SEC - tb_delta_xs;
update_gtod(tb_last_jiffy, new_xsec, do_gtod.varp->tb_to_xs);

#ifdef CONFIG_PPC64
Expand Down

0 comments on commit 41261bc

Please sign in to comment.