hv_vcpu_create(_:_:_:)
Creates a vCPU instance for the current thread.
Declaration
func hv_vcpu_create(_ vcpu: UnsafeMutablePointer<hv_vcpu_t>, _ exit: UnsafeMutablePointer<UnsafeMutablePointer<hv_vcpu_exit_t>?>, _ config: hv_vcpu_config_t?) -> hv_return_tParameters
- vcpu:
An argument that the hypervisor populates with the instance of a vCPU on a successful return.
- exit:
The pointer to the vCPU exit information. The function Hv_vcpu_run(_:) updates this structure on return.
Apple silicon only.
- config:
The configuration of the vCPU or
nilfor a default configuration.Apple silicon only.
Return Value
HV_SUCCESS if the operation was successful, otherwise an error code specified in hv_return_t.
Discussion
Intel-based Mac computers have different parameters:
flags: The vCPU creation flag. The available flags are HV_VCPU_ACCEL_RDPMC, HV_VCPU_TSC_RELATIVE, and HV_VCPU_DEFAULT. The default is HV_VCPU_DEFAULT.