Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Jul 1999 16:20:48 -0700
From:      "Jeff Hagendaz" <jeffhdz@my-Deja.com>
To:        freebsd-questions@freebsd.org
Subject:   polling in device driver
Message-ID:  <BALPOCGFGEOOBAAA@my-deja.com>

next in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BALPOCGFGEOOBAAA>