summaryrefslogtreecommitdiff
path: root/sys/dev/acpi
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2016-07-28 21:57:58 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2016-07-28 21:57:58 +0000
commit9166829d87c15f27009bc183caf9a518131a272e (patch)
tree7249fc6d7e845c2a96b10742c4ebfa0f2b565023 /sys/dev/acpi
parent0bb4bf32c533cbf40b194ba69eba643acebca59b (diff)
Store the acpi processor ID/UID in struct cpu_info, and use it to attach
acpicpu(4) drivers to the right cpu(4). ok mlarkin@, guenther@
Diffstat (limited to 'sys/dev/acpi')
-rw-r--r--sys/dev/acpi/acpi.c11
-rw-r--r--sys/dev/acpi/acpicpu.c4
-rw-r--r--sys/dev/acpi/acpimadt.c12
-rw-r--r--sys/dev/acpi/acpivar.h5
4 files changed, 16 insertions, 16 deletions
diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c
index 0d2d56fa46b..a676d4551df 100644
--- a/sys/dev/acpi/acpi.c
+++ b/sys/dev/acpi/acpi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpi.c,v 1.312 2016/06/10 20:03:46 kettenis Exp $ */
+/* $OpenBSD: acpi.c,v 1.313 2016/07/28 21:57:56 kettenis Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
@@ -1960,6 +1960,8 @@ acpi_add_device(struct aml_node *node, void *arg)
struct acpi_attach_args aaa;
#ifdef MULTIPROCESSOR
struct aml_value res;
+ CPU_INFO_ITERATOR cii;
+ struct cpu_info *ci;
int proc_id = -1;
#endif
@@ -1980,8 +1982,11 @@ acpi_add_device(struct aml_node *node, void *arg)
proc_id = res.v_processor.proc_id;
aml_freevalue(&res);
}
- if (proc_id < -1 || proc_id >= LAPIC_MAP_SIZE ||
- (acpi_lapic_flags[proc_id] & ACPI_PROC_ENABLE) == 0)
+ CPU_INFO_FOREACH(cii, ci) {
+ if (ci->ci_acpi_proc_id == proc_id)
+ break;
+ }
+ if (ci == NULL)
return 0;
#endif
nacpicpus++;
diff --git a/sys/dev/acpi/acpicpu.c b/sys/dev/acpi/acpicpu.c
index fc8d36a9108..ea61ca24615 100644
--- a/sys/dev/acpi/acpicpu.c
+++ b/sys/dev/acpi/acpicpu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpicpu.c,v 1.74 2016/03/17 13:18:47 mpi Exp $ */
+/* $OpenBSD: acpicpu.c,v 1.75 2016/07/28 21:57:56 kettenis Exp $ */
/*
* Copyright (c) 2005 Marco Peereboom <marco@openbsd.org>
* Copyright (c) 2015 Philip Guenther <guenther@openbsd.org>
@@ -675,7 +675,7 @@ acpicpu_attach(struct device *parent, struct device *self, void *aux)
/* link in the matching cpu_info */
CPU_INFO_FOREACH(cii, ci)
- if (ci->ci_cpuid == sc->sc_dev.dv_unit) {
+ if (ci->ci_acpi_proc_id == sc->sc_cpu) {
ci->ci_acpicpudev = self;
sc->sc_ci = ci;
break;
diff --git a/sys/dev/acpi/acpimadt.c b/sys/dev/acpi/acpimadt.c
index 7c3ce723cf9..4d67501b700 100644
--- a/sys/dev/acpi/acpimadt.c
+++ b/sys/dev/acpi/acpimadt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpimadt.c,v 1.34 2016/07/10 20:41:19 kettenis Exp $ */
+/* $OpenBSD: acpimadt.c,v 1.35 2016/07/28 21:57:56 kettenis Exp $ */
/*
* Copyright (c) 2006 Mark Kettenis <kettenis@openbsd.org>
*
@@ -40,8 +40,6 @@
#include "ioapic.h"
-u_int8_t acpi_lapic_flags[LAPIC_MAP_SIZE];
-
int acpimadt_match(struct device *, void *, void *);
void acpimadt_attach(struct device *, struct device *, void *);
@@ -244,8 +242,6 @@ acpimadt_attach(struct device *parent, struct device *self, void *aux)
lapic_map[entry->madt_lapic.acpi_proc_id] =
entry->madt_lapic.apic_id;
- acpi_lapic_flags[entry->madt_lapic.acpi_proc_id] =
- entry->madt_lapic.flags;
memset(&caa, 0, sizeof(struct cpu_attach_args));
if (lapic_cpu_number() == entry->madt_lapic.apic_id)
@@ -255,7 +251,8 @@ acpimadt_attach(struct device *parent, struct device *self, void *aux)
ncpusfound++;
}
caa.caa_name = "cpu";
- caa.cpu_number = entry->madt_lapic.apic_id;
+ caa.cpu_apicid = entry->madt_lapic.apic_id;
+ caa.cpu_acpi_proc_id = entry->madt_lapic.acpi_proc_id;
#ifdef MULTIPROCESSOR
caa.cpu_func = &mp_cpu_funcs;
#endif
@@ -308,7 +305,8 @@ acpimadt_attach(struct device *parent, struct device *self, void *aux)
ncpusfound++;
}
caa.caa_name = "cpu";
- caa.cpu_number = entry->madt_x2apic.apic_id;
+ caa.cpu_apicid = entry->madt_x2apic.apic_id;
+ caa.cpu_acpi_proc_id = entry->madt_x2apic.acpi_proc_uid;
#ifdef MULTIPROCESSOR
caa.cpu_func = &mp_cpu_funcs;
#endif
diff --git a/sys/dev/acpi/acpivar.h b/sys/dev/acpi/acpivar.h
index 6b84fe1f1a6..aaf35fa030c 100644
--- a/sys/dev/acpi/acpivar.h
+++ b/sys/dev/acpi/acpivar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpivar.h,v 1.82 2016/01/12 01:11:15 jcs Exp $ */
+/* $OpenBSD: acpivar.h,v 1.83 2016/07/28 21:57:56 kettenis Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
*
@@ -41,9 +41,6 @@ extern int acpi_debug;
extern int acpi_hasprocfvs;
-#define LAPIC_MAP_SIZE 256
-extern u_int8_t acpi_lapic_flags[LAPIC_MAP_SIZE];
-
struct klist;
struct acpiec_softc;
struct acpipwrres_softc;