diff options
author | Igor Mammedov <imammedo@redhat.com> | 2015-12-10 00:41:15 +0100 |
---|---|---|
committer | Timothy Pearson <tpearson@raptorengineering.com> | 2019-11-29 19:28:21 -0600 |
commit | d30cc931fc847986cb084db578b5371a0f69ccc9 (patch) | |
tree | c1326c6c9e145abb9fe367c6298565db76ccac2c /hw | |
parent | f79db567e289abea6afa7056eb72ce0e093d4c84 (diff) | |
download | hqemu-d30cc931fc847986cb084db578b5371a0f69ccc9.zip hqemu-d30cc931fc847986cb084db578b5371a0f69ccc9.tar.gz |
acpi add aml_dma()
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')
-rw-r--r-- | hw/acpi/aml-build.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index 9222e8f..0ab8087 100644 --- a/hw/acpi/aml-build.c +++ b/hw/acpi/aml-build.c @@ -1275,6 +1275,20 @@ Aml *aml_qword_memory(AmlDecode dec, AmlMinFixed min_fixed, addr_trans, len, flags); } +/* ACPI 1.0b: 6.4.2.2 DMA Format/6.4.2.2.1 ASL Macro for DMA Descriptor */ +Aml *aml_dma(AmlDmaType typ, AmlDmaBusMaster bm, AmlTransferSize sz, + uint8_t channel) +{ + Aml *var = aml_alloc(); + uint8_t flags = sz | bm << 2 | typ << 5; + + assert(channel < 8); + build_append_byte(var->buf, 0x2A); /* Byte 0: DMA Descriptor */ + build_append_byte(var->buf, 1U << channel); /* Byte 1: _DMA - DmaChannel */ + build_append_byte(var->buf, flags); /* Byte 2 */ + return var; +} + /* ACPI 1.0b: 16.2.5.3 Type 1 Opcodes Encoding: DefSleep */ Aml *aml_sleep(uint64_t msec) { |