Subject: Re: 2 Driver related questions
To: Bruce Martin <BruceM@cat.co.za>
From: Manuel Bouyer <bouyer@antioche.lip6.fr>
List: port-i386
Date: 07/20/1999 16:14:57
On Tue, Jul 20, 1999 at 12:03:07PM +0200, Bruce Martin wrote:
> We have written a driver for a piece if hardware that uses the ISA bus.
> At startup, it allocated port 0x390-0x985! We need it to start at 0x390,
> but only allocate to 0x397 - where is this set?
> 
> Also, how do you use inb, outb functions in NetBSD - I have tried to
> #include<machine/pio.h> but I get a syntax error on line 67 of the
> included file - do I need to set any compiler switches for this?

For both of this you want to use the bus_space access method instead of
allocating port and do inb/outb by yourselve.
Have a look at the bus_space(9) manual page, and some drivers of sys/dev/isa
(boca.c for example).
This way your driver will work with minimal changes if you ever have the same
chip on another bus, or this board in a non-i386 machine.

--
Manuel Bouyer, LIP6, Universite Paris VI.           Manuel.Bouyer@lip6.fr
--