Sun Java Solaris Communities My SDN Account Join SDN
 
Documentation

Solaris (Intel Platform Edition) - Device Driver Writer's Orientation

 

Page 33 of 66


Interrupt Handling

Registering Interrupt Handlers:
  • Most drivers implement an Interrupt Service Routine (ISR)
  • DDI/DKI routine ddi_add_intr(9F) registers the driver's ISR
  • ddi_add_intr(9F) is usually called from driver's attach(9E) routine
  • ddi_remove_intr(9F) is usually called from driver's detach(9E) routine
  • Interrupt characteristics (IRQ, priority) embedded in "interrupts" property
  • Each device instance has its own "interrupts" property
  • Driver specifies ISR to call when the device might have interrupted
  • Driver also specifies argument to be passed to that ISR
  • The argument allows the interrupt routine to distinguish between multiple device instances that may have been registered to the same ISR
  • Argument is conventionally a pointer to the instance's soft state structure
  • A device may have more than one interrupt, though most have only one
  • If the device has more than one interrupt, the driver adds each one in a separate call to ddi_add_intr(9F)

FIRST   PREVIOUS   NEXT   LAST   CONTENTS

Return to White Papers