Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch Reorder some instructions, reduces the diff between...
details: https://anonhg.NetBSD.org/src/rev/1bef38991752
branches: trunk
changeset: 346450:1bef38991752
user: maxv <maxv%NetBSD.org@localhost>
date: Wed Jul 13 15:53:26 2016 +0000
description:
Reorder some instructions, reduces the diff between amd64 and i386.
diffstat:
sys/arch/amd64/amd64/machdep.c | 7 +++----
sys/arch/i386/i386/machdep.c | 21 ++++++++++-----------
2 files changed, 13 insertions(+), 15 deletions(-)
diffs (107 lines):
diff -r 8136c0b02807 -r 1bef38991752 sys/arch/amd64/amd64/machdep.c
--- a/sys/arch/amd64/amd64/machdep.c Wed Jul 13 15:39:33 2016 +0000
+++ b/sys/arch/amd64/amd64/machdep.c Wed Jul 13 15:53:26 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.222 2016/07/13 15:39:33 maxv Exp $ */
+/* $NetBSD: machdep.c,v 1.223 2016/07/13 15:53:26 maxv Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008, 2011
@@ -111,7 +111,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.222 2016/07/13 15:39:33 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.223 2016/07/13 15:53:26 maxv Exp $");
/* #define XENDEBUG_LOW */
@@ -1543,8 +1543,6 @@
#endif
#endif /* !XEN */
- cpu_probe(&cpu_info_primary);
-
#ifdef XEN
KASSERT(HYPERVISOR_shared_info != NULL);
cpu_info_primary.ci_vcpu = &HYPERVISOR_shared_info->vcpu_info[0];
@@ -1552,6 +1550,7 @@
__PRINTK(("init_x86_64(0x%lx)\n", first_avail));
#endif /* XEN */
+ cpu_probe(&cpu_info_primary);
cpu_init_msrs(&cpu_info_primary, true);
use_pae = 1; /* PAE always enabled in long mode */
diff -r 8136c0b02807 -r 1bef38991752 sys/arch/i386/i386/machdep.c
--- a/sys/arch/i386/i386/machdep.c Wed Jul 13 15:39:33 2016 +0000
+++ b/sys/arch/i386/i386/machdep.c Wed Jul 13 15:53:26 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.757 2016/07/13 15:39:33 maxv Exp $ */
+/* $NetBSD: machdep.c,v 1.758 2016/07/13 15:53:27 maxv Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2000, 2004, 2006, 2008, 2009
@@ -67,7 +67,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.757 2016/07/13 15:39:33 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.758 2016/07/13 15:53:27 maxv Exp $");
#include "opt_beep.h"
#include "opt_compat_ibcs2.h"
@@ -1145,10 +1145,9 @@
cpu_info_primary.ci_vcpu = &HYPERVISOR_shared_info->vcpu_info[0];
#endif
- cpu_probe(&cpu_info_primary);
-
uvm_lwp_setuarea(&lwp0, lwp0uarea);
+ cpu_probe(&cpu_info_primary);
cpu_init_msrs(&cpu_info_primary, true);
#ifdef PAE
@@ -1177,10 +1176,6 @@
cpu_info_primary.ci_pae_l3_pdir = (pd_entry_t *)(rcr3() + KERNBASE);
#endif /* PAE && !XEN */
-#ifdef XEN
- xen_parse_cmdline(XEN_PARSE_BOOTFLAGS, NULL);
-#endif
-
/*
* Initialize PAGE_SIZE-dependent variables.
*/
@@ -1205,10 +1200,14 @@
*/
avail_start = 6 * PAGE_SIZE;
#else /* !XEN */
- /* steal one page for gdt */
+ /* Parse Xen command line (replace bootinfo) */
+ xen_parse_cmdline(XEN_PARSE_BOOTFLAGS, NULL);
+
+ /* Steal one page for gdt */
gdt = (void *)((u_long)first_avail + KERNBASE);
first_avail += PAGE_SIZE;
- /* Make sure the end of the space used by the kernel is rounded. */
+
+ /* Determine physical address space */
first_avail = round_page(first_avail);
avail_start = first_avail;
avail_end = ctob((paddr_t)xen_start_info.nr_pages);
@@ -1219,12 +1218,12 @@
mem_cluster_cnt++;
physmem += xen_start_info.nr_pages;
uvmexp.wired += atop(avail_start);
+
/*
* initgdt() has to be done before consinit(), so that %fs is properly
* initialised. initgdt() uses pmap_kenter_pa so it can't be called
* before the above variables are set.
*/
-
initgdt(gdt);
mutex_init(&pte_lock, MUTEX_DEFAULT, IPL_VM);
Home |
Main Index |
Thread Index |
Old Index