summaryrefslogtreecommitdiff
path: root/sys/include/vm
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-01-12 00:07:32 -0500
committerIan Moffett <ian@osmora.org>2024-01-12 00:07:32 -0500
commiteec633d16fe2ce6e740c1848209ebb8b6d9b60bd (patch)
tree3db96a1037b4456d53a4cf7d702c4b42ad2d6ff3 /sys/include/vm
parent5b366121157051691dd1c89d80f6a405f9430f4a (diff)
kernel/amd64: pmap: Add pmap_map() routine
Add pmap_map() routine for creating virtual memory mappings. Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/include/vm')
-rw-r--r--sys/include/vm/pmap.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/include/vm/pmap.h b/sys/include/vm/pmap.h
index 4d7a06f..e35d14a 100644
--- a/sys/include/vm/pmap.h
+++ b/sys/include/vm/pmap.h
@@ -49,6 +49,10 @@
#include <sys/types.h>
#include <sys/spinlock.h>
+/* prot flags for mappings */
+#define PMAP_WRITABLE __BIT(0) /* Writable */
+#define PMAP_EXEC __BIT(1) /* Executable */
+
/*
* vm_ctx - Per core virtual memory context
*/
@@ -65,4 +69,9 @@ struct vm_ctx {
*/
struct vas pmap_read_vas(void);
+/*
+ * Map a physical address to a virtual address.
+ */
+int pmap_map(struct vm_ctx *, vaddr_t, paddr_t, vm_prot_t);
+
#endif /* _VM_PMAP_H_ */