Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/sys/dev/ic



On Wed, Nov 02, 2011 at 04:54:51PM +0000, Jonathan A. Kollasch wrote:
> Module Name:  src
> Committed By: jakllsch
> Date:         Wed Nov  2 16:54:51 UTC 2011
> 
> Modified Files:
>       src/sys/dev/ic: ahcisatareg.h
> 
> Log Message:
> Additionally apply __aligned(8) to all __packed hardware data structures.
> (The hardware actually requires much larger alignment on these structures
> (128 to 1024 bytes), but 8 is big enough for the compiler to generate more
> efficient code on strict alignment architectures.)

If these structures only have the odd field that needs non-native
alignments (eg 32bit on 16bit alignment or 64bit on 32bit alignment)
then it can be achieved by applying __aligned() to that single field.

That also allows the compiler to generate larger-than-byte accesses
on strict alignment systems.

See the mbr definition in (IIRC) disklabel.h and the 64bit types
in amd64's compat32 for examples.

        David

-- 
David Laight: david%l8s.co.uk@localhost


Home | Main Index | Thread Index | Old Index