<!--
{
  "availability" : [
    "DriverKit: -",
    "iOS: -",
    "iPadOS: -",
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "DriverKit",
  "identifier" : "/documentation/DriverKit/IOInterruptDispatchSource",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "DriverKit"
    ],
    "preciseIdentifier" : "c:@S@IOInterruptDispatchSource"
  },
  "title" : "IOInterruptDispatchSource"
}
-->

# IOInterruptDispatchSource

A dispatch source that reports hardware-related interrupt events to your driver.

```
class IOInterruptDispatchSource;
```

## Overview

An [`IOInterruptDispatchSource`](/documentation/DriverKit/IOInterruptDispatchSource) object executes an associated action in response to hardware-related interrupts. If your driver handles hardware interrupts, configure this dispatch source and use your action object to provide an appropriat response.

Interrupt-related actions execute at the normal thread level. The system records the time at which the interrupt fired using the [`mach_absolute_time`](/documentation/DriverKit/mach_absolute_time) function, and passes that time value to your action’s callback method. For PCI devices, DriverKit supports only MSI interrupt sources.

## Topics

### Configuring the Interrupt Source

[`static kern_return_t Create(IOService *provider, uint32_t index, IODispatchQueue *queue, IOInterruptDispatchSource **source);`](/documentation/DriverKit/IOInterruptDispatchSource/Create)

Create a dispatch source that reports hardware-related interrupts generated by the specified service provider.

[`virtual bool init();`](/documentation/DriverKit/IOInterruptDispatchSource/init)

Handles the basic initialization of the dispatch source.

[`virtual void free();`](/documentation/DriverKit/IOInterruptDispatchSource/free)

Performs any final cleanup for the dispatch source.

[`virtual kern_return_t SetHandler(OSAction *action);`](/documentation/DriverKit/IOInterruptDispatchSource/SetHandler)

Set the handler block to run when the interrupt fires.

### Starting and Stopping the Interrupt Source

[`virtual kern_return_t SetEnableWithCompletion(bool enable, IODispatchSourceCancelHandler handler);`](/documentation/DriverKit/IOInterruptDispatchSource/SetEnableWithCompletion)

Enables or disables the delivery of interrupts.

[`virtual kern_return_t Cancel(IODispatchSourceCancelHandler handler);`](/documentation/DriverKit/IOInterruptDispatchSource/Cancel)

Cancels all callbacks from the event source.

[`typedef void (^)(void) IODispatchSourceCancelHandler;`](/documentation/DriverKit/IODispatchSourceCancelHandler)

A block to execute when a canceled dispatch source stops executing tasks.

### Declaring Actions

[`virtual void InterruptOccurred(OSAction *action, uint64_t count, uint64_t time);`](/documentation/DriverKit/IOInterruptDispatchSource/InterruptOccurred)

Executes custom code when an interrupt occurs.

[`virtual kern_return_t CheckForWork(bool synchronous);`](/documentation/DriverKit/IOInterruptDispatchSource/CheckForWork)

Checks for events to handle.

[`struct IOInterruptDispatchSourcePayload;`](/documentation/DriverKit/IOInterruptDispatchSourcePayload)

A private structure for an interrupt dispatch source.

### Instance Methods

[`virtual kern_return_t GetLastInterrupt(uint64_t *count, uint64_t *time);`](/documentation/DriverKit/IOInterruptDispatchSource/GetLastInterrupt)

### Type Methods

[`static kern_return_t GetInterruptType(IOService *provider, uint32_t index, uint64_t *interruptType);`](/documentation/DriverKit/IOInterruptDispatchSource/GetInterruptType)

## Relationships

### Inherits From

[`IODispatchSource`](/documentation/DriverKit/IODispatchSource)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)