Sparse Dynamic Areas
Sparse dynamic areas are dynamic areas whose memory allocation is not linear from the base of the area. Such regions might be used to release memory back to the RISC OS pool or to provide a virtual memory implementation. The Sparse dynamic areas are created with bit 10 set. Subsequently they should be resized by the SparseClaim and SparseRelease reason codes.
OS_DynamicArea SparseClaim (9)
Ensure region of sparse dynamic area is mapped to valid memory
On entry
R0 = 9
R1 = area number
R2 = base of region to claim
R3 = size of region
On exit
R0-R3 preserved
This SWI is used to claim an area of a Sparse Dynamic Area for use by the client. The size requested will be rounded up to a page. If not all of the region can be mapped in, an error will occur.
OS_DynamicArea SparseRelease (10)
Allow region of sparse dynamic area to release memory to free pool
On entry
R0 = 10
R1 = area number
R2 = base of region to release
R3 = size of region
On exit
R0-R3 preserved
This SWI is used to release areas of memory previously claimed back in to the free pool, unmapping the area requested. If not all of the region can be released, an error will occur.
|