RISC OS Open
A fast and easily customised operating system for ARM devices
ROOL
Home | News | Software | Bugs | Bounties | Forum | Documents | Photos | Contact us
Account

OS_EnterOS

Programmer's Reference Manuals
» Part 15 – SWI Calls
» OS
» OS_EnterOS

OS_EnterOS

(SWI &16)
Entry
- -
Exit
All registers preserved

Use

The purpose of this call is to set the processor to Supervisor mode.

Notes

Interrupt and Fast Interrupt status is unaltered. Note that SWI calls while in SVC mode will alter R14, and will use R13 as stack.

To return to User mode on an ARM6 or later:

MSR   CPSR_c,#%10000  ; USR32

alternatively to return to either USR32 or USR26

MRS   R14,CPSR
BIC   R14,R14,#%1111  ; Only sets usermode
MSR   CPSR_c,R14

To return to User mode pre ARM6 (deprecated):

TEQP  PC,#0
MOV   R0,R0  ; Anything that doesn't use banked R8-R14

alternatively to return to user mode leaving the other PSR bits constant

BIC   R14,PC,#%11  ; Only sets usermode
TEQP  R14,#0
MOV   R0,R0  ; Anything that doesn't use banked R8-R14

See also

  • OS_LeaveOS
Revised on December 24, 2011 11:37:37 by Sprow (202)? (109.176.233.8)
Edit | Back in time (4 revisions) | See changes | History | Views: Print | Source | Linked from: OS SWI Calls, OS_LeaveOS

Search the Wiki

Commercial use

For commercial enquiries, please contact the owners of RISC OS, Castle Technology Ltd.

ROOL Store

The official C/C++ Development kit and more here.

Donate! Why?

Help ROOL make things happen – please consider donating!

Navigation

  • Home Page
  • All Pages
  • Recently Revised
  • Authors
  • Feeds
  • Export
Site design © RISC OS Open Limited 2011 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