Subject: Re: PCI subsystem on BigEndian.
To: None <drahn@pacific.urbana.mcd.mot.com>
From: Niklas Hallqvist <niklas@appli.se>
List: tech-ports
Date: 04/23/1996 18:56:27
Well it's not just PCI that's interesting, I have this problem with
the ISA-bus on Amiga.  I've solved it by extending the bus.h interface
locally with the following functions:

u_int16_t bus_to_host_2(bus_chipset_tag_t, u_int16_t)
u_int32_t bus_to_host_4(bus_chipset_tag_t, u_int32_t)
u_int64_t bus_to_host_8(bus_chipset_tag_t, u_int64_t)

and

u_int16_t bus_to_host_2(bus_chipset_tag_t, u_int16_t)
u_int32_t bus_to_host_4(bus_chipset_tag_t, u_int32_t)
u_int64_t bus_to_host_8(bus_chipset_tag_t, u_int64_t)

These are only needed when you copy in structures as raw chunks and
need to convert on a field by field basis.  When dealing with moving
multibyte entitys directly to/from I/O space or memory, the possible
swapping is encapsulated in the bus_{io,mem}_{read,write}_[1248]
functions.

Niklas

Niklas Hallqvist       Phone: +46-(0)31-40 75 00  Home: +46-(0)31-41 93 95
Applitron Datasystem   Fax:   +46-(0)31-83 39 50  Home: +46-(0)31-41 93 96
Molndalsvagen 95       Email: niklas@appli.se     GSM:  +46-(0)70-714 10 35
S-412 63  GOTEBORG     WWW:   Here
Sweden		       IRC:   niklas (#NetBSD)