Messages in this thread |  | | Subject | Why does test9 outlaw HZ < 48? | Date | Tue, 03 Oct 2000 19:28:24 -0500 | From | Jeff Dike <> |
| |
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/
|  |