Safeguarding the past, present and future of RISC OS for everyone
Account
News | Downloads | Bugs | Bounties | Forums | Library

OS_MMUControl 2

OS SWI Calls
» OS_MMUControl
» OS_MMUControl 2

OS_MMUControl 2

(SWI &6B)
Entry
R0 Bits 0-7: 2 (reason code)
Bits 8-15: ARMop index
Other bits: Reserved (should be zero)
Exit
R0 ARMop function pointer

Use

The purpose of this call is to read the address of one of the kernels “ARMop” routines. The ARMops are the low-level cache/TLB maintenance routines that the OS uses, and calling them directly can result in higher performance than calling equivalent SWIs such as OS_MMUControl 1.

Notes

The available ARMops are as follows:

Index
0 Cache_CleanInvalidateAll
1 Cache_CleanAll
2 Cache_InvalidateAll
3 Cache_RangeThreshold
4 TLB_InvalidateAll
5 TLB_InvalidateEntry
6 DSB_ReadWrite
7 IMB_Full
8 IMB_Range
9 IMB_List
10 MMU_Changing
11 MMU_ChangingEntry
12 MMU_ChangingUncached
13 MMU_ChangingUncachedEntry
14 MMU_ChangingEntries
15 MMU_ChangingUncachedEntries
16 DSB_Write
17 DSB_Read
18 DMB_ReadWrite
19 DMB_Write
20 DMB_Read
21 Cache_CleanInvalidateRange

Requesting an unknown ARMop will result in an error. Unused ARMops (e.g. IMB on CPU with unified cache) will return a pointer to a dummy routine which does nothing – this can be detected as it will be a single MOV pc,lr instruction.

The general rules for register usage and preservation in calling these ARMops are:

  • Any parameters are passed in R0,R1 etc. as required
  • SP must be a valid stack pointer, with at least 16 words available
  • Return address must be in LR
  • The CPU must be in a privileged mode
  • ARMops are allowed to corrupt R0, LR, and the PSR status flags. All other registers (unless used for return values) are preserved.

All ARMops are re-entrant, and it is preferred to call them with interrupts enabled (cache clean operations can be lengthy).

Note that where register values are given as logical addresses, these are RISC OS logical addresses. The equivalent ARM terminology is virtual address (VA), or modified virtual address (MVA) for architectures with the fast context switch extension.

Note also that where cache invalidation is required, it is implicit that any associated operations for a particular ARM will be performed also. The most obvious example is for an ARM with branch prediction, where it may be necessary to invalidate a branch cache anywhere where instruction cache invalidation is to be performed.

This call was first introduced with RISC OS 5.23

See also

  • OS_MMUControl 1
Revised on November 13, 2017 03:02:25 by Alan Robertson (52) (49.192.18.196)
Edit | Back in time (3 revisions) | See changes | History | Views: Print | Source | Linked from: OS_MMUControl, PCI_RAMAlloc, GraphicsV 13, Cache_CleanInvalidateAll ARMop, Cache_CleanAll ARMop, Cache_RangeThreshold ARMop, TLB_InvalidateAll ARMop, TLB_InvalidateEntry ARMop, Cache_InvalidateAll ARMop, IMB_Full ARMop, IMB_Range ARMop, IMB_List ARMop, MMU_Changing ARMop, MMU_ChangingEntry ARMop, DSB_ReadWrite ARMop, DSB_Write ARMop, DSB_Read ARMop, DMB_ReadWrite ARMop, DMB_Write ARMop, DMB_Read ARMop, Cache_CleanInvalidateRange ARMop, MMU_ChangingUncached ARMop, MMU_ChangingUncachedEntry ARMop, MMU_ChangingEntries ARMop, MMU_ChangingUncachedEntries ARMop

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
Contact Us  |  About Us

The RISC OS Open Instiki theme is based on Insitki's default layout
Site design © RISC OS Open Limited 2024 except where indicated

Hosted by Arachsys

Instiki 0.19.1(MML+)
This site runs on Rails