Date: Sun, 3 Nov 1996 03:31:12 +1100 From: Bruce Evans <bde@zeta.org.au> To: freebsd-hackers@FreeBSD.org, j@uriah.heep.sax.de Subject: Re: VM answer requested Message-ID: <199611021631.DAA10756@godzilla.zeta.org.au>
next in thread | raw e-mail | index | archive | help
>> I'd like to be able to turn on the bit so that I get a fault (and it >> kills the offending process) when an unaligned access occurs. > >Adding support for this should be fairly simple. I wonder why you Especially since it was added on 1995/01/14 in rev.1.46 of locore.s :-). Applications have to set PSL_AC when they want alignment faults. Alignment faults generate SIGBUS. gcc still generates misaligned accesses, e.g., --- struct foo { short x[2]; }; struct bar { short pad; struct foo r; } bar1, bar2; main() { asm("pushfl; popl %eax; orl $0x40000,%eax; pushl %eax; popfl"); bar1.r = bar2.r; /* trap */ } --- Bruce
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199611021631.DAA10756>