1# zx_iommu_create
2
3## NAME
4
5<!-- Updated by update-docs-from-abigen, do not edit. -->
6
7iommu_create - create a new IOMMU object in the kernel
8
9## SYNOPSIS
10
11<!-- Updated by update-docs-from-abigen, do not edit. -->
12
13```
14#include <zircon/syscalls.h>
15
16zx_status_t zx_iommu_create(zx_handle_t resource,
17                            uint32_t type,
18                            const void* desc,
19                            size_t desc_size,
20                            zx_handle_t* out);
21```
22
23## DESCRIPTION
24
25`zx_iommu_create()` creates a new object in the kernel representing an IOMMU device.
26
27The value of *type* determines the interpretation of *desc*.  See below for
28details about the values of *type*.
29
30Upon success, a handle for the new IOMMU is returned.  This handle will have rights
31**ZX_RIGHT_DUPLICATE** and **ZX_RIGHT_TRANSFER**.
32
33### *type* = **ZX_IOMMU_TYPE_DUMMY**
34
35This type represents a no-op IOMMU.  It provides no hardware-level protections
36against unauthorized access to memory.  It does allow pinning of physical memory
37pages, to prevent the reuse of a page until the driver using the page says it is
38done with it.
39
40*desc* must be a valid pointer to a value of type `zx_iommu_desc_dummy_t`.
41*desc_size* must be `sizeof(zx_iommu_desc_dummy_t)`.
42
43## RIGHTS
44
45<!-- Updated by update-docs-from-abigen, do not edit. -->
46
47*resource* must have resource kind **ZX_RSRC_KIND_ROOT**.
48
49## RETURN VALUE
50
51`zx_iommu_create()` returns **ZX_OK** and a handle to the new IOMMU
52(via *out*) on success.  In the event of failure, a negative error value
53is returned.
54
55## ERRORS
56
57**ZX_ERR_BAD_HANDLE**  *resource* is not a valid handle.
58
59**ZX_ERR_WRONG_TYPE**  *resource* is not a resource handle.
60
61**ZX_ERR_ACCESS_DENIED**  *resource* handle does not have sufficient privileges.
62
63**ZX_ERR_NOT_SUPPORTED** *type* is not a defined value or is not
64supported on this system.
65
66**ZX_ERR_INVALID_ARGS**  *desc_size* is larger than **ZX_IOMMU_MAX_DESC_LEN**,
67*desc* is an invalid pointer, *out* is an invalid pointer, or the contents of
68*desc* are not valid for the given *type*.
69
70**ZX_ERR_NO_MEMORY**  Failure due to lack of memory.
71There is no good way for userspace to handle this (unlikely) error.
72In a future build this error will no longer occur.
73
74## SEE ALSO
75
76 - [`zx_bti_create()`]
77 - [`zx_bti_pin()`]
78 - [`zx_pmt_unpin()`]
79
80<!-- References updated by update-docs-from-abigen, do not edit. -->
81
82[`zx_bti_create()`]: bti_create.md
83[`zx_bti_pin()`]: bti_pin.md
84[`zx_pmt_unpin()`]: pmt_unpin.md
85