summaryrefslogtreecommitdiff
path: root/arch/x86/machine/pmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/machine/pmap.c')
-rw-r--r--arch/x86/machine/pmap.c35
1 files changed, 18 insertions, 17 deletions
diff --git a/arch/x86/machine/pmap.c b/arch/x86/machine/pmap.c
index 0520c132..628a9d93 100644
--- a/arch/x86/machine/pmap.c
+++ b/arch/x86/machine/pmap.c
@@ -31,7 +31,6 @@
#include <kern/macros.h>
#include <kern/mutex.h>
#include <kern/panic.h>
-#include <kern/param.h>
#include <kern/percpu.h>
#include <kern/spinlock.h>
#include <kern/syscnt.h>
@@ -40,6 +39,7 @@
#include <machine/boot.h>
#include <machine/cpu.h>
#include <machine/lapic.h>
+#include <machine/page.h>
#include <machine/pmap.h>
#include <machine/trap.h>
#include <machine/types.h>
@@ -447,11 +447,12 @@ pmap_setup_paging(void)
directmap_end = biosmem_directmap_end();
- if (directmap_end > (VM_MAX_DIRECTMAP_ADDRESS - VM_MIN_DIRECTMAP_ADDRESS)) {
+ if (directmap_end > (PMAP_MAX_DIRECTMAP_ADDRESS
+ - PMAP_MIN_DIRECTMAP_ADDRESS)) {
boot_panic(pmap_panic_directmap_msg);
}
- va = VM_MIN_DIRECTMAP_ADDRESS;
+ va = PMAP_MIN_DIRECTMAP_ADDRESS;
pa = 0;
for (i = 0; i < directmap_end; i += pgsize) {
@@ -464,7 +465,7 @@ pmap_setup_paging(void)
/*
* On 64-bits systems, the kernel isn't linked at addresses included
* in the direct mapping, which requires the creation of an additional
- * mapping for it. See param.h for more details.
+ * mapping for it.
*/
va = P2ALIGN((uintptr_t)&_init, pgsize);
pa = BOOT_VTOP(va);
@@ -509,14 +510,14 @@ pmap_ap_setup_paging(void)
#define pmap_assert_range(pmap, start, end) \
MACRO_BEGIN \
assert((start) < (end)); \
- assert(((end) <= VM_MIN_DIRECTMAP_ADDRESS) \
- || ((start) >= VM_MAX_DIRECTMAP_ADDRESS)); \
+ assert(((end) <= PMAP_MIN_DIRECTMAP_ADDRESS) \
+ || ((start) >= PMAP_MAX_DIRECTMAP_ADDRESS)); \
\
if ((pmap) == kernel_pmap) { \
- assert(((start) >= VM_MIN_KMEM_ADDRESS) \
- && ((end) <= VM_MAX_KMEM_ADDRESS)); \
+ assert(((start) >= PMAP_MIN_KMEM_ADDRESS) \
+ && ((end) <= PMAP_MAX_KMEM_ADDRESS)); \
} else { \
- assert((end) <= VM_MAX_ADDRESS); \
+ assert((end) <= PMAP_MAX_ADDRESS); \
} \
MACRO_END
@@ -583,7 +584,7 @@ pmap_walk_vas(uintptr_t start, uintptr_t end, pmap_walk_fn_t walk_fn)
assert(vm_page_aligned(start));
assert(start < end);
#ifdef __LP64__
- assert((start < VM_MAX_ADDRESS) || (start >= VM_MIN_KERNEL_ADDRESS));
+ assert((start < PMAP_MAX_ADDRESS) || (start >= PMAP_MIN_KERNEL_ADDRESS));
#endif /* __LP64__ */
va = start;
@@ -592,8 +593,8 @@ pmap_walk_vas(uintptr_t start, uintptr_t end, pmap_walk_fn_t walk_fn)
do {
#ifdef __LP64__
/* Handle long mode canonical form */
- if (va == VM_MAX_ADDRESS) {
- va = VM_MIN_KERNEL_ADDRESS;
+ if (va == PMAP_MAX_ADDRESS) {
+ va = PMAP_MIN_KERNEL_ADDRESS;
}
#endif /* __LP64__ */
@@ -641,7 +642,7 @@ pmap_setup_global_page(phys_addr_t ptp_pa, unsigned int index,
static void __init
pmap_setup_global_pages(void)
{
- pmap_walk_vas(VM_MIN_KERNEL_ADDRESS, VM_MAX_KERNEL_ADDRESS,
+ pmap_walk_vas(PMAP_MIN_KERNEL_ADDRESS, PMAP_MAX_KERNEL_ADDRESS,
pmap_setup_global_page);
pmap_pt_levels[0].mask |= PMAP_PTE_G;
cpu_enable_global_pages();
@@ -900,7 +901,7 @@ pmap_setup_set_ptp_type(phys_addr_t ptp_pa, unsigned int index,
static void __init
pmap_setup_fix_ptps(void)
{
- pmap_walk_vas(VM_MIN_ADDRESS, VM_MAX_KERNEL_ADDRESS,
+ pmap_walk_vas(PMAP_MIN_ADDRESS, PMAP_MAX_KERNEL_ADDRESS,
pmap_setup_set_ptp_type);
}
@@ -946,8 +947,8 @@ pmap_copy_cpu_table_recursive(const pmap_pte_t *sptp, unsigned int level,
i++, va = P2END(va, 1UL << pt_level->skip)) {
#ifdef __LP64__
/* Handle long mode canonical form */
- if (va == VM_MAX_ADDRESS) {
- va = VM_MIN_KERNEL_ADDRESS;
+ if (va == PMAP_MAX_ADDRESS) {
+ va = PMAP_MIN_KERNEL_ADDRESS;
}
#endif /* __LP64__ */
@@ -1006,7 +1007,7 @@ pmap_copy_cpu_table(unsigned int cpu)
dptp = vm_page_direct_ptr(page);
#endif /* X15_X86_PAE */
- pmap_copy_cpu_table_recursive(sptp, level, dptp, VM_MIN_ADDRESS);
+ pmap_copy_cpu_table_recursive(sptp, level, dptp, PMAP_MIN_ADDRESS);
}
void __init