Altera Nios II User Manual page 173

Hide thumbs Also See for Nios II:
Table of Contents

Advertisement

Chapter 7: Application Binary Interface
ABI for Linux Systems
There are no floating-point exceptions. The optional floating point unit (FPU) does not
support exceptions and any process wanting exact IEEE conformance needs to use a
soft-float library (possibly accelerated by use of the attached FPU).
The break instruction in a user process might generate a SIGTRAP signal for that
process, but is not required to. Userspace programs should not use the break
instruction and userspace debuggers should not insert one. If no hardware debugger
is connected, the OS should assure that the break instruction does not cause the
system to stop responding. For information about userspace debugging, refer to
"Userspace Breakpoints" on page
The page size is 4 KB. Virtual addresses in user mode are all below 2 GB due to the
MMU design. The NULL page is not mapped.
Linux Process Initialization
The stack pointer, sp, points to the argument count on the stack.
Table 7–8. Stack Initial State at User Process Start
Unspecified
Referenced strings
Unspecified
Null auxilliary vector entry
Auxilliary vector entries
NULL terminator for envp
Environment pointers
NULL terminator for argv
Argument pointers
Argument count
Unspecified
If the application should register a destructor function with atexit, the pointer is
placed in r4. Otherwise r4 is zero.
The contents of all other registers are unspecified. User code should set fp to zero to
mark the end of the frame chain.
The auxiliary vector is a series of pairs of 32-bit tag and 32-bit value, terminated by an
AT_NULL tag.
Linux Position-Independent Code
Every position-independent code (PIC) function which uses global data or global
functions must load the value of the GOT pointer into a register. Any available
register may be used. If a caller-saved register is used the function must save and
restore it around calls. If a callee-saved register is used it must be saved and restored
around the current function. Examples in this document use r22 for the GOT pointer.
February 2014 Altera Corporation
7–20.
Purpose
High addresses
sp + 8 + 4 × argc
sp + 4 + 4 × argc
sp + 4
sp
Low addresses
Start Address
Varies
4 bytes
8 bytes each
4 bytes
4 bytes each
4 bytes
4 bytes each
4 bytes
Nios II Processor Reference Handbook
7–15
Length

Advertisement

Table of Contents
loading

Table of Contents