diff options
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/amd64/amd64/mainbus.c | 6 | ||||
-rw-r--r-- | sys/arch/amd64/amd64/mpbios.c | 25 | ||||
-rw-r--r-- | sys/arch/amd64/include/cpu.h | 7 | ||||
-rw-r--r-- | sys/arch/amd64/include/mpconfig.h | 5 | ||||
-rw-r--r-- | sys/arch/amd64/isa/isa_machdep.c | 9 | ||||
-rw-r--r-- | sys/arch/amd64/pci/pci_machdep.c | 6 |
6 files changed, 38 insertions, 20 deletions
diff --git a/sys/arch/amd64/amd64/mainbus.c b/sys/arch/amd64/amd64/mainbus.c index 4767cf38930..2f661daa01b 100644 --- a/sys/arch/amd64/amd64/mainbus.c +++ b/sys/arch/amd64/amd64/mainbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mainbus.c,v 1.9 2006/11/17 20:55:47 kettenis Exp $ */ +/* $OpenBSD: mainbus.c,v 1.10 2006/11/25 16:59:31 niklas Exp $ */ /* $NetBSD: mainbus.c,v 1.1 2003/04/26 18:39:29 fvdl Exp $ */ /* @@ -118,8 +118,8 @@ int mp_nbus; struct mp_intr_map *mp_intrs; int mp_nintr; -int mp_isa_bus = -1; -int mp_eisa_bus = -1; +struct mp_bus *mp_isa_bus; +struct mp_bus *mp_eisa_bus; #ifdef MPVERBOSE int mp_verbose = 1; diff --git a/sys/arch/amd64/amd64/mpbios.c b/sys/arch/amd64/amd64/mpbios.c index 29145529ddc..b95d07262e4 100644 --- a/sys/arch/amd64/amd64/mpbios.c +++ b/sys/arch/amd64/amd64/mpbios.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mpbios.c,v 1.7 2006/10/03 22:39:40 gwk Exp $ */ +/* $OpenBSD: mpbios.c,v 1.8 2006/11/25 16:59:31 niklas Exp $ */ /* $NetBSD: mpbios.c,v 1.7 2003/05/15 16:32:50 fvdl Exp $ */ /*- @@ -276,6 +276,13 @@ mpbios_probe(self) struct mp_map t; + /* + * Skip probe if someone else (e.g. acpi) already provided the + * necessary details. + */ + if (mp_busses) + return (0); + /* see if EBDA exists */ mpbios_page = mpbios_map (0, PAGE_SIZE, &t); @@ -950,21 +957,23 @@ mpbios_bus(ent, self) mp_busses[bus_id].mb_data = inb(ELCR0) | (inb(ELCR1) << 8); - if (mp_eisa_bus != -1) - printf("oops: multiple isa busses?\n"); + if (mp_eisa_bus) + printf("%s: multiple isa busses?\n", + self->dv_xname); else - mp_eisa_bus = bus_id; + mp_eisa_bus = &mp_busses[bus_id]; #endif } else if (memcmp(entry->bus_type, "ISA ", 6) == 0) { mp_busses[bus_id].mb_name = "isa"; - mp_busses[bus_id].mb_idx = 0; /* XXX */ + mp_busses[bus_id].mb_idx = bus_id; mp_busses[bus_id].mb_intr_print = mp_print_isa_intr; mp_busses[bus_id].mb_intr_cfg = mp_cfg_isa_intr; - if (mp_isa_bus != -1) - printf("oops: multiple isa busses?\n"); + if (mp_isa_bus) + printf("%s: multiple isa busses?\n", + self->dv_xname); else - mp_isa_bus = bus_id; + mp_isa_bus = &mp_busses[bus_id]; } else { printf("%s: unsupported bus type %6.6s\n", self->dv_xname, entry->bus_type); diff --git a/sys/arch/amd64/include/cpu.h b/sys/arch/amd64/include/cpu.h index 5d587c39f1f..ee62a9373ba 100644 --- a/sys/arch/amd64/include/cpu.h +++ b/sys/arch/amd64/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.19 2006/11/07 09:09:42 otto Exp $ */ +/* $OpenBSD: cpu.h,v 1.20 2006/11/25 16:59:31 niklas Exp $ */ /* $NetBSD: cpu.h,v 1.1 2003/04/26 18:39:39 fvdl Exp $ */ /*- @@ -47,6 +47,11 @@ #include <machine/intrdefs.h> #include <machine/cacheinfo.h> +#ifdef MULTIPROCESSOR +#include <machine/i82489reg.h> +#include <machine/i82489var.h> +#endif + #include <sys/device.h> #include <sys/lock.h> #include <sys/sched.h> diff --git a/sys/arch/amd64/include/mpconfig.h b/sys/arch/amd64/include/mpconfig.h index 350b5e2bf3c..922f4e0e31e 100644 --- a/sys/arch/amd64/include/mpconfig.h +++ b/sys/arch/amd64/include/mpconfig.h @@ -1,4 +1,4 @@ -/* $OpenBSD: mpconfig.h,v 1.3 2006/05/10 01:39:04 krw Exp $ */ +/* $OpenBSD: mpconfig.h,v 1.4 2006/11/25 16:59:31 niklas Exp $ */ /* $NetBSD: mpconfig.h,v 1.2 2003/05/11 00:05:52 fvdl Exp $ */ /* @@ -59,7 +59,8 @@ extern int mp_verbose; extern struct mp_bus *mp_busses; extern struct mp_intr_map *mp_intrs; extern int mp_nintr; -extern int mp_isa_bus, mp_eisa_bus; +extern struct mp_bus *mp_isa_bus; +extern struct mp_bus *mp_eisa_bus; extern int mp_nbus; #endif #endif diff --git a/sys/arch/amd64/isa/isa_machdep.c b/sys/arch/amd64/isa/isa_machdep.c index 74efd9479c9..45f164d3420 100644 --- a/sys/arch/amd64/isa/isa_machdep.c +++ b/sys/arch/amd64/isa/isa_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isa_machdep.c,v 1.9 2006/06/08 03:18:08 weingart Exp $ */ +/* $OpenBSD: isa_machdep.c,v 1.10 2006/11/25 16:59:31 niklas Exp $ */ /* $NetBSD: isa_machdep.c,v 1.22 1997/06/12 23:57:32 thorpej Exp $ */ #define ISA_DMA_STATS @@ -372,8 +372,11 @@ isa_intr_establish(ic, irq, type, level, ih_fun, ih_arg, ih_what) struct mp_intr_map *mip; if (mp_busses != NULL) { - for (mip = mp_busses[mp_isa_bus].mb_intrs; mip != NULL; - mip = mip->next) { + if (mp_isa_bus == NULL) + panic("no isa bus"); + + for (mip = mp_isa_bus->mb_intrs; mip != NULL; + mip = mip->next) { if (mip->bus_pin == pin) { pin = APIC_IRQ_PIN(mip->ioapic_ih); pic = &mip->ioapic->sc_pic; diff --git a/sys/arch/amd64/pci/pci_machdep.c b/sys/arch/amd64/pci/pci_machdep.c index 020f122774f..2b056fadd0b 100644 --- a/sys/arch/amd64/pci/pci_machdep.c +++ b/sys/arch/amd64/pci/pci_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_machdep.c,v 1.8 2006/05/31 06:13:48 weingart Exp $ */ +/* $OpenBSD: pci_machdep.c,v 1.9 2006/11/25 16:59:31 niklas Exp $ */ /* $NetBSD: pci_machdep.c,v 1.3 2003/05/07 21:33:58 fvdl Exp $ */ /*- @@ -481,12 +481,12 @@ pci_intr_map(pa, ihp) } #if NIOAPIC > 0 if (mp_busses != NULL) { - if (intr_find_mpmapping(mp_isa_bus, line, ihp) == 0) { + if (intr_find_mpmapping(mp_isa_bus->mb_idx, line, ihp) == 0) { *ihp |= line; return 0; } #if NEISA > 0 - if (intr_find_mpmapping(mp_eisa_bus, line, ihp) == 0) { + if (intr_find_mpmapping(mp_eisa_bus->mb_idx, line, ihp) == 0) { *ihp |= line; return 0; } |