summaryrefslogtreecommitdiff
path: root/src/arch/x86/boot
diff options
context:
space:
mode:
authorVladimir Serbinenko <phcoder@gmail.com>2014-02-15 18:57:17 +0100
committerVladimir Serbinenko <phcoder@gmail.com>2014-05-25 15:59:46 +0200
commit20ea04034dd1d2a1660e6d5fc9f5e8bc6c7859f4 (patch)
tree47c1202d3e60575b38ce620e5afec8882b41cc50 /src/arch/x86/boot
parenta31a838cdb22c827b8afe5b1620eedffa4ad4f0e (diff)
downloadcoreboot-20ea04034dd1d2a1660e6d5fc9f5e8bc6c7859f4.tar.xz
acpigen: Add acpigen_write_irq.
Change-Id: Iba52dc2d52b7ac9a65d1d17b43e7204f5ede373e Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com> Reviewed-on: http://review.coreboot.org/5241 Tested-by: build bot (Jenkins) Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Diffstat (limited to 'src/arch/x86/boot')
-rw-r--r--src/arch/x86/boot/acpigen.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/arch/x86/boot/acpigen.c b/src/arch/x86/boot/acpigen.c
index 6496d759de..fdb7e02c9b 100644
--- a/src/arch/x86/boot/acpigen.c
+++ b/src/arch/x86/boot/acpigen.c
@@ -623,6 +623,21 @@ int acpigen_write_register(acpi_addr_t *addr)
return 15;
}
+int acpigen_write_irq(u16 mask)
+{
+ /*
+ * acpi 3.0b section 6.4.2.1: IRQ Descriptor
+ * Byte 0:
+ * Bit7 : 0 => small item
+ * Bit6-3: 0100 (0x4) => IRQ port descriptor
+ * Bit2-0: 010 (0x2) => 2 Bytes long
+ */
+ acpigen_emit_byte(0x22);
+ acpigen_emit_byte(mask & 0xff);
+ acpigen_emit_byte((mask >> 8) & 0xff);
+ return 3;
+}
+
int acpigen_write_io16(u16 min, u16 max, u8 align, u8 len, u8 decode16)
{
/*