DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
SVR5

cm_intr_attach(D3)


cm_intr_attach -- attach device interrupts

Synopsis

   #include <sys/confmgr.h>
   #include <sys/ddi.h>
   

int cm_intr_attach(rm_key_t key, int (*handler)(), void *idata, drvinfo_t *infop, void **intr_cookiep);

Description

cm_intr_attach is used to attach an interrupt handler for the board instance specified by key.

Arguments


key
Resource manager key selecting a particular board instance. this is the key that was passed to the CFG_ADD subfunction of the config(D2) entry point routine.

handler
Interrupt handler function to attach.

idata
Pointer to the device-specific instance as returned by the CFG_ADD subfunction of the config(D2) entry point routine.

infop
Pointer to the calling driver's drvinfo(D4) structure. The drvinfo structure is not modified by cm_intr_attach. config(D2) entry point routine.

intr_cookiep
Pointer to location in which to store the interrupt "magic cookie". This is the address of the void * that the driver has to trace. The magic cookie provides a reference to the attached interrupts that can subsequently be used in a call to cm_intr_detach(D3). If intr_cookiep is NULL, then no interrupt cookie is stored, and it will not be possible to subsequently detach interrupts for this driver.

Return values

cm_intr_attach( ) returns the number of interrupts successfully attached. It will return 0 and fail to attach the interrupt handler if key is invalid, or if key fails to have a legitimate value for any of the following parameters: CM_IRQ, CM_IPL, CM_ITYPE.

Usage

Context and synchronization

User or blockable context.

Hardware applicability

All

Version applicability

ddi: 5, 5mp, 6, 6mp, 7, 7mp, 7.1, 7.1mp, 8, 8mp

Differences between versions

In DDI versions prior to version 8, the syntax for the cm_intr_attach( ) function is:
   int cm_intr_attach(rm_key_t key, void (*handler)(),
                      int *devflagp, void **intr_cookiep);
The arguments to the earlier version of this function are the same with the following exceptions:

key
can be obtained by calling cm_getbrdkey(D3).

devflagp
pointer to the calling driver's devflag(D1). devflag is not changed by cm_intr_attach.

SCO OpenServer ODDI compatibility

SCO OpenServer ODDI drivers use the idistributed(D3oddi) function to register interrupts for the driver. See ``Interrupt handlers, attaching and registering'' in HDK Technical Reference.

References

cm_getbrdkey(D3), cm_intr_detach(D3), cm_params(D5), intr(D2)

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


19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005