diff options
author | Igor Mammedov <imammedo@redhat.com> | 2015-02-20 18:22:10 +0000 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2015-03-01 12:33:22 +0100 |
commit | 7056045332b997a8cd298e3bf231ecf690accdf4 (patch) | |
tree | 81ad2ec5a8bdbe37cf6a557b63a4b137a6ef79f6 /hw/acpi/aml-build.c | |
parent | 4ec8d2b3f54dd1dcd9e2a80e529feff4e2603288 (diff) |
acpi: add acpi_irq_no_flags() term
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/acpi/aml-build.c')
-rw-r--r-- | hw/acpi/aml-build.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index d793775d93..60245e7ded 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) { |