Date: Wed, 21 Jul 1999 19:33:18 -0400 From: Dutch Collins <dutch@charm.net> To: Jeff Hagendaz <jeffhdz@my-Deja.com> Cc: freebsd-questions@FreeBSD.ORG Subject: Re: polling in device driver Message-ID: <379658BD.4292B15C@charm.net> References: <BALPOCGFGEOOBAAA@my-deja.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Jeff Hagendaz wrote:
>
> Hi,
>
> I asked this in -hackers, but didn't get an answer.
> Guess it is too simple to quanlify into -hackers,
> I am moving it here. Your help is highly appreciated.
>
> -- Jeff
>
> Hi,
>
> I am reading a Linux device driver. At some point it
> polls a device to check if it is ready. The timeout
> is set to 5 second. It uses the system jiffies to
> count the time:
>
> u32 time_out = jiffies + 5 * HZ;
> for (;;) {
> /* code to check if dev is ready */
> ........
> if (ready) break;
> if (intr_count == 0) schedule();
> if (jiffies > time_out) return ERROR;
> }
>
> How do I implement such polling in FreeBSD? Thanks.
>
> --Jeff
>
> --== Sent via Deja.com http://www.deja.com/ ==--
> Share what you know. Learn what you don't.
>
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message
--
I can point you to some Linux-BSD hacker types at U. of Maryland
Baltimore County. These guys are good. Sometimes the local list gets
offtopic a little (yeah right).
umbclinux@lists.umbc.edu
-d
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?379658BD.4292B15C>
