I wrote a simple character driver and requested an IRQ on the gpio pin and asked for a handler for it.
err = request_irq (irq, irq_handler, IRQF_SHARED | IRQF_TRIGGER_RISING, INTERRUPT_DEVICE_NAME, raspi_gpio_devp);
static irqreturn_t irq_handler (int irq, void * arg);
Now, from theory, I know that after an interrupt, the Interrupt Controller inform the processor about the call to do_IRQ (), which will check the IDT and call my interrupt handler for this line.
how does the kernel know that the interrupt handler was for this particular device file
I also know that interrupt handlers do not start in any process context. But let me say that I refer to any variable declared outside the processing area of the handler, static global flag = 0. In the handler, I make flag = 1, indicating that an interrupt has occurred. This variable is in the context of the process. Therefore, I am confused by the way this handler does not in any context of the process change the variable in the context of the process.
thank
source
share