From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43937) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJOMZ-0007f8-Uk for qemu-devel@nongnu.org; Thu, 05 Feb 2015 10:29:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YJOMW-0005Mh-GI for qemu-devel@nongnu.org; Thu, 05 Feb 2015 10:29:03 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36108) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJOMW-0005MW-7T for qemu-devel@nongnu.org; Thu, 05 Feb 2015 10:29:00 -0500 Message-ID: <54D38C27.4010308@redhat.com> Date: Thu, 05 Feb 2015 17:28:39 +0200 From: Marcel Apfelbaum MIME-Version: 1.0 References: <1421938231-25698-1-git-send-email-imammedo@redhat.com> <1421938231-25698-25-git-send-email-imammedo@redhat.com> In-Reply-To: <1421938231-25698-25-git-send-email-imammedo@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed 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: Igor Mammedov , qemu-devel@nongnu.org Cc: pbonzini@redhat.com, drjones@redhat.com, marcel.a@redhat.com, claudio.fontana@huawei.com, mst@redhat.com 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? 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); >