Showing changes from revision #9 to #10:
Added | Removed | Changed
Entry | |
---|---|
R0 | 0 (reason code) |
R1 | -1 (or new area number 128-255; reserved for internal use) |
R2 | Initial logical size of area, in bytes |
R3 | -1 (or base of area; reserved for internal use) |
R4 | Area flags vary by OS; see note |
R5 | Maximum logical size of area in bytes, or -1 for unlimited (see notes) |
R6 | Handler routine |
R7 | Pointer to workspace for handler, or -1 for base of area |
R8 | Pointer to name of area (limited to 31-chars in 3.80+) |
R9 | Initial maximum physical size of PMP in pages (if area is a PMP; otherwise, unused) |
Exit | |
---|---|
R1 | Allocated area number |
R3 | Base of area |
R5 | Maximum logical size of area |
R9 | Maximum physical size of area (if area is a PMP; otherwise, preserved) |
All other registers preserved |
The purpose of this call is to create a new dynamic area.
Area numbers allocated are greater than or equal to 256.
The setting R5 as -1 is strongly deprecated due to the problems of address space exhaustion on large memory machines. Also, a maximum size of -1 has no valid meaning for Sparse areas. New code should set the smallest maximum size that is sensible for the use required. Because old code may often use -1, a clamp may be set via OS_DynamicArea 8 in order to limit the address space exhaustion problem.
Area flags in b12-15 vary by OS version – specifically if OS_Byte 129 (OS) returns &AA.
When creating a PMP, arguments must be set as follows:
When the PMP is created it will have no pages assigned to it.
If necessary, the maximum physical size specified in R9 will be clamped to the total number of pages in the system – therefore you can specify -1 in order to create the largest possible PMP. However this will also require the kernel to allocate a large amount of memory for storing the page list, so to reduce memory wastage it’s recommended to dynamically adjust the maximum physical size of the PMP in order to avoid situations where a large PMP only has a small number of pages allocated to it.
The maximum logical size of a PMP will be clamped using the same rules as for regular dynamic areas. If the maximum logical size was zero then the PMP will have no logical space allocated to it and will return with R3 equal to zero.