the most suitable way the handle system calls on a ARM system is by calling software interrupts (swi). this is done simply by one line of inline assembler: asm(" SWI #any_int_number");
in any_int_number the number of the desired system call can be handed over. this number is then located in the R0 processor register. the big advantage of the swi-calls is that it includes switches to privileged mode.
the change I will do to the swi handler is the following:
save registers R0-R14
adjust stack pointer
get handed over any_int_number
if any_int_number is in range 0 - 64 (system call numbers)
call system call handler
after system call handler was executed: switch back to user mode
restore register
the most suitable way the handle system calls on a ARM system is by calling software interrupts (swi). this is done simply by one line of inline assembler: asm(" SWI #any_int_number"); in any_int_number the number of the desired system call can be handed over. this number is then located in the R0 processor register. the big advantage of the swi-calls is that it includes switches to privileged mode.
the change I will do to the swi handler is the following: save registers R0-R14 adjust stack pointer get handed over any_int_number if any_int_number is in range 0 - 64 (system call numbers) call system call handler after system call handler was executed: switch back to user mode restore register
FYI: this ticket is related to ticket #31