From owner-freebsd-hackers Wed Jul 21 8:30:48 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from mc-qout4.whowhere.com (mc-qout4.whowhere.com [209.185.123.18]) by hub.freebsd.org (Postfix) with SMTP id 8127B14D56 for ; Wed, 21 Jul 1999 08:30:45 -0700 (PDT) (envelope-from jeffhdz@my-deja.com) Received: from Unknown/Local ([?.?.?.?]) by my-deja.com; Wed Jul 21 08:30:38 1999 To: freebsd-hackers@freebsd.org Date: Wed, 21 Jul 1999 08:30:38 -0700 From: "Jeff Hagendaz" Message-ID: Mime-Version: 1.0 Cc: X-Sent-Mail: off Reply-To: X-Mailer: MailCity Service Subject: polling in device driver X-Sender-Ip: 216.103.85.57 Organization: My Deja Email (http://www.my-deja.com:80) Content-Type: text/plain; charset=us-ascii Content-Length: 590 Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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