[Contents] [Index] [Help] [Retrace] [Browse <] [Browse >]


   NAME
       CD_ADDCHANGEINT -- add a disk change software interrupt handler.

   FUNCTION
       This command lets you add a software interrupt handler to the
       disk device that gets invoked whenever a disk insertion or removal
       occurs.

       You must pass in a properly initialized Exec interrupt structure
       and be prepared to deal with disk insertions/removals immediately.
       The interrupt is generated by the exec cause function, so you must
       preserve A6.

       To set up the handler, an interrupt structure must be initialized.
       This structure is supplied as the io_Data to the CD_ADDCHANGEINT
       command.  The handler then gets linked into the handler chain and
       gets invoked whenever a disk change happens.  You must eventually
       remove the handler before you exit.

       This command only returns when the handler is removed. That is,
       the device holds onto the IO request until the cd_remchangeint command
       is executed with that same IO request.  Hence, you must use sendio()
       with this command.

   IO REQUEST INPUT
       io_Device       preset by the call to opendevice()
       io_Unit         preset by the call to opendevice()
       io_Command      CD_ADDCHANGEINT
       io_Length       sizeof(struct Interrupt)
       io_Data         pointer to interrupt structure

   IO REQUEST RESULT
       io_Error - 0 for success, or an error code as defined in
                  <devices/cd.h>

   SEE ALSO
       cd_remchangeint, <devices/cd.h>, <exec/interrupts.h>,
       exec.library/cause()