summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2020-08-26 17:10:50 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2020-08-26 17:10:50 +0000
commitac1a5974814c82ddfda00178a96287bf873af4da (patch)
tree3e3a61afafb5c3f9d0005519cbfbdbd41d332173
parent93a466a6bf1bec811a6d2be401129e5431a566ac (diff)
Let aml_copyvalue() handle AML_OBJTYPE_DEVICE.
ok jmatthew@
-rw-r--r--sys/dev/acpi/acpicpu.c15
-rw-r--r--sys/dev/acpi/dsdt.c4
2 files changed, 17 insertions, 2 deletions
diff --git a/sys/dev/acpi/acpicpu.c b/sys/dev/acpi/acpicpu.c
index e3aaaa52fde..7357c149ae4 100644
--- a/sys/dev/acpi/acpicpu.c
+++ b/sys/dev/acpi/acpicpu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpicpu.c,v 1.86 2020/08/10 04:11:48 jmatthew Exp $ */
+/* $OpenBSD: acpicpu.c,v 1.87 2020/08/26 17:10:49 kettenis Exp $ */
/*
* Copyright (c) 2005 Marco Peereboom <marco@openbsd.org>
* Copyright (c) 2015 Philip Guenther <guenther@openbsd.org>
@@ -186,6 +186,11 @@ struct cfdriver acpicpu_cd = {
NULL, "acpicpu", DV_DULL
};
+const char *acpicpu_hids[] = {
+ "ACPI0007",
+ NULL
+};
+
extern int setperf_prio;
#if 0
@@ -648,6 +653,9 @@ acpicpu_match(struct device *parent, void *match, void *aux)
struct acpi_attach_args *aa = aux;
struct cfdata *cf = match;
+ if (acpi_matchhids(aa, acpicpu_hids, cf->cf_driver->cd_name))
+ return (1);
+
/* sanity */
if (aa->aaa_name == NULL ||
strcmp(aa->aaa_name, cf->cf_driver->cd_name) != 0 ||
@@ -663,6 +671,7 @@ acpicpu_attach(struct device *parent, struct device *self, void *aux)
struct acpicpu_softc *sc = (struct acpicpu_softc *)self;
struct acpi_attach_args *aa = aux;
struct aml_value res;
+ int64_t uid;
int i;
uint32_t status = 0;
CPU_INFO_ITERATOR cii;
@@ -673,6 +682,10 @@ acpicpu_attach(struct device *parent, struct device *self, void *aux)
SLIST_INIT(&sc->sc_cstates);
+ if (aml_evalinteger(sc->sc_acpi, sc->sc_devnode,
+ "_UID", 0, NULL, &uid) == 0)
+ sc->sc_cpu = uid;
+
if (aml_evalnode(sc->sc_acpi, sc->sc_devnode, 0, NULL, &res) == 0) {
if (res.type == AML_OBJTYPE_PROCESSOR) {
sc->sc_cpu = res.v_processor.proc_id;
diff --git a/sys/dev/acpi/dsdt.c b/sys/dev/acpi/dsdt.c
index 3c6bf6ff1db..2c265eef35f 100644
--- a/sys/dev/acpi/dsdt.c
+++ b/sys/dev/acpi/dsdt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dsdt.c,v 1.253 2020/08/26 03:29:06 visa Exp $ */
+/* $OpenBSD: dsdt.c,v 1.254 2020/08/26 17:10:49 kettenis Exp $ */
/*
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
*
@@ -994,6 +994,8 @@ aml_copyvalue(struct aml_value *lhs, struct aml_value *rhs)
lhs->v_objref = rhs->v_objref;
aml_addref(lhs->v_objref.ref, "");
break;
+ case AML_OBJTYPE_DEVICE:
+ break;
default:
printf("copyvalue: %x", rhs->type);
break;