From eec633d16fe2ce6e740c1848209ebb8b6d9b60bd Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Fri, 12 Jan 2024 00:07:32 -0500 Subject: kernel/amd64: pmap: Add pmap_map() routine Add pmap_map() routine for creating virtual memory mappings. Signed-off-by: Ian Moffett --- sys/include/vm/pmap.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'sys/include/vm') 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 #include +/* 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_ */ -- cgit v1.2.3