Initialize kern_end in amd64 instead of x86.

This commit is contained in:
maxv 2016-11-15 15:00:55 +00:00
parent 880c0915ea
commit 2433a8616e
3 changed files with 14 additions and 12 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.230 2016/08/27 16:17:16 maxv Exp $ */ /* $NetBSD: machdep.c,v 1.231 2016/11/15 15:00:56 maxv Exp $ */
/*- /*-
* Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008, 2011 * Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008, 2011
@ -111,7 +111,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.230 2016/08/27 16:17:16 maxv Exp $"); __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.231 2016/11/15 15:00:56 maxv Exp $");
/* #define XENDEBUG_LOW */ /* #define XENDEBUG_LOW */
@ -1540,7 +1540,9 @@ init_x86_64(paddr_t first_avail)
int x; int x;
#ifndef XEN #ifndef XEN
int ist; int ist;
#endif /* !XEN */ #endif
KASSERT(first_avail % PAGE_SIZE == 0);
#ifdef XEN #ifdef XEN
KASSERT(HYPERVISOR_shared_info != NULL); KASSERT(HYPERVISOR_shared_info != NULL);
@ -1609,11 +1611,13 @@ init_x86_64(paddr_t first_avail)
*/ */
pmap_bootstrap(VM_MIN_KERNEL_ADDRESS); pmap_bootstrap(VM_MIN_KERNEL_ADDRESS);
/* End of the virtual space we have created so far. */
kern_end = KERNBASE + first_avail;
#ifndef XEN #ifndef XEN
/* Internalize the physical pages into the VM system. */ /* Internalize the physical pages into the VM system. */
init_x86_vm(first_avail); init_x86_vm(first_avail);
#else /* XEN */ #else /* XEN */
kern_end = KERNBASE + first_avail;
physmem = xen_start_info.nr_pages; physmem = xen_start_info.nr_pages;
uvm_page_physload(atop(avail_start), uvm_page_physload(atop(avail_start),

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.763 2016/11/11 11:34:51 maxv Exp $ */ /* $NetBSD: machdep.c,v 1.764 2016/11/15 15:00:55 maxv Exp $ */
/*- /*-
* Copyright (c) 1996, 1997, 1998, 2000, 2004, 2006, 2008, 2009 * Copyright (c) 1996, 1997, 1998, 2000, 2004, 2006, 2008, 2009
@ -67,7 +67,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.763 2016/11/11 11:34:51 maxv Exp $"); __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.764 2016/11/15 15:00:55 maxv Exp $");
#include "opt_beep.h" #include "opt_beep.h"
#include "opt_compat_ibcs2.h" #include "opt_compat_ibcs2.h"
@ -1141,6 +1141,8 @@ init386(paddr_t first_avail)
extern u_char biostramp_image[]; extern u_char biostramp_image[];
#endif #endif
KASSERT(first_avail % PAGE_SIZE == 0);
#ifdef XEN #ifdef XEN
XENPRINTK(("HYPERVISOR_shared_info %p (%x)\n", HYPERVISOR_shared_info, XENPRINTK(("HYPERVISOR_shared_info %p (%x)\n", HYPERVISOR_shared_info,
xen_start_info.shared_info)); xen_start_info.shared_info));

View File

@ -1,4 +1,4 @@
/* $NetBSD: x86_machdep.c,v 1.75 2016/08/01 16:07:39 maxv Exp $ */ /* $NetBSD: x86_machdep.c,v 1.76 2016/11/15 15:00:56 maxv Exp $ */
/*- /*-
* Copyright (c) 2002, 2006, 2007 YAMAMOTO Takashi, * Copyright (c) 2002, 2006, 2007 YAMAMOTO Takashi,
@ -31,7 +31,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: x86_machdep.c,v 1.75 2016/08/01 16:07:39 maxv Exp $"); __KERNEL_RCSID(0, "$NetBSD: x86_machdep.c,v 1.76 2016/11/15 15:00:56 maxv Exp $");
#include "opt_modular.h" #include "opt_modular.h"
#include "opt_physmem.h" #include "opt_physmem.h"
@ -849,14 +849,10 @@ init_x86_vm(paddr_t pa_kend)
x86_freelists[i].freelist = VM_FREELIST_DEFAULT; x86_freelists[i].freelist = VM_FREELIST_DEFAULT;
} }
/* Make sure the end of the space used by the kernel is rounded. */
pa_kend = round_page(pa_kend);
#ifdef amd64 #ifdef amd64
extern vaddr_t kern_end; extern vaddr_t kern_end;
extern vaddr_t module_start, module_end; extern vaddr_t module_start, module_end;
kern_end = KERNBASE + pa_kend;
module_start = kern_end; module_start = kern_end;
module_end = KERNBASE + NKL2_KIMG_ENTRIES * NBPD_L2; module_end = KERNBASE + NKL2_KIMG_ENTRIES * NBPD_L2;
#endif #endif