Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Sep 1999 23:59:26 -0400 (EDT)
From:      "Matthew N. Dodd" <winter@jurai.net>
To:        Warner Losh <imp@village.org>
Cc:        KATO Takenori <kato@FreeBSD.org>, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/conf files src/sys/i386/conf files.i386 
Message-ID:  <Pine.BSF.4.10.9909272353220.1659-100000@sasami.jurai.net>
In-Reply-To: <199909270628.AAA08033@harmony.village.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.10.9909272353220.1659-100000>