do_software_interrupt, do_irq and do_fiq are interrupt service routines for SWI, IRQ, and FIQ, respectively. These functions are implemented in c using the gccs attribute function. Here is the actual c code containing the procedures for irq, fiq and program interrupt.
entry.c
void __attribute__((interrupt("IRQ"))) do_irq() { //your irq service code goes here } void __attribute__((interrupt("FIQ"))) do_fiq() { //your fiq service code goes here } void __attribute__((interrupt("SWI"))) do_software_interrupt() { volatile unsigned int int_num; asm("LDR r0, [lr, #-4]"); asm("BIC r0, #0xFF000000"); asm("MOV %0, r0":"=r"(int_num):); //based on int_num, you can determine which system call is called } void c_start() { asm volatile ("SVC 0x5"); while(1){} }
source share