lkml.org 
[lkml]   [2000]   [Oct]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectWhy does test9 outlaw HZ < 48?
Date
From
UML has HZ == 20.  When I built test9, I ran into trouble with this new block 
in include/linux/timex.h:

#if HZ >= 24 && HZ < 48
# define SHIFT_HZ 5
#elif HZ >= 48 && HZ < 96
# define SHIFT_HZ 6
...

I added the obvious 12 <= HZ < 24 lines and got this from kernel/timer.c:

timer.c:446: warning: right shift count is negative
timer.c:449: warning: right shift count is negative

Those lines are these:
time_adj -= -ltemp >> (SHIFT_USEC + SHIFT_HZ - SHIFT_SCALE);
time_adj += ltemp >> (SHIFT_USEC + SHIFT_HZ - SHIFT_SCALE);

When you chase down the constants (the others are in timex.h, too), the shift
value turns out to be:
16 + SHIFT_HZ - 22

16 + SHIFT_HZ - 22 >= 0 implies SHIFT_HZ >= 6.

Now, my questions are:

What's the reasoning behind these magic numbers? The comment associated with
those constants is less than illumunating IMHO.

Is there anything wrong with HZ < 48? If not, what's the right way to get it
without upsetting the compiler?

Jeff


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:39    [W:0.034 / U:0.456 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site