Skip to Content
Linux Device Drivers, Second Edition
book

Linux Device Drivers, Second Edition

by Jonathan Corbet, Alessandro Rubini
June 2001
Intermediate to advanced
592 pages
19h 20m
English
O'Reilly Media, Inc.
Content preview from Linux Device Drivers, Second Edition

Quick Reference

These symbols related to interrupt management were introduced in this chapter.

#include <linux/sched.h> , int request_irq(unsigned int irq, void (*handler)(), unsigned long flags, const char *dev_name, void *dev_id); , void free_irq(unsigned int irq, void *dev_id);

These calls are used to register and unregister an interrupt handler.

SA_INTERRUPT , SA_SHIRQ , SA_SAMPLE_RANDOM

Flags for request_irq. SA_INTERRUPT requests installation of a fast handler (as opposed to a slow one). SA_SHIRQ installs a shared handler, and the third flag asserts that interrupt timestamps can be used to generate system entropy.

/proc/interrupts , /proc/stat

These filesystem nodes are used to report information about hardware interrupts and installed handlers.

unsigned long probe_irq_on(void); , int probe_irq_off(unsigned long);

These functions are used by the driver when it has to probe to determine what interrupt line is being used by a device. The result of probe_irq_on must be passed back to probe_irq_off after the interrupt has been generated. The return value of probe_irq_off is the detected interrupt number.

void disable_irq(int irq); , void disable_irq_nosync(int irq); , void enable_irq(int irq);

A driver can enable and disable interrupt reporting. If the hardware tries to generate an interrupt while interrupts are disabled, the interrupt is lost forever. A driver using a shared handler must not use these functions.

DECLARE_TASKLET(name, function, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Linux Device Drivers, 3rd Edition

Linux Device Drivers, 3rd Edition

Jonathan Corbet, Alessandro Rubini, Greg Kroah-Hartman

Publisher Resources

ISBN: 0596000081Supplemental ContentCatalog PageErrata