HPlogo PA-RISC Procedure Calling Conventions Reference Manual

PA-RISC Procedure Calling Conventions Reference Manual

MPE documents

Complete PDF
Table of Contents

HP Part Number: 09740-90015

Edition: Volume 2

Published: E0191

Notice
Table of Contents
1. Overview
1.1 Types of Procedure Calls
1.2 Interfaces

2. Stack Usage
2.1 Leaf and Non-Leaf Procedures
2.2 Storage Areas Required for a Call
2.3 Frame Marker Area
2.4 Fixed Arguments Area
2.5 Variable Arguments Area

3. Register Usage and Parameter Passing
3.1 Register Partitioning
3.2 Other Register Conventions
3.3 The Floating-Point Coprocessor Status Register
3.4 Summary of Dedicated Register Usage
3.5 Parameter Passing and Function Results
3.5.1 Value Parameters
3.5.2 Inter-Language Parameter Data Types and Sizes
3.5.3 Reference Parameters
3.5.4 Value-Result and Result Parameters
3.5.5 Routine References
3.5.6 Argument Register Usage Conventions
3.5.7 Function Return Values
3.5.8 Parameter Type Checking
3.6 Parameter Relocation

4. The Actual Call
4.1 Control Flow of a Standard Procedure Call
4.2 Efficiency
4.3 The Code Involved in a Simple Local Call

5. Inter-Module Procedure Calls
5.1 External Calls on MPE XL
5.1.1 Requirements of an External Call on MPE XL
5.1.2 Requirements of an External Return
5.1.3 Control Flow of an MPE XL External Call
5.1.4 Calling Code
5.1.5 Called Code
5.1.6 Import and Export Stubs
5.1.7 Import Stubs
5.1.8 External Procedure Call Millicode (CALLX)
5.1.9 Export Stubs
5.1.10 Inter-Module Cross Reference Table (XRT)
5.1.11 The Layout of the XRT
5.1.12 Sub-table Header
5.1.13 Linkage Pointer
5.1.14 System Security and the XRT
5.1.15 Interface Between Import and Export Stubs
5.1.16 Summary of an External Procedure Call
5.1.17 Dynamic Linking
5.1.18 Procedure Labels
5.2 External Calls on HP-UX
5.2.1 Control Flow of an HP-UX External Call
5.2.2 Calling Code
5.2.3 Called Code
5.3 PIC Requirements for Compilers and Assembly Code
5.3.1 Long Calls
5.3.2 Procedure Labels and Dynamic Calls

6. Millicode Calls
6.1 The Millicode Hierarchy
6.2 Descriptions
6.3 Introduction to Local and External Millicode
6.4 Efficiency Factors
6.5 Making a Millicode Call
6.6 Nested Millicode Calls

7. Stack Unwinding
7.1 Requirements for Successful Stack Unwinding
7.2 Unwinding From Millicode
7.3 Instances in Which Unwinding May Fail
7.4 Callee-Saves Register Spill
7.5 The HP Pascal ESCAPE Mechanism
7.6 A Simple Example
7.7 An Advanced Example: Multiple Unwind Regions

Appendicies

A. Standard Procedure Calls
A.1 Pascal Source Code
A.2 ANSI C Source Code
A.3 FORTRAN Source Code
A.4 Assembly Listing
A.5 Code Description
A.6 Other Compiler-Generated Information
A.7 External Calls
A.7.1 Pascal Source Code
A.7.2 Assembly Code
A.8 Assembly Documentation

B. Summary of PA-RISC Assembler Procedure Control

C. The Stack Unwind Library
C.1 The Unwind Descriptor
C.2 Unwind Utility Routines
C.3 Recover Utility Routines
C.3.1 The Recover Table
C.4 Obtaining a Stack Trace
C.5 Errors From The Unwind Library

D. The Stack Unwind Process
D.1 Role of Stubs in Unwinding
D.2 Unwinding From Stubs on MPE XL
D.3 Unwinding From Stubs on HP-UX
D.4 Unwinding From Millicode
D.5 Unwinding Across an Interrupt Marker
D.6 Advanced Example

List of Figures
1-1 Procedure Call Convention Architected Interfaces
2-1 General Stack Layout
3-1 Register Partitioning
3-2 Floating-Point Registers
3-3 Parameter Relocation Stub
4-1 Control Flow of a Standard Procedure Call
5-1 Simplified External Procedure Call
5-2 Layout of the XRT
5-3 Sub-table Header
5-4 One XRT Entry
5-5 Summary of External Procedure Call
5-6 HP-UX External Procedure Call
6-1 Millicode Overview
6-2 Millicode Stack Storage Layout
List of Tables
2-1 Elements of Single Stack Frame Necessary for a Procedure Call
3-1 Space Register Usage
3-2 General Register Usage
3-3 Floating-Point Register Usage
3-4 Parameter Data Types and Sizes
3-5 Argument Register Use
3-6 Return Values




D.6 Advanced Example


Chapter 1 Overview