From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51295) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YKlzR-0003sP-HF for qemu-devel@nongnu.org; Mon, 09 Feb 2015 05:54:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YKlzN-0000as-0U for qemu-devel@nongnu.org; Mon, 09 Feb 2015 05:54:53 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42489) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YKlzM-0000aa-Pv for qemu-devel@nongnu.org; Mon, 09 Feb 2015 05:54:48 -0500 From: Igor Mammedov Date: Mon, 9 Feb 2015 10:53:37 +0000 Message-Id: <1423479254-15342-16-git-send-email-imammedo@redhat.com> In-Reply-To: <1423479254-15342-1-git-send-email-imammedo@redhat.com> References: <1423479254-15342-1-git-send-email-imammedo@redhat.com> Subject: [Qemu-devel] [PATCH v3 15/52] acpi: add aml_return() term List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: drjones@redhat.com, marcel.a@redhat.com, claudio.fontana@huawei.com, mst@redhat.com, zhaoshenglong@huawei.com Signed-off-by: Igor Mammedov --- hw/acpi/aml-build.c | 8 ++++++++ include/hw/acpi/aml-build.h | 1 + 2 files changed, 9 insertions(+) diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index de775e2..2a29c8f 100644 --- a/hw/acpi/aml-build.c +++ b/hw/acpi/aml-build.c @@ -395,6 +395,14 @@ Aml *aml_def_block(const char *signature, uint8_t revision, return var; } +/* ACPI 1.0b: 16.2.5.3 Type 1 Opcodes Encoding: DefReturn */ +Aml *aml_return(Aml *val) +{ + Aml *var = aml_opcode(0xA4 /* ReturnOp */); + aml_append(var, val); + return var; +} + /* * ACPI 1.0b: 16.2.3 Data Objects Encoding: * encodes: ByteConst, WordConst, DWordConst, QWordConst, ZeroOp, OneOp diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h index 31225c6..8d35751 100644 --- a/include/hw/acpi/aml-build.h +++ b/include/hw/acpi/aml-build.h @@ -72,6 +72,7 @@ void aml_append(Aml *parent_ctx, Aml *child); /* non block AML object primitives */ Aml *aml_name(const char *name_format, ...) GCC_FMT_ATTR(1, 2); Aml *aml_name_decl(const char *name, Aml *val); +Aml *aml_return(Aml *val); Aml *aml_int(const uint64_t val); /* Block AML object primitives */ -- 1.8.3.1