summaryrefslogtreecommitdiff
path: root/vm/vm_kmem.c
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2013-06-15 17:16:26 +0200
committerRichard Braun <rbraun@sceen.net>2013-06-15 17:16:26 +0200
commit44f8bf7d26bf21cc66d2fc8c14a924ed2e1b4f0f (patch)
tree1e63214f90c0c46140ff0e3c70c24f45052d3b15 /vm/vm_kmem.c
parentcb92d9b44686dae10f94a410c5cab93ff29f7208 (diff)
vm/vm_map: rework flags
Add vm/vm_adv.h for VM_ADV_xxx advice macros, and directly use VM_{ADV,INHERIT,PROT}_xxx macros in the "packed" format used for mapping requests and in map entries. This allows simpler comparisons between stored flags and user provided values.
Diffstat (limited to 'vm/vm_kmem.c')
-rw-r--r--vm/vm_kmem.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/vm/vm_kmem.c b/vm/vm_kmem.c
index 9f6088de..24a23525 100644
--- a/vm/vm_kmem.c
+++ b/vm/vm_kmem.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2012 Richard Braun.
+ * Copyright (c) 2011, 2012, 2013 Richard Braun.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -22,10 +22,13 @@
#include <kern/stddef.h>
#include <kern/types.h>
#include <machine/pmap.h>
-#include <vm/vm_map.h>
+#include <vm/vm_adv.h>
+#include <vm/vm_inherit.h>
#include <vm/vm_kmem.h>
+#include <vm/vm_map.h>
#include <vm/vm_page.h>
#include <vm/vm_phys.h>
+#include <vm/vm_prot.h>
/*
* Kernel map and storage.
@@ -123,8 +126,8 @@ vm_kmem_alloc_va(size_t size)
size = vm_page_round(size);
va = 0;
- flags = VM_MAP_PROT_ALL | VM_MAP_MAX_PROT_ALL | VM_MAP_INHERIT_NONE
- | VM_MAP_ADV_NORMAL;
+ flags = VM_MAP_FLAGS(VM_PROT_ALL, VM_PROT_ALL, VM_INHERIT_NONE,
+ VM_ADV_DEFAULT, 0);
error = vm_map_enter(kernel_map, NULL, 0, &va, size, 0, flags);
if (error)