aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-02-26 23:00:49 -0500
committerIan Moffett <ian@osmora.org>2024-02-26 23:01:43 -0500
commit0584b545dfa1136ca080863f2fca988b9af5fd2b (patch)
tree00780d9b2477e8e50497319720964c3a614e7658 /sys
parent0425722963289ba8ef65d9cc7a1c7bc82d27914f (diff)
kernel: pmap: Use PROT_ instead of PMAP_ prefix
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/amd64/amd64/pmap.c4
-rw-r--r--sys/include/vm/map.h1
-rw-r--r--sys/include/vm/pmap.h4
3 files changed, 5 insertions, 4 deletions
diff --git a/sys/arch/amd64/amd64/pmap.c b/sys/arch/amd64/amd64/pmap.c
index 8a21f63..2fcab57 100644
--- a/sys/arch/amd64/amd64/pmap.c
+++ b/sys/arch/amd64/amd64/pmap.c
@@ -60,9 +60,9 @@ pmap_prot_to_pte(vm_prot_t prot)
{
uint64_t pte_flags = PTE_P | PTE_NX;
- if (__TEST(prot, PMAP_WRITABLE))
+ if (__TEST(prot, PROT_WRITE))
pte_flags |= PTE_RW;
- if (__TEST(prot, PMAP_EXEC))
+ if (__TEST(prot, PROT_EXEC))
pte_flags &= ~(PTE_NX);
return pte_flags;
diff --git a/sys/include/vm/map.h b/sys/include/vm/map.h
index 679831b..603da92 100644
--- a/sys/include/vm/map.h
+++ b/sys/include/vm/map.h
@@ -31,6 +31,7 @@
#define _VM_MMAP_H_
#include <sys/types.h>
+#include <sys/cdefs.h>
#include <vm/pmap.h>
int vm_map_create(vaddr_t va, paddr_t pa, vm_prot_t prot, size_t bytes);
diff --git a/sys/include/vm/pmap.h b/sys/include/vm/pmap.h
index 6e37a00..7a8d577 100644
--- a/sys/include/vm/pmap.h
+++ b/sys/include/vm/pmap.h
@@ -50,8 +50,8 @@
#include <sys/spinlock.h>
/* prot flags for mappings */
-#define PMAP_WRITABLE __BIT(0) /* Writable */
-#define PMAP_EXEC __BIT(1) /* Executable */
+#define PROT_WRITE __BIT(0) /* Writable */
+#define PROT_EXEC __BIT(1) /* Executable */
#define is_vas_valid(vas) (vas.top_level != 0)