Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 30206
b: refs/heads/master
c: 260a423
h: refs/heads/master
v: v3
  • Loading branch information
john stultz authored and Linus Torvalds committed Jun 26, 2006
1 parent 02ec523 commit 4fdd366
Show file tree
Hide file tree
Showing 4 changed files with 20 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: ad596171ed635c51a9eef829187af100cbf8dcf7
refs/heads/master: 260a42309b31cbc54eb4b6b85649e412bcad053f
2 changes: 1 addition & 1 deletion trunk/arch/powerpc/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ static __inline__ void timer_recalc_offset(u64 cur_tb)

if (__USE_RTC())
return;
tlen = current_tick_length();
tlen = current_tick_length(SHIFT_SCALE - 10);
offset = cur_tb - do_gtod.varp->tb_orig_stamp;
if (tlen == last_tick_len && offset < 0x80000000u)
return;
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/linux/timex.h
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ time_interpolator_reset(void)
#endif /* !CONFIG_TIME_INTERPOLATION */

/* Returns how long ticks are at present, in ns / 2^(SHIFT_SCALE-10). */
extern u64 current_tick_length(void);
extern u64 current_tick_length(long);

extern int do_adjtimex(struct timex *);

Expand Down
21 changes: 17 additions & 4 deletions trunk/kernel/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -780,16 +780,29 @@ static void update_wall_time_one_tick(void)
* Return how long ticks are at the moment, that is, how much time
* update_wall_time_one_tick will add to xtime next time we call it
* (assuming no calls to do_adjtimex in the meantime).
* The return value is in fixed-point nanoseconds with SHIFT_SCALE-10
* bits to the right of the binary point.
* The return value is in fixed-point nanoseconds shifted by the
* specified number of bits to the right of the binary point.
* This function has no side-effects.
*/
u64 current_tick_length(void)
u64 current_tick_length(long shift)
{
long delta_nsec;
u64 ret;

/* calculate the finest interval NTP will allow.
* ie: nanosecond value shifted by (SHIFT_SCALE - 10)
*/
delta_nsec = tick_nsec + adjtime_adjustment() * 1000;
return ((u64) delta_nsec << (SHIFT_SCALE - 10)) + time_adj;
ret = ((u64) delta_nsec << (SHIFT_SCALE - 10)) + time_adj;

/* convert from (SHIFT_SCALE - 10) to specified shift scale: */
shift = shift - (SHIFT_SCALE - 10);
if (shift < 0)
ret >>= -shift;
else
ret <<= shift;

return ret;
}

/* XXX - all of this timekeeping code should be later moved to time.c */
Expand Down

0 comments on commit 4fdd366

Please sign in to comment.