Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch Fix NLAPIC, NISA and NIOAPIC related conditional co...



details:   https://anonhg.NetBSD.org/src/rev/4b730948b362
branches:  trunk
changeset: 996945:4b730948b362
user:      cherry <cherry%NetBSD.org@localhost>
date:      Thu Feb 14 07:12:40 2019 +0000

description:
Fix NLAPIC, NISA and NIOAPIC related conditional compile errors.

This will allow us to now compile an amd64 kernel without PCI.

No functional changes.

diffstat:

 sys/arch/amd64/amd64/amd64_mainbus.c |   6 +++---
 sys/arch/amd64/amd64/db_interface.c  |  10 ++++++++--
 sys/arch/i386/i386/db_interface.c    |   6 ++++--
 sys/arch/x86/x86/cpu.c               |  15 +++++++++------
 4 files changed, 24 insertions(+), 13 deletions(-)

diffs (167 lines):

diff -r 5dd79a2a9d4b -r 4b730948b362 sys/arch/amd64/amd64/amd64_mainbus.c
--- a/sys/arch/amd64/amd64/amd64_mainbus.c      Thu Feb 14 06:59:24 2019 +0000
+++ b/sys/arch/amd64/amd64/amd64_mainbus.c      Thu Feb 14 07:12:40 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: amd64_mainbus.c,v 1.4 2018/12/22 08:35:04 maxv Exp $   */
+/*     $NetBSD: amd64_mainbus.c,v 1.5 2019/02/14 07:12:40 cherry Exp $ */
 /*     NetBSD: mainbus.c,v 1.39 2018/12/02 08:19:44 cherry Exp         */
 
 /*
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: amd64_mainbus.c,v 1.4 2018/12/22 08:35:04 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amd64_mainbus.c,v 1.5 2019/02/14 07:12:40 cherry Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -155,7 +155,7 @@
 void
 amd64_mainbus_attach(device_t parent, device_t self, void *aux)
 {
-#if NPCI > 0 || NACPICA > 0 || NIPMI > 0
+#if NISA > 0 || NPCI > 0 || NACPICA > 0 || NIPMI > 0
        union amd64_mainbus_attach_args mba;
 #endif
 
diff -r 5dd79a2a9d4b -r 4b730948b362 sys/arch/amd64/amd64/db_interface.c
--- a/sys/arch/amd64/amd64/db_interface.c       Thu Feb 14 06:59:24 2019 +0000
+++ b/sys/arch/amd64/amd64/db_interface.c       Thu Feb 14 07:12:40 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: db_interface.c,v 1.35 2019/02/11 14:59:32 cherry Exp $ */
+/*     $NetBSD: db_interface.c,v 1.36 2019/02/14 07:12:40 cherry Exp $ */
 
 /*
  * Mach Operating System
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.35 2019/02/11 14:59:32 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.36 2019/02/14 07:12:40 cherry Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -52,9 +52,13 @@
 #include <machine/cpufunc.h>
 #include <machine/db_machdep.h>
 #include <machine/cpuvar.h>
+#if NIOAPIC > 0
 #include <machine/i82093var.h>
+#endif
+#if NLAPIC > 0
 #include <machine/i82489reg.h>
 #include <machine/i82489var.h>
+#endif
 
 #include <ddb/db_sym.h>
 #include <ddb/db_command.h>
@@ -145,7 +149,9 @@
 #ifdef XENPV
                xen_broadcast_ipi(XEN_IPI_DDB);
 #else
+#if NLAPIC > 0
                x86_ipi(ddb_vec, LAPIC_DEST_ALLEXCL, LAPIC_DLMODE_FIXED);
+#endif
 #endif /* XENPV */
        }
        ddb_mp_online = x86_mp_online;
diff -r 5dd79a2a9d4b -r 4b730948b362 sys/arch/i386/i386/db_interface.c
--- a/sys/arch/i386/i386/db_interface.c Thu Feb 14 06:59:24 2019 +0000
+++ b/sys/arch/i386/i386/db_interface.c Thu Feb 14 07:12:40 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: db_interface.c,v 1.83 2019/02/11 14:59:32 cherry Exp $ */
+/*     $NetBSD: db_interface.c,v 1.84 2019/02/14 07:12:40 cherry Exp $ */
 
 /*
  * Mach Operating System
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.83 2019/02/11 14:59:32 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.84 2019/02/14 07:12:40 cherry Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -150,7 +150,9 @@
 #ifdef XENPV
                xen_broadcast_ipi(XEN_IPI_DDB);
 #else
+#if NLAPIC > 0         
                x86_ipi(ddb_vec, LAPIC_DEST_ALLEXCL, LAPIC_DLMODE_FIXED);
+#endif         
 #endif /* XENPV */
        }
        ddb_mp_online = x86_mp_online;
diff -r 5dd79a2a9d4b -r 4b730948b362 sys/arch/x86/x86/cpu.c
--- a/sys/arch/x86/x86/cpu.c    Thu Feb 14 06:59:24 2019 +0000
+++ b/sys/arch/x86/x86/cpu.c    Thu Feb 14 07:12:40 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.c,v 1.164 2018/12/04 19:27:22 cherry Exp $ */
+/*     $NetBSD: cpu.c,v 1.165 2019/02/14 07:12:40 cherry Exp $ */
 
 /*
  * Copyright (c) 2000-2012 NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.164 2018/12/04 19:27:22 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.165 2019/02/14 07:12:40 cherry Exp $");
 
 #include "opt_ddb.h"
 #include "opt_mpbios.h"                /* for MPDEBUG */
@@ -754,12 +754,14 @@
 void
 cpu_start_secondary(struct cpu_info *ci)
 {
-       paddr_t mp_pdirpa;
        u_long psl;
        int i;
 
+#if NLAPIC > 0
+       paddr_t mp_pdirpa;
        mp_pdirpa = pmap_init_tmp_pgtbl(mp_trampoline_paddr);
        cpu_copy_trampoline(mp_pdirpa);
+#endif
 
        atomic_or_32(&ci->ci_flags, CPUF_AP);
        ci->ci_curlwp = ci->ci_data.cpu_idlelwp;
@@ -948,7 +950,9 @@
        cpu_get_tsc_freq(ci);
 
        s = splhigh();
+#if NLAPIC > 0
        lapic_write_tpri(0);
+#endif
        x86_enable_intr();
        splx(s);
        x86_errata();
@@ -1032,7 +1036,6 @@
 int
 mp_cpu_start(struct cpu_info *ci, paddr_t target)
 {
-       unsigned short dwordptr[2];
        int error;
 
        /*
@@ -1048,15 +1051,15 @@
        outb(IO_RTC, NVRAM_RESET);
        outb(IO_RTC+1, NVRAM_RESET_JUMP);
 
+#if NLAPIC > 0
        /*
         * "and the warm reset vector (DWORD based at 40:67) to point
         * to the AP startup code ..."
         */
-
+       unsigned short dwordptr[2];
        dwordptr[0] = 0;
        dwordptr[1] = target >> 4;
 
-#if NLAPIC > 0
        memcpy((uint8_t *)cmos_data_mapping + 0x467, dwordptr, 4);
 #endif
 



Home | Main Index | Thread Index | Old Index