Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 Jul 1999 14:25:40 -0400 (EDT)
From:      Bill Paul <wpaul@skynet.ctr.columbia.edu>
To:        sprice@hiwaay.net (Steve Price)
Cc:        freebsd-current@FreeBSD.ORG, parag@cgt.com
Subject:   Re: alpha kernel build failure (w/patch)
Message-ID:  <199907051825.OAA21013@skynet.ctr.columbia.edu>
In-Reply-To: <Pine.OSF.4.10.9907051300170.19262-100000@fly.HiWAAY.net> from "Steve Price" at Jul 5, 99 01:12:28 pm

next in thread | previous in thread | raw e-mail | index | archive | help
Of all the gin joints in all the towns in all the world, Steve Price had 
to walk into mine and say:

> [trimmed -alpha from cc: list to keep the cross posting
>  police from coming after me :)]
> 
> On Mon, 5 Jul 1999, Parag Patel wrote:
> 
> # On Mon, 05 Jul 1999 00:33:57 CDT, Steve Price wrote:
> # >+#ifdef __i386__
> # > 	sc->wb_btag = I386_BUS_SPACE_IO;
> # >+#endif
> # >+#ifdef __alpha__
> # >+	sc->wb_btag = ALPHA_BUS_SPACE_IO;
> # >+#endif
> # 
> # Just curious, but is there a reason that these lines aren't simply
> # 
> # 	sc->wb_btag = BUS_SPACE_IO;
> # 
> # with this macro being set to the correct machine-specific one in some
> # appropriate header file?  I'm sure I'm missing something...
> 
> I wondered that as well.  For both the i386 and alpha port
> the definitions end up in /usr/include/machine/bus.h and
> stripping off the arch-specific prefix shows that their value
> is the same.  In fact they appear to be the only #define in
> bus.h with the arch-specific prefix besides the multiple-inclusion
> #defines.  I think they could be combined, but defer the
> decision (commit) to the folks working on the new bus code
> as they know their way around this code much better than I
> do.

The reason it's not done that way is because the bus_space code is
incomplete. The NetBSD code from which it was taken has a routine
that sets up the bus tag for you (and I think the handle too) based
on the actual bus type. In other words, you're supposed to be passed
a handle to the bus on which your device resides, and you pass that
to bus_space_create() or whatever, and it figures out all the right
machine specific details for you.

Why don't we have this routine? Because we don't have the NetBSD bus
architecture and at the time we only ran on the i386 arch, so we took
a shortcut and fiddled with the bus space handle and bus space tag
directly.

If we're really lucky then some day this will get fixed correctly,
by somebody who is not me, as I have plenty of other things to keep
me busy.

-Bill

-- 
=============================================================================
-Bill Paul            (212) 854-6020 | System Manager, Master of Unix-Fu
Work:         wpaul@ctr.columbia.edu | Center for Telecommunications Research
Home:  wpaul@skynet.ctr.columbia.edu | Columbia University, New York City
=============================================================================
 "It is not I who am crazy; it is I who am mad!" - Ren Hoek, "Space Madness"
=============================================================================


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




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