mirror of https://github.com/xemu-project/xemu.git
hw/acpi: piix4_pm_init(): take fw_cfg object no more
This PIIX4 init function has no more reason to receive a pointer to the FwCfg object. Remove the parameter from the prototype, and update callers. As a result, the pc_init1() function no longer needs to save the return value of pc_memory_init() and xen_load_linux(), which makes it more similar to pc_q35_init(). The return type & value of pc_memory_init() and xen_load_linux() are not changed themselves; maybe we'll need their return values sometime later. RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1204696 Cc: Amit Shah <amit.shah@redhat.com> Cc: "Michael S. Tsirkin" <mst@redhat.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Richard Henderson <rth@twiddle.net> Cc: Eduardo Habkost <ehabkost@redhat.com> Cc: Aurelien Jarno <aurelien@aurel32.net> Cc: Leon Alrae <leon.alrae@imgtec.com> Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
This commit is contained in:
parent
e3845e7c47
commit
6e7d82497d
|
@ -503,8 +503,7 @@ Object *piix4_pm_find(void)
|
||||||
|
|
||||||
I2CBus *piix4_pm_init(PCIBus *bus, int devfn, uint32_t smb_io_base,
|
I2CBus *piix4_pm_init(PCIBus *bus, int devfn, uint32_t smb_io_base,
|
||||||
qemu_irq sci_irq, qemu_irq smi_irq,
|
qemu_irq sci_irq, qemu_irq smi_irq,
|
||||||
int kvm_enabled, FWCfgState *fw_cfg,
|
int kvm_enabled, DeviceState **piix4_pm)
|
||||||
DeviceState **piix4_pm)
|
|
||||||
{
|
{
|
||||||
DeviceState *dev;
|
DeviceState *dev;
|
||||||
PIIX4PMState *s;
|
PIIX4PMState *s;
|
||||||
|
|
|
@ -99,7 +99,6 @@ static void pc_init1(MachineState *machine)
|
||||||
MemoryRegion *pci_memory;
|
MemoryRegion *pci_memory;
|
||||||
MemoryRegion *rom_memory;
|
MemoryRegion *rom_memory;
|
||||||
DeviceState *icc_bridge;
|
DeviceState *icc_bridge;
|
||||||
FWCfgState *fw_cfg = NULL;
|
|
||||||
PcGuestInfo *guest_info;
|
PcGuestInfo *guest_info;
|
||||||
ram_addr_t lowmem;
|
ram_addr_t lowmem;
|
||||||
|
|
||||||
|
@ -180,16 +179,16 @@ static void pc_init1(MachineState *machine)
|
||||||
|
|
||||||
/* allocate ram and load rom/bios */
|
/* allocate ram and load rom/bios */
|
||||||
if (!xen_enabled()) {
|
if (!xen_enabled()) {
|
||||||
fw_cfg = pc_memory_init(machine, system_memory,
|
pc_memory_init(machine, system_memory,
|
||||||
below_4g_mem_size, above_4g_mem_size,
|
below_4g_mem_size, above_4g_mem_size,
|
||||||
rom_memory, &ram_memory, guest_info);
|
rom_memory, &ram_memory, guest_info);
|
||||||
} else if (machine->kernel_filename != NULL) {
|
} else if (machine->kernel_filename != NULL) {
|
||||||
/* For xen HVM direct kernel boot, load linux here */
|
/* For xen HVM direct kernel boot, load linux here */
|
||||||
fw_cfg = xen_load_linux(machine->kernel_filename,
|
xen_load_linux(machine->kernel_filename,
|
||||||
machine->kernel_cmdline,
|
machine->kernel_cmdline,
|
||||||
machine->initrd_filename,
|
machine->initrd_filename,
|
||||||
below_4g_mem_size,
|
below_4g_mem_size,
|
||||||
guest_info);
|
guest_info);
|
||||||
}
|
}
|
||||||
|
|
||||||
gsi_state = g_malloc0(sizeof(*gsi_state));
|
gsi_state = g_malloc0(sizeof(*gsi_state));
|
||||||
|
@ -288,7 +287,7 @@ static void pc_init1(MachineState *machine)
|
||||||
/* TODO: Populate SPD eeprom data. */
|
/* TODO: Populate SPD eeprom data. */
|
||||||
smbus = piix4_pm_init(pci_bus, piix3_devfn + 3, 0xb100,
|
smbus = piix4_pm_init(pci_bus, piix3_devfn + 3, 0xb100,
|
||||||
gsi[9], *smi_irq,
|
gsi[9], *smi_irq,
|
||||||
kvm_enabled(), fw_cfg, &piix4_pm);
|
kvm_enabled(), &piix4_pm);
|
||||||
smbus_eeprom_init(smbus, 8, NULL, 0);
|
smbus_eeprom_init(smbus, 8, NULL, 0);
|
||||||
|
|
||||||
object_property_add_link(OBJECT(machine), PC_MACHINE_ACPI_DEVICE_PROP,
|
object_property_add_link(OBJECT(machine), PC_MACHINE_ACPI_DEVICE_PROP,
|
||||||
|
|
|
@ -1161,7 +1161,7 @@ void mips_malta_init(MachineState *machine)
|
||||||
pci_piix4_ide_init(pci_bus, hd, piix4_devfn + 1);
|
pci_piix4_ide_init(pci_bus, hd, piix4_devfn + 1);
|
||||||
pci_create_simple(pci_bus, piix4_devfn + 2, "piix4-usb-uhci");
|
pci_create_simple(pci_bus, piix4_devfn + 2, "piix4-usb-uhci");
|
||||||
smbus = piix4_pm_init(pci_bus, piix4_devfn + 3, 0x1100,
|
smbus = piix4_pm_init(pci_bus, piix4_devfn + 3, 0x1100,
|
||||||
isa_get_irq(NULL, 9), NULL, 0, NULL, NULL);
|
isa_get_irq(NULL, 9), NULL, 0, NULL);
|
||||||
smbus_eeprom_init(smbus, 8, smbus_eeprom_buf, smbus_eeprom_size);
|
smbus_eeprom_init(smbus, 8, smbus_eeprom_buf, smbus_eeprom_size);
|
||||||
g_free(smbus_eeprom_buf);
|
g_free(smbus_eeprom_buf);
|
||||||
pit = pit_init(isa_bus, 0x40, 0, NULL);
|
pit = pit_init(isa_bus, 0x40, 0, NULL);
|
||||||
|
|
|
@ -218,8 +218,7 @@ void ioapic_init_gsi(GSIState *gsi_state, const char *parent_name);
|
||||||
|
|
||||||
I2CBus *piix4_pm_init(PCIBus *bus, int devfn, uint32_t smb_io_base,
|
I2CBus *piix4_pm_init(PCIBus *bus, int devfn, uint32_t smb_io_base,
|
||||||
qemu_irq sci_irq, qemu_irq smi_irq,
|
qemu_irq sci_irq, qemu_irq smi_irq,
|
||||||
int kvm_enabled, FWCfgState *fw_cfg,
|
int kvm_enabled, DeviceState **piix4_pm);
|
||||||
DeviceState **piix4_pm);
|
|
||||||
void piix4_smbus_register_device(SMBusDevice *dev, uint8_t addr);
|
void piix4_smbus_register_device(SMBusDevice *dev, uint8_t addr);
|
||||||
|
|
||||||
/* hpet.c */
|
/* hpet.c */
|
||||||
|
|
Loading…
Reference in New Issue