diff options
author | tobhe <tobhe@cvs.openbsd.org> | 2021-03-10 22:20:45 +0000 |
---|---|---|
committer | tobhe <tobhe@cvs.openbsd.org> | 2021-03-10 22:20:45 +0000 |
commit | 10f39f7895242e0acfef1acfeb6243be35acaa42 (patch) | |
tree | 19d97bea3298ec0125d3022bdb3f5bac8171f4cb /sys | |
parent | 2f18b321e836d9897be1c0a87a0e6765eba09f85 (diff) |
Handle named references in acpi_getdevlist(). Fixes a regression in acpitz
caused by the reference handling change from December.
ok kettenis@ patrick@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/acpi/dsdt.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/dev/acpi/dsdt.c b/sys/dev/acpi/dsdt.c index ac0e4323653..e44f449dc12 100644 --- a/sys/dev/acpi/dsdt.c +++ b/sys/dev/acpi/dsdt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dsdt.c,v 1.259 2021/03/10 21:49:55 patrick Exp $ */ +/* $OpenBSD: dsdt.c,v 1.260 2021/03/10 22:20:44 tobhe Exp $ */ /* * Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org> * @@ -4619,10 +4619,20 @@ acpi_getdevlist(struct acpi_devlist_head *list, struct aml_node *root, { struct acpi_devlist *dl; struct aml_value *val; + struct aml_node *node; int idx; for (idx = off; idx < pkg->length; idx++) { val = pkg->v_package[idx]; + if (val->type == AML_OBJTYPE_NAMEREF) { + node = aml_searchrel(root, aml_getname(val->v_nameref)); + if (node == NULL) { + printf("%s: device %s not found\n", __func__, + aml_getname(val->v_nameref)); + continue; + } + val = node->value; + } if (val->type == AML_OBJTYPE_OBJREF) val = val->v_objref.ref; if (val->node) { |