summaryrefslogtreecommitdiff
path: root/tools/src/iova.h
diff options
context:
space:
mode:
authormagh <magh@maghmogh.com>2023-03-06 18:44:55 -0600
committermagh <magh@maghmogh.com>2023-03-06 18:44:55 -0600
commite80d9d8871b325a04b18f90a9ea4bb7fd148fb25 (patch)
tree79dbdb8506b7ff1e92549188d1b94cfc0b3503ae /tools/src/iova.h
add m1n1HEADmaster
Diffstat (limited to 'tools/src/iova.h')
-rw-r--r--tools/src/iova.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/tools/src/iova.h b/tools/src/iova.h
new file mode 100644
index 0000000..1637be4
--- /dev/null
+++ b/tools/src/iova.h
@@ -0,0 +1,18 @@
+/* SPDX-License-Identifier: MIT */
+
+#ifndef IOVA_H
+#define IOVA_H
+
+#include "dart.h"
+#include "types.h"
+
+typedef struct iova_domain iova_domain_t;
+
+iova_domain_t *iovad_init(u64 base, u64 limit);
+void iovad_shutdown(iova_domain_t *iovad, dart_dev_t *dart);
+
+bool iova_reserve(iova_domain_t *iovad, u64 iova, size_t sz);
+u64 iova_alloc(iova_domain_t *iovad, size_t sz);
+void iova_free(iova_domain_t *iovad, u64 iova, size_t sz);
+
+#endif