Mail Archives: djgpp/1997/11/13/12:48:56
> AFAIK, there's no such thing as SIGBUS on machines which don't require
> alignment. x86 can handle misaligned objects, they just inflict runtime
> penalty. Machines that have SIGBUS cannot access misaligned objects at
> all.
Not sure here. I think the pentium (at least) and above have
this capability. I doubt its enabled in most (any?) cases though.
From 'Pentium Processor User's Manual Volume 3'
Page 14-24 (edited for length by yours truly)
14.9.16. Interrupt 17 - Alignment Check
An alignment-check fault can be generated for access to unaligned operands.
For example, a word stored at an odd byte address, or a doubleword
stored at an address which is not an integer multiple of four ....
To enable alignment checking, the following conditions myst be true:
^ AM bit in the CR0 register is set
^ AC flag is set
^ CPL is 3 (user mode)
> A better way is to check SIGBUS itself:
> Here, also, a better way is to test for the (un)supported feature rather
> than for a system name:
Of course. Right on both counts. I have a tendency to do the
quick and dirty fix. I will send off your changes to the
maintainer.
Andy
--
_______ ___________________________________________________________
/ Andrew Crabtree
/ Workgroup Networks Division
____ ___ / Hewlett-Packard
/ / / / Roseville, CA
__/ __/ _____/ 916/785-1675
/ andrewc AT rosemail DOT rose DOT hp DOT com
___________ __/ _____________________________________________________
- Raw text -