Architectures with strict alignment?
bruce at cran.org.uk
Sat Jan 5 02:16:31 PST 2008
Marco van de Voort wrote:
> On Sat, Dec 08, 2007 at 03:43:30AM +0100, Ivan Voras wrote:
>> Which of the architectures FreeBSD supports (if any) have strict memory
>> alignment requirements? (in the sense that accessing a 32-bit integer
>> not aligned on a 32-bit address results in a hardware trap/exception).
> I do know that older PPCs (PowerPC603) have a requirement on aligning of
> IIRC the e.g. Linux the kernel hooks an exception handler that makes it
> transparent for apps (at the cost of some performance), and NetBSD does not
> I never ran FreeBSD on PPC, so I wouldn't know that one.
The newer 32-bit PPCs (G4 / PPC7447A) can't handle unaligned 64-bit
either - they generate a trap which gets handled by fix_unaligned in
/sys/powerpc/powerpc/trap.c on FreeBSD.
More information about the freebsd-hackers