summaryrefslogtreecommitdiff
path: root/sys/arch/i386
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/i386')
-rw-r--r--sys/arch/i386/i386/bios.c30
1 files changed, 27 insertions, 3 deletions
diff --git a/sys/arch/i386/i386/bios.c b/sys/arch/i386/i386/bios.c
index 44d360106c7..2d9ae9d4676 100644
--- a/sys/arch/i386/i386/bios.c
+++ b/sys/arch/i386/i386/bios.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bios.c,v 1.71 2007/11/03 05:48:49 ckuethe Exp $ */
+/* $OpenBSD: bios.c,v 1.72 2007/11/15 20:02:33 deraadt Exp $ */
/*
* Copyright (c) 1997-2001 Michael Shalayeff
@@ -145,7 +145,7 @@ biosattach(struct device *parent, struct device *self, void *aux)
struct smbtable bios;
volatile u_int8_t *va;
char scratch[64], *str;
- int flags;
+ int flags, ncpu = 0;
/* remember flags */
flags = sc->sc_dev.dv_cfdata->cf_flags;
@@ -282,6 +282,30 @@ biosattach(struct device *parent, struct device *self, void *aux)
printf(" date %s", fixstring(scratch));
}
smbios_info(sc->sc_dev.dv_xname);
+
+#ifdef MULTIPROCESSOR
+ /* count cpus so that we can disable apm when cpu > 1 */
+ bzero(&bios, sizeof(bios));
+ while (smbios_find_table(SMBIOS_TYPE_PROCESSOR,&bios)) {
+ struct smbios_cpu *cpu = bios.tblhdr;
+
+ if (cpu->cpu_status & SMBIOS_CPUST_POPULATED) {
+ /*
+ * smbios 2.5 added multi code support
+ */
+ if (sh->majrev * 100 +
+ sh->minrev >= 250 &&
+ cpu->cpu_core_enabled)
+ ncpu += cpu->cpu_core_enabled;
+ else {
+ ncpu++;
+ if (cpu->cpu_id_edx & CPUID_HTT)
+ ncpu++;
+ }
+ }
+ }
+#endif /* MULTIPROCESSOR */
+
break;
}
}
@@ -289,7 +313,7 @@ biosattach(struct device *parent, struct device *self, void *aux)
printf("\n");
#if NAPM > 0
- if (apm) {
+ if (apm && ncpu < 2) {
struct bios_attach_args ba;
#if defined(DEBUG) || defined(APMDEBUG)
printf("apminfo: %x, code %x[%x]/%x[%x], data %x[%x], ept %x\n",