最終更新:2014-06-05 (木) 21:11:31 (3613d)
request_threaded_irq
Top / request_threaded_irq
allocate an interrupt line
https://www.kernel.org/doc/htmldocs/kernel-api/API-request-threaded-irq.html
request_threaded_irq(unsigned int irq, irq_handler_t handler, irq_handler_t thread_fn, unsigned long flags, const char *name, void *dev);
引数
- irq - Interrupt line to allocate
- handler - Function to be called when the IRQ occurs. (request_irq)
- Primary handler for threaded interrupts
- If NULL and thread_fn != NULL the default primary handler is installed
- thread_fn - Function called from the irq handler thread If NULL, no irq thread is created
- irqflags - Interrupt type flags
- devname - An ascii name for the claiming device
- dev_id - A cookie passed back to the handler function
実装
- kernel/irq/manage.c?
呼び出し
request_irqとの違い
- http://stackoverflow.com/questions/7685294/request-threaded-irq-is-used-in-the-driver-why-not-request-irq-what-are-the
- The request_threaded_irq() function was added to allow developers to split interrupt handling code into two parts.
- One part that will execute with interrupts blocked, and a second part that can be done by a kernel thread without interrupts blocked.
- For details of why, you can read this: http://lwn.net/Articles/302043/
request_irqはrequest_threaded_irqのラッパー
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); }