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

# hv_gic_set_state(_:_:)

Sets the state of a generic interrupt controller (GIC) device.

```
func hv_gic_set_state(_ gic_state_data: UnsafeRawPointer, _ gic_state_size: Int) -> hv_return_t
```

## Parameters

`gic_state_data`

A pointer to the state buffer to use to set the GIC.

`gic_state_size`

Size of GIC state buffer, in bytes.

## Return Value

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

## Discussion

Use this method to restore the state of a GIC. You can only restore a GIC’s state after creating a GIC device and vCPUs and before the vCPUs are running. Restore the rest of the virtual machine including GIC CPU registers with values that are compatible with the [`hv_gic_state_t`](/documentation/Hypervisor/hv_gic_state_t).

In some cases this method can fail if a software update has changed the host in a way that would be incompatible with the previous format.

---

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)