diff options
author | Simon Glass <sjg@chromium.org> | 2020-07-07 13:11:50 -0600 |
---|---|---|
committer | Bin Meng <bmeng.cn@gmail.com> | 2020-07-17 14:32:24 +0800 |
commit | 7e148f2ed365c89f50701ed45acd6e36138de447 (patch) | |
tree | ba5c7a575add711589a21a5b1b1527094e42c8ca /include/dm/acpi.h | |
parent | 70e5e67a4dc7cee0c69eaf9f5cc07b201a59cb59 (diff) | |
download | u-boot-7e148f2ed365c89f50701ed45acd6e36138de447.tar.gz |
acpigen: Support writing a length
It is convenient to write a length value for preceding a block of data.
Of course the length is not known or is hard to calculate a priori. So add
a way to mark the start on a stack, so the length can be updated when
known.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'include/dm/acpi.h')
-rw-r--r-- | include/dm/acpi.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/include/dm/acpi.h b/include/dm/acpi.h index 696b1a96a0..dfda88e493 100644 --- a/include/dm/acpi.h +++ b/include/dm/acpi.h @@ -16,12 +16,15 @@ #define ACPI_OPS_PTR(_ptr) #endif -/* Length of an ACPI name string, excluding nul terminator */ +/* Length of an ACPI name string, excluding null terminator */ #define ACPI_NAME_LEN 4 /* Length of an ACPI name string including nul terminator */ #define ACPI_NAME_MAX (ACPI_NAME_LEN + 1) +/* Number of nested objects supported */ +#define ACPIGEN_LENSTACK_SIZE 10 + #if !defined(__ACPI__) /** @@ -35,6 +38,8 @@ * adding a new table. The RSDP holds pointers to the RSDT and XSDT. * @rsdt: Pointer to the Root System Description Table * @xsdt: Pointer to the Extended System Description Table + * @len_stack: Stack of 'length' words to fix up later + * @ltop: Points to current top of stack (0 = empty) */ struct acpi_ctx { void *base; @@ -42,6 +47,8 @@ struct acpi_ctx { struct acpi_rsdp *rsdp; struct acpi_rsdt *rsdt; struct acpi_xsdt *xsdt; + char *len_stack[ACPIGEN_LENSTACK_SIZE]; + int ltop; }; /** |