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>
This commit is contained in:
Vladimir Serbinenko 2014-02-15 18:57:17 +01:00
parent a31a838cdb
commit 20ea04034d
2 changed files with 16 additions and 0 deletions

View File

@ -623,6 +623,21 @@ int acpigen_write_register(acpi_addr_t *addr)
return 15; 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) int acpigen_write_io16(u16 min, u16 max, u8 align, u8 len, u8 decode16)
{ {
/* /*

View File

@ -62,6 +62,7 @@ int acpigen_write_resourcetemplate_header(void);
int acpigen_write_resourcetemplate_footer(int len); int acpigen_write_resourcetemplate_footer(int len);
int acpigen_write_mainboard_resource_template(void); int acpigen_write_mainboard_resource_template(void);
int acpigen_write_mainboard_resources(const char *scope, const char *name); int acpigen_write_mainboard_resources(const char *scope, const char *name);
int acpigen_write_irq(u16 mask);
int get_cst_entries(acpi_cstate_t **); int get_cst_entries(acpi_cstate_t **);