goodjesse
goodjesse

Reputation: 147

What is the meaning of the instruction {interrupt do_IRQ} in linux kernel?

What is the meaning of the instruction {interrupt do_IRQ} in linux kernel file arch/x86/kernel/entry_64.S ? Is interrupt a instruction or a macro? Where is the definition? How to use it ?

847 common_interrupt: 
848         XCPT_FRAME    
849         addq $-0x80,(%rsp)              /* Adjust vector to [-256,-1] range */
850         interrupt do_IRQ
851         /* 0(%rsp): old_rsp-ARGOFFSET */

Upvotes: 2

Views: 1900

Answers (2)

akp
akp

Reputation: 1823

Interrupt are basically used for suspending all the current processes running on the current interrupted cpu core & then run the generated interrupt related work. & the interrupt related work is done with the handler routine or function which is registered.

Interrupt may be generated by H/W or S/W. and there are basically two types of interrupt as...1-)soft interrupt & 2-)hard interrupt.

so whenever a particular interrupt is generated its handler routine or function is called & this calling is related with the parameter passed in the function do_IRQ(struct pt_regs *regs) which is pt_regs structure type & it basically stores the registers values as...

struct pt_regs{
unsigned long r0;
unsigned long r1;
...
...
};

& for more info u can follow this link https://access.redhat.com/knowledge/docs/en-US/Red_Hat_Enterprise_MRG/1.3/html/Realtime_Reference_Guide/chap-Realtime_Reference_Guide-Hardware_interrupts.html

Upvotes: 0

Jamey Sharp
Jamey Sharp

Reputation: 8511

It's declared a short distance above:

/* 0(%rsp): ~(interrupt number) */
    .macro interrupt func
    /* reserve pt_regs for scratch regs and rbp */
    subq $ORIG_RAX-RBP, %rsp
    CFI_ADJUST_CFA_OFFSET ORIG_RAX-RBP
    call save_args
    PARTIAL_FRAME 0
    call \func
    .endm

I don't know what that does, though. :-)

Upvotes: 1

Related Questions