Signed-off-by: Igor Mammedov <imamm...@redhat.com> --- hw/acpi/acpi_gen_utils.c | 11 +++++++++++ include/hw/acpi/acpi_gen_utils.h | 1 + 2 files changed, 12 insertions(+)
diff --git a/hw/acpi/acpi_gen_utils.c b/hw/acpi/acpi_gen_utils.c index 606efcd..8a37bac 100644 --- a/hw/acpi/acpi_gen_utils.c +++ b/hw/acpi/acpi_gen_utils.c @@ -280,6 +280,17 @@ static AcpiAml aml_allocate_internal(uint8_t op, AcpiBlockFlags flags) } /* + * ACPI 5.0: 20.2.3 Data Objects Encoding: + * encodes: ByteConst, WordConst, DWordConst, QWordConst, ZeroOp, OneOp + */ +AcpiAml acpi_int(const uint64_t val) +{ + AcpiAml var = aml_allocate_internal(0, NON_BLOCK); + build_append_int(var.buf, val); + return var; +} + +/* * help to construct NameString, which return AcpiAml object * for using with other aml_append or other acpi_* terms */ diff --git a/include/hw/acpi/acpi_gen_utils.h b/include/hw/acpi/acpi_gen_utils.h index d21e107..2ea53f9 100644 --- a/include/hw/acpi/acpi_gen_utils.h +++ b/include/hw/acpi/acpi_gen_utils.h @@ -22,6 +22,7 @@ typedef struct AcpiAml { void aml_append(AcpiAml *parent_ctx, AcpiAml child); /* non block ASL object primitives */ +AcpiAml acpi_int(const uint64_t val); AcpiAml GCC_FMT_ATTR(1, 2) acpi_name(const char *name_format, ...); AcpiAml acpi_name_decl(const char *name, AcpiAml val); /* Block ASL object primitives */ -- 1.8.3.1