diff options
author | Marco Peereboom <marco@cvs.openbsd.org> | 2008-06-04 18:20:10 +0000 |
---|---|---|
committer | Marco Peereboom <marco@cvs.openbsd.org> | 2008-06-04 18:20:10 +0000 |
commit | 8e4b93b0d63335923d0a9a19013170d078bcbd43 (patch) | |
tree | f1201bbe9b9ab663498d41f661e5f23bfbc9e43b /sys/dev/acpi | |
parent | b55c0630d80a07f15c4fdbe70aba714c2b5e3ac1 (diff) |
Fix panic on my i386 box when local variable isnt handled properly.
code from jordan
Diffstat (limited to 'sys/dev/acpi')
-rw-r--r-- | sys/dev/acpi/dsdt.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/sys/dev/acpi/dsdt.c b/sys/dev/acpi/dsdt.c index 7c24ff679c3..c2074744fd3 100644 --- a/sys/dev/acpi/dsdt.c +++ b/sys/dev/acpi/dsdt.c @@ -1,5 +1,5 @@ -/* $OpenBSD: dsdt.c,v 1.116 2008/06/01 17:59:55 marco Exp $ */ +/* $OpenBSD: dsdt.c,v 1.117 2008/06/04 18:20:09 marco Exp $ */ /* * Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org> * @@ -2940,6 +2940,10 @@ aml_xstore(struct aml_scope *scope, struct aml_value *lhs , int64_t ival, aml_xfldio(scope, rhs, &tmp, ACPI_IOREAD); rhs = &tmp; } + /* Store to LocalX: free value */ + if (lhs->stack >= AMLOP_LOCAL0 && lhs->stack <= AMLOP_LOCAL7) + aml_freevalue(lhs); + while (lhs->type == AML_OBJTYPE_OBJREF) { lhs = lhs->v_objref.ref; } @@ -3758,17 +3762,6 @@ aml_xparse(struct aml_scope *scope, int ret_type, const char *stype) case AMLOP_LOCAL7: my_ret = opargs[0]; aml_xaddref(my_ret, htab->mnem); - if (ret_type == AML_ARG_INTEGER) { - /* Return copy of integer value */ - aml_xconvert(my_ret, &my_ret, AML_OBJTYPE_INTEGER, 0); - ival = my_ret->v_integer; - aml_xdelref(&my_ret, "local.int"); - my_ret = NULL; - } - else if (ret_type == AML_ARG_TARGET) { - /* Store to LocalX: free object */ - aml_freevalue(my_ret); - } break; case AMLOP_ARG0: case AMLOP_ARG1: @@ -4369,6 +4362,7 @@ aml_xparse(struct aml_scope *scope, int ret_type, const char *stype) if (ret_type == 'i' && my_ret && my_ret->type != AML_OBJTYPE_INTEGER) { dnprintf(10,"quick: %.4x convert to integer %s -> %s\n", pc, htab->mnem, stype); + aml_xconvert(my_ret, &my_ret, AML_OBJTYPE_INTEGER, 0); } if (my_ret != NULL) { /* Display result */ |