diff options
author | 2011-06-08 05:38:28 +0000 | |
---|---|---|
committer | 2011-06-08 05:38:28 +0000 | |
commit | de178a3e429904ae815636241cbdeb86e18a13ad (patch) | |
tree | 6f78187218299f74a38e12e7884fddf90ef94ec7 | |
parent | bring in lots of improvements from kristaps@; (diff) | |
download | wireguard-openbsd-de178a3e429904ae815636241cbdeb86e18a13ad.tar.xz wireguard-openbsd-de178a3e429904ae815636241cbdeb86e18a13ad.zip |
Use static scope during AML disassembly, fixes splassert error
-rw-r--r-- | sys/dev/acpi/dsdt.c | 56 |
1 files changed, 30 insertions, 26 deletions
diff --git a/sys/dev/acpi/dsdt.c b/sys/dev/acpi/dsdt.c index fcd72f352f2..0910cc86673 100644 --- a/sys/dev/acpi/dsdt.c +++ b/sys/dev/acpi/dsdt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dsdt.c,v 1.189 2011/06/03 16:44:16 jordan Exp $ */ +/* $OpenBSD: dsdt.c,v 1.190 2011/06/08 05:38:28 jordan Exp $ */ /* * Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org> * @@ -2614,7 +2614,7 @@ aml_disasm(struct aml_scope *scope, int lvl, uint64_t ival; struct aml_value *rv, tmp; uint8_t *end = NULL; - struct aml_scope *ms; + struct aml_scope ms; char *ch; char mch[64]; @@ -2902,51 +2902,55 @@ aml_disasm(struct aml_scope *scope, int lvl, scope->pos = end; break; case 'F': - /* Field List */ - tmp.v_buffer = scope->pos; - tmp.length = end - scope->pos; - - ms = aml_pushscope(scope, &tmp, scope->node, 0); - while (ms && ms->pos < ms->end) { - if (*ms->pos == 0x00) { - ms->pos++; - aml_parselength(ms); - } else if (*ms->pos == 0x01) { - ms->pos+=3; + /* Scope: Field List */ + memset(&ms, 0, sizeof(ms)); + ms.node = scope->node; + ms.start = scope->pos; + ms.end = end; + ms.pos = ms.start; + ms.type = AMLOP_FIELD; + + while (ms.pos < ms.end) { + if (*ms.pos == 0x00) { + ms.pos++; + aml_parselength(&ms); + } else if (*ms.pos == 0x01) { + ms.pos+=3; } else { - ms->pos = aml_parsename(ms->node, - ms->pos, &rv, 1); - aml_parselength(ms); + ms.pos = aml_parsename(ms.node, + ms.pos, &rv, 1); + aml_parselength(&ms); dbprintf(arg," %s\n", aml_nodename(rv->node)); aml_delref(&rv, 0); } } - aml_popscope(ms); /* Display address and closing bracket */ dbprintf(arg,"%.4x ", aml_pc(scope->pos)); for (pc=0; pc<(lvl & 0x7FFF); pc++) { - dbprintf(arg," "); + dbprintf(arg," "); } scope->pos = end; break; case 'T': /* Scope: Termlist */ - tmp.v_buffer = scope->pos; - tmp.length = end - scope->pos; - - ms = aml_pushscope(scope, &tmp, scope->node, 0); - while (ms && ms->pos < ms->end) { - aml_disasm(ms, (lvl + 1) & 0x7FFF, + memset(&ms, 0, sizeof(ms)); + ms.node = scope->node; + ms.start = scope->pos; + ms.end = end; + ms.pos = ms.start; + ms.type = AMLOP_SCOPE; + + while (ms.pos < ms.end) { + aml_disasm(&ms, (lvl + 1) & 0x7FFF, dbprintf, arg); } - aml_popscope(ms); /* Display address and closing bracket */ dbprintf(arg,"%.4x ", aml_pc(scope->pos)); for (pc=0; pc<(lvl & 0x7FFF); pc++) { - dbprintf(arg," "); + dbprintf(arg," "); } scope->pos = end; break; |