From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51885) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YKm0Z-0005gL-BI for qemu-devel@nongnu.org; Mon, 09 Feb 2015 05:56:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YKm0Y-0001Kz-FQ for qemu-devel@nongnu.org; Mon, 09 Feb 2015 05:56:03 -0500 Received: from mx1.redhat.com ([209.132.183.28]:47168) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YKm0Y-0001Kl-4H for qemu-devel@nongnu.org; Mon, 09 Feb 2015 05:56:02 -0500 From: Igor Mammedov Date: Mon, 9 Feb 2015 10:54:10 +0000 Message-Id: <1423479254-15342-49-git-send-email-imammedo@redhat.com> In-Reply-To: <1423479254-15342-1-git-send-email-imammedo@redhat.com> References: <1423479254-15342-1-git-send-email-imammedo@redhat.com> Subject: [Qemu-devel] [PATCH v3 48/52] acpi: add acpi_irq_no_flags() term List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: drjones@redhat.com, marcel.a@redhat.com, claudio.fontana@huawei.com, mst@redhat.com, zhaoshenglong@huawei.com Signed-off-by: Igor Mammedov --- hw/acpi/aml-build.c | 21 +++++++++++++++++++++ include/hw/acpi/aml-build.h | 1 + 2 files changed, 22 insertions(+) diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index bfebdb4..3f87d51 100644 --- a/hw/acpi/aml-build.c +++ b/hw/acpi/aml-build.c @@ -554,6 +554,27 @@ Aml *aml_io(AmlIODecode dec, uint16_t min_base, uint16_t max_base, return var; } +/* + * ACPI 1.0b: 6.4.2.1.1 ASL Macro for IRQ Descriptor + * + * More verbose description at: + * ACPI 5.0: 19.5.64 IRQNoFlags (Interrupt Resource Descriptor Macro) + * 6.4.2.1 IRQ Descriptor + */ +Aml *aml_irq_no_flags(uint8_t irq) +{ + uint16_t irq_mask; + Aml *var = aml_alloc(); + + assert(irq < 16); + build_append_byte(var->buf, 0x22); /* IRQ descriptor 2 byte form */ + + irq_mask = 1U << irq; + build_append_byte(var->buf, irq_mask & 0xFF); /* IRQ mask bits[7:0] */ + build_append_byte(var->buf, irq_mask >> 8); /* IRQ mask bits[15:8] */ + return var; +} + /* ACPI 1.0b: 16.2.5.4 Type 2 Opcodes Encoding: DefLEqual */ Aml *aml_equal(Aml *arg1, Aml *arg2) { diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h index 0f499a6..44cb7ea 100644 --- a/include/hw/acpi/aml-build.h +++ b/include/hw/acpi/aml-build.h @@ -156,6 +156,7 @@ Aml *aml_io(AmlIODecode dec, uint16_t min_base, uint16_t max_base, uint8_t aln, uint8_t len); Aml *aml_operation_region(const char *name, AmlRegionSpace rs, uint32_t offset, uint32_t len); +Aml *aml_irq_no_flags(uint8_t irq); Aml *aml_named_field(const char *name, unsigned length); Aml *aml_reserved_field(unsigned length); Aml *aml_local(int num); -- 1.8.3.1