Take the 2-minute tour ×

I have read about system calls in Linux, and everywhere description is given regarding x86 architecture (ox80 interrupt and SYSENTER). But i am not able to track down the files and process for a system call in ARM achitecture. Can anyone please help.

Few relevant files which i got to know are


\arch\arm\kernel\entry-common.S (explanation needed)

share|improve this question
Is it how user space makes a system call that you are wondering or how it is handled in kernel space? –  auselen Oct 18 '12 at 6:47
@auselen how it is handles in kernel space. and as far as user space is concerned, i dont think it will be arm specific. thanks –  shingaridavesh Oct 18 '12 at 7:20
thinking about the answer you accepted below, I wonder what you've seen there kernel specific? –  auselen Oct 18 '12 at 7:32
i am reading and analysing how the kernel issues software interrupt in case of ARM to switch to system mode and how library calls are linked with system calls. It seems that swi is converted to svc. For further clarification i need to run a program using/calling a basic system call. Kindly correct me if i am wrong or if i am missing something. –  shingaridavesh Oct 18 '12 at 7:50
It is the user space which issues a software interrupt (which looks like the part you are interested), then kernel takes over. The way you do it in arm is "supervisor call / svc" (previously called swi). see this boilerplate code from uclibc git.uclibc.org/uClibc/tree/libc/sysdeps/linux/arm/syscall.c –  auselen Oct 18 '12 at 8:47

3 Answers 3

up vote 4 down vote accepted

In ARM world, you do a software interrupt (mechanism to signal the kernel) by supervisor call / svc (previously called SWI).

ARM assembly (UAL) syntax looks like this:

SVC{<c>}{<q>} {#}<imm>

(In Linux you need to pass #0)

You should cheat from other projects like bionic/write or uClibc boilerplate.

share|improve this answer
thanks for the link, it is clear from that the arguments are loaded in the registers. Linux allows 5 arguments as mentioned, so there must be loading somewhere in General purpose registers in linux code(for arm). I am not able to find the corresponding file in linux code. –  shingaridavesh Oct 18 '12 at 9:58
you can pass them as in uClibc example. –  auselen Oct 18 '12 at 11:14

The disassembly of hello world in n900 shows svc #0


share|improve this answer
Thanks, reading the article. Great help. –  shingaridavesh Oct 18 '12 at 7:22

This is what i know and have observed.

In an ARM based Linux environment.

Register R8 is used to pass the system call number that is whenever you use a system call through an API, the function being called does not do any specific work. It acts as an interface between the user and the system call system routine.

the registers R9,R10,R11,R12 are used to pass the parameters to the system call. if the system call needs more than 4 parameters then the first 4 are placed on the registers and the others are placed on the stack (This approach can vary with the Compiler being used to compile the kernel).

this was the process, for the files i would suggest looking into the /arch directory in the kernel source tree an once you do you will find syscalls.h there and there would be other files too, system call wrappers and the syscall table (trough which wee know which system call is being called) are present in other files. you can look at them.

right now i am on a windows system, will update it as soon as i get a look into the kernel source tree.

share|improve this answer
As far as I know, it's register R7 and not R8 that is used for passing the syscall number. –  DocKimbel May 25 '13 at 18:49
maybe im wrong... but according to me this shall vary from compiler to compiler. –  Arun Kumar May 26 '13 at 1:36

Your Answer


