summaryrefslogtreecommitdiff
path: root/sys/dev/acpi
diff options
context:
space:
mode:
authorJordan Hargrave <jordan@cvs.openbsd.org>2008-02-05 21:15:27 +0000
committerJordan Hargrave <jordan@cvs.openbsd.org>2008-02-05 21:15:27 +0000
commitc3fa30528edf8e121d2592dfb3b87d963ac515b6 (patch)
treeb5f249b769d528b789b6ecc0ad9697407de9af43 /sys/dev/acpi
parent9104e8625d481591ba077a7a5595c44b57fac9e6 (diff)
Added change for debugging setbufint
ok marco@
Diffstat (limited to 'sys/dev/acpi')
-rw-r--r--sys/dev/acpi/dsdt.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/sys/dev/acpi/dsdt.c b/sys/dev/acpi/dsdt.c
index 4ae31c65961..2cf71410723 100644
--- a/sys/dev/acpi/dsdt.c
+++ b/sys/dev/acpi/dsdt.c
@@ -1,4 +1,5 @@
-/* $OpenBSD: dsdt.c,v 1.107 2008/01/22 19:28:57 jordan Exp $ */
+
+/* $OpenBSD: dsdt.c,v 1.108 2008/02/05 21:15:26 jordan Exp $ */
/*
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
*
@@ -980,9 +981,10 @@ void
aml_setbufint(struct aml_value *dst, int bitpos, int bitlen,
struct aml_value *src)
{
- if (src->type != AML_OBJTYPE_BUFFER)
+ if (src->type != AML_OBJTYPE_BUFFER) {
+ aml_showvalue(src, 0);
aml_die("wrong setbufint type %d\n", src->type);
-
+ }
#if 1
/* Return buffer type */
_aml_setvalue(dst, AML_OBJTYPE_BUFFER, (bitlen+7)>>3, NULL);
@@ -1633,10 +1635,16 @@ aml_setvalue(struct aml_scope *scope, struct aml_value *lhs,
struct aml_value tmpint;
/* Use integer as result */
+ memset(&tmpint, 0, sizeof(tmpint));
if (rhs == NULL) {
- memset(&tmpint, 0, sizeof(tmpint));
rhs = _aml_setvalue(&tmpint, AML_OBJTYPE_INTEGER, ival, NULL);
}
+ else if (rhs->type == AML_OBJTYPE_BUFFERFIELD ||
+ rhs->type == AML_OBJTYPE_FIELDUNIT)
+ {
+ aml_fieldio(scope, rhs, &tmpint, ACPI_IOREAD);
+ rhs = &tmpint;
+ }
if (!is_local(scope, lhs))
lhs = aml_dereftarget(scope, lhs);
@@ -1725,6 +1733,7 @@ aml_setvalue(struct aml_scope *scope, struct aml_value *lhs,
dnprintf(10, "setvalue.unknown: %x", lhs->type);
break;
}
+ aml_freevalue(&tmpint);
}
/* Allocate dynamic AML value