@@ -467,3 +467,11 @@ AcpiAml GCC_FMT_ATTR(1, 2) acpi_device(const char *name_format, ...)
va_end(ap);
return var;
}
+
+/* ACPI 5.0: 20.2.5.4 Type 2 Opcodes Encoding: DefPackage */
+AcpiAml acpi_package(uint8_t num_elements)
+{
+ AcpiAml var = aml_allocate_internal(0x12 /* PackageOp */, PACKAGE);
+ build_append_byte(var.buf, num_elements);
+ return var;
+}
@@ -45,6 +45,7 @@ AcpiAml acpi_if(AcpiAml predicate);
AcpiAml acpi_method(const char *name, int arg_count);
AcpiAml GCC_FMT_ATTR(1, 2) acpi_scope(const char *name_format, ...);
AcpiAml GCC_FMT_ATTR(1, 2) acpi_device(const char *name_format, ...);
+AcpiAml acpi_package(uint8_t num_elements);
/* other helpers */
GArray *build_alloc_array(void);
Signed-off-by: Igor Mammedov <imammedo@redhat.com> --- hw/acpi/acpi_gen_utils.c | 8 ++++++++ include/hw/acpi/acpi_gen_utils.h | 1 + 2 files changed, 9 insertions(+)