@@ -299,3 +299,14 @@ AcpiAml GCC_FMT_ATTR(1, 2) acpi_scope(const char *name_format, ...)
va_end(ap);
return var;
}
+
+/* ACPI 5.0: 20.2.5.2 Named Objects Encoding: DefDevice */
+AcpiAml GCC_FMT_ATTR(1, 2) acpi_device(const char *name_format, ...)
+{
+ va_list ap;
+ AcpiAml var = aml_allocate_internal(0x82 /* DeviceOp */, EXT_PACKAGE);
+ va_start(ap, name_format);
+ build_append_namestringv(var.buf, name_format, ap);
+ va_end(ap);
+ return var;
+}
@@ -23,6 +23,7 @@ void aml_append(AcpiAml *parent_ctx, AcpiAml child);
/* Block ASL object primitives */
AcpiAml GCC_FMT_ATTR(1, 2) acpi_scope(const char *name_format, ...);
+AcpiAml GCC_FMT_ATTR(1, 2) acpi_device(const char *name_format, ...);
/* other helpers */
GArray *build_alloc_array(void);
Signed-off-by: Igor Mammedov <imammedo@redhat.com> --- hw/acpi/acpi_gen_utils.c | 11 +++++++++++ include/hw/acpi/acpi_gen_utils.h | 1 + 2 files changed, 12 insertions(+)