diff options
author | Simon Glass <sjg@chromium.org> | 2020-07-07 13:11:52 -0600 |
---|---|---|
committer | Bin Meng <bmeng.cn@gmail.com> | 2020-07-17 14:32:24 +0800 |
commit | 83b2bd5a74a4a07a738ba039afc3028d8df2f97d (patch) | |
tree | c5f57ccdad2b04017ede514165076a493e61ade3 /include/acpi/acpigen.h | |
parent | 03967ce2e5e4332edd1e023360707a1086f42242 (diff) |
acpi: Support writing an integer
ACPI supports storing integers in various ways. Add a function to handle
this.
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/acpi/acpigen.h')
-rw-r--r-- | include/acpi/acpigen.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/acpi/acpigen.h b/include/acpi/acpigen.h index c1a6bc263c..9e52ec589f 100644 --- a/include/acpi/acpigen.h +++ b/include/acpi/acpigen.h @@ -19,6 +19,12 @@ struct acpi_ctx; /* ACPI Op/Prefix codes */ enum { + ZERO_OP = 0x00, + ONE_OP = 0x01, + BYTE_PREFIX = 0x0a, + WORD_PREFIX = 0x0b, + DWORD_PREFIX = 0x0c, + QWORD_PREFIX = 0x0e, PACKAGE_OP = 0x12, }; @@ -138,4 +144,15 @@ void acpigen_pop_len(struct acpi_ctx *ctx); */ char *acpigen_write_package(struct acpi_ctx *ctx, int nr_el); +/** + * acpigen_write_integer() - Write an integer + * + * This writes an operation (BYTE_OP, WORD_OP, DWORD_OP, QWORD_OP depending on + * the integer size) and an integer value. Note that WORD means 16 bits in ACPI. + * + * @ctx: ACPI context pointer + * @data: Integer to write + */ +void acpigen_write_integer(struct acpi_ctx *ctx, u64 data); + #endif |