From owner-freebsd-questions Wed Jul 21 16:36:41 1999 Delivered-To: freebsd-questions@freebsd.org Received: from fellspt.charm.net (fellspt.charm.net [199.0.70.29]) by hub.freebsd.org (Postfix) with ESMTP id 99E2514E2E for ; Wed, 21 Jul 1999 16:36:34 -0700 (PDT) (envelope-from dutch@charm.net) Received: from charm.net (coretel-115-138.charm.net [209.143.115.138]) by fellspt.charm.net (8.9.3/8.9.3) with ESMTP id TAA09922; Wed, 21 Jul 1999 19:33:37 -0400 (EDT) Message-ID: <379658BD.4292B15C@charm.net> Date: Wed, 21 Jul 1999 19:33:18 -0400 From: Dutch Collins X-Mailer: Mozilla 4.61 [en] (Win98; I) X-Accept-Language: en MIME-Version: 1.0 To: Jeff Hagendaz Cc: freebsd-questions@FreeBSD.ORG Subject: Re: polling in device driver References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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