@@ -365,6 +365,17 @@ AcpiAml acpi_store(AcpiAml val, AcpiAml target)
return var;
}
+/* ACPI 5.0: 20.2.5.4 Type 2 Opcodes Encoding: DefAnd */
+AcpiAml acpi_and(AcpiAml arg1, AcpiAml arg2)
+{
+ AcpiAml var = aml_allocate_internal(0, NON_BLOCK);
+ build_append_byte(var.buf, 0x7B); /* AndOp */
+ aml_append(&var, arg1);
+ aml_append(&var, arg2);
+ build_append_int(var.buf, 0x00); /* NullNameOp */
+ return var;
+}
+
/* ACPI 5.0: 20.2.5.3 Type 1 Opcodes Encoding: DefIfElse */
AcpiAml acpi_if(AcpiAml predicate)
{
@@ -31,6 +31,7 @@ AcpiAml acpi_arg1(void);
AcpiAml acpi_arg2(void);
AcpiAml acpi_arg3(void);
AcpiAml acpi_store(AcpiAml val, AcpiAml target);
+AcpiAml acpi_and(AcpiAml arg1, AcpiAml arg2);
/* Block ASL object primitives */
AcpiAml acpi_if(AcpiAml predicate);
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(+)