From baf974407209ab084a5bf4aa12e00d6a99cca61d Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Tue, 16 Jun 2015 11:48:35 +0200 Subject: [PATCH 073/217] hw/acpi/aml-build: Add aml_else() term MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-id: <1434455325-23399-24-git-send-email-drjones@redhat.com> Patchwork-id: 66253 O-Subject: [AArch64 RHEL-7.2 qemu-kvm-rhev PATCH 23/33] hw/acpi/aml-build: Add aml_else() term Bugzilla: 1231719 RH-Acked-by: Miroslav Rezanina RH-Acked-by: Wei Huang RH-Acked-by: Igor Mammedov RH-Acked-by: Laszlo Ersek Author: Shannon Zhao Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao Reviewed-by: Alex Bennée Reviewed-by: Igor Mammedov Reviewed-by: Michael S. Tsirkin Message-id: 1432522520-8068-19-git-send-email-zhaoshenglong@huawei.com Signed-off-by: Peter Maydell (cherry picked from commit 467b07dfae6087381d0993ab910253a6c1850457) Signed-off-by: Andrew Jones Signed-off-by: Miroslav Rezanina --- hw/acpi/aml-build.c | 7 +++++++ include/hw/acpi/aml-build.h | 1 + 2 files changed, 8 insertions(+) diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index e925fd9..3b06349 100644 --- a/hw/acpi/aml-build.c +++ b/hw/acpi/aml-build.c @@ -633,6 +633,13 @@ Aml *aml_if(Aml *predicate) return var; } +/* ACPI 1.0b: 16.2.5.3 Type 1 Opcodes Encoding: DefElse */ +Aml *aml_else(void) +{ + Aml *var = aml_bundle(0xA1 /* ElseOp */, AML_PACKAGE); + return var; +} + /* ACPI 1.0b: 16.2.5.2 Named Objects Encoding: DefMethod */ Aml *aml_method(const char *name, int arg_count) { diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h index fdc5f4a..356484a 100644 --- a/include/hw/acpi/aml-build.h +++ b/include/hw/acpi/aml-build.h @@ -254,6 +254,7 @@ Aml *aml_scope(const char *name_format, ...) GCC_FMT_ATTR(1, 2); Aml *aml_device(const char *name_format, ...) GCC_FMT_ATTR(1, 2); Aml *aml_method(const char *name, int arg_count); Aml *aml_if(Aml *predicate); +Aml *aml_else(void); Aml *aml_package(uint8_t num_elements); Aml *aml_buffer(int buffer_size, uint8_t *byte_list); Aml *aml_resource_template(void); -- 1.8.3.1