From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56305) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YgTvo-0002uV-08 for qemu-devel@nongnu.org; Fri, 10 Apr 2015 04:04:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YgTvj-0003Ii-Kj for qemu-devel@nongnu.org; Fri, 10 Apr 2015 04:04:51 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:15294) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YgTvj-0003I3-1l for qemu-devel@nongnu.org; Fri, 10 Apr 2015 04:04:47 -0400 Message-ID: <55278401.8000305@huawei.com> Date: Fri, 10 Apr 2015 16:04:17 +0800 From: Shannon Zhao MIME-Version: 1.0 References: <1428055432-12120-1-git-send-email-zhaoshenglong@huawei.com> <1428055432-12120-15-git-send-email-zhaoshenglong@huawei.com> <20150409153554.4b46b9ef@nial.brq.redhat.com> <55276A84.5060004@huawei.com> <20150410094630.3b7423d5@igors-macbook-pro.local> In-Reply-To: <20150410094630.3b7423d5@igors-macbook-pro.local> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v4 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, hanjun.guo@linaro.org, msalter@redhat.com, pbonzini@redhat.com, lersek@redhat.com, christoffer.dall@linaro.org, shannon.zhao@linaro.org On 2015/4/10 15:46, Igor Mammedov wrote: > On Fri, 10 Apr 2015 14:15:32 +0800 > Shannon Zhao wrote: > >> > On 2015/4/9 21:35, Igor Mammedov wrote: >>> > > On Fri, 3 Apr 2015 18:03:46 +0800 >>> > > Shannon Zhao wrote: >>> > > >>>>> > >> > From: Shannon Zhao >>>>> > >> > >>>>> > >> > Add aml_or() term and make aml_and can take three args. >>>>> > >> > 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 | 24 +++++++++++++++++++++--- >>>>> > >> > hw/i386/acpi-build.c | 2 +- >>>>> > >> > include/hw/acpi/aml-build.h | 4 +++- >>>>> > >> > 3 files changed, 25 insertions(+), 5 deletions(-) >>>>> > >> > >>>>> > >> > diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c >>>>> > >> > index 5a94fc9..312afb6 100644 >>>>> > >> > --- a/hw/acpi/aml-build.c >>>>> > >> > +++ b/hw/acpi/aml-build.c >>>>> > >> > @@ -240,7 +240,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; >>>>> > >> > >>>>> > >> > @@ -445,12 +445,30 @@ Aml *aml_store(Aml *val, Aml *target) >>>>> > >> > } >>>>> > >> > >>>>> > >> > /* ACPI 1.0b: 16.2.5.4 Type 2 Opcodes Encoding: DefAnd */ >>>>> > >> > -Aml *aml_and(Aml *arg1, Aml *arg2) >>>>> > >> > +Aml *aml_and(Aml *arg1, Aml *arg2, Aml *arg3) >>> > > I know that it's possible to Store inside of And(a, b, save_here) >>> > > ASL op, but could you instead rewrite it to >>> > > >>> > > Store(And(a, b), save_here) >>> > > >>> > > so it wouldn't clatter trivial And(a,b) uses and drop this hunk. >>> > > >> > Yes, we can use Store(And(a, b), save_here) but according to the SPEC >> > the And op can have 3 args. We don't support it? > I don't think that we should do it if it could be implemented > using 2 already existing API calls to keep it simple and not to > pollute code with extra ", NULL" argument in most cases. Ok, will replace that.