Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch #ifdef - #endif-ed. NMCA, NISA, NNPX, NIOAPIC, LAPI...
details: https://anonhg.NetBSD.org/src/rev/123213cec8cb
branches: trunk
changeset: 783158:123213cec8cb
user: kiyohara <kiyohara%NetBSD.org@localhost>
date: Sat Dec 08 12:36:30 2012 +0000
description:
#ifdef - #endif-ed. NMCA, NISA, NNPX, NIOAPIC, LAPIC, MPBIOS and MULTIPROCESSOR.
diffstat:
sys/arch/i386/i386/db_interface.c | 11 ++++++++-
sys/arch/i386/i386/trap.c | 10 +++++++-
sys/arch/x86/x86/bus_dma.c | 12 +++++++++-
sys/arch/x86/x86/cpu.c | 43 +++++++++++++++++++++++++++++++++++---
sys/arch/x86/x86/platform.c | 6 +++-
5 files changed, 70 insertions(+), 12 deletions(-)
diffs (truncated from 415 to 300 lines):
diff -r 27b9d69fb24b -r 123213cec8cb sys/arch/i386/i386/db_interface.c
--- a/sys/arch/i386/i386/db_interface.c Sat Dec 08 11:43:27 2012 +0000
+++ b/sys/arch/i386/i386/db_interface.c Sat Dec 08 12:36:30 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: db_interface.c,v 1.68 2012/08/24 05:54:30 dholland Exp $ */
+/* $NetBSD: db_interface.c,v 1.69 2012/12/08 12:36:30 kiyohara Exp $ */
/*
* Mach Operating System
@@ -33,11 +33,14 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.68 2012/08/24 05:54:30 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.69 2012/12/08 12:36:30 kiyohara Exp $");
#include "opt_ddb.h"
#include "opt_multiprocessor.h"
+#include "ioapic.h"
+#include "lapic.h"
+
#include <sys/param.h>
#include <sys/proc.h>
#include <sys/reboot.h>
@@ -53,9 +56,13 @@
#include <machine/cpufunc.h>
#include <machine/db_machdep.h>
#include <machine/cpuvar.h>
+#if NIOAPIC > 0
#include <machine/i82093var.h>
+#endif
+#if LAPIC > 0
#include <machine/i82489reg.h>
#include <machine/i82489var.h>
+#endif
#include <ddb/db_sym.h>
#include <ddb/db_command.h>
diff -r 27b9d69fb24b -r 123213cec8cb sys/arch/i386/i386/trap.c
--- a/sys/arch/i386/i386/trap.c Sat Dec 08 11:43:27 2012 +0000
+++ b/sys/arch/i386/i386/trap.c Sat Dec 08 12:36:30 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.265 2012/10/03 18:58:32 dsl Exp $ */
+/* $NetBSD: trap.c,v 1.266 2012/12/08 12:36:30 kiyohara Exp $ */
/*-
* Copyright (c) 1998, 2000, 2005, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.265 2012/10/03 18:58:32 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.266 2012/12/08 12:36:30 kiyohara Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@@ -102,7 +102,9 @@
#include <machine/db_machdep.h>
#include "mca.h"
+#if NMCA > 0
#include <machine/mca_machdep.h>
+#endif
#include <x86/nmi.h>
@@ -584,9 +586,11 @@
case T_DIVIDE|T_USER:
ksi.ksi_code = FPE_INTDIV;
break;
+#if NNPX > 0
case T_ARITHTRAP|T_USER:
ksi.ksi_code = npxtrap(l);
break;
+#endif
default:
ksi.ksi_code = 0;
break;
@@ -780,7 +784,9 @@
if (kdb_trap(type, 0, frame))
return;
/* machine/parity/power fail/"kitchen sink" faults */
+#if NMCA > 0
mca_nmi();
+#endif
x86_nmi();
}
diff -r 27b9d69fb24b -r 123213cec8cb sys/arch/x86/x86/bus_dma.c
--- a/sys/arch/x86/x86/bus_dma.c Sat Dec 08 11:43:27 2012 +0000
+++ b/sys/arch/x86/x86/bus_dma.c Sat Dec 08 12:36:30 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bus_dma.c,v 1.68 2011/10/14 18:28:04 bouyer Exp $ */
+/* $NetBSD: bus_dma.c,v 1.69 2012/12/08 12:36:31 kiyohara Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2007 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.68 2011/10/14 18:28:04 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.69 2012/12/08 12:36:31 kiyohara Exp $");
/*
* The following is included because _bus_dma_uiomove is derived from
@@ -85,6 +85,8 @@
*/
#include "ioapic.h"
+#include "isa.h"
+#include "opt_mpbios.h"
#include <sys/param.h>
#include <sys/systm.h>
@@ -96,11 +98,17 @@
#include <sys/bus.h>
#include <machine/bus_private.h>
+#if NIOAPIC > 0
#include <machine/i82093var.h>
+#endif
+#ifdef MPBIOS
#include <machine/mpbiosvar.h>
+#endif
+#if NISA > 0
#include <dev/isa/isareg.h>
#include <dev/isa/isavar.h>
+#endif
#include <uvm/uvm.h>
diff -r 27b9d69fb24b -r 123213cec8cb sys/arch/x86/x86/cpu.c
--- a/sys/arch/x86/x86/cpu.c Sat Dec 08 11:43:27 2012 +0000
+++ b/sys/arch/x86/x86/cpu.c Sat Dec 08 12:36:30 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.c,v 1.100 2012/07/02 01:05:48 chs Exp $ */
+/* $NetBSD: cpu.c,v 1.101 2012/12/08 12:36:31 kiyohara Exp $ */
/*-
* Copyright (c) 2000-2012 NetBSD Foundation, Inc.
@@ -62,11 +62,12 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.100 2012/07/02 01:05:48 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.101 2012/12/08 12:36:31 kiyohara Exp $");
#include "opt_ddb.h"
#include "opt_mpbios.h" /* for MPDEBUG */
#include "opt_mtrr.h"
+#include "opt_multiprocessor.h"
#include "lapic.h"
#include "ioapic.h"
@@ -92,7 +93,9 @@
#include <machine/cpuvar.h>
#include <machine/pmap.h>
#include <machine/vmparam.h>
+#if MPBIOS > 0
#include <machine/mpbiosvar.h>
+#endif
#include <machine/pcb.h>
#include <machine/specialreg.h>
#include <machine/segments.h>
@@ -105,9 +108,11 @@
#include <machine/tlog.h>
#endif
+#if NLAPIC > 0
#include <machine/apicvar.h>
#include <machine/i82489reg.h>
#include <machine/i82489var.h>
+#endif
#include <dev/ic/mc146818reg.h>
#include <i386/isa/nvram.h>
@@ -131,10 +136,12 @@
bool sc_wasonline;
};
+#ifdef MULTIPROCESSOR
int mp_cpu_start(struct cpu_info *, paddr_t);
void mp_cpu_start_cleanup(struct cpu_info *);
const struct cpu_functions mp_cpu_funcs = { mp_cpu_start, NULL,
mp_cpu_start_cleanup };
+#endif
CFATTACH_DECL2_NEW(cpu, sizeof(struct cpu_softc),
@@ -179,15 +186,23 @@
extern char x86_64_doubleflt_stack[];
+#ifdef MULTIPROCESSOR
bool x86_mp_online;
paddr_t mp_trampoline_paddr = MP_TRAMPOLINE;
+#endif
+#if NLAPIC > 0
static vaddr_t cmos_data_mapping;
+#endif
struct cpu_info *cpu_starting;
+#ifdef MULTIPROCESSOR
void cpu_hatch(void *);
static void cpu_boot_secondary(struct cpu_info *ci);
static void cpu_start_secondary(struct cpu_info *ci);
+#endif
+#if NLAPIC > 0
static void cpu_copy_trampoline(void);
+#endif
/*
* Runs once per boot once multiprocessor goo has been detected and
@@ -195,6 +210,7 @@
*
* Called from lapic_boot_init() (from mpbios_scan()).
*/
+#if NLAPIC > 0
void
cpu_init_first(void)
{
@@ -208,6 +224,7 @@
pmap_kenter_pa(cmos_data_mapping, 0, VM_PROT_READ|VM_PROT_WRITE, 0);
pmap_update(pmap_kernel());
}
+#endif
static int
cpu_match(device_t parent, cfdata_t match, void *aux)
@@ -275,7 +292,9 @@
struct cpu_attach_args *caa = aux;
struct cpu_info *ci;
uintptr_t ptr;
+#if NLAPIC > 0
int cpunum = caa->cpu_number;
+#endif
static bool again;
sc->sc_dev = self;
@@ -313,6 +332,7 @@
aprint_naive(": %s Processor\n",
caa->cpu_role == CPU_ROLE_SP ? "Single" : "Boot");
ci = &cpu_info_primary;
+#if NLAPIC > 0
if (cpunum != lapic_cpu_number()) {
/* XXX should be done earlier. */
uint32_t reg;
@@ -327,6 +347,7 @@
if (cpunum != lapic_cpu_number()) {
aprint_error_dev(self, "unable to reset apic id\n");
}
+#endif
}
ci->ci_self = ci;
@@ -370,12 +391,14 @@
cpu_init(ci);
cpu_set_tss_gates(ci);
pmap_cpu_init_late(ci);
+#if NLAPIC > 0
if (caa->cpu_role != CPU_ROLE_SP) {
/* Enable lapic. */
lapic_enable();
lapic_set_lvt();
lapic_calibrate_timer(ci);
}
+#endif
/* Make sure DELAY() is initialized. */
DELAY(1);
again = true;
@@ -398,6 +421,7 @@
x86_cpu_idle_init();
break;
+#ifdef MULTIPROCESSOR
case CPU_ROLE_AP:
/*
* report on an AP
@@ -418,6 +442,7 @@
tmp->ci_next = ci;
}
break;
+#endif
default:
aprint_normal("\n");
@@ -429,6 +454,7 @@
if (!pmf_device_register1(self, cpu_suspend, cpu_resume, cpu_shutdown))
aprint_error_dev(self, "couldn't establish power handler\n");
+#ifdef MULTIPROCESSOR
if (mp_verbose) {
struct lwp *l = ci->ci_data.cpu_idlelwp;
struct pcb *pcb = lwp_getpcb(l);
@@ -443,6 +469,7 @@
#endif
);
Home |
Main Index |
Thread Index |
Old Index