STREAMS/UX for the HP 9000 Reference Manual

178
Debugging STREAMS/UX Modules and Drivers
Using adb
PA-RISC Procedure Calling Conventions Overview
The following is a very brief overview of the PA-RISC procedure calling
convention. More information can be obtained from the PA-RISC Procedure
Calling Conventions Reference Manual.
PA-RISC machines have 32 general use registers. These registers are
identical physically, but are assigned different roles by the PA-RISC
operating systems and compilers in order to enable procedure calls to take
place efficiently and consistently. The following table lists these special
roles:
Table 5 General Use Register Roles
r0 Value is always zero.
r1 Scratch register.
r2
Return pointer, also known as rp. This is the instruction address the
called procedure will return to when it is finished executing.
r3 - r18 Callee saves. If the called procedure wishes to modify any of these
registers, it must save the original contents on its stack and restore the
contents before returning to the caller.
r19 - r22 Caller saves. The called procedure is free to modify these registers
without saving the original contents. If the calling procedure wants to
retain the contents, it must save them before making the procedure call
and restore them after the call returns.
r23 - r26
First four procedure arguments, also known as arg0, arg1, arg2, and arg3.
The calling procedure loads the first four procedure arguments into these
registers before making the procedure call.
r27
Global data pointer, also known as dp.
r28 - r29
Procedure return values, also known as ret0 and ret1. The called
procedure loads the return values into these registers before returning.
r30
Stack pointer, also known as sp.
r31 Millicode return pointer, or scratch register.