RISC OS Open
Safeguarding the past, present and future of RISC OS for everyone
ROOL
Home | News | Downloads | Bugs | Bounties | Forum | Documents | Photos | Contact us
Account

OS_Memory 18

OS SWI Calls
» OS_Memory
» OS_Memory 18

OS_Memory 18

(SWI &68)
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.

Use

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.

Notes

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):

  • User write
  • User execute
  • User read
  • Privileged write
  • Privileged execute
  • Privileged read

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.

See also

  • OS_Memory
  • OS_Memory 17
  • Memory Map Page Access
Revised on November 11, 2017 08:06:45 by Alan Robertson (52) (49.192.18.196)
Edit | Back in time (1 revision) | See changes | History | Views: Print | Source | Linked from: OS_AbortTrap, OS_Memory, Memory Map Page Access, OS_Memory 17

Search the Wiki

Social

Follow us on and

ROOL Store

Buy RISC OS Open merchandise here, including SD cards for Raspberry Pi and more.

Donate! Why?

Help ROOL make things happen – please consider donating!

RISC OS IPR

RISC OS is an Open Source operating system owned by RISC OS Developments Ltd and licensed primarily under the Apache 2.0 license.

Navigation

  • Home Page
  • All Pages
  • Recently Revised
  • Authors
  • Feeds
Site design © RISC OS Open Limited 2018 except where indicated
The RISC OS Open Instiki theme is based on Insitki's default layout

Valid XHTML 1.0  |  Valid CSS

Instiki 0.19.1(MML+)
This site runs on Rails

Hosted by Arachsys