From 9fe1756df85e1b11c091f8ab0cdcf473bd93553a Mon Sep 17 00:00:00 2001 From: alc Date: Sun, 22 Jun 2008 04:54:27 +0000 Subject: [PATCH] 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, the memory allocated during bootstrap, before the call to kmem_init(), starts at KERNBASE, which is not necessarily the same as VM_MIN_KERNEL_ADDRESS on amd64. --- sys/vm/vm_kern.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/vm/vm_kern.c b/sys/vm/vm_kern.c index fc27e9013362..81ca681e0b66 100644 --- a/sys/vm/vm_kern.c +++ b/sys/vm/vm_kern.c @@ -497,8 +497,12 @@ kmem_init(start, end) /* N.B.: cannot use kgdb to debug, starting with this assignment ... */ kernel_map = m; (void) vm_map_insert(m, NULL, (vm_ooffset_t) 0, - VM_MIN_KERNEL_ADDRESS, start, VM_PROT_ALL, VM_PROT_ALL, - MAP_NOFAULT); +#ifdef __amd64__ + KERNBASE, +#else + VM_MIN_KERNEL_ADDRESS, +#endif + start, VM_PROT_ALL, VM_PROT_ALL, MAP_NOFAULT); /* ... and ending with the completion of the above `insert' */ vm_map_unlock(m); }