From owner-freebsd-hackers Thu Jan 15 18:27:53 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id SAA12514 for hackers-outgoing; Thu, 15 Jan 1998 18:27:53 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from webfarm1.whistle.com (webfarm1.whistle.com [207.76.204.6]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id SAA12509 for ; Thu, 15 Jan 1998 18:27:34 -0800 (PST) (envelope-from julian@whistle.com) Received: (from smap@localhost) by webfarm1.whistle.com (8.8.5/8.8.5) id QAA26100 for ; Sat, 10 Jan 1998 16:50:32 -0800 (PST) X-Authentication-Warning: webfarm1.whistle.com: smap set sender to using -f Received: from alpo.whistle.com(alpo.isp.whistle.com 207.76.204.38) by webfarm1.whistle.com via smap (V2.0) id xma026097; Sat, 10 Jan 98 16:50:09 -0800 Received: (from daemon@localhost) by alpo.whistle.com (8.8.5/8.8.5) id QAA10173; Sat, 10 Jan 1998 16:32:46 -0800 (PST) Received: from UNKNOWN(), claiming to be "current1.whistle.com" via SMTP by alpo.whistle.com, id smtpd010168; Sat Jan 10 16:32:39 1998 Date: Sat, 10 Jan 1998 16:29:34 -0800 (PST) From: Julian Elischer To: Luigi Rizzo cc: hackers@FreeBSD.ORG Subject: Re: How do I DELAY() at boot time ? In-Reply-To: <199801101244.NAA09631@labinfo.iet.unipi.it> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk On Sat, 10 Jan 1998, Luigi Rizzo wrote: > Suppose during the probe/attach routine for a device I have to wait for > some time, what is the correct approach ? I am currently using DELAY() Very early, DELAY() is the correct aproach. > (this is in the audio driver, ad1848.c for what matters) and this seems > not to have the desired effect. Since the same code is also used during > regular operation, DELAY works fine there... DELAY should not be used excet for VERY small delays during normal operation. instead, either "aquire_timer0()" or timeout() should be used. tsleep() can sometimes be used. > should I do something like > > if (booting) > do_something_to_spend_time(x); > else > DELAY(x) > I'd say that it should be the other way around.. DELAY() was developed specifically for probes etc. At other times you don't want to waste the cycles (DELAY is a busy-loop) > instead ? > > Thanks > Luigi > -----------------------------+-------------------------------------- > Luigi Rizzo | Dip. di Ingegneria dell'Informazione > email: luigi@iet.unipi.it | Universita' di Pisa > tel: +39-50-568533 | via Diotisalvi 2, 56126 PISA (Italy) > fax: +39-50-568522 | http://www.iet.unipi.it/~luigi/ > _____________________________|______________________________________ >