Date: Wed, 21 Jul 1999 08:30:38 -0700 From: "Jeff Hagendaz" <jeffhdz@my-Deja.com> To: freebsd-hackers@freebsd.org Subject: polling in device driver Message-ID: <IKCDDIIDOJENBAAA@my-deja.com>
next in thread | raw e-mail | index | archive | help
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-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?IKCDDIIDOJENBAAA>