qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Igor Mammedov <imammedo@redhat.com>
To: qemu-devel@nongnu.org
Cc: marcel@redhat.com, mst@redhat.com
Subject: [Qemu-devel] [PATCH v5 06/16] acpi: add acpi_irq_no_flags() term
Date: Fri, 20 Feb 2015 18:22:10 +0000	[thread overview]
Message-ID: <1424456540-27854-7-git-send-email-imammedo@redhat.com> (raw)
In-Reply-To: <1424456540-27854-1-git-send-email-imammedo@redhat.com>

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
 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 d793775..60245e7 100644
--- a/hw/acpi/aml-build.c
+++ b/hw/acpi/aml-build.c
@@ -514,6 +514,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 d2b2c35..1187197 100644
--- a/include/hw/acpi/aml-build.h
+++ b/include/hw/acpi/aml-build.h
@@ -146,6 +146,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

  parent reply	other threads:[~2015-02-20 18:22 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-20 18:22 [Qemu-devel] [PATCH v5 00/16] ACPI refactoring: replace template patching with C AML API Igor Mammedov
2015-02-20 18:22 ` [Qemu-devel] [PATCH v5 01/16] pc: acpi-build: create PCI0._CRS dynamically Igor Mammedov
2015-02-20 18:22 ` [Qemu-devel] [PATCH v5 02/16] pc: acpi: drop manual hole punching for PCI hotplug resources Igor Mammedov
2015-02-20 18:22 ` [Qemu-devel] [PATCH v5 03/16] pc: acpi: drop manual hole punching for CPU " Igor Mammedov
2015-02-20 18:22 ` [Qemu-devel] [PATCH v5 04/16] pc: acpi: drop manual hole punching for GPE0 resources Igor Mammedov
2015-02-20 18:22 ` [Qemu-devel] [PATCH v5 05/16] pc: acpi-build: drop remaining ssdt_misc template Igor Mammedov
2015-02-20 18:22 ` Igor Mammedov [this message]
2015-02-20 18:22 ` [Qemu-devel] [PATCH v5 07/16] pc: export applesmc IO port/len Igor Mammedov
2015-02-20 18:22 ` [Qemu-devel] [PATCH v5 08/16] pc: acpi-build: drop template patching and create Device(SMC) dynamically Igor Mammedov
2015-02-26 16:33   ` Igor Mammedov
2015-02-20 18:22 ` [Qemu-devel] [PATCH v5 09/16] tests: ACPI test blobs update due to PCI0._CRS changes Igor Mammedov
2015-02-20 18:22 ` [Qemu-devel] [PATCH v5 10/16] tests: bios-tables-test: add support for testing bridges Igor Mammedov
2015-02-20 18:22 ` [Qemu-devel] [PATCH v5 11/16] tests: add ACPI blobs for qemu with bridge cases Igor Mammedov
2015-02-20 18:22 ` [Qemu-devel] [PATCH v5 12/16] pc: acpi-build: simplify PCI bus tree generation Igor Mammedov
2015-02-20 18:22 ` [Qemu-devel] [PATCH v5 13/16] tests: ACPI: update pc/SSDT.bridge due to new alg of PCI tree creation Igor Mammedov
2015-02-20 18:22 ` [Qemu-devel] [PATCH v5 14/16] pc: acpi-build: drop template patching and create PCI bus tree dynamically Igor Mammedov
2015-02-20 18:22 ` [Qemu-devel] [PATCH v5 15/16] pc: acpi: remove not used anymore ssdt-[misc|pcihp].hex.generated blobs Igor Mammedov
2015-02-20 18:22 ` [Qemu-devel] [PATCH v5 16/16] acpi: make build_*() routines static to aml-build.c Igor Mammedov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1424456540-27854-7-git-send-email-imammedo@redhat.com \
    --to=imammedo@redhat.com \
    --cc=marcel@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).