Sparse Dynamic Areas

Introduction and Overview

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.

SWI Calls

OS_DynamicArea 9OS_DynamicArea_SparseClaimSWI &66
Ensure region of sparse dynamic area is mapped to valid memory
R0=9
R1=Area number
R2=Base of region to claim
R3=Size of region
R0 - R3=Preserved
Interrupts are undefined
Fast interrupts are undefined
Processor is in undefined mode
Not defined

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 AOS_DynamicArea_SparseReleaseSWI &66
Allow region of sparse dynamic area to release memory to free pool
R0=10
R1=Area number
R2=Base of region to release
R3=Size of region
R0 - R3=Preserved
Interrupts are undefined
Fast interrupts are undefined
Processor is in undefined mode
Not defined

This SWI is used to release areas of memory previously claimed back into the free pool, unmapping the area requested. If not all of the region can be released, an error will occur.