DOC PREVIEW
CORNELL CS 414 - The ARM-THUMB Procedure Call Standard

This preview shows page 1-2-17-18-19-36-37 out of 37 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 37 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 37 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 37 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 37 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 37 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 37 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 37 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 37 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

The ARM-THUMB Procedure Call StandardSWS ESPC 0002 A-05 Page 1 of 37 The ARM-THUMB Procedure CallStandardDevelopment Systems Business UnitEngineering Software GroupDocument number: SWS ESPC 0002 A-05Date of Issue: 05 November, 1998Author: -Authorized by:© Copyright ARM Limited 1998. All rights reserved.AbstractThis document defines a family of procedure call standards for the ARM and THUMB instruction sets.Keywordsprocedure call, function call, calling conventionsDistribution listName Function Name FunctionThe ARM-THUMB Procedure Call StandardSWS ESPC 0002 A-05 Page 2 of 37Contents1 ABOUT THIS DOCUMENT 51.1 Change control 51.1.1 Current status and anticipated changes 51.1.2 Change history 51.2 References 51.3 Terms and abbreviations 62 SCOPE 73 INTRODUCTION 83.1 Design goals 83.2 Conformance 83.3 Processes and the memory model 83.4 Pre-conditions and post-conditions 94 THE BASE STANDARD 104.1 Machine registers 104.2 Floating point registers 114.3 Subroutine call 114.4 Parameter passing 124.4.1 Variable number of parameters (variadic routines) 134.4.2 Fixed number of parameters 134.5 Result return 134.6 The FPA procedure call standard 144.7 The VFP (scalar mode) procedure call standard 144.8 The no floating-point hardware procedure call standard 155 THE STANDARD VARIANTS 165.1 Inter-working between ARM-state and Thumb-state 165.2 Read-only position-independence—PIC 16The ARM-THUMB Procedure Call StandardSWS ESPC 0002 A-05 Page 3 of 375.3 Read-write position-independence—PID 175.3.1 Position-independent data addressing 175.3.2 RWPI defined 175.4 Re-entrant code 175.5 Shared libraries 185.6 The shared-library data-addressing architecture 185.7 Stack limit checking 195.8 Chunked stacks 206 STACK UNWINDING 216.1.1 Background 216.1.2 What this standard defines 216.2 Allowed alternatives for unwinding 216.2.1 Basic routine shape 226.2.2 The stack-moves-once condition 226.2.3 Unwinding a fixed size activation record by interpreting an entry sequence 226.2.4 Unwinding a fixed size activation record by executing an exit sequence 236.2.5 Constraints on frame pointers 236.2.6 Unwinding an activation record using a frame pointer 246.3 The shape of routine entry 247 ARM C AND C++ CONVENTIONS 257.1 ANSI C and C++ argument passing conventions 257.2 Narrow arguments 267.3 Result return 267.3.1 Non-floating-point results 267.3.2 Floating-point results 267.3.3 Value-in-registers result return 277.4 __shared_library 278 RATIONALE FOR ATPCS VARIANTS 288.1 The base standard and its variants 288.2 ARM Shared Libraries 298.2.1 Basic static data addressing in a shared-library-using application 308.2.2 Exported data 308.2.3 Base-standard clients 308.3 Dynamically loaded libraries 31The ARM-THUMB Procedure Call StandardSWS ESPC 0002 A-05 Page 4 of 378.4 Legacy issues 318.4.1 Floating point argument passing 328.4.2 Narrow arguments 338.5 Derivation of library variant costs 34The ARM-THUMB Procedure Call StandardSWS ESPC 0002 A-05 Page 5 of 371 ABOUT THIS DOCUMENT1.1 Change control1.1.1 Current status and anticipated changesRelease A-05 of this specification is the first public release. No changes are anticipated.1.1.2 Change historyIssue Date By ChangeA-01 18 March, 1998 - First partial draft for early review (WD, HM, SW, EN)A-01 20 March, 1998 - Second partial draft for internal review.A-02 30 March, 1998 - First external-review DRAFT.A-03 17 July, 1998 - Second external-review DRAFTA-04 23 October 1998 - FINAL internal review DRAFTA-05 5 November, 1998 - Editorial changes following review1.2 ReferencesThis document refers to the following documents.Ref Doc No Author(s) TitleThe ARM-THUMB Procedure Call StandardSWS ESPC 0002 A-05 Page 6 of 371.3 Terms and abbreviationsThis document uses the following terms and abbreviations.Term MeaningPCS Procedure Call StandardAPCS ARM Procedure Call StandardTPCS Thumb Procedure Call StandardATPCS ARM-Thumb Procedure Call StandardSubroutine, routine A fragment of program to which control can be transferred that, on completing itstask, returns control to its caller at an instruction following the call.Procedure A routine that returns no result value.Function A routine that returns a result value. A C/C++ function.Memory state The state of the program’s memory, including values in machine registers.Externally visible [interface] [An interface] between separately compiled or separately assembled routines.Activation (call-frame) stack The stack of routine activation records (call frames).Variable register, v-register A register used to hold the value of a variable (usually one local to a routine).Scratch register, temporaryregisterA register used to hold an intermediate value during a calculation (usually, suchvalues are not named in the program source and have a limited lifetime).Activation record The memory used by a routine for saving registers and holding local variables(usually allocated on a stack, once per activation of the routine).Call frame The part of an activation record used to save registers.ParameterA formal parameter of a routine given the value of the actual parameter when theroutine is called.Argument Formal parameter or actual parameter according to context.PIC, PID Position-independent code, position-independent data.More specific terminology is defined when it is first used.The ARM-THUMB Procedure Call StandardSWS ESPC 0002 A-05 Page 7 of 372 SCOPEThis standard defines how subroutines can be separately written, separately compiled, and separately assembledto work together. It describes a contract between a calling routine and a called routine that defines:o Obligations on the caller to create a memory state in which the called routine may start to execute.o Obligations on the called routine to preserve the memory-state of the caller across the call.o The rights of the called routine to alter the memory-state of its caller.The standard also defines how an external agent can unwind the subroutine activation stack. This standard specifies a family of Procedure Call Standard (PCS) variants, generated by a cross product of user-choices that reflect alternative priorities among:o Code size.o Performance.o Functionality (for example, ease of debugging, run-time checking, support for shared libraries). Many of the variants generated are not compatible with one another because the choices on which they are basedare mutually exclusive or incompatible. This standard is presented in four sections that specify:o A machine-level base standard.o A


View Full Document

CORNELL CS 414 - The ARM-THUMB Procedure Call Standard

Documents in this Course
Security

Security

49 pages

Processes

Processes

24 pages

Deadlocks

Deadlocks

57 pages

Threads

Threads

5 pages

Threads

Threads

29 pages

Deadlocks

Deadlocks

36 pages

Load more
Download The ARM-THUMB Procedure Call Standard
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view The ARM-THUMB Procedure Call Standard and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view The ARM-THUMB Procedure Call Standard 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?