|
| 以 PDF 格式下載這本書
NAME
- ddi_add_softintr, ddi_remove_softintr, ddi_trigger_softintr - add, remove or trigger a soft interrupt
SYNOPSIS
-
#include <sys/conf.h>
-
-
#include <sys/ddi.h>
#include <sys/sunddi.h>
-
int ddi_add_softintr(dev_info_t * dip,int preference, ddi_softintr_t * idp,
-
-
ddi_iblock_cookie_t * ibcp,ddi_idevice_cookie_t * idcp,
u_int(* int_handler)(caddr_t int_handler_arg), caddr_t int_handler_arg)
void ddi_remove_softintr(ddi_softintr_t id)
void ddi_trigger_softintr(ddi_softintr_t id)
ARGUMENTS
ddi_add_softintr( )
-
-
dip
- Pointer to dev_info structure.
-
-
preference
- A hint value describing the type of soft interrupt to generate.
-
-
idp
- Pointer to a soft interrupt identifier where a returned soft interrupt identifier is stored.
-
-
ibcp
- Optional pointer to an interrupt block cookie where a returned interrupt block cookie is stored.
-
-
idcp
- Optional pointer to an interrupt device cookie where a returned interrupt device cookie is stored.
-
-
int_handler
- Pointer to interrupt handler.
-
-
int_handler_arg
- Argument for interrupt handler.
ddi_remove_softintr( )
-
-
id
- The identifier specifying which soft interrupt handler to remove.
ddi_trigger_softintr( )
-
-
id
- The identifier specifying which soft interrupt to trigger and which soft interrupt handler will be called.
INTERFACE LEVEL
- Solaris DDI specific (Solaris DDI).
DESCRIPTION
-
ddi_add_softintr( ) adds a soft interrupt to the system. The user specified hint preference identifies three suggested levels for the system to attempt to allocate the soft interrupt priority at. The possible values for preference are:
-
-
DDI_SOFTINT_LOW
- Low priority soft interrupt
-
-
DDI_SOFTINT_MED
- Medium priority soft interrupt
-
-
DDI_SOFTINT_HIGH
- High priority soft interrupt
- The value returned in location pointed at by idp is the soft interrupt identifier. This value is used in later calls to ddi_remove_softintr( ) and ddi_trigger_softintr( ) to identify the soft interrupt and the soft interrupt handler.
- The value returned in the location pointed at by ibcp is an interrupt block cookie which contains information needed for initializing mutexes associated with this soft interrupt (see mutex_init(9F). If the interrupt cookie pointer is set to NULL no value will be returned.
- The value returned in the location pointed at by idcp is an interrupt device cookie which contains the machine specific bits used by the system to program a soft interrupt. This value is currently not useful to device drivers and is available only for future extensions to the DDI/DKI. If the device cookie pointer is set to NULL no value will be returned.
- The routine intr_handler, with its argument int_handler_arg, is called upon receipt of appropriate soft interrupt. The interrupt handler should return DDI_INTR_CLAIMED if the interrupt was claimed, DDI_INTR_UNCLAIMED otherwise.
- If successful, ddi_add_softintr( ) will return DDI_SUCCESS ;if the interrupt information cannot be found, it will return DDI_FAILURE.
-
ddi_remove_softintr( ) removes a soft interrupt from the system. The soft interrupt identifier id, which was returned from a call to ddi_add_softintr( ), is used to determine which soft interrupt and which soft interrupt handler to remove. Unloadable drivers should call this routine to detach themselves from the system.
-
ddi_trigger_softintr( ) triggers a soft interrupt. The soft interrupt identifier id, which was returned from a call to ddi_add_softintr( ), is used to determine which soft interrupt to trigger and subsequently which soft interrupt handler to call. This function is used by device drivers when they wish to trigger a soft interrupt which they had set up using ddi_add_softintr( ).
RETURN VALUES
-
ddi_add_softintr( ) returns:
-
-
DDI_SUCCESS
- on success
-
-
DDI_FAILURE
- on failure
CONTEXT
- These functions can be called from user or interrupt context.
SEE ALSO
-
ddi_add_intr(9F), ddi_remove_intr(9F), mutex_init(9F)
-
Writing Device Drivers
|
|