delaying "milliseconds" in the kernel

delaying "milliseconds" in the kernel

Post by Marty Leisne » Thu, 08 Nov 2001 06:20:14



I'm writing a driver, and want to delay n milliseconds
in an algorithm.

Timers need jiffies, so I need to convert.

Is there a standard to define time?  (I didn't see it -- seems
everything is in HZ).

I wanted a macro or something so I could express my constraint
in milliseconds, and it would be converted to jiffies...

I wanted something like a macro:
#define MSECS_TO_JIFFIES(x)     (x*(HZ/1000))

It seems there is no "standard" way to do this in the kernel
(I ran gid on 2.4.5).

The only think I easily saw was:
drivers/isdn/sc/hardware.h:112:#define milliseconds(x)  (x/(1000/HZ))
which would do what I wanted...I would want to see this at a higher level...

Instead of throwing around HZ everywhere (and having to inuitate how this
mapped time to jiffies), would it be a good idea to have some
standard way to express milliseconds -- since time is important,
jiffies are an implementation detail.

I think the code would be much clear if I saw
MSECS_TO_JIFFIES(250)
instead of
(HZ/4)

Just IMHO


Don't  confuse education with schooling.
        Milton Friedman to Yogi Berra
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

1. eth0 and eth1 "Delaying eth0 Initialization" and "Delaying eth1 Initialization" errors

Hello, I am a linux newbie, and have run into a problem.

I am using RH 7.1 with kernel 2.4.2.  I built a new kernel (to be used for
firewall purposes).  The kernel built fine and it booted successfully except
that with both eth0 and eth1, the errors "Delaying eth0 Initialization" and
"Delaying eth0 Initialization" come up.  I did not have this problem with
the original kernel.

Both NICs are Linksys LNE100TXs using the 169 chip.  The ipcfg-eth0 and 1
are set to activate on boot.

Any ideas?

Thank you,

Alan

2. /etc/sendmail.cw question

3. GETSERVBYNAME()????????????????????"""""""""""""

4. graphical disk usage utility

5. """"""""My SoundBlast 16 pnp isn't up yet""""""""""""

6. UDMA-66

7. High-Res-Timers: Unexpected "lock" during "Calibrating delay loop "

8. Help ! Telnet takes forever !

9. "keyboard error"; "socket destroy delayed"

10. "etho init delayed" " symbol for parameter io not found" Help .....

11. "double lock on device queue!", "Socket destroy delayed"

12. Unexpected lock during "Calibrating delay loop" and failure to compile without "HighRes"

13. Type "(", ")" and "{", "}" in X...