tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: 9.1: boot-time delay? [WORKAROUND FOUND]



> #  define hztoms(t) ((unsigned int)(((t) + 0ul) * 1000ul / hz))

> when hz > 1000, this returns 0 for input of 1.

True, which is correct - when hz > 1000, one tick is less than one
millisecond.

If, that is, it's defined to round down (and, if not, the
implementation you quote is broken).  What does its interface contract
say?  (I don't have easy access to 9.1 at the moment, or I'd go
looking.)

How heavily is hztoms used?  (I would expect mstohz to be used far more
heavily.)

> 0 can sometimes mean "never block" and sometimes can mean "block
> forever".

What does hztoms's return value get used for?  Is it actually used to
compute delay values?  It sounds dodgy to me to do so, for this among
other reasons.

/~\ The ASCII				  Mouse
\ / Ribbon Campaign
 X  Against HTML		mouse%rodents-montreal.org@localhost
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B


Home | Main Index | Thread Index | Old Index