HPlogo PA-RISC Procedure Calling Conventions Reference Manual > Chapter 2 Stack Usage

2.2 Storage Areas Required for a Call

MPE documents

Complete PDF
Table of Contents

The elements of a single stack frame that must be present in order for a procedure call to occur are shown below. The stack addresses are all given as byte offsets from the actual SP (stack pointer) value; for example, 'SP -36' designates the address 36 bytes below the current SP value.

The fields shown in Table 2-1 are explained in the text following the table.

Table 2-1 Elements of Single Stack Frame Necessary for a Procedure Call

[Table 2-1]

The size of a stack frame is required to be a multiple of 64 bytes so that the stack pointer is always kept 64-byte aligned. Since cache-lines on PA-RISC can be no larger than 64 bytes, this requirement allows compilers to know when data structures allocated on the stack are cache-line aligned. Knowledge of this alignment allows the compiler to use cache hints on memory references to those structures.


NOTE: Previous versions of this calling convention only required that stack frames be multiples of 8 bytes in size. The requirement has been increased to allow more effective use of cache hints on memory references to data items on the stack. Through the use of fixups specified by the compilers, the linker will be able to detect and eliminate uses of the cache hint bits in situations where 64-byte stack pointer alignment cannot be guaranteed. Some of the examples in this manual do not have 64-byte aligned stack frames.




2.1 Leaf and Non-Leaf Procedures


2.3 Frame Marker Area