From owner-cvs-all Sun Oct 7 13: 5:36 2001 Delivered-To: cvs-all@freebsd.org Received: from rover.village.org (rover.bsdimp.com [204.144.255.66]) by hub.freebsd.org (Postfix) with ESMTP id 2CE1437B405; Sun, 7 Oct 2001 13:05:27 -0700 (PDT) Received: from harmony.village.org (harmony.village.org [10.0.0.6]) by rover.village.org (8.11.3/8.11.3) with ESMTP id f97K5Pu99092; Sun, 7 Oct 2001 14:05:25 -0600 (MDT) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (localhost [127.0.0.1]) by harmony.village.org (8.11.6/8.11.6) with ESMTP id f97K5O753677; Sun, 7 Oct 2001 14:05:24 -0600 (MDT) (envelope-from imp@harmony.village.org) Message-Id: <200110072005.f97K5O753677@harmony.village.org> To: Marcel Moolenaar Subject: Re: cvs commit: src/sys/ia64/include cpufunc.h Cc: Bruce Evans , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org In-reply-to: Your message of "Sun, 07 Oct 2001 12:37:37 PDT." <20011007123737.A380@athlon.pn.xcllnt.net> References: <20011007123737.A380@athlon.pn.xcllnt.net> <20011006121654.B68233@kayak.xcllnt.net> <20011007132357.J6012-100000@delplex.bde.org> Date: Sun, 07 Oct 2001 14:05:24 -0600 From: Warner Losh 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 In message <20011007123737.A380@athlon.pn.xcllnt.net> Marcel Moolenaar writes: : > 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? : : Because sys/dev/fb uses it (see below). drivers are supposed to use bus_space* exclusively. Those drivers that do not do it because a) they are old an predate bus_space* functions, b) the driver author was ignorant of the new api, c) there was some compelling reason to use things directly. By far, (a) is the most common, but it can be hard to tell the difference between that and the others sometimes :-) Drivers should generally be updated to use bus_space, as this effort has been going on since CAM was integreated into the kernel. : > The alpha versions : > of these functions actually seem to be compatibility cruft, mainly for : > NetBSD. : : 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. : > 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...). : : Yes, I can agree with that. I'll probably reshuffle things if and when : I manage to get a bigger picture. I'm too preoccupied ATM with getting : a firm enough grip on the porting work that I don't fall flat on my : face everytime the world changes around me... 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). Do not remove the inb/outb functions from cpufunc.h. For better or worse, it is used by userland programs. Many ports will break. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message