Subject: Extending the bus_{io|mem}_write_X functionality.
To: None <tech-ports@NetBSD.ORG>
From: Dale Rahn <drahn@pacific.urbana.mcd.mot.com>
List: tech-ports
Date: 05/06/1996 13:40:21
The new bus_{io|mem}_{read|write}_{1|2|4} functions are very nice for
accessing devices. It would be nice however if there was bus accessors
that would allow drivers to write to memory space using a function like
bus_mem_write_X that would set up the appropriate data structure for
devices on the bus to read.

Example

BE - Big Endian, LE - Little Endian

BE cpu  <-> BE memory <-> PCI bus (no swapping) <-> LE device.

With this configuration the accesses that the device makes to
real memory will have the data in the wrong endian.

If NCR scsi scripts are written into memory in Big Endian, the NCR
chip will not be able to execute them because they will be byte swapped
of what it expects. if it was possible to do a bus_mem_attach() or something
it would be possible to write the scripts using bus_mem_write_4() then the
scripts and data would be in the correct for the NCR chip to read.

Does this sound reasonable?

Dale Rahn					drahn@urbana.mcd.mot.com
Not representing my employer