diff options
author | alc <alc@FreeBSD.org> | 2008-06-20 05:22:09 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2008-06-20 05:22:09 +0000 |
commit | 2fc7871f11f777726ba33446fb7c230152d69133 (patch) | |
tree | 588b605f30e268cea80d6d6553410cfc09d47d5e /sys/amd64 | |
parent | 9e4d306f6fe863ceecc097ac5554fee53ab1d7e5 (diff) | |
download | FreeBSD-src-2fc7871f11f777726ba33446fb7c230152d69133.zip FreeBSD-src-2fc7871f11f777726ba33446fb7c230152d69133.tar.gz |
Make preparations for increasing the size of the kernel virtual
address space on the amd64 architecture. The amd64 architecture
requires kernel code and global variables to reside in the highest 2GB
of the 64-bit virtual address space. Thus, KERNBASE cannot change.
However, KERNBASE is sometimes used as the start of the kernel virtual
address space. Henceforth, VM_MIN_KERNEL_ADDRESS should be used
instead. Since KERNBASE and VM_MIN_KERNEL_ADDRESS are still the same
address, there should be no visible effect from this change (yet).
Diffstat (limited to 'sys/amd64')
-rw-r--r-- | sys/amd64/amd64/mem.c | 2 | ||||
-rw-r--r-- | sys/amd64/amd64/pmap.c | 4 | ||||
-rw-r--r-- | sys/amd64/amd64/trap.c | 2 | ||||
-rw-r--r-- | sys/amd64/include/pmc_mdep.h | 4 | ||||
-rw-r--r-- | sys/amd64/include/stack.h | 2 |
5 files changed, 7 insertions, 7 deletions
diff --git a/sys/amd64/amd64/mem.c b/sys/amd64/amd64/mem.c index 00f5a8e..af119dc 100644 --- a/sys/amd64/amd64/mem.c +++ b/sys/amd64/amd64/mem.c @@ -119,7 +119,7 @@ kmemphys: addr = trunc_page(v); eaddr = round_page(v + c); - if (addr < (vm_offset_t)KERNBASE) + if (addr < VM_MIN_KERNEL_ADDRESS) return (EFAULT); for (; addr < eaddr; addr += PAGE_SIZE) if (pmap_extract(kernel_pmap, addr) == 0) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index be003ec..9e8b257 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -1673,7 +1673,7 @@ pmap_release(pmap_t pmap) static int kvm_size(SYSCTL_HANDLER_ARGS) { - unsigned long ksize = VM_MAX_KERNEL_ADDRESS - KERNBASE; + unsigned long ksize = VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS; return sysctl_handle_long(oidp, &ksize, 0, req); } @@ -1703,7 +1703,7 @@ pmap_growkernel(vm_offset_t addr) mtx_assert(&kernel_map->system_mtx, MA_OWNED); if (kernel_vm_end == 0) { - kernel_vm_end = KERNBASE; + kernel_vm_end = VM_MIN_KERNEL_ADDRESS; nkpt = 0; while ((*pmap_pde(kernel_pmap, kernel_vm_end) & PG_V) != 0) { kernel_vm_end = (kernel_vm_end + PAGE_SIZE * NPTEPG) & ~(PAGE_SIZE * NPTEPG - 1); diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c index 509d9f0..00e596f 100644 --- a/sys/amd64/amd64/trap.c +++ b/sys/amd64/amd64/trap.c @@ -605,7 +605,7 @@ trap_pfault(frame, usermode) vm_offset_t eva = frame->tf_addr; va = trunc_page(eva); - if (va >= KERNBASE) { + if (va >= VM_MIN_KERNEL_ADDRESS) { /* * Don't allow user-mode faults in kernel address space. */ diff --git a/sys/amd64/include/pmc_mdep.h b/sys/amd64/include/pmc_mdep.h index e391c54..258d6aa 100644 --- a/sys/amd64/include/pmc_mdep.h +++ b/sys/amd64/include/pmc_mdep.h @@ -74,8 +74,8 @@ struct pmc; #define PMC_IN_KERNEL_STACK(S,START,END) \ ((S) >= (START) && (S) < (END)) -#define PMC_IN_KERNEL(va) (((va) >= DMAP_MIN_ADDRESS && \ - (va) < DMAP_MAX_ADDRESS) || ((va) >= KERNBASE && \ +#define PMC_IN_KERNEL(va) (((va) >= DMAP_MIN_ADDRESS && \ + (va) < DMAP_MAX_ADDRESS) || ((va) >= VM_MIN_KERNEL_ADDRESS && \ (va) < VM_MAX_KERNEL_ADDRESS)) #define PMC_IN_USERSPACE(va) ((va) <= VM_MAXUSER_ADDRESS) diff --git a/sys/amd64/include/stack.h b/sys/amd64/include/stack.h index 2a70d30..24e2547 100644 --- a/sys/amd64/include/stack.h +++ b/sys/amd64/include/stack.h @@ -33,7 +33,7 @@ * Stack trace. */ #define INKERNEL(va) (((va) >= DMAP_MIN_ADDRESS && (va) < DMAP_MAX_ADDRESS) \ - || ((va) >= KERNBASE && (va) < VM_MAX_KERNEL_ADDRESS)) + || ((va) >= VM_MIN_KERNEL_ADDRESS && (va) < VM_MAX_KERNEL_ADDRESS)) struct amd64_frame { struct amd64_frame *f_frame; |