FIXADE(2-BSD) RISC/os Reference Manual FIXADE(2-BSD)
NAME
fixade - fix address exceptions (unaligned references)
SYNOPSIS
fixade(x)
int x;
DESCRIPTION
This system call enables or disables kernel fix up of
misaligned memory references. The MIPS hardware traps load
and store operations where the address is not a multiple of
the number of bytes loaded or stored. Usually this trap
indicates incorrect program operation and so by default the
kernel converts this trap into a SIGBUS signal to the pro-
cess, typically causing a core dump for debugging.
Older programs developed on systems with lax alignment con-
straints sometimes make occasional misaligned references in
course of correct operation. The best way to port such pro-
grams to MIPS hardware is to correct the program by aligning
the data. A SIGBUS handler exists to assist the programmer
in locating unaligned references. See unaligned(3).
Some applications, however, must deal with unaligned data.
The MIPS architecture provides special instructions, sup-
ported by builtin assembler macros, for loading and storing
unaligned data. These applications can use these instruc-
tions where appropriate. Non-assembler programs can access
these instructions via calls, also described in
unaligned(3).
When it is inappropriate to modify the application to either
align the data properly, or to use special access methods
for unaligned data, this system call, fixade, can be used as
a method of last resort. This system call directs the ker-
nel to handle misaligned traps and emulate an unaligned
reference. The program no longer receives a SIGBUS signal.
This emulation is slow, and heavy use will significantly
slow down program execution.
A non-zero argument enables and a zero argument disables the
fix up.
If the program gets an address exception when making a
reference outside its address space, it will still get a
SIGBUS signal even if this is enabled.
SEE ALSO
unaligned(3)
Printed 11/19/92 Page 1