summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2008-12-21 18:49:47 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2008-12-21 18:49:47 +0000
commit3de5604e2caf04b966d719c4930e572d83947d58 (patch)
treec1aeb7db60225be4dc46abdedca79764ecd969b6 /sys
parent7731f3f93e4d9f387f756d9c9093394fd7636524 (diff)
Change the way we include mpbios code to be similar to what we do on i386.
ok deraadt@
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/amd64/amd64/ioapic.c6
-rw-r--r--sys/arch/amd64/amd64/mainbus.c17
-rw-r--r--sys/arch/amd64/conf/GENERIC.MP3
-rw-r--r--sys/arch/amd64/conf/files.amd648
4 files changed, 12 insertions, 22 deletions
diff --git a/sys/arch/amd64/amd64/ioapic.c b/sys/arch/amd64/amd64/ioapic.c
index c66c165ddd8..16c15f02f48 100644
--- a/sys/arch/amd64/amd64/ioapic.c
+++ b/sys/arch/amd64/amd64/ioapic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ioapic.c,v 1.16 2008/10/21 21:52:07 brad Exp $ */
+/* $OpenBSD: ioapic.c,v 1.17 2008/12/21 18:49:45 kettenis Exp $ */
/* $NetBSD: ioapic.c,v 1.6 2003/05/15 13:30:31 fvdl Exp $ */
/*-
@@ -84,10 +84,6 @@
#include <machine/mpbiosvar.h>
-#if !defined(MPBIOS) && !defined(MPACPI)
-#error "ioapic needs at least one of the MPBIOS or MPACPI options"
-#endif
-
/*
* XXX locking
*/
diff --git a/sys/arch/amd64/amd64/mainbus.c b/sys/arch/amd64/amd64/mainbus.c
index a9627064289..d8a8ccfe2ff 100644
--- a/sys/arch/amd64/amd64/mainbus.c
+++ b/sys/arch/amd64/amd64/mainbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mainbus.c,v 1.14 2007/12/05 19:17:14 deraadt Exp $ */
+/* $OpenBSD: mainbus.c,v 1.15 2008/12/21 18:49:45 kettenis Exp $ */
/* $NetBSD: mainbus.c,v 1.1 2003/04/26 18:39:29 fvdl Exp $ */
/*
@@ -47,6 +47,7 @@
#include "acpi.h"
#include "ipmi.h"
#include "bios.h"
+#include "mpbios.h"
#include <machine/cpuvar.h>
#include <machine/i82093var.h>
@@ -107,7 +108,7 @@ struct isabus_attach_args mba_iba = {
};
#endif
-#if defined(MPBIOS) || defined(MPACPI)
+#if NMPBIOS > 0 || NACPI > 0
struct mp_bus *mp_busses;
int mp_nbus;
struct mp_intr_map *mp_intrs;
@@ -142,9 +143,6 @@ mainbus_attach(struct device *parent, struct device *self, void *aux)
#if NPCI > 0
union mainbus_attach_args mba;
#endif
-#ifdef MPBIOS
- int mpbios_present = 0;
-#endif
extern void (*setperf_setup)(struct cpu_info *);
printf("\n");
@@ -173,14 +171,9 @@ mainbus_attach(struct device *parent, struct device *self, void *aux)
}
#endif
-#ifdef MPBIOS
- mpbios_present = mpbios_probe(self);
-#endif
-
-#ifdef MPBIOS
- if (mpbios_present)
+#if NMPBIOS > 0
+ if (mpbios_probe(self))
mpbios_scan(self);
- else
#endif
if ((cpu_info_primary.ci_flags & CPUF_PRESENT) == 0) {
diff --git a/sys/arch/amd64/conf/GENERIC.MP b/sys/arch/amd64/conf/GENERIC.MP
index 164926c6b8f..805c23c1ba1 100644
--- a/sys/arch/amd64/conf/GENERIC.MP
+++ b/sys/arch/amd64/conf/GENERIC.MP
@@ -1,9 +1,8 @@
-# $OpenBSD: GENERIC.MP,v 1.8 2007/01/27 22:48:01 kettenis Exp $
+# $OpenBSD: GENERIC.MP,v 1.9 2008/12/21 18:49:46 kettenis Exp $
include "arch/amd64/conf/GENERIC"
option MULTIPROCESSOR
-option MPBIOS
cpu* at mainbus?
ioapic* at mainbus?
diff --git a/sys/arch/amd64/conf/files.amd64 b/sys/arch/amd64/conf/files.amd64
index 7ce88984879..d8345e69cc9 100644
--- a/sys/arch/amd64/conf/files.amd64
+++ b/sys/arch/amd64/conf/files.amd64
@@ -1,4 +1,4 @@
-# $OpenBSD: files.amd64,v 1.41 2008/11/09 15:11:19 oga Exp $
+# $OpenBSD: files.amd64,v 1.42 2008/12/21 18:49:46 kettenis Exp $
maxpartitions 16
maxusers 2 16 128
@@ -36,7 +36,9 @@ file arch/amd64/amd64/mp_setperf.c multiprocessor
file arch/amd64/amd64/apic.c ioapic | lapic
-file arch/amd64/amd64/mpbios.c mpbios
+#Intel SMP specification 1.4
+define mpbios
+file arch/amd64/amd64/mpbios.c mpbios needs-flag
file arch/amd64/amd64/mpbios_intr_fixup.c mpbios & pci
@@ -89,7 +91,7 @@ file arch/amd64/amd64/cpu.c cpu
define lapic
file arch/amd64/amd64/lapic.c lapic needs-flag
-device ioapic: lapic
+device ioapic: mpbios, lapic
attach ioapic at mainbus
file arch/amd64/amd64/ioapic.c ioapic needs-flag