OAR

RTEMS 4.5.1-pre3 On-Line Library


Calling Conventions Call and Return Mechanism

PREV UP NEXT Bookshelf RTEMS SPARC Applications Supplement

2.4: Call and Return Mechanism

The SPARC architecture supports a simple yet effective call and return mechanism. A subroutine is invoked via the call (call) instruction. This instruction places the return address in the caller's output register 7 (o7). After the callee executes a save instruction, this value is available in input register 7 (i7) until the corresponding restore instruction is executed.

The callee returns to the caller via a jmp to the return address. There is a delay slot following this instruction which is commonly used to execute a restore instruction -- if a register window was allocated by this subroutine.

It is important to note that the SPARC subroutine call and return mechanism does not automatically save and restore any registers. This is accomplished via the save and restore instructions which manage the set of registers windows.


PREV UP NEXT Bookshelf RTEMS SPARC Applications Supplement

Copyright © 1988-2000 OAR Corporation