Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ARM modes: User and System

Tags:

arm

Can you explain how the ARM mode get changed in case of a system call handling? I heard ARM mode change can happen only in privileged mode, but in case of a system call handling while the ARM is in user mode (which is a non-privileged mode), how does the ARM mode change?

Can anybody explain the whole action flow for the user mode case, and also more generally the system call handling (especially how the ARM mode change)?

Thanks in advance.

like image 503
ManishB Avatar asked Nov 20 '11 05:11

ManishB


1 Answers

In the case of system calls on ARM, normally the system call causes a SWI instruction to be executed. Anytime the processor executes a SWI (software interrupt) instruction, it goes into SVC mode, which is privileged, and jumps to the SWI exception handler. The SWI handler then looks at the cause of the interrupt (embedded in the instruction) and then does whatever the OS programmer decided it should do. The other exceptions - reset, undefined instruction, prefetch abort, data abort, interrupt, and fast interrupt - all also cause the processor to enter privileged modes.

How file handling works is entirely up to whoever wrote your operating system - there's nothing ARM specific about that at all.

like image 65
Carl Norum Avatar answered Oct 22 '22 10:10

Carl Norum