From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55227) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJQgM-0006Iy-2W for qemu-devel@nongnu.org; Thu, 05 Feb 2015 12:57:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YJQgK-0002Xj-MU for qemu-devel@nongnu.org; Thu, 05 Feb 2015 12:57:38 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46759) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJQgK-0002XV-Cs for qemu-devel@nongnu.org; Thu, 05 Feb 2015 12:57:36 -0500 Date: Thu, 5 Feb 2015 18:57:29 +0100 From: Igor Mammedov Message-ID: <20150205185729.65621659@nial.brq.redhat.com> In-Reply-To: <54D38C27.4010308@redhat.com> References: <1421938231-25698-1-git-send-email-imammedo@redhat.com> <1421938231-25698-25-git-send-email-imammedo@redhat.com> <54D38C27.4010308@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 24/47] acpi: add acpi_operation_region() term List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Marcel Apfelbaum Cc: drjones@redhat.com, marcel.a@redhat.com, mst@redhat.com, claudio.fontana@huawei.com, qemu-devel@nongnu.org, pbonzini@redhat.com On Thu, 05 Feb 2015 17:28:39 +0200 Marcel Apfelbaum wrote: > On 01/22/2015 04:50 PM, Igor Mammedov wrote: > > Signed-off-by: Igor Mammedov > > --- > > hw/acpi/acpi-build-utils.c | 14 ++++++++++++++ > > include/hw/acpi/acpi-build-utils.h | 7 +++++++ > > 2 files changed, 21 insertions(+) > > > > diff --git a/hw/acpi/acpi-build-utils.c b/hw/acpi/acpi-build-utils.c > > index 094c821..9ac5a0d 100644 > > --- a/hw/acpi/acpi-build-utils.c > > +++ b/hw/acpi/acpi-build-utils.c > > @@ -544,3 +544,17 @@ AcpiAml acpi_package(uint8_t num_elements) > > build_append_byte(var.buf, num_elements); > > return var; > > } > > + > > +/* ACPI 5.0: 20.2.5.2 Named Objects Encoding: DefOpRegion */ > > +AcpiAml acpi_operation_region(const char *name, acpiRegionSpace rs, > > + uint32_t offset, uint32_t len) > > +{ > > + AcpiAml var = aml_allocate_internal(0, NON_BLOCK); > > + build_append_byte(var.buf, 0x5B); /* ExtOpPrefix */ > > + build_append_byte(var.buf, 0x80); /* OpRegionOp */ > > + build_append_namestring(var.buf, "%s", name); > > + build_append_byte(var.buf, rs); > > + build_append_int(var.buf, offset); > > + build_append_int(var.buf, len); > > + return var; > > +} > > diff --git a/include/hw/acpi/acpi-build-utils.h b/include/hw/acpi/acpi-build-utils.h > > index 176596e..cb45129 100644 > > --- a/include/hw/acpi/acpi-build-utils.h > > +++ b/include/hw/acpi/acpi-build-utils.h > > @@ -24,6 +24,11 @@ typedef enum { > > acpi_decode16 = 1, > > } acpiIODecode; > ^^^ > Why do you want enums to no start with capital letters? fixed > > Thanks, > Marcel > > > > > +typedef enum { > > + acpi_system_memory = 0x00, > > + acpi_system_io = 0x01, > > +} acpiRegionSpace; > > + > > void aml_append(AcpiAml *parent_ctx, AcpiAml child); > > > > /* non block ASL object primitives */ > > @@ -46,6 +51,8 @@ AcpiAml acpi_call4(const char *method, AcpiAml arg1, AcpiAml arg2, > > AcpiAml arg3, AcpiAml arg4); > > AcpiAml acpi_io(acpiIODecode dec, uint16_t min_base, uint16_t max_base, > > uint8_t aln, uint8_t len); > > +AcpiAml acpi_operation_region(const char *name, acpiRegionSpace rs, > > + uint32_t offset, uint32_t len); > > > > /* Block ASL object primitives */ > > AcpiAml acpi_if(AcpiAml predicate); > > >