next up previous contents
Next: kill: send a signal Up: MOSS system calls Previous: irq_free: free a previously-allocated

irq_request: allocate and handle a hardware interrupt vector

SYNOPSIS

int irq_request(int irq, int pri, struct sigevent *ev);

DESCRIPTION

This function allows a MOSS application to intercept one of the PC's hardware interrupts and service it in the application itself.

There are two ways the application can service interrupts, indicated by ev->sigev_notify:

The irq_request() function causes the specified hardware interrupt to be enabled if it wasn't enabled already. Therefore, the interrupt handler must be ready to service interrupts when this routine is called.

The main advantages of dispatching hardware interrupts as signals are:

The advantages of using the FASTINT mechanism are:

In general, you may want to use signal handlers to catch and handle hardware interrupts during debugging, because of their greater convenience, and switch to using FASTINT handlers for the ``release'' version of the program to achieve maximum performance and DPMI compatibility.

PARAMETERS

irq
The hardware IRQ number to intercept, 0-15.
pri
Currently unused.
ev
A sigevent structure describing the action to take when the interrupt occurs.

RETURN VALUE

Returns 0 if successful, or -1 on error, in which case errno indicates the error.


next up previous contents
Next: kill: send a signal Up: MOSS system calls Previous: irq_free: free a previously-allocated

Bryan Ford