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>
This commit is contained in:
parent
4ec8d2b3f5
commit
7056045332
@ -514,6 +514,27 @@ Aml *aml_io(AmlIODecode dec, uint16_t min_base, uint16_t max_base,
|
|||||||
return var;
|
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 */
|
/* ACPI 1.0b: 16.2.5.4 Type 2 Opcodes Encoding: DefLEqual */
|
||||||
Aml *aml_equal(Aml *arg1, Aml *arg2)
|
Aml *aml_equal(Aml *arg1, Aml *arg2)
|
||||||
{
|
{
|
||||||
|
@ -146,6 +146,7 @@ Aml *aml_io(AmlIODecode dec, uint16_t min_base, uint16_t max_base,
|
|||||||
uint8_t aln, uint8_t len);
|
uint8_t aln, uint8_t len);
|
||||||
Aml *aml_operation_region(const char *name, AmlRegionSpace rs,
|
Aml *aml_operation_region(const char *name, AmlRegionSpace rs,
|
||||||
uint32_t offset, uint32_t len);
|
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_named_field(const char *name, unsigned length);
|
||||||
Aml *aml_reserved_field(unsigned length);
|
Aml *aml_reserved_field(unsigned length);
|
||||||
Aml *aml_local(int num);
|
Aml *aml_local(int num);
|
||||||
|
Loading…
Reference in New Issue
Block a user