Signed-off-by: Igor Mammedov <imamm...@redhat.com> --- hw/acpi/acpi-build-utils.c | 11 +++++++++++ include/hw/acpi/acpi-build-utils.h | 1 + 2 files changed, 12 insertions(+)
diff --git a/hw/acpi/acpi-build-utils.c b/hw/acpi/acpi-build-utils.c index d78d34f..a575ba1 100644 --- a/hw/acpi/acpi-build-utils.c +++ b/hw/acpi/acpi-build-utils.c @@ -390,6 +390,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) { diff --git a/include/hw/acpi/acpi-build-utils.h b/include/hw/acpi/acpi-build-utils.h index 5d3651d..50bb1aa 100644 --- a/include/hw/acpi/acpi-build-utils.h +++ b/include/hw/acpi/acpi-build-utils.h @@ -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); -- 1.8.3.1