[Solved]-Compiling RTX Kernel files using GCC Compiler in Eclipse IDE-eclipse

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 gcc’s attribute feature. Here is the actual c code containing routines for irq, fiq and software interrupt.


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");

Read more here: Source link