From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42527) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZnrJI-0006xp-LW for qemu-devel@nongnu.org; Sun, 18 Oct 2015 12:59:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZnrJH-00009i-D9 for qemu-devel@nongnu.org; Sun, 18 Oct 2015 12:59:52 -0400 Received: from mga09.intel.com ([134.134.136.24]:16793) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZnrJH-00008u-7m for qemu-devel@nongnu.org; Sun, 18 Oct 2015 12:59:51 -0400 From: Xiao Guangrong Date: Mon, 19 Oct 2015 08:53:50 +0800 Message-Id: <1445216059-88521-5-git-send-email-guangrong.xiao@linux.intel.com> In-Reply-To: <1445216059-88521-1-git-send-email-guangrong.xiao@linux.intel.com> References: <1445216059-88521-1-git-send-email-guangrong.xiao@linux.intel.com> Subject: [Qemu-devel] [PATCH v4 04/33] acpi: add aml_concatenate List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: pbonzini@redhat.com, imammedo@redhat.com Cc: Xiao Guangrong , ehabkost@redhat.com, kvm@vger.kernel.org, mst@redhat.com, gleb@kernel.org, mtosatti@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com, dan.j.williams@intel.com, rth@twiddle.net Implement Concatenate term which is used by NVDIMM _DSM method in later patch Signed-off-by: Xiao Guangrong --- hw/acpi/aml-build.c | 14 ++++++++++++++ include/hw/acpi/aml-build.h | 1 + 2 files changed, 15 insertions(+) diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index 9fe5e7b..efc06ab 100644 --- a/hw/acpi/aml-build.c +++ b/hw/acpi/aml-build.c @@ -1164,6 +1164,20 @@ Aml *aml_create_field(Aml *srcbuf, Aml *index, Aml *len, const char *name) return var; } +/* ACPI 1.0b: 16.2.5.4 Type 2 Opcodes Encoding: DefConcat */ +Aml *aml_concatenate(Aml *source1, Aml *source2, Aml *target) +{ + Aml *var = aml_opcode(0x73 /* ConcatOp */); + aml_append(var, source1); + aml_append(var, source2); + + if (target) { + aml_append(var, target); + } + + return var; +} + void build_header(GArray *linker, GArray *table_data, AcpiTableHeader *h, const char *sig, int len, uint8_t rev) diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h index 7e1c43b..325782d 100644 --- a/include/hw/acpi/aml-build.h +++ b/include/hw/acpi/aml-build.h @@ -277,6 +277,7 @@ Aml *aml_unicode(const char *str); Aml *aml_derefof(Aml *arg); Aml *aml_sizeof(Aml *arg); Aml *aml_create_field(Aml *srcbuf, Aml *index, Aml *len, const char *name); +Aml *aml_concatenate(Aml *source1, Aml *source2, Aml *target); void build_header(GArray *linker, GArray *table_data, -- 1.8.3.1