<!--
{
  "availability" : [
    "macOS: 11.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Hypervisor",
  "identifier" : "/documentation/Hypervisor/hv_vm_add_pio_notifier(_:_:_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Hypervisor"
    ],
    "preciseIdentifier" : "c:@F@hv_vm_add_pio_notifier"
  },
  "title" : "hv_vm_add_pio_notifier(_:_:_:_:_:)"
}
-->

# hv_vm_add_pio_notifier(_:_:_:_:_:)

Generate a notification when the Hypervisor issues a matching guest port I/O.

```
func hv_vm_add_pio_notifier(_ addr: UInt16, _ size: Int, _ value: UInt32, _ mach_port: mach_port_t, _ flags: hv_ion_flags_t) -> hv_return_t
```

## Parameters

`addr`

The port I/O address to match.

`size`

Size to match (1, 2, or 4).

`value`

The value to match against.

`mach_port`

The Mach port to write to; requires send permission.

`flags`

Notifier options using [`hv_ion_flags_t`](/documentation/Hypervisor/hv_ion_flags_t).

## Return Value

`0` on success, or an [`hv_return_t`](/documentation/Hypervisor/hv_return_t) error code.

## Discussion

The notifier suppresses guest exits caused by the matching I/O and instead sends a [`hv_ion_message_t`](/documentation/Hypervisor/hv_ion_message_t) message to the Mach port you specify. The Hypervisor framework only permits one notifier per port address.

---

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)