diff options
author | Jordan Hargrave <jordan@cvs.openbsd.org> | 2006-10-30 18:37:08 +0000 |
---|---|---|
committer | Jordan Hargrave <jordan@cvs.openbsd.org> | 2006-10-30 18:37:08 +0000 |
commit | da033472ee4e779e4555283be5691cdbc43e546a (patch) | |
tree | 054af4228db20cea2251148ed7131af3590a525a /sys/dev/acpi | |
parent | 869425daac9da8dae605348c18173b4f1035ccbf (diff) |
Fix nameref -> objref for forward definition evaluator
ok marco@
Diffstat (limited to 'sys/dev/acpi')
-rw-r--r-- | sys/dev/acpi/dsdt.c | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/sys/dev/acpi/dsdt.c b/sys/dev/acpi/dsdt.c index 56a4cecb28a..3ee6bbe592b 100644 --- a/sys/dev/acpi/dsdt.c +++ b/sys/dev/acpi/dsdt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dsdt.c,v 1.60 2006/10/25 21:23:19 jordan Exp $ */ +/* $OpenBSD: dsdt.c,v 1.61 2006/10/30 18:37:07 jordan Exp $ */ /* * Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org> * @@ -1706,6 +1706,7 @@ aml_evalnode(struct acpi_softc *sc, struct aml_node *node, struct aml_value *res) { static int lastck; + struct aml_node *ref; if (res) memset(res, 0, sizeof(struct aml_value)); @@ -1737,6 +1738,14 @@ aml_evalnode(struct acpi_softc *sc, struct aml_node *node, if (res) aml_copyvalue(res, node->value); break; + case AML_OBJTYPE_NAMEREF: + if (res == NULL) + break; + if ((ref = aml_searchname(node, node->value->v_nameref)) != NULL) + _aml_setvalue(res, AML_OBJTYPE_OBJREF, -1, ref); + else + aml_copyvalue(res, node->value); + break; default: break; } @@ -1755,6 +1764,24 @@ aml_evalname(struct acpi_softc *sc, struct aml_node *parent, const char *name, return aml_evalnode(sc, aml_searchname(parent, name), argc, argv, res); } +int +aml_evalinteger(struct acpi_softc *sc, struct aml_node *parent, const char *name, + int argc, struct aml_value *argv, + int64_t *ival) +{ + struct aml_value res; + + if (name != NULL) { + parent = aml_searchname(parent, name); + } + if (aml_evalnode(sc, parent, argc, argv, &res) == 0) { + *ival = aml_val2int(&res); + aml_freevalue(&res); + return 0; + } + return 1; +} + void aml_walktree(struct aml_node *node) { |