Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 8 Oct 2001 13:25:55 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Warner Losh <imp@harmony.village.org>
Cc:        Marcel Moolenaar <marcel@xcllnt.net>, <cvs-committers@FreeBSD.org>, <cvs-all@FreeBSD.org>
Subject:   Re: cvs commit: src/sys/ia64/include cpufunc.h 
Message-ID:  <20011008131340.N13486-100000@delplex.bde.org>
In-Reply-To: <200110072005.f97K5O753677@harmony.village.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 7 Oct 2001, Warner Losh wrote:

> In message <20011007123737.A380@athlon.pn.xcllnt.net> Marcel Moolenaar writes:
> : Above you say that drivers for *BSD are supposed to use the bus_space
> : functions. This seems to contradict with the statement that we added
> : the mem*io functions for compatibility with NetBSD on Alpha. This is
> : fine, but it makes it all the harder for me to figure out what we call
> : "right", so that I can do it right the first time.
>
> There's more to the kernel than just the drivers.  The mem*io
> functions were used to implement routines that the drivers call.

No.  These functions don't exist on i386's and are just compatibility
cruft on alphas.

> The big picture is that drivers are supposed to use bus_space.
> bus_space can be coded directly to the iron, or can use cpufunc.h.
> cpufunc.h generally shouldn't be used in drivers or by userland
> programs (although it is used by many many different userland programs
> as there's no other api that we support).

That's another bug suite.  When I wrote cpufunc.h, I intended at least
inb() and outb() to be usable in both the kernel and userland, but
David Greenman taught me that that would be wrong :-).  This left no
supported interface for userland but that didn't stop bad programs
using unsupported ones of course.

> Do not remove the inb/outb functions from cpufunc.h.  For better or
> worse, it is used by userland programs.  Many ports will break.

They can at least be moved to <machine/pio.h> where other BSD's have
them.

Bruce


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




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