mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
hw/arm: simplify arm_load_dtb
In struct arm_boot_info, kernel_filename, initrd_filename and kernel_cmdline are copied from from MachineState. This patch add MachineState as a parameter into arm_load_dtb() and move the copy chunk of kernel_filename, initrd_filename and kernel_cmdline into arm_load_kernel(). Reviewed-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Liu Jingqi <jingqi.liu@intel.com> Suggested-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Tao Xu <tao3.xu@intel.com> Message-Id: <20190809065731.9097-2-tao3.xu@intel.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Acked-by: Andrew Jeffery <andrew@aj.id.au> Acked-by: Cédric Le Goater <clg@kaod.org> [ehabkost: include hw/boards.h again to fix build failures] Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
This commit is contained in:
parent
14a25a511b
commit
2744ece809
30 changed files with 44 additions and 147 deletions
|
@ -1368,6 +1368,7 @@ void virt_machine_done(Notifier *notifier, void *data)
|
|||
{
|
||||
VirtMachineState *vms = container_of(notifier, VirtMachineState,
|
||||
machine_done);
|
||||
MachineState *ms = MACHINE(vms);
|
||||
ARMCPU *cpu = ARM_CPU(first_cpu);
|
||||
struct arm_boot_info *info = &vms->bootinfo;
|
||||
AddressSpace *as = arm_boot_address_space(cpu, info);
|
||||
|
@ -1385,7 +1386,7 @@ void virt_machine_done(Notifier *notifier, void *data)
|
|||
vms->memmap[VIRT_PLATFORM_BUS].size,
|
||||
vms->irqmap[VIRT_PLATFORM_BUS]);
|
||||
}
|
||||
if (arm_load_dtb(info->dtb_start, info, info->dtb_limit, as) < 0) {
|
||||
if (arm_load_dtb(info->dtb_start, info, info->dtb_limit, as, ms) < 0) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
@ -1711,16 +1712,13 @@ static void machvirt_init(MachineState *machine)
|
|||
create_platform_bus(vms, pic);
|
||||
|
||||
vms->bootinfo.ram_size = machine->ram_size;
|
||||
vms->bootinfo.kernel_filename = machine->kernel_filename;
|
||||
vms->bootinfo.kernel_cmdline = machine->kernel_cmdline;
|
||||
vms->bootinfo.initrd_filename = machine->initrd_filename;
|
||||
vms->bootinfo.nb_cpus = smp_cpus;
|
||||
vms->bootinfo.board_id = -1;
|
||||
vms->bootinfo.loader_start = vms->memmap[VIRT_MEM].base;
|
||||
vms->bootinfo.get_dtb = machvirt_dtb;
|
||||
vms->bootinfo.skip_dtb_autoload = true;
|
||||
vms->bootinfo.firmware_loaded = firmware_loaded;
|
||||
arm_load_kernel(ARM_CPU(first_cpu), &vms->bootinfo);
|
||||
arm_load_kernel(ARM_CPU(first_cpu), machine, &vms->bootinfo);
|
||||
|
||||
vms->machine_done.notify = virt_machine_done;
|
||||
qemu_add_machine_init_done_notifier(&vms->machine_done);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue