In order to understand the threaded interrupt model's inner workings, let's take a look at the relevant APIs. We've already covered using the request_irq() API. Let's look at its implementation:
// include/linux/interrupt.h
static inline int __must_check
request_irq(unsigned int irq, irq_handler_t handler, unsigned long flags, const char *name, void *dev)
{
return request_threaded_irq(irq, handler, NULL, flags, name, dev);
}
This API is merely a thin wrapper over the request_threaded_irq() API! Its signature is as follows:
int __must_check
request_threaded_irq(unsigned int irq, irq_handler_t handler,
irq_handler_t thread_fn,
unsigned long flags, const char *name, void *dev);
The parameters, except for the third one, are identical to request_irq(). The following are a few key points to note:
- irq_handler_t handler: The second parameter is a pointer to the usual...