Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 7 Oct 2001 14:09:50 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Marcel Moolenaar <marcel@xcllnt.net>
Cc:        <cvs-committers@FreeBSD.org>, <cvs-all@FreeBSD.org>
Subject:   Re: cvs commit: src/sys/ia64/include cpufunc.h
Message-ID:  <20011007132357.J6012-100000@delplex.bde.org>
In-Reply-To: <20011006121654.B68233@kayak.xcllnt.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 6 Oct 2001, Marcel Moolenaar wrote:

> On Sat, Oct 06, 2001 at 10:57:48PM +1000, Bruce Evans wrote:
> > On Sat, 6 Oct 2001, Marcel Moolenaar wrote:
> > >   o  Add memcpy_fromio, memcpy_io, memcpy_toio, memset_io,
> > >      memsetw and memsetw_io. I'm not sure this is the right
> > >      place for it, though.
> >
> > Certainly not.  As the comment near the beginning says says, cpufunc.h
> > is "to provide access to special ${MACHINE_ARCH} instructions".  It should
> > not contain anything that can be written in C, including anything that
> > can be written in C by combining primitives written in inline asm.
>
> I thought so. What is the right place, then. It seems that bus_memio.h
> is a good match, but that file is empty for all ports and thus is
> making me nervous. The other logical place is bus.h. On alpha the
> functions are there, but that's mostly because of the implementation.

bus_memio.h is supposed to just enable the memio functions in
bus_xyz${MACHINE}.h (I don't like this, but...).

Why do you even need these functions?  They are standard functions in
Linux, but in *BSD, drivers are supposed to use the bus_space functions
for all of them except memsetw.  E.g., memsetw_io is spelled
bus_space_set_region_2 in *BSD, except the latter is more general (it
can handle both memory-mapped ioport-mapped i/o).  The alpha versions
of these functions actually seem to be compatibility cruft, mainly for
NetBSD.  They are little or not at all used under FreeBSD.  Drivers
in FreeBSD mostly use old interfaces directly if they don't use the
bus space interfaces.

Well, I almost see the reason -- on ia64's, the bus space interfaces
are implemented using the primitives in cpufunc.h instead of repeating
lots of code and writing loops in asm (there are no inline asms in the
ia64 bus.h).  This is closer to the original intended use of cpufunc.h
than the i386 implementation of bus space.  However, I think the i/o
interfaces are special enough to keep separate (remove all the i/o
primitives from the i386 cpufunc.h...).

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?20011007132357.J6012-100000>