diff options
author | Vladimir Serbinenko <phcoder@gmail.com> | 2014-11-02 21:51:22 +0100 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2014-11-08 22:28:44 +0100 |
commit | 430363ace7338b9708feefb5917d667f1733944d (patch) | |
tree | c280928f6aaffb692355b946aaa1ba4b5cdced03 /src/arch/x86/boot | |
parent | 689ddf68323633ec96cf6455d8a323fb6f019503 (diff) |
acpigen: Add new function acpigen_pop_len
acpigen_patch_len doesn't really need its argument: length always includes
everything from length bytes to current pointer and never bytes before it.
Hence just infer all the info implicitly.
Argument is wrong in several places through the codebase but ACPI parsing
is lax enough to swallow incorrect SSDT. After this function is used throughout
the codebase, these issues will be fixed.
Change-Id: I9fa536a614c5595146a7a1cd71f2676d8a8d9c2f
Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
Reviewed-on: http://review.coreboot.org/7325
Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Tested-by: build bot (Jenkins)
Diffstat (limited to 'src/arch/x86/boot')
-rw-r--r-- | src/arch/x86/boot/acpigen.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/arch/x86/boot/acpigen.c b/src/arch/x86/boot/acpigen.c index 222a2db284..0689273b0a 100644 --- a/src/arch/x86/boot/acpigen.c +++ b/src/arch/x86/boot/acpigen.c @@ -57,6 +57,19 @@ void acpigen_patch_len(int len) } +void acpigen_pop_len(void) +{ + int len; + ASSERT(ltop > 0) + char *p = len_stack[--ltop]; + len = gencurrent - p; + ASSERT(len <= ACPIGEN_MAXLEN) + /* generate store length for 0xfff max */ + p[0] = (0x40 | (len & 0xf)); + p[1] = (len >> 4 & 0xff); + +} + void acpigen_set_current(char *curr) { gencurrent = curr; |