> In message <[EMAIL PROTECTED]> Mike Smith writes:
> : Any form of packing is going to cause problems for items that are
> : located in illegal fashions. 
> 
> It is almost more appropriate to use bus_space_{read,write} than using
> memory mapped structures.  The bus macros will work for otherwise
> unaligned thigns, while direct access won't.  Also, the
> compiler/system may optimize things in strange ways that cause
> problems.  Do yourself a big favor and don't go down this path.

The most common use for alignment-sensitive data structures nowadays
is in control structures exchanged with devices via busmaster DMA.

Needless to say, the bus_space functions aren't very useful for this, and
controlled alignment is necessary.

Even then, I really want a mechanical way of generating a stub function to
correct endianness in a structure based on the structure definition; we have
a lot of drivers that are explicitly little-endian due to all this.

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to