Visit Our UNIX and Linux User Community

Linux and UNIX Man Pages

Test Your Knowledge in Computers #119
Difficulty: Easy
The Single UNIX Specification (SUS) is a standard for Unix systems to qualify and have permission to use the UNIX certification mark.
True or False?
Linux & Unix Commands - Search Man Pages

request_threaded_irq(9) [centos man page]

REQUEST_THREADED_IRQ(9) 				     Public Functions Provided					   REQUEST_THREADED_IRQ(9)

request_threaded_irq - allocate an interrupt line SYNOPSIS
int request_threaded_irq(unsigned int irq, irq_handler_t handler, irq_handler_t thread_fn, unsigned long irqflags, const char * devname, void * dev_id); ARGUMENTS
irq Interrupt line to allocate handler Function to be called when the IRQ occurs. 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 DESCRIPTION
This call allocates interrupt resources and enables the interrupt line and IRQ handling. From the point this call is made your handler function may be invoked. Since your handler function must clear any interrupt the board raises, you must take care both to initialise your hardware and to set up the interrupt handler in the right order. If you want to set up a threaded irq handler for your device then you need to supply handler and thread_fn. handler is still called in hard interrupt context and has to check whether the interrupt originates from the device. If yes it needs to disable the interrupt on the device and return IRQ_WAKE_THREAD which will wake up the handler thread and run thread_fn. This split handler design is necessary to support shared interrupts. Dev_id must be globally unique. Normally the address of the device data structure is used as the cookie. Since the handler receives this value it makes sense to use it. If your interrupt is shared you must pass a non NULL dev_id as this is required when freeing the interrupt. FLAGS
IRQF_SHARED Interrupt is shared IRQF_TRIGGER_* Specify active edge(s) or level AUTHORS
Thomas Gleixner <> Author. Ingo Molnar <> Author. COPYRIGHT
Kernel Hackers Manual 3.10 June 2014 REQUEST_THREADED_IRQ(9)

Check Out this Related Man Page

BUS_DESCRIBE_INTR(9)					   BSD Kernel Developer's Manual				      BUS_DESCRIBE_INTR(9)

BUS_DESCRIBE_INTR, bus_describe_intr -- associate a description with an active interrupt handler SYNOPSIS
#include <sys/param.h> #include <sys/bus.h> int BUS_BIND_INTR(device_t dev, device_t child, struct resource *irq, void *cookie, const char *descr); int bus_describe_intr(device_t dev, struct resource *irq, void *cookie, const char *fmt, ...); DESCRIPTION
The BUS_DESCRIBE_INTR() method associates a description with an active interrupt handler. The cookie parameter must be the value returned by a successful call to BUS_SETUP_INTR(9) for the interrupt irq. The bus_describe_intr() function is a simple wrapper around BUS_DESCRIBE_INTR(). As a convenience, bus_describe_intr() allows the caller to use printf(9) style formatting to build the description string using fmt. When an interrupt handler is established by BUS_SETUP_INTR(9), the handler is named after the device the handler is established for. This name is then used in various places such as interrupt statistics displayed by systat(1) and vmstat(8). For devices that use a single inter- rupt, the device name is sufficiently unique to identify the interrupt handler. However, for devices that use multiple interrupts it can be useful to distinguish the interrupt handlers. When a description is set for an active interrupt handler, a colon followed by the description is appended to the device name to form the interrupt handler name. RETURN VALUES
Zero is returned on success, otherwise an appropriate error is returned. SEE ALSO
BUS_SETUP_INTR(9), systat(1), vmstat(8), device(9), printf(9) HISTORY
The BUS_DESCRIBE_INTR() method and bus_describe_intr() functions first appeared in FreeBSD 8.1. BUGS
It is not currently possible to remove a description from an active interrupt handler. BSD
October 14, 2009 BSD

Featured Tech Videos