Subject: Re: PCI device driver for sparc, sparc64, and i386
To: None <steven_grunza@ieee.org, tech-kern@netbsd.org>
From: None <eeh@netbsd.org>
List: tech-kern
Date: 02/06/2001 15:58:59
I'm not sure if this is the correct list for this question but:
I plan on writing a device driver for a PCI card. I would like the same
source to work on sparc, sparc64, and i386. Are there any issues betwen
the 32-bit sparc and i386 and the 64-bit sparc64 of which I should be
aware? I'm expecting to be calling hton and ntoh to deal with the endian
problems...
Hm. PCI on 32-bit sparc machines?
Take a look at bus_space(9) and bus_dma(9). Also, look at the way existing
drivers are put together.
You should only use hto[bl]e{16,32,64}() calls for data you will transfer
to the device through DMA. The bus_space(9) accessors should handle
any endian issues themselves.
Eduardo