From owner-freebsd-questions Wed Jul 21 16:22:21 1999 Delivered-To: freebsd-questions@freebsd.org Received: from mc-qout4.whowhere.com (mc-qout4.whowhere.com [209.185.123.18]) by hub.freebsd.org (Postfix) with SMTP id 071CE14CF2 for ; Wed, 21 Jul 1999 16:22:19 -0700 (PDT) (envelope-from jeffhdz@my-deja.com) Received: from Unknown/Local ([?.?.?.?]) by my-deja.com; Wed Jul 21 16:20:48 1999 To: freebsd-questions@freebsd.org Date: Wed, 21 Jul 1999 16:20:48 -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: 773 Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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