Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/i386/i386 Handle per-CPU local APIC redir tables in...



details:   https://anonhg.NetBSD.org/src/rev/d0c4301a603d
branches:  trunk
changeset: 537844:d0c4301a603d
user:      fvdl <fvdl%NetBSD.org@localhost>
date:      Sun Oct 06 14:28:55 2002 +0000

description:
Handle per-CPU local APIC redir tables in the MP BIOS.

diffstat:

 sys/arch/i386/i386/lapic.c  |  12 ++++++------
 sys/arch/i386/i386/mpbios.c |  13 ++++++++-----
 2 files changed, 14 insertions(+), 11 deletions(-)

diffs (81 lines):

diff -r c062e54fc273 -r d0c4301a603d sys/arch/i386/i386/lapic.c
--- a/sys/arch/i386/i386/lapic.c        Sun Oct 06 14:28:17 2002 +0000
+++ b/sys/arch/i386/i386/lapic.c        Sun Oct 06 14:28:55 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lapic.c,v 1.2 2002/10/01 12:56:53 fvdl Exp $ */
+/* $NetBSD: lapic.c,v 1.3 2002/10/06 14:28:55 fvdl Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -119,9 +119,9 @@
 void
 lapic_set_lvt ()
 {
-#ifdef MULTIPROCESSOR
        struct cpu_info *ci = curcpu();
 
+#ifdef MULTIPROCESSOR
        if (mp_verbose) {
                apic_format_redir (ci->ci_dev->dv_xname, "prelint", 0, 0,
                    i82489_readreg(LAPIC_LVINT0));
@@ -129,10 +129,10 @@
                    i82489_readreg(LAPIC_LVINT1));
        }
 #endif
-       if (lapic_ints[0])
-               i82489_writereg(LAPIC_LVINT0, lapic_ints[0]->redir);
-       if (lapic_ints[1])
-               i82489_writereg(LAPIC_LVINT1, lapic_ints[1]->redir);
+       if (ci->ci_lapic_ints[0])
+               i82489_writereg(LAPIC_LVINT0, ci->ci_lapic_ints[0]->redir);
+       if (ci->ci_lapic_ints[1])
+               i82489_writereg(LAPIC_LVINT1, ci->ci_lapic_ints[1]->redir);
 
 #ifdef MULTIPROCESSOR
        if (mp_verbose) {
diff -r c062e54fc273 -r d0c4301a603d sys/arch/i386/i386/mpbios.c
--- a/sys/arch/i386/i386/mpbios.c       Sun Oct 06 14:28:17 2002 +0000
+++ b/sys/arch/i386/i386/mpbios.c       Sun Oct 06 14:28:55 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mpbios.c,v 1.3 2002/10/04 06:02:38 explorer Exp $      */
+/*     $NetBSD: mpbios.c,v 1.4 2002/10/06 14:28:55 fvdl Exp $  */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -455,7 +455,6 @@
 int mp_nbus;
 struct mp_intr_map *mp_intrs;
 
-struct mp_intr_map *lapic_ints[2]; /* XXX */
 int mp_isa_bus = -1;           /* XXX */
 int mp_eisa_bus = -1;          /* XXX */
 
@@ -1000,6 +999,9 @@
        u_int32_t type = entry->int_type;
        u_int32_t flags = entry->int_flags;
 
+       struct cpu_info *ci;
+       CPU_INFO_ITERATOR cii;
+
        switch (type) {
        case MPS_INTTYPE_INT:
                mpb = &(mp_busses[bus]);
@@ -1055,14 +1057,15 @@
                        sc->sc_pins[pin].ip_map = mpi;
                }
        } else {
-               if (id != MPS_ALL_APICS)
-                       panic("can't deal with not-all-lapics interrupt yet!");
                if (pin >= 2)
                        printf("pin %d of local apic doesn't exist!\n", pin);
                else {
                        mpi->ioapic = NULL;
                        mpi->ioapic_pin = pin;
-                       lapic_ints[pin] = mpi;
+                       for (CPU_INFO_FOREACH(cii, ci)) {
+                               if (id == MPS_ALL_APICS || ci->ci_cpuid == id)
+                                       ci->ci_lapic_ints[pin] = mpi;
+                       }
                }
        }
        if (mp_verbose) {



Home | Main Index | Thread Index | Old Index