From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36361) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ymzlo-0003x7-7N for qemu-devel@nongnu.org; Tue, 28 Apr 2015 03:17:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ymzli-0005kE-Fo for qemu-devel@nongnu.org; Tue, 28 Apr 2015 03:17:28 -0400 Received: from szxga01-in.huawei.com ([58.251.152.64]:9909) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ymzlh-0005e3-Jd for qemu-devel@nongnu.org; Tue, 28 Apr 2015 03:17:22 -0400 Message-ID: <553F32DA.9090908@huawei.com> Date: Tue, 28 Apr 2015 15:12:26 +0800 From: Shannon Zhao MIME-Version: 1.0 References: <1429104309-3844-1-git-send-email-zhaoshenglong@huawei.com> <1429104309-3844-15-git-send-email-zhaoshenglong@huawei.com> <20150428085625.2c8597cd@nial.brq.redhat.com> In-Reply-To: <20150428085625.2c8597cd@nial.brq.redhat.com> Content-Type: text/plain; charset="ISO-8859-1" 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: Igor Mammedov 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 2015/4/28 14:56, Igor Mammedov wrote: > 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 This will be used for adding elements to buffer like in ptach 19/20. + buf = aml_buffer(); + build_append_int_noprefix(buf->buf, 0x01, 1); > why it's related to this patch in particular? I should move this to another patch. -- Thanks, Shannon