Date: Sat, 10 Jan 1998 16:29:34 -0800 (PST) From: Julian Elischer <julian@whistle.com> To: Luigi Rizzo <luigi@labinfo.iet.unipi.it> Cc: hackers@FreeBSD.ORG Subject: Re: How do I DELAY() at boot time ? Message-ID: <Pine.BSF.3.95.980110162516.11339C-100000@current1.whistle.com> In-Reply-To: <199801101244.NAA09631@labinfo.iet.unipi.it>
next in thread | previous in thread | raw e-mail | index | archive | help
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/ > _____________________________|______________________________________ >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.95.980110162516.11339C-100000>