summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjmatthew <jmatthew@openbsd.org>2020-08-10 04:11:48 +0000
committerjmatthew <jmatthew@openbsd.org>2020-08-10 04:11:48 +0000
commitc03004a5ea9cdabe3e79909338a7410a207192fa (patch)
treeba1202c0458467c499d75f80898fb92795d7ff25
parentadd the ability to filter which kstats are displayed. (diff)
downloadwireguard-openbsd-c03004a5ea9cdabe3e79909338a7410a207192fa.tar.xz
wireguard-openbsd-c03004a5ea9cdabe3e79909338a7410a207192fa.zip
Remove the acpicpu_sc array and instead locate acpicpu instances using
the ci_acpicpudev pointer in struct cpu_info. This simplifies matters when we have lots of cpus. ok kettenis@
-rw-r--r--sys/dev/acpi/acpicpu.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/sys/dev/acpi/acpicpu.c b/sys/dev/acpi/acpicpu.c
index ba806663a06..e3aaaa52fde 100644
--- a/sys/dev/acpi/acpicpu.c
+++ b/sys/dev/acpi/acpicpu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpicpu.c,v 1.85 2020/05/27 05:02:21 jsg Exp $ */
+/* $OpenBSD: acpicpu.c,v 1.86 2020/08/10 04:11:48 jmatthew Exp $ */
/*
* Copyright (c) 2005 Marco Peereboom <marco@openbsd.org>
* Copyright (c) 2015 Philip Guenther <guenther@openbsd.org>
@@ -188,8 +188,6 @@ struct cfdriver acpicpu_cd = {
extern int setperf_prio;
-struct acpicpu_softc *acpicpu_sc[MAXCPUS];
-
#if 0
void
acpicpu_set_throttle(struct acpicpu_softc *sc, int level)
@@ -672,7 +670,6 @@ acpicpu_attach(struct device *parent, struct device *self, void *aux)
sc->sc_acpi = (struct acpi_softc *)parent;
sc->sc_devnode = aa->aaa_node;
- acpicpu_sc[sc->sc_dev.dv_unit] = sc;
SLIST_INIT(&sc->sc_cstates);
@@ -979,7 +976,7 @@ acpicpu_fetch_pss(struct acpicpu_pss **pss)
* the bios ensures this...
*/
- sc = acpicpu_sc[0];
+ sc = (struct acpicpu_softc *)cpu_info_primary.ci_acpicpudev;
if (!sc)
return 0;
*pss = sc->sc_pss;
@@ -1024,7 +1021,7 @@ acpicpu_set_notify(void (*func)(struct acpicpu_pss *, int))
{
struct acpicpu_softc *sc;
- sc = acpicpu_sc[0];
+ sc = (struct acpicpu_softc *)cpu_info_primary.ci_acpicpudev;
if (sc != NULL)
sc->sc_notify = func;
}
@@ -1034,7 +1031,7 @@ acpicpu_setperf_ppc_change(struct acpicpu_pss *pss, int npss)
{
struct acpicpu_softc *sc;
- sc = acpicpu_sc[0];
+ sc = (struct acpicpu_softc *)cpu_info_primary.ci_acpicpudev;
if (sc != NULL)
cpu_setperf(sc->sc_level);
@@ -1048,7 +1045,7 @@ acpicpu_setperf(int level)
int idx, len;
uint32_t status = 0;
- sc = acpicpu_sc[cpu_number()];
+ sc = (struct acpicpu_softc *)curcpu()->ci_acpicpudev;
dnprintf(10, "%s: acpicpu setperf level %d\n",
sc->sc_devnode->name, level);