[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v8 24/24] hw/arm/virt: Enable dynamic generation of
From: |
Shannon Zhao |
Subject: |
[Qemu-devel] [PATCH v8 24/24] hw/arm/virt: Enable dynamic generation of ACPI v5.1 tables |
Date: |
Thu, 21 May 2015 10:28:51 +0800 |
From: Shannon Zhao <address@hidden>
Initialize VirtGuestInfoState and register a machine_init_done notify to
call virt_acpi_build().
Signed-off-by: Shannon Zhao <address@hidden>
Signed-off-by: Shannon Zhao <address@hidden>
---
hw/arm/virt.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index a6a399d..05db8cb 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -44,6 +44,7 @@
#include "qemu/bitops.h"
#include "qemu/error-report.h"
#include "hw/pci-host/gpex.h"
+#include "hw/arm/virt-acpi-build.h"
/* Number of external interrupt lines to configure the GIC with */
#define NUM_IRQS 128
@@ -697,6 +698,14 @@ static void *machvirt_dtb(const struct arm_boot_info
*binfo, int *fdt_size)
return board->fdt;
}
+static
+void virt_guest_info_machine_done(Notifier *notifier, void *data)
+{
+ VirtGuestInfoState *guest_info_state = container_of(notifier,
+ VirtGuestInfoState,
machine_done);
+ virt_acpi_setup(&guest_info_state->info);
+}
+
static void machvirt_init(MachineState *machine)
{
VirtMachineState *vms = VIRT_MACHINE(machine);
@@ -706,6 +715,8 @@ static void machvirt_init(MachineState *machine)
MemoryRegion *ram = g_new(MemoryRegion, 1);
const char *cpu_model = machine->cpu_model;
VirtBoardInfo *vbi;
+ VirtGuestInfoState *guest_info_state = g_malloc0(sizeof *guest_info_state);
+ VirtGuestInfo *guest_info = &guest_info_state->info;
uint32_t gic_phandle;
char **cpustr;
@@ -798,6 +809,14 @@ static void machvirt_init(MachineState *machine)
create_virtio_devices(vbi, pic);
create_fw_cfg(vbi);
+ rom_set_fw(fw_cfg_find());
+
+ guest_info->smp_cpus = smp_cpus;
+ guest_info->fw_cfg = fw_cfg_find();
+ guest_info->memmap = vbi->memmap;
+ guest_info->irqmap = vbi->irqmap;
+ guest_info_state->machine_done.notify = virt_guest_info_machine_done;
+ qemu_add_machine_init_done_notifier(&guest_info_state->machine_done);
vbi->bootinfo.ram_size = machine->ram_size;
vbi->bootinfo.kernel_filename = machine->kernel_filename;
--
2.0.4
- [Qemu-devel] [PATCH v8 05/24] hw/acpi/aml-build: Add aml_memory32_fixed() term, (continued)
- [Qemu-devel] [PATCH v8 05/24] hw/acpi/aml-build: Add aml_memory32_fixed() term, Shannon Zhao, 2015/05/20
- [Qemu-devel] [PATCH v8 09/24] hw/arm/virt-acpi-build: Generate MADT table, Shannon Zhao, 2015/05/20
- [Qemu-devel] [PATCH v8 08/24] hw/arm/virt-acpi-build: Generate FADT table and update ACPI headers, Shannon Zhao, 2015/05/20
- [Qemu-devel] [PATCH v8 13/24] hw/arm/virt-acpi-build: Generate MCFG table, Shannon Zhao, 2015/05/20
- [Qemu-devel] [PATCH v8 12/24] hw/arm/virt-acpi-build: Generate RSDP table, Shannon Zhao, 2015/05/20
- [Qemu-devel] [PATCH v8 18/24] hw/acpi/aml-build: Add aml_else() term, Shannon Zhao, 2015/05/20
- [Qemu-devel] [PATCH v8 21/24] hw/acpi/aml-build: Add Unicode macro, Shannon Zhao, 2015/05/20
- [Qemu-devel] [PATCH v8 20/24] hw/acpi/aml-build: Add aml_dword_io() term, Shannon Zhao, 2015/05/20
- [Qemu-devel] [PATCH v8 22/24] hw/arm/virt-acpi-build: Add PCIe controller in ACPI DSDT table, Shannon Zhao, 2015/05/20
- [Qemu-devel] [PATCH v8 23/24] ACPI: split CONFIG_ACPI into 4 pieces, Shannon Zhao, 2015/05/20
- [Qemu-devel] [PATCH v8 24/24] hw/arm/virt: Enable dynamic generation of ACPI v5.1 tables,
Shannon Zhao <=
- [Qemu-devel] [PATCH v8 11/24] hw/arm/virt-acpi-build: Generate RSDT table, Shannon Zhao, 2015/05/20
- [Qemu-devel] [PATCH v8 06/24] hw/acpi/aml-build: Add aml_interrupt() term, Shannon Zhao, 2015/05/20
- [Qemu-devel] [PATCH v8 10/24] hw/arm/virt-acpi-build: Generate GTDT table, Shannon Zhao, 2015/05/20
- [Qemu-devel] [PATCH v8 19/24] hw/acpi/aml-build: Add aml_create_dword_field() term, Shannon Zhao, 2015/05/20