[coreboot-gerrit] Patch set updated for coreboot: 93f0615 acpigen: Add new function acpigen_pop_len
Vladimir Serbinenko (phcoder@gmail.com)
gerrit at coreboot.org
Tue Nov 4 22:23:04 CET 2014
Vladimir Serbinenko (phcoder at gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/7325
-gerrit
commit 93f0615c79f6888458c475944d99b9dd817d0f76
Author: Vladimir Serbinenko <phcoder at gmail.com>
Date: Sun Nov 2 21:51:22 2014 +0100
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 at gmail.com>
---
src/arch/x86/boot/acpigen.c | 13 +++++++++++++
src/arch/x86/include/arch/acpigen.h | 1 +
2 files changed, 14 insertions(+)
diff --git a/src/arch/x86/boot/acpigen.c b/src/arch/x86/boot/acpigen.c
index 222a2db..0689273 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;
diff --git a/src/arch/x86/include/arch/acpigen.h b/src/arch/x86/include/arch/acpigen.h
index 3217dbe..d9df5d0 100644
--- a/src/arch/x86/include/arch/acpigen.h
+++ b/src/arch/x86/include/arch/acpigen.h
@@ -27,6 +27,7 @@
int acpigen_write_len_f(void);
void acpigen_patch_len(int len);
+void acpigen_pop_len(void);
void acpigen_set_current(char *curr);
char *acpigen_get_current(void);
int acpigen_write_package(int nr_el);
More information about the coreboot-gerrit
mailing list