From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60419) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YmzZk-0005Q1-T4 for qemu-devel@nongnu.org; Tue, 28 Apr 2015 03:05:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YmzRW-0003eC-E0 for qemu-devel@nongnu.org; Tue, 28 Apr 2015 02:57:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58223) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YmzRW-0003e2-74 for qemu-devel@nongnu.org; Tue, 28 Apr 2015 02:56:30 -0400 Date: Tue, 28 Apr 2015 08:56:25 +0200 From: Igor Mammedov Message-ID: <20150428085625.2c8597cd@nial.brq.redhat.com> In-Reply-To: <1429104309-3844-15-git-send-email-zhaoshenglong@huawei.com> References: <1429104309-3844-1-git-send-email-zhaoshenglong@huawei.com> <1429104309-3844-15-git-send-email-zhaoshenglong@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v5 14/20] hw/acpi/aml-build: Add aml_or() term List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Shannon Zhao Cc: peter.maydell@linaro.org, hangaohuai@huawei.com, mst@redhat.com, a.spyridakis@virtualopensystems.com, claudio.fontana@huawei.com, qemu-devel@nongnu.org, peter.huangpeng@huawei.com, alex.bennee@linaro.org, hanjun.guo@linaro.org, pbonzini@redhat.com, lersek@redhat.com, christoffer.dall@linaro.org, shannon.zhao@linaro.org On Wed, 15 Apr 2015 21:25:03 +0800 Shannon Zhao wrote: > From: Shannon Zhao > > Add aml_or() term and expose build_append_int_noprefix > as it wiil be used by creating a buffer. > > Signed-off-by: Shannon Zhao > Signed-off-by: Shannon Zhao > --- > hw/acpi/aml-build.c | 12 +++++++++++- > include/hw/acpi/aml-build.h | 2 ++ > 2 files changed, 13 insertions(+), 1 deletion(-) > > diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c > index 316d5a5..cd4ffe2 100644 > --- a/hw/acpi/aml-build.c > +++ b/hw/acpi/aml-build.c > @@ -242,7 +242,7 @@ static void build_extop_package(GArray *package, uint8_t op) > build_prepend_byte(package, 0x5B); /* ExtOpPrefix */ > } > > -static void build_append_int_noprefix(GArray *table, uint64_t value, int size) > +void build_append_int_noprefix(GArray *table, uint64_t value, int size) > { > int i; > > @@ -456,6 +456,16 @@ Aml *aml_and(Aml *arg1, Aml *arg2) > return var; > } > > +/* ACPI 1.0b: 16.2.5.4 Type 2 Opcodes Encoding: DefOr */ > +Aml *aml_or(Aml *arg1, Aml *arg2) > +{ > + Aml *var = aml_opcode(0x7D /* OrOp */); > + aml_append(var, arg1); > + aml_append(var, arg2); > + build_append_byte(var->buf, 0x00 /* NullNameOp */); > + return var; > +} > + > /* ACPI 1.0b: 16.2.5.3 Type 1 Opcodes Encoding: DefNotify */ > Aml *aml_notify(Aml *arg1, Aml *arg2) > { > diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h > index b41fd0c..61c1a03 100644 > --- a/include/hw/acpi/aml-build.h > +++ b/include/hw/acpi/aml-build.h > @@ -202,6 +202,7 @@ Aml *aml_int(const uint64_t val); > Aml *aml_arg(int pos); > Aml *aml_store(Aml *val, Aml *target); > Aml *aml_and(Aml *arg1, Aml *arg2); > +Aml *aml_or(Aml *arg1, Aml *arg2); > Aml *aml_notify(Aml *arg1, Aml *arg2); > Aml *aml_call1(const char *method, Aml *arg1); > Aml *aml_call2(const char *method, Aml *arg1, Aml *arg2); > @@ -260,6 +261,7 @@ Aml *aml_resource_template(void); > Aml *aml_field(const char *name, AmlFieldFlags flags); > Aml *aml_varpackage(uint32_t num_elements); > Aml *aml_touuid(const char *uuid); > +void build_append_int_noprefix(GArray *table, uint64_t value, int size); why does it exports internal function and why it's related to this patch in particular? > > void > build_header(GArray *linker, GArray *table_data,