ddi_intr_remove_handler(9f) 맨 페이지 - 윈디하나의 솔라나라

개요

섹션
맨 페이지 이름
검색(S)

ddi_intr_remove_handler(9f)

ddi_intr_add_handler(9F)       Kernel Functions       ddi_intr_add_handler(9F)

NAME
       ddi_intr_add_handler, ddi_intr_remove_handler - add or remove interrupt
       handler

SYNOPSIS
       #include <sys/types.h>
       #include <sys/conf.h>
       #include <sys/ddi.h>
       #include <sys/sunddi.h>

       int ddi_intr_add_handler(ddi_intr_handle_t *h,
            ddi_intr_handler_t inthandler, void *arg1,
             void *arg2);


       int ddi_intr_remove_handler(ddi_intr_handle_t h);

INTERFACE LEVEL
       Solaris DDI specific (Solaris DDI).

PARAMETERS
       ddi_intr_add_handler()

       h             Pointer to the DDI interrupt handle


       inthandler    Pointer to interrupt handler


       arg1          First argument for the interrupt handler


       arg2          Second, optional, argument for the interrupt handler



       ddi_intr_remove_handler()

       h    DDI interrupt handle


DESCRIPTION
       The  ddi_intr_add_handler() function adds an interrupt handler given by
       the inthandler argument to the system with the handler  arguments  arg1
       and arg2 for the previously allocated interrupt handle specified by the
       h pointer. The arguments arg1 and arg2 are passed as the first and sec‐
       ond  arguments,  respectively, to the interrupt handler inthandler. See
       <sys/ddi_intr.h> for the definition of the interrupt handler.


       The routine inthandler with the arguments arg1 and arg2 is called  upon
       receipt  of the appropriate interrupt. The interrupt handler should re‐
       turn DDI_INTR_CLAIMED if the  interrupt  is  claimed  and  DDI_INTR_UN‐
       CLAIMED otherwise.


       The  ddi_intr_add_handler()  function must be called after ddi_intr_al‐
       loc(), but before ddi_intr_enable() is called. The  interrupt  must  be
       enabled  through ddi_intr_enable() or ddi_intr_block_enable() before it
       can be used.


       The ddi_intr_remove_handler() function removes the handler association,
       added previously with ddi_intr_add_handler(), for the interrupt identi‐
       fied by the interrupt handle h argument. Unloadable drivers should call
       this routine during their detach(9E) routine to  remove  the  interrupt
       handler from the system.


       The ddi_intr_remove_handler() function is used to disassociate the han‐
       dler  after  the  interrupt is disabled to remove dup-ed interrupt han‐
       dles. See ddi_intr_dup_handler(9F) for dup-ed interrupt handles.  If  a
       handler  is  duplicated  with  the ddi_intr_dup_handler() function, all
       added and duplicated instances of the  handler  must  be  removed  with
       ddi_intr_remove_handler() in order for the handler to be completely re‐
       moved.

RETURN VALUES
       The  ddi_intr_add_handler() and ddi_intr_remove_handler() functions re‐
       turn:

       DDI_SUCCESS    On success.


       DDI_EINVAL     On encountering invalid input parameters.


       DDI_FAILURE    On any implementation specific failure.


CONTEXT
       The ddi_intr_add_handler() and ddi_intr_remove_handler() functions  can
       be called from kernel non-interrupt context.

ATTRIBUTES
       See attributes(7) for descriptions of the following attributes:

       tab()  box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) ATTRIBUTE TYPEAT‐
       TRIBUTE VALUE _ Interface StabilityCommitted


SEE ALSO
       attributes(7),     attach(9E),     detach(9E),      ddi_intr_alloc(9F),
       ddi_intr_block_enable(9F),    ddi_intr_disable(9F),   ddi_intr_dup_han‐
       dler(9F),  ddi_intr_enable(9F),  ddi_intr_free(9F),   ddi_intr_get_sup‐
       ported_types(9F), mutex(9F), mutex_init(9F), rw_init(9F), rwlock(9F)


       Writing Device Drivers in Oracle Solaris 11.4

NOTES
       Consumers  of  these  interfaces should verify that the return value is
       not equal to DDI_SUCCESS. Incomplete checking for failure  codes  could
       result in inconsistent behavior among platforms.


       If  a  device  driver that uses MSI and MSI-X interrupts resets the de‐
       vice, the device might reset  its  configuration  space  modifications.
       Such  a reset could cause a device driver to lose any MSI and MSI-X in‐
       terrupt usage settings that have been applied.


       The second argument, arg2, is optional. Device drivers are free to  use
       the  two  arguments however they see fit. There is no officially recom‐
       mended model or restrictions. For example,  an  interrupt  handler  may
       wish  to use the first argument as the pointer to its softstate and the
       second argument as the value of the MSI vector.

Oracle Solaris 11.4               22 Apr 2005         ddi_intr_add_handler(9F)
맨 페이지 내용의 저작권은 맨 페이지 작성자에게 있습니다.
RSS ATOM XHTML 5 CSS3