Showing changes from revision #1 to #2:
Added | Removed | Changed
Entry | |
---|---|
R0 | 18 (reason code) |
R1 | Desired permission flag values: |
Bit 0: Executable in user mode | |
Bit 1: Writable in user mode | |
Bit 2: Readable in user mode | |
Bit 3: Executable in privileged modes | |
Bit 4: Writable in privileged modes | |
Bit 5: Readable in privileged modes | |
Bits 6+: Reserved | |
R2 | Mask of which bits in R1 are specified |
Exit | |
---|---|
R0 | Number of the closest access privilege, or error |
R2 | Permission flags of that access privilege. Preserved on error. |
This call allows you to find the access privilege number that provides the closest match to the permissions you specify.
The searches for an AP which satisfies the constraint of ((permissions AND R2) == R1)
, and which grants the least extra permissions over those that were requested. E.g. to only allow AP values where user mode code has no access, bits 0-2 of R1 must be clear and bits 0-2 of R2 must be set.
If the system is unable to find an AP which satisfies the constraints of R1 and R2 then an error will be returned.
R1 must be a subset of R2, i.e. you must not have a bit set in R1 if the same bit is not set in R2.
Extra permissions are weighted as follows (least acceptable first):
This call was introduced in RISC OS 5.23. For the permissions supported by earlier RISC OS versions, see Memory Map Page Access.
OS_Memory 17 can be used to enumerate the available access privileges and read their permissions.