.travis.yml: Shorten the runtime of the problematic jobs
[qemu/kevin.git] / hw / virtio / virtio-acpi.c
blob230a6695001fc0ad4db6b7d585964eb3a9a33bd4
1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3 * virtio ACPI Support
5 */
7 #include "qemu/osdep.h"
8 #include "hw/virtio/virtio-acpi.h"
9 #include "hw/acpi/aml-build.h"
11 void virtio_acpi_dsdt_add(Aml *scope, const hwaddr base, const hwaddr size,
12 uint32_t mmio_irq, long int start_index, int num)
14 hwaddr virtio_base = base;
15 uint32_t irq = mmio_irq;
16 long int i;
18 for (i = start_index; i < start_index + num; i++) {
19 Aml *dev = aml_device("VR%02u", (unsigned)i);
20 aml_append(dev, aml_name_decl("_HID", aml_string("LNRO0005")));
21 aml_append(dev, aml_name_decl("_UID", aml_int(i)));
22 aml_append(dev, aml_name_decl("_CCA", aml_int(1)));
24 Aml *crs = aml_resource_template();
25 aml_append(crs, aml_memory32_fixed(virtio_base, size, AML_READ_WRITE));
26 aml_append(crs,
27 aml_interrupt(AML_CONSUMER, AML_LEVEL, AML_ACTIVE_HIGH,
28 AML_EXCLUSIVE, &irq, 1));
29 aml_append(dev, aml_name_decl("_CRS", crs));
30 aml_append(scope, dev);
31 virtio_base += size;
32 irq++;