From owner-cvs-all Sat Oct 6 21:11:15 2001 Delivered-To: cvs-all@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id 75B1F37B408; Sat, 6 Oct 2001 21:11:09 -0700 (PDT) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id OAA06271; Sun, 7 Oct 2001 14:10:31 +1000 Date: Sun, 7 Oct 2001 14:09:50 +1000 (EST) From: Bruce Evans X-X-Sender: To: Marcel Moolenaar Cc: , Subject: Re: cvs commit: src/sys/ia64/include cpufunc.h In-Reply-To: <20011006121654.B68233@kayak.xcllnt.net> Message-ID: <20011007132357.J6012-100000@delplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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