DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
SCO OpenServer

add_intr_handler(D3oddi)


add_intr_handler -- dynamically add interrupt routine handler

Synopsis (Not recommended for current drivers)

#include <sys/devreg.h>

int add_intr_handler(int type, int vector, void (*handler)(int), int ipl);

Description

add_intr_handler( ) dynamically registers an interrupt handler routine with the kernel.

Arguments


type
Matches the type field in sdevice.

vector
Interrupt vector to be registered

handler
Routine to be registered

ipl
Interrupt priority level for the interrupts being registered

Return values

add_intr_handler returns 0 (zero) if handler is successfully installed.

Otherwise, handler is not installed and one of the following error codes (defined in <sys/devreg.h>) is returned:


INTR_BADIPL
The value of ipl is not in the range 1 to IPLHI (defined in <sys/ipl.h>).

INTR_BADTYPE
The type is not in the range 1 to 5.

INTR_BADVECTOR
The vector is not in the range 1 to the maximum usable vector size for this architecture.

INTR_ENABLED
Interrupts have been enabled and it is no longer possible to register interrupt handlers.

INTR_PRIVATE
Either:

INTR_WRONGIPL
vector is already occupied but its interrupt level is not ipl.

Usage

Most drivers that control hardware must handle interrupts generated by that hardware. Interrupts for full UNIX device drivers must co-operate with the UNIX kernel in defining when and how interrupts are to be handled. (SCSI device drivers must use the SCSI registration mechanism; see Sdevregister(D3osdi) and Sharegister(D3osdi) for more details.) This can be done either by static configuration via sdevice(F), or by dynamic configuration via this routine, add_intr_handler.

This routine must be called before interrupts are enabled, for example, from either the driver's xxpminit or xxinit routine.

Context and synchronization

Initialization context

Hardware applicability

All

Version applicability

oddi: 2

Differences between versions

add_intr_handler( ) was used in earlier SCO systems for dynamic registration of interrupts for single-threaded drivers. It is retained in SCO OpenServer for backward compatibility, but all drivers should call idistributed(D3oddi) to register interrupts whether the driver is single-threaded or multithreaded.

Interrupt registration in DDI drivers is handled as part of the autoconfiguration scheme.

SVR5 DDI compatibility

add_intr_handler( ) is not supported for any DDI version. See ``Interrupt handlers, attaching and registering'' in HDK Technical Reference for information about attaching interrupts in DDI drivers.

References

idistributed(D3oddi), sdevice(F), Sdevregister(D3osdi), Sharegister(D3osdi)

``Interrupt handlers, attaching and registering'' in HDK Technical Reference

``ODDI driver interface version for SCO OpenServer 5'' in HDK Technical Reference


19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 5 HDK - June 2005