Showing changes from revision #4 to #5:
Added | Removed | Changed
The page access flags used below are used by the OS_DynamicArea, OS_Memory, and the OS_SetMemMapEntries group of SWIs. However, when using calls to modify the access of pages, be aware that not all APIs support all types of flags. Specifying an unsupported flag can lead to malfunction. Also note that this page only lists the flags supported by RISC OS 5 and its predecessors; for information on RISC OS 4 and 6, please see ROL’s documentation.
Bit | Meaning | OS version | Notes |
---|---|---|---|
0-3 | Access privileges to be given to each page in the area | Arthur | |
4 | Set if area is not bufferable by chips | 3.50 | 1 |
5 | Set if area is not cacheable by chips | 3.50 | 1 |
6 | If set, area is doubly mapped (reserved, OS use only), otherwise area is singly mapped | 3.50 | 2 |
3.50 | |||
1 =>area may not be dragged by the user in Task Manager window (has green bar) | 3.50 | ||
8 | 0 =>area does not require specific physical pages (ie R1 is undefined on entry to the PreGrow and PostGrow handlers) | 3.50 | |
1 =>area may require specific physical pages (ie R1 points at a page block on entry to the PreGrow and PostGrow handlers) | 3.50 | ||
9 | 1 =>area is Shrinkable | 3.80 | |
10 | 1 =>area is Sparse | 3.80 | |
11 | 1 =>area is bound? to client application | 3.80 | |
12-14 | Cache policy | 5.00 | |
5.19 | 3 | ||
16-30 | Reserved (must be zero) | ||
31 | Virtual memory is active for dynamic area | 2 |
Prior to RISC OS 5.00, OS_ReadMemMapEntries and OS_FindMemMapEntries would return all of the flags for a given page, but OS_SetMemMapEntries would only pay attention to the bottom two bits and clear the rest to zero. With RISC OS 5.00 this behaviour was fixed so that the full set of flags are used.
1 Advice on bits 4 & 5
Setting flags such that r4 bit 4 is 1 and bit 5 is 0 (area is cacheable but not bufferable) has different meanings depending on the operating system version. On RISC OS 5 it selects a non-merging write-through or write-back cache policy. On other operating system versions it is unsupported and must not be used.
2 Virtual Doubly memory mapped regions
If Using bit 31 is set when the dynamic area is created then virtual memory is activated immediately. Note that no error is produced if it is not possible to start virtual memory for the new dynamic area. Note: This feature is not implemented by the OS and requires third-party software to function.OS_SetMemMapEntries to set a page as doubly mapped is not supported and will result the page tables being incorrectly modified.
3 DMA
Under RISC OS 5, setting bit 15 will cause the OS to ignore any PreGrow handler specified by the user and instead use a routine which only allocates from DMA capable memory. The memory is not guaranteed to be physically contiguous – if physical contiguity is required, consider using OS_Memory 12 with bit 8 of R0 set from within a PreGrow handler, or use PCI_RAMAlloc.
This same functionality is available under ROL’s OS (from RISC OS 4.?? onwards), but requires you to set bit 12 of the flags, not bit 15. Be aware of this difference when writing software targeting both OS versions.