Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Mar 95 10:36:04 MST
From:      terry@cs.weber.edu (Terry Lambert)
To:        gibbs@estienne.CS.Berkeley.EDU (Justin T. Gibbs)
Cc:        hackers@FreeBSD.org
Subject:   Re: DELAY()
Message-ID:  <9503171736.AA29024@cs.weber.edu>
In-Reply-To: <199503171033.CAA14976@estienne.cs.berkeley.edu> from "Justin T. Gibbs" at Mar 17, 95 02:33:34 am

next in thread | previous in thread | raw e-mail | index | archive | help
> Does anyone have an alternate implementation idea for DELAY so that it
> is cpu/bus independant?

I think this is relatively impossible without using timers to do the
work.

The ability to do this is limited by your timer resolution and the
firing/rescheduling overhead, so it would not be suitable for spins
below a certain (TBD) duration.

This will probably become more of an issue in porting to non-strictly
PC architectures.  SMP will cause it to be a big issue, as will the
use of spins on some bus architectures intefering with the ability
to deliver interrupts (message passing buses... ie: Sequent, Nothern
Telecom).

This is a "bite the bullet later" issue.

As a workaround for non-complex (PC) architectures, you may want to
look at calibrated delay loops.  These are discussed in "The
Undocumented PC" in implementing reliable keyboard I/O not using
the BIOS.  The Linux kernel uses a calibrated loop for its DELAY
mechanism (it even spits out a calibration message while booting).


					Terry Lambert
					terry@cs.weber.edu
---
Any opinions in this posting are my own and not those of my present
or previous employers.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9503171736.AA29024>