@@ -305,6 +305,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
*/
@@ -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 */
Signed-off-by: Igor Mammedov <imammedo@redhat.com> --- hw/acpi/acpi-build-utils.c | 11 +++++++++++ include/hw/acpi/acpi-build-utils.h | 1 + 2 files changed, 12 insertions(+)