REQUEST_IRQ
Section: Kernel Reference Guide (9)
Updated: AUGUST 1995
Index
Return to Main Contents
NAME
request_irq, free_irq, enable_irq, disable_irq
- set up and remove a hardware interrupt handler, enable and disable interrupt.
SYNOPSIS
#include <linux/sched.h>
#include <linux/signal.h>
#include <asm/irq.h>
int request_irq(unsigned int irq,
void (*handler)(int, struct pt_regs *),
unsigned long flags,
const char *device);
void free_irq(unsigned int irq);
void enable_irq(unsigned int irq_nr);
void disable_irq(unsigned int irq_nr);
DESCRIPTION
request_irq()
is used to set up an interrupt
handler
for
irq.
The
handler
will be called on interrupt with the arguments
int irq,
which is the number of the interrupt, and
struct pt_regs * regs,
which is a pointer to the processor registers on stack.
flags
is one of
0, SA_INTERRUPT, SA_ONESHOT
or
SA_PROBE.
0
-
The interrupt is a slow interrupt. All registers will be saved.
The interrupt handler always runs with other interrupts
enabled. The handler gets a pointer
struct pt_regs *
to the processor registers on the stack.
After execution of the handler ret_from_syscall is executed,
where bottom halves are checked and if necessary exececuted.
need_reschedule is checked and the scheduler will be called if set.
Signals are checked and handled.
SA_INTERRUPT
-
The interrupt is a fast interrupt. The handler is running with other
interrupts disabled, unless it explicitly enables them. The pointer
struct pt_regs *
given to the handler will be
NULL.
There will be no check for signals, need_resched, or bottom halves after
execution.
SA_ONESHOT
-
The interrupt will be disabled after one execution, but the handler
will not be discarded.
SA_PROBE
-
Same as
SA_ONESHOT.
This is used for probe_irq_on() for finding the irq of a device by trial.
( See arch/i386/kernel/irq.c )
device
is a string which contains the name of the device.
free_irq()
discards the interrupt handler for interrupt
irq.
enable_irq()
enables the irq with the number
irq_nr
in the hardware interrupt controller.
disable_irq()
disables the irq with the number
irq_nr
in the hardware interrupt controller.
RETURN VALUE
request_irq() returns zero on sucess or a negative error number if an error
occured. ( see include/linux/errno.h )
ERRORS
EINVAL
The requested interrupt has a number out of range, or
handler
is a pointer to NULL.
EBUSY
There exists a registered handler for the requested interrupt.
SOURCES
linux/arch/i386/kernel/irq.c,
linux/include/asm-i386/irq.h,
linux/arch/i386/kernel/entry.S
FILES
/proc/interrupts
BUGS/LIMITAIONS
It's not possible to register more than one handler for one interrupt,
But I heard this is planned for the future.
AUTHOR
Linus Torvalds
Index
- NAME
-
- SYNOPSIS
-
- DESCRIPTION
-
- RETURN VALUE
-
- ERRORS
-
- SOURCES
-
- FILES
-
- BUGS/LIMITAIONS
-
- AUTHOR
-
This document was created by
man2html,
using the manual pages.
Time: 12:22:41 GMT, March 22, 2025