From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35445) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YhqbR-0005LD-JX for qemu-devel@nongnu.org; Mon, 13 Apr 2015 22:29:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YhqbO-00075L-D4 for qemu-devel@nongnu.org; Mon, 13 Apr 2015 22:29:29 -0400 Received: from szxga01-in.huawei.com ([58.251.152.64]:12030) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YhqbN-00073n-Kx for qemu-devel@nongnu.org; Mon, 13 Apr 2015 22:29:26 -0400 Message-ID: <552C7AA9.1030008@huawei.com> Date: Tue, 14 Apr 2015 10:25:45 +0800 From: Shannon Zhao MIME-Version: 1.0 References: <1428055432-12120-1-git-send-email-zhaoshenglong@huawei.com> <1428055432-12120-17-git-send-email-zhaoshenglong@huawei.com> <87sic4ja5a.fsf@linaro.org> In-Reply-To: <87sic4ja5a.fsf@linaro.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH v4 16/20] hw/acpi/aml-build: Add aml_else() term List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?QWxleCBCZW5uw6ll?= Cc: peter.maydell@linaro.org, hangaohuai@huawei.com, mst@redhat.com, a.spyridakis@virtualopensystems.com, msalter@redhat.com, claudio.fontana@huawei.com, qemu-devel@nongnu.org, peter.huangpeng@huawei.com, hanjun.guo@linaro.org, imammedo@redhat.com, pbonzini@redhat.com, lersek@redhat.com, christoffer.dall@linaro.org, shannon.zhao@linaro.org On 2015/4/13 23:55, Alex Bennée wrote: > > Shannon Zhao writes: > >> From: Shannon Zhao >> >> Signed-off-by: Shannon Zhao >> Signed-off-by: Shannon Zhao > > I was considering if the magic numbers should be defined somewhere but I > guess that is the point of the stub functions. > Yes, I think so. We can add another patch to do this. > Reviewed-by: Alex Bennée > > >> --- >> hw/acpi/aml-build.c | 7 +++++++ >> include/hw/acpi/aml-build.h | 1 + >> 2 files changed, 8 insertions(+) >> >> diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c >> index 4f936f7..9b8b422 100644 >> --- a/hw/acpi/aml-build.c >> +++ b/hw/acpi/aml-build.c >> @@ -626,6 +626,13 @@ Aml *aml_if(Aml *predicate) >> return var; >> } >> >> +/* ACPI 1.0: 16.2.3 Operators: DefElse */ >> +Aml *aml_else(void) >> +{ >> + Aml *var = aml_bundle(0xA1 /* ElseOp */, AML_PACKAGE); >> + return var; >> +} >> + >> /* ACPI 1.0b: 16.2.5.2 Named Objects Encoding: DefMethod */ >> Aml *aml_method(const char *name, int arg_count) >> { >> diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h >> index 6b407d5..3901515 100644 >> --- a/include/hw/acpi/aml-build.h >> +++ b/include/hw/acpi/aml-build.h >> @@ -206,6 +206,7 @@ Aml *aml_scope(const char *name_format, ...) GCC_FMT_ATTR(1, 2); >> Aml *aml_device(const char *name_format, ...) GCC_FMT_ATTR(1, 2); >> Aml *aml_method(const char *name, int arg_count); >> Aml *aml_if(Aml *predicate); >> +Aml *aml_else(void); >> Aml *aml_package(uint8_t num_elements); >> Aml *aml_buffer(void); >> Aml *aml_resource_template(void); >