Source-Changes-HG archive

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

[src/sommerfeld_i386mp_1]: src/sys/arch/i386/i386 Let ioapic know the id of t...



details:   https://anonhg.NetBSD.org/src/rev/fefcdbb67312
branches:  sommerfeld_i386mp_1
changeset: 482207:fefcdbb67312
user:      sommerfeld <sommerfeld%NetBSD.org@localhost>
date:      Sun Feb 27 20:42:54 2000 +0000

description:
Let ioapic know the id of the boot CPU so interrupts get routed there
for now.  Previously it assumed "cpu 0", which wasn't necessarily the
boot CPU.

This is a temporary kludge until we have symmetric interrupt handling.

diffstat:

 sys/arch/i386/i386/cpu.c    |  10 +++++++++-
 sys/arch/i386/i386/ioapic.c |   8 ++++----
 2 files changed, 13 insertions(+), 5 deletions(-)

diffs (73 lines):

diff -r 1e180694e530 -r fefcdbb67312 sys/arch/i386/i386/cpu.c
--- a/sys/arch/i386/i386/cpu.c  Sun Feb 27 20:26:06 2000 +0000
+++ b/sys/arch/i386/i386/cpu.c  Sun Feb 27 20:42:54 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.c,v 1.1.2.4 2000/02/21 21:05:57 sommerfeld Exp $ */
+/* $NetBSD: cpu.c,v 1.1.2.5 2000/02/27 20:42:54 sommerfeld Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -75,6 +75,7 @@
 #include "opt_mpbios.h"                /* for MPDEBUG */
 
 #include "lapic.h"
+#include "ioapic.h"
 
 #include <sys/param.h>
 #include <sys/proc.h>
@@ -104,6 +105,10 @@
 #include <machine/i82489var.h>
 #endif
 
+#if NIOAPIC > 0
+#include <machine/i82093var.h>
+#endif
+
 int     cpu_match __P((struct device *, struct cfdata *, void *));
 void    cpu_attach __P((struct device *, struct device *, void *));
 
@@ -245,6 +250,9 @@
                lapic_enable();
                lapic_calibrate_timer(ci);
 #endif
+#if NIOAPIC > 0
+               ioapic_bsp_id = caa->cpu_number;
+#endif
                break;
                
        case CPU_ROLE_AP:
diff -r 1e180694e530 -r fefcdbb67312 sys/arch/i386/i386/ioapic.c
--- a/sys/arch/i386/i386/ioapic.c       Sun Feb 27 20:26:06 2000 +0000
+++ b/sys/arch/i386/i386/ioapic.c       Sun Feb 27 20:42:54 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ioapic.c,v 1.1.2.2 2000/02/21 18:51:00 sommerfeld Exp $ */
+/* $NetBSD: ioapic.c,v 1.1.2.3 2000/02/27 20:42:54 sommerfeld Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -110,6 +110,7 @@
 
 int apic_verbose = 0;
 
+int ioapic_bsp_id = 0;
 int ioapic_cold = 1;
 
 static __inline  u_int32_t
@@ -324,15 +325,14 @@
                redlo |= (IOAPIC_REDLO_DEL_FIXED<<IOAPIC_REDLO_DEL_SHIFT);
                redlo &= ~IOAPIC_REDLO_DSTMOD;
                
-               /* destination: CPU 0 */
+               /* destination: BSP CPU */
 
-               /* XXX assumes primary CPU at apic id 0 */
                /*
                 * XXX will want to eventually switch to
                 * lowest-priority delivery mode, possibly with focus
                 * processor.
                 */
-               redhi |= (0 << IOAPIC_REDHI_DEST_SHIFT);
+               redhi |= (ioapic_bsp_id << IOAPIC_REDHI_DEST_SHIFT);
 
                /* XXX derive this bit from BIOS info */
                if (pin->ip_type == IST_LEVEL)



Home | Main Index | Thread Index | Old Index