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

# hv_gic_state_get_data(_:_:)

Gets the state data for generic interrupt controller (GIC).

```
func hv_gic_state_get_data(_ state: hv_gic_state_t, _ gic_state_data: UnsafeMutableRawPointer) -> hv_return_t
```

## Parameters

`state`

The GIC state object.

`gic_state_data`

Pointer to GIC state buffer that the framework writes to upon success.

## Return Value

[`HV_SUCCESS`](/documentation/Hypervisor/HV_SUCCESS) on success; otherwise, an error code.

## Discussion

The function returns an opaque data buffer that contains the complete serialized state of the device, except for the GIC CPU registers. You can write the data to a file and is stable. It’s also versioned which allows the framework to detect incompatibilities when it restores the state. The size of this GIC state buffer must be at least as large as the size returned by [`hv_gic_state_get_size(_:_:)`](/documentation/Hypervisor/hv_gic_state_get_size(_:_:)).

You can read GIC CPU system registers separately, and save them to be able to restore the CPU state for the virtual machine.

---

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)