Subject: Re: bus space macros for structures
To: Michael Richardson <mcr@sandelman.ottawa.on.ca>
From: Jason Thorpe <thorpej@nas.nasa.gov>
List: tech-kern
Date: 02/03/1997 17:10:45
On Mon, 3 Feb 1997 19:40:48 -0500 (EST)
Michael Richardson <mcr@sandelman.ottawa.on.ca> wrote:
> I take it that the bus macros mean that one should *not* map a
> structure to
> shared ram? Assume that the structure has two definitions based on
> endianness.
> I should, to achieve maximum portability, bus_read/bus_write all
> I/O to shared
> memory?
>
That is correct; structures are not portable for a couple of reasons,
one of them being byte order, the other being packing...
You should access the device using only offsets in bus_space_* calls.
(Arguably, we should do the same thing with e.g. SCSI CDBs.)
Jason R. Thorpe thorpej@nas.nasa.gov
NASA Ames Research Center Home: 408.866.1912
NAS: M/S 258-6 Work: 415.604.0935
Moffett Field, CA 94035 Pager: 415.428.6939