From owner-cvs-all Mon Sep 27 20:59:38 1999 Delivered-To: cvs-all@freebsd.org Received: from sasami.jurai.net (sasami.jurai.net [63.67.141.99]) by hub.freebsd.org (Postfix) with ESMTP id 12444154F1; Mon, 27 Sep 1999 20:59:32 -0700 (PDT) (envelope-from winter@jurai.net) Received: from localhost (winter@localhost) by sasami.jurai.net (8.8.8/8.8.7) with ESMTP id XAA02347; Mon, 27 Sep 1999 23:59:26 -0400 (EDT) Date: Mon, 27 Sep 1999 23:59:26 -0400 (EDT) From: "Matthew N. Dodd" To: Warner Losh Cc: KATO Takenori , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/conf files src/sys/i386/conf files.i386 In-Reply-To: <199909270628.AAA08033@harmony.village.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk This sounds about like what I was thinking would be our only 'solution'. I think some interface that would allow one to pass in a base and an array describing the offsets would be useful to avoid having the driver think about such things. Ideally this information would be passed to the PC98 bus routines in resource discover/assignment so that rman_get_bustag()/rman_get_bushandle() would remain unchanged along with existing code. This would involve the pc98 equilivent of eisa_add_iospace()/mca_add_iospace() (not sure how ISA will end up doing it once that interface is redesigned.) to take an additional arg describing the offsets. How does this jive with the resource manager or is this problem already solved? On Mon, 27 Sep 1999, Warner Losh wrote: > I'd also like to get some feedback on a related issue. I'd like to > know what people think of adding a third space to the I386 port. The > third I/O space would be I386_BUS_SPACE_IO_INDIRECT. The code for it > would look like the following. In a nutshel, its bsh is a pointer to > an array of I/O ports, and the offset is an index into that array. So > you'd effectively replace bsh+offset with bsh[offset]. The driver > would be responsible for managing the bsh array for the _INDIRECT > case. > > I think something like this would go a long ways towards merging the > last, few pc98 specific drivers. > > The code for bus_space_write_1, fully optimized as it is now, would > look like: > > ... > #define I386_BUS_SPACE_IO_INDIRECT 2 > ... > static __inline void > bus_space_write_1(bus_space_tag_t tag, bus_space_handle_t bsh, > bus_size_t offset, u_int8_t value) > { > #if defined(_I386_BUS_PIO_H_) > #if defined(_I386_BUS_MEMIO_H_) || defined(_I386_BUS_PIOI_H_) > if (tag == I386_BUS_SPACE_IO) > #endif > outb(bsh + offset, value); > #endif > #if defined(_I386_BUS_MEMIO_H_) > #if defined(_I386_BUS_PIO_H_) || defined(_I386_BUS_PIOI_H_) > else if (tag == I386_BUS_SPACE_MEM) > #endif > *(volatile u_int8_t *)(bsh + offset) = value; > #endif > #if defined(_I386_BUS_PIOI_H_) > #if defined(_I386_BUS_PIO_H_) || defined(_I386_BUS_MEMIO_H_) > else if (tag == I386_BUS_SPACE_IO_INDIRECT) > #endif > outb(bsh[offset], value); > #endif > } > > I'd be happy to implement the bus.h parts of this, if it would be > useful for the pc98 folks. > > Warner > -- | Matthew N. Dodd | '78 Datsun 280Z | '75 Volvo 164E | FreeBSD/NetBSD | | winter@jurai.net | 2 x '84 Volvo 245DL | ix86,sparc,pmax | | http://www.jurai.net/~winter | This Space For Rent | ISO8802.5 4ever | To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message