From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52144) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNinw-0006Ue-Ld for qemu-devel@nongnu.org; Tue, 17 Feb 2015 09:07:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YNins-0001Bm-Ga for qemu-devel@nongnu.org; Tue, 17 Feb 2015 09:07:12 -0500 Received: from mx1.redhat.com ([209.132.183.28]:59220) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNins-0001BW-8V for qemu-devel@nongnu.org; Tue, 17 Feb 2015 09:07:08 -0500 Date: Tue, 17 Feb 2015 15:06:59 +0100 From: Igor Mammedov Message-ID: <20150217150659.38f08e1a@nial.brq.redhat.com> In-Reply-To: <20150217121819.GA6185@redhat.com> References: <1423479254-15342-1-git-send-email-imammedo@redhat.com> <1423479254-15342-32-git-send-email-imammedo@redhat.com> <20150217121819.GA6185@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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: "Michael S. Tsirkin" Cc: drjones@redhat.com, marcel.a@redhat.com, claudio.fontana@huawei.com, qemu-devel@nongnu.org, zhaoshenglong@huawei.com On Tue, 17 Feb 2015 13:18:19 +0100 "Michael S. Tsirkin" wrote: > 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? yep, it should s/op/num/ I'm sorry for not running make check on the last iteration, I'll post fixup shortly. > > > > + 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