h6. [[OS SWI Calls]] h6(. » [[OS_MMUControl]] h6((. » OS_MMUControl 2 h2. OS_MMUControl 2 h5. (SWI &6B) |_<^{width:4em}. Entry | | |/3<^. R0 |<^. Bits 0-7: 2 (reason code) | |<^. Bits 8-15: ARMop index | |<^. Other bits: Reserved (should be zero) | |_<^{width:4em}. Exit | | |<^. R0 |<^. ARMop function pointer | h4. 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]]. h4. Notes The available ARMops are as follows: |_<^{width:4em}. Index | | | 0 | [[Cache_CleanInvalidateAll ARMop|Cache_CleanInvalidateAll]] | | 1 | [[Cache_CleanAll ARMop|Cache_CleanAll]] | | 2 | [[Cache_InvalidateAll ARMop|Cache_InvalidateAll]] | | 3 | [[Cache_RangeThreshold ARMop|Cache_RangeThreshold]] | | 4 | [[TLB_InvalidateAll ARMop|TLB_InvalidateAll]] | | 5 | [[TLB_InvalidateEntry ARMop|TLB_InvalidateEntry]] | | 6 | [[DSB_ReadWrite ARMop|DSB_ReadWrite]] | | 7 | [[IMB_Full ARMop|IMB_Full]] | | 8 | [[IMB_Range ARMop|IMB_Range]] | | 9 | [[IMB_List ARMop|IMB_List]] | | 10 | [[MMU_Changing ARMop|MMU_Changing]] | | 11 | [[MMU_ChangingEntry ARMop|MMU_ChangingEntry]] | | 12 | [[MMU_ChangingUncached ARMop|MMU_ChangingUncached]] | | 13 | [[MMU_ChangingUncachedEntry ARMop|MMU_ChangingUncachedEntry]] | | 14 | [[MMU_ChangingEntries ARMop|MMU_ChangingEntries]] | | 15 | [[MMU_ChangingUncachedEntries ARMop|MMU_ChangingUncachedEntries]] | | 16 | [[DSB_Write ARMop|DSB_Write]] | | 17 | [[DSB_Read ARMop|DSB_Read]] | | 18 | [[DMB_ReadWrite ARMop|DMB_ReadWrite]] | | 19 | [[DMB_Write ARMop|DMB_Write]] | | 20 | [[DMB_Read ARMop|DMB_Read]] | | 21 | [[Cache_CleanInvalidateRange ARMop|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 h4. See also * [[OS_MMUControl 1]]