On entry
Register | Contents | |
---|---|---|
R0 | Pointer to list of stub descriptions each having the following format: | |
Offset | Contents | |
+0 | Library chunk id (1 or 2) | |
+4 | Entry vector base | |
+8 | Entry vector limit | |
+12 | Static data base | |
+16 | Static data limit | |
R1 | Pointer to workspace start | |
R2 | Pointer to workspace limit | |
R3 | –1 | |
R4 | 0 | |
R5 | –1 |
On exit
Entry vectors specified by the stubs descriptions are patched to contain branches to routines in the library.
If R5 > R4 on entry the users statics are copied to the bottom of the workspace specified in R1 and the Client static data offset (at byte offset +24 from the stack base) is initialised.
For each library chunk the library statics are copied either into the workspace specified in R1 if R5 > R4 on entry or to the static data area specified in the chunks stub description if R5 <= R4.
The Library static data offset (at byte offset +20 from the stack base) is initialised.
Space for the root stack chunk is claimed from the workspace specified in R1.
This is legacy from Arthur and should not be used. It’s documented here for historic reasons.
The stub list pointed to in R0 is terminated by an entry with a library chunk id of –1
APCS | Register | APCS | Contents |
---|---|---|---|
APCS-Arthur | R0 | a1 | Argument 1 |
R1 | a2 | Argument 2 | |
R2 | a3 | Argument 3 | |
R3 | a4 | Argument 4 | |
R4 | v1 | Register variable 1 | |
R5 | v2 | Register variable 2 | |
R6 | v3 | Register variable 3 | |
R7 | v4 | Register variable 4 | |
R8 | v5 | Register variable 5 | |
R9 | v6 | Register variable 6 | |
R10 | fp | Frame pointer | |
R11 | ip | Used as temporary workspace | |
R12 | sp | Lower end of current stack frame | |
R13 | sl | Stack limit / Stack chunk handle | |
R14 | lr | Link register | |
R15 | pc | Program counter |
Chunk 1 is 152 bytes containing 38 entries (the last being _kernel_fpavailable)
Statics are 800 bytes (matching APCS-R)
Chunk 2 is 672 bytes containing 168 entries (the last being __assert)
Statics are 2888 bytes (matching APCS-R)