Entry | |
---|---|
R0 | 24 (&18) |
R1 | Low address (inclusive) |
R2 | High address (exclusive) |
Exit | |
---|---|
R0 | Preserved |
R1 | Access flags |
R2 | Preserved |
This call examines a given logical address range and returns a set of flags indicating the access rights that programs have when accessing the block of memory. It is essentially a more verbose version of OS_ValidateAddress. However, unlike OS_ValidateAddress, it does not issue Service_ValidateAddress when given an unknown region.
This call is supported by RISC OS Select and RISC OS 5.21.
Bit | Meaning |
---|---|
0 | Range is completely readable in user mode |
1 | Range is completely writable in user mode |
2 | Range is completely readable in privileged modes |
3 | Range is completely writable in privileged modes |
4 | Range is partially readable in user mode |
5 | Range is partially writable in user mode |
6 | Range is partially readable in privileged modes |
7 | Range is partially writable in privileged modes |
8 | Range is completely physically mapped |
9 | Range is completely abortable (aborts handled by code) 2 |
10 | Range is completely non-executable in user mode 1 |
11 | Range is completely non-executable in privileged modes 1 |
12 | Range is partially physically mapped |
13 | Range is partially abortable (aborts handled by code) 2 |
14 | Range is partially non-executable in user mode 1 |
15 | Range is partially non-executable in privileged modes 1 |
All other bits are reserved for future expansion.
1 Executability information
RISC OS 5.23 adds support for reporting whether areas are non-executable. This ties in with the introduction of the ability for software to mark areas as non-executable in the page tables via the use of new access privileges.
For an area to be executable, the readable bit must be set and the non-executable bit must be clear. This provides an interpretation of the flags which is backwards-compatible with old OS versions. However it is important to remember that just because an area is reported as being executable, it does not guarantee that there is valid code at that location.
Note that because the flag indicates that areas are non-executable, the flag will be set for any unmapped areas of memory. In order to allow for future flags to be added in a similar manner it is important that software ignores the values of any flags which it does not understand (e.g. do not assume that unmapped memory will return with R1 equal to zero).
2 Under RISC OS 5, the following areas will be flagged as abortable: