Hi,
In IRQ flow of ARM architecture for example, when interrupt was triggered, in the architecture specific assembly file the Program Counter register was assigned the address of handle_arch_irq function, which in turn was assigned the function pointer "mdesc->handle_irq".
The handle_irq function pointer is declared in struct machine_desc. In that structure declaration, handle_irq function pointer has argument as struct pt_regs, whose definition is
Code:
struct pt_regs {
unsigned long uregs[18];
};
But in the generic IRQ handling source code we don't have any handle_irq function having the struct pt_regs as argument.
Also in
https://www.kernel.org/doc/html/late...enericirq.html
it was mentioned as
Whenever an interrupt triggers, the low-level architecture code calls into the generic interrupt code by calling desc->handle_irq().
But that generic interrupt code has two arguments irq number and struct irq_desc.
My doubt is will the struct pt_regs argument in architecture specific function pointer handle_irq smoothly type casted to the arguments of generic interrupt code handle_irq function pointer's 2 argument?
I got this doubt because I could not find exact match of function prototype between architecture specific function pointer and generic interrupt handling function pointer and as internally the arguments of generic code will be passed into the stack space which can be accommodated with struct pt_regs as it has just array of unsigned long.
Please reply whether my mapping is correct, if not what is the real logic?
Thanks,
Ayyappan M.