1# zx_vmo_create_physical
2
3## NAME
4
5vmo_create_physical- create a VM object referring to a specific contiguous range
6of physical memory
7
8## SYNOPSIS
9
10```
11#include <zircon/syscalls.h>
12
13zx_status_t zx_vmo_create_physical(zx_handle_t resource, zx_paddr_t paddr,
14                                   size_t size, zx_handle_t* out);
15```
16
17## DESCRIPTION
18
19**vmo_create_physical**() creates a new virtual memory object (VMO), which represents the
20*size* bytes of physical memory beginning at physical address *paddr*.
21
22One handle is returned on success, representing an object with the requested
23size.
24
25The following rights will be set on the handle by default:
26
27**ZX_RIGHT_DUPLICATE** - The handle may be duplicated.
28
29**ZX_RIGHT_TRANSFER** - The handle may be transferred to another process.
30
31**ZX_RIGHT_READ** - May be read from or mapped with read permissions.
32
33**ZX_RIGHT_WRITE** - May be written to or mapped with write permissions.
34
35**ZX_RIGHT_EXECUTE** - May be mapped with execute permissions.
36
37**ZX_RIGHT_MAP** - May be mapped.
38
39**ZX_RIGHT_GET_PROPERTY** - May get its properties using
40[object_get_property](object_get_property).
41
42**ZX_RIGHT_SET_PROPERTY** - May set its properties using
43[object_set_property](object_set_property).
44
45The **ZX_VMO_ZERO_CHILDREN** signal is active on a newly created VMO. It becomes
46inactive whenever a clone of the VMO is created and becomes active again when
47all clones have been destroyed and no mappings of those clones into address
48spaces exist.
49
50## NOTES
51
52The VMOs created by this syscall are not usable with **vmo_read**() and
53**vmo_write**().
54
55## RIGHTS
56
57TODO(ZX-2399)
58
59## RETURN VALUE
60
61**vmo_create_physical**() returns **ZX_OK** on success. In the event
62of failure, a negative error value is returned.
63
64## ERRORS
65
66**ZER_ERR_WRONG_TYPE** *resource* is not a handle to a Resource object.
67
68**ZER_ERR_ACCESS_DENIED** *resource* does not grant access to the requested
69range of memory.
70
71**ZX_ERR_INVALID_ARGS**  *out* is an invalid pointer or NULL, or *paddr* or
72*size* are not page-aligned.
73
74**ZX_ERR_NO_MEMORY**  Failure due to lack of memory.
75There is no good way for userspace to handle this (unlikely) error.
76In a future build this error will no longer occur.
77
78## SEE ALSO
79
80[vmar_map](vmar_map.md).
81