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

# hv_vm_map_space(_:_:_:_:_:)

Maps a region in the virtual address space of the current task into a guest physical address space of the VM.

```
func hv_vm_map_space(_ asid: hv_vm_space_t, _ uva: hv_uvaddr_t, _ gpa: hv_gpaddr_t, _ size: Int, _ flags: hv_memory_flags_t) -> hv_return_t
```

## Parameters

`asid`

The Address space ID.

`uva`

The page-aligned virtual address in the current task.

`gpa`

The page-aligned address in the guest physical address space.

`size`

The size in bytes of the region to map.

`flags`

One of either `READ`, `WRITE` or `EXECUTE` permissions of the region.

## Return Value

[`HV_SUCCESS`](/documentation/Hypervisor/HV_SUCCESS) if the operation was successful, otherwise an error code specified in [`hv_return_t`](/documentation/Hypervisor/hv_return_t).

## Discussion

---

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)