IPR-NIOS Altera, IPR-NIOS Datasheet - Page 179

no-image

IPR-NIOS

Manufacturer Part Number
IPR-NIOS
Description
IP NIOS II MEGACORE RENEW
Manufacturer
Altera
Type
MegaCorer
Datasheet

Specifications of IPR-NIOS

License
Renewal License
Lead Free Status / RoHS Status
Not applicable / Not applicable
Chapter 7: Application Binary Interface
ABI for Linux Systems
December 2010 Altera Corporation
Linux Function Calls
Linux Operating System Call Interface
Register r23 is reserved for the thread pointer on GNU Linux systems. It is initialized
by the C library and it may be used directly for TLS access, but not modified. On non-
Linux systems r23 is a general-purpose, callee-saved register.
The global pointer, r26 or gp, is globally fixed. It is initialized in startup code and
always valid on entry to a function. This method does not allow for multiple gp
values, so gp-relative data references are only possible in the main application (that is,
from position dependent code). gp is only used for small data access, not GOT access,
because code compiled as PIC may be used from shared libraries. The linker may take
advantage of gp for shorter PLT sequences when the addresses are in range. The
compiler needs an option to disable use of gprel; the option is necessary for
applications with excessive amounts of small data. For comparison, XUL (Mozilla
display engine, 16 MB code, 2 MB data) has only 27 KB of small data and the limit is
64 KB. This option is separate from -G 0, because -G 0 creates ABI incompatibility. A
file compiled with -G 0 puts global int variables into .data but files compiled with
-G 8 expect such int variables to be in .sdata.
PIC code which needs a GOT pointer needs to initialize the pointer locally using
nextpc; the GOT pointer is not passed during function calls. This approach is
compatible with both static relocatable binaries and System V style shared objects. A
separate ABI is needed for shared objects with independently relocatable text and
data.
Stack alignment is 32-bit. The frame pointer points at the top of the stack when it is in
use, to simplify backtracing. Insert alloca between the local variables and the
outgoing arguments. The stack pointer points to the bottom of the outgoing argument
area.
A large struct return value is handled by passing a pointer in the first argument
register (not the disjoint return value register).
Unhandled instruction-related exceptions in user programs are mapped to the signals
shown in
Table 7–7. Signals for Unhandled Intruction-Related Exceptions
Supervisor-only Instruction Address
TLB Permission Violation (execute)
Supervisor-only Instruction
Unimplemented Instruction
Illegal Instruction
Break Instruction
Supervisor-only Data Address
Misaligned Data Address
Misaligned Destination Address
Division Error
Table
7–7.
Exception
SIGSEGV
SIGSEGV
SIGILL
SIGILL
SIGILL
SIGTRAP
SIGSEGV
SIGBUS
SIGBUS
SIGFPE
Signal
Nios II Processor Reference Handbook
7–15

Related parts for IPR-NIOS