Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

ABI

Software appears to use the PowerPC embedded ABI (or simply EABI), which is a modified version of the PowerPC ABI supplement to System V (described in this document) designed for embedded systems.

The EABI is described in detail in this document, but this page will give an overview over the most important parts of it.

Registers

Registers have three kinds:

  • Volatile: These registers are general purpose and do not need to be preserved by routines.
  • Preserved: These registers are general purpose and must be preserved by routines.
  • Dedicated: These registers have a special purpose in the ABI, and must also be preserved by routines.

General purpose registers

RegisterKindPurpose
R00VolatileLanguage specific
R01DedicatedStack pointer
R02DedicatedRead only small data base address
R03VolatileFirst parameter, first return value
R04VolatileSecond parameter, second return value
R05..R11VolatileParameters after R3 & R4
R11..R13VolatileTemporaries
R14..PreservedGeneral

Floating point registers

RegisterKindPurpose
F00VolatileLanguage specific
F01VolatileFirst parameter, first (and only) float return value
F02..F09VolatileParameters after F01
F09..F14VolatileTemporaries
F14..PreservedGeneral

Condition register fields

All fields in the condition register are volatile except for CR2..CR5, which are preserved.

Other registers

All other registers are volatile.

Stack Frames

The stack pointer points to the lowest word of the current stack frame (i.e. the stack grows down). Stack frames are always aligned on double words (8 bytes). Their format is as follows:

AddressSizeDescription
sp4Previous sp
sp + 44Return address
sp + 8VariableRoutine specific

Registers are callee saved. As a side effect, if a routine is a leaf and does not need the stack or any preserved registers, it can skip creating a stack frame.