From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43805) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtUsV-00028k-IN for qemu-devel@nongnu.org; Tue, 03 Nov 2015 01:15:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZtUsS-0004ej-9m for qemu-devel@nongnu.org; Tue, 03 Nov 2015 01:15:31 -0500 Received: from szxga03-in.huawei.com ([119.145.14.66]:55287) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtUsR-0004eP-9l for qemu-devel@nongnu.org; Tue, 03 Nov 2015 01:15:28 -0500 Message-ID: <563850DF.3070003@huawei.com> Date: Tue, 3 Nov 2015 14:14:55 +0800 From: Shannon Zhao MIME-Version: 1.0 References: <1446455617-129562-1-git-send-email-guangrong.xiao@linux.intel.com> <1446455617-129562-4-git-send-email-guangrong.xiao@linux.intel.com> In-Reply-To: <1446455617-129562-4-git-send-email-guangrong.xiao@linux.intel.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v7 03/35] acpi: add aml_create_field List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Xiao Guangrong , pbonzini@redhat.com, imammedo@redhat.com Cc: vsementsov@virtuozzo.com, 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 On 2015/11/2 17:13, Xiao Guangrong wrote: > Implement CreateField term which is used by NVDIMM _DSM method in later patch > > Signed-off-by: Xiao Guangrong > --- > hw/acpi/aml-build.c | 13 +++++++++++++ > include/hw/acpi/aml-build.h | 1 + > 2 files changed, 14 insertions(+) > > diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c > index a72214d..9fe5e7b 100644 > --- a/hw/acpi/aml-build.c > +++ b/hw/acpi/aml-build.c > @@ -1151,6 +1151,19 @@ Aml *aml_sizeof(Aml *arg) > return var; > } > > +/* ACPI 1.0b: 16.2.5.2 Named Objects Encoding: DefCreateField */ > +Aml *aml_create_field(Aml *srcbuf, Aml *index, Aml *len, const char *name) > +{ > + Aml *var = aml_alloc(); > + build_append_byte(var->buf, 0x5B); /* ExtOpPrefix */ > + build_append_byte(var->buf, 0x13); /* CreateFieldOp */ > + aml_append(var, srcbuf); > + aml_append(var, index); > + aml_append(var, len); > + build_append_namestring(var->buf, "%s", name); > + 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 7296efb..7e1c43b 100644 > --- a/include/hw/acpi/aml-build.h > +++ b/include/hw/acpi/aml-build.h > @@ -276,6 +276,7 @@ Aml *aml_touuid(const char *uuid); > 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); > Maybe this could be moved together with existing aml_create_dword_field. > void > build_header(GArray *linker, GArray *table_data, > -- Shannon