From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55300) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNh6q-0007Qu-C0 for qemu-devel@nongnu.org; Tue, 17 Feb 2015 07:18:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YNh6n-0007XK-6u for qemu-devel@nongnu.org; Tue, 17 Feb 2015 07:18:36 -0500 Received: from mx1.redhat.com ([209.132.183.28]:49417) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNh6n-0007X2-00 for qemu-devel@nongnu.org; Tue, 17 Feb 2015 07:18:33 -0500 Date: Tue, 17 Feb 2015 13:18:19 +0100 From: "Michael S. Tsirkin" Message-ID: <20150217121819.GA6185@redhat.com> References: <1423479254-15342-1-git-send-email-imammedo@redhat.com> <1423479254-15342-32-git-send-email-imammedo@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1423479254-15342-32-git-send-email-imammedo@redhat.com> Subject: Re: [Qemu-devel] [PATCH v3 31/52] acpi: add aml_local() term List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov Cc: drjones@redhat.com, marcel.a@redhat.com, claudio.fontana@huawei.com, qemu-devel@nongnu.org, zhaoshenglong@huawei.com On Mon, Feb 09, 2015 at 10:53:53AM +0000, Igor Mammedov wrote: > Signed-off-by: Igor Mammedov > --- This causes asserts. > hw/acpi/aml-build.c | 11 +++++++++++ > include/hw/acpi/aml-build.h | 1 + > 2 files changed, 12 insertions(+) > > diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c > index 10995a9..cb58e19 100644 > --- a/hw/acpi/aml-build.c > +++ b/hw/acpi/aml-build.c > @@ -647,3 +647,14 @@ Aml *aml_field(const char *name, AmlFieldFlags flags) > build_append_byte(var->buf, flags); > return var; > } > + > +/* ACPI 1.0b: 16.2.6.2 Local Objects Encoding */ > +Aml *aml_local(int num) > +{ > + Aml *var; > + uint8_t op = 0x60 /* Local0Op */ + num; So op is 0x6X here. > + > + assert(op <= 7); And here we assert it is <= 7? > + var = aml_opcode(op); > + return var; > +} > diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h > index 8b954d9..6e25315 100644 > --- a/include/hw/acpi/aml-build.h > +++ b/include/hw/acpi/aml-build.h > @@ -101,6 +101,7 @@ Aml *aml_io(AmlIODecode dec, uint16_t min_base, uint16_t max_base, > Aml *aml_operation_region(const char *name, AmlRegionSpace rs, > uint32_t offset, uint32_t len); > Aml *aml_named_field(const char *name, unsigned length); > +Aml *aml_local(int num); > > /* Block AML object primitives */ > Aml *aml_def_block(const char *signature, uint8_t revision, > -- > 1.8.3.1