mirror of
https://github.com/xemu-project/xemu.git
synced 2025-01-19 02:12:26 +00:00
spapr: Pass sPAPR machine state down to spapr_pci_switch_vga()
This allows to drop a user of qdev_get_machine(). Signed-off-by: Greg Kurz <groug@kaod.org> Message-Id: <20201209170052.1431440-4-groug@kaod.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
d57d72a874
commit
c4c81d7d51
@ -1351,6 +1351,7 @@ static target_ulong h_logical_dcbf(PowerPCCPU *cpu, SpaprMachineState *spapr,
|
||||
}
|
||||
|
||||
static target_ulong h_set_mode_resource_le(PowerPCCPU *cpu,
|
||||
SpaprMachineState *spapr,
|
||||
target_ulong mflags,
|
||||
target_ulong value1,
|
||||
target_ulong value2)
|
||||
@ -1365,12 +1366,12 @@ static target_ulong h_set_mode_resource_le(PowerPCCPU *cpu,
|
||||
switch (mflags) {
|
||||
case H_SET_MODE_ENDIAN_BIG:
|
||||
spapr_set_all_lpcrs(0, LPCR_ILE);
|
||||
spapr_pci_switch_vga(true);
|
||||
spapr_pci_switch_vga(spapr, true);
|
||||
return H_SUCCESS;
|
||||
|
||||
case H_SET_MODE_ENDIAN_LITTLE:
|
||||
spapr_set_all_lpcrs(LPCR_ILE, LPCR_ILE);
|
||||
spapr_pci_switch_vga(false);
|
||||
spapr_pci_switch_vga(spapr, false);
|
||||
return H_SUCCESS;
|
||||
}
|
||||
|
||||
@ -1411,7 +1412,7 @@ static target_ulong h_set_mode(PowerPCCPU *cpu, SpaprMachineState *spapr,
|
||||
|
||||
switch (resource) {
|
||||
case H_SET_MODE_RESOURCE_LE:
|
||||
ret = h_set_mode_resource_le(cpu, args[0], args[2], args[3]);
|
||||
ret = h_set_mode_resource_le(cpu, spapr, args[0], args[2], args[3]);
|
||||
break;
|
||||
case H_SET_MODE_RESOURCE_ADDR_TRANS_MODE:
|
||||
ret = h_set_mode_resource_addr_trans_mode(cpu, args[0],
|
||||
|
@ -2493,9 +2493,8 @@ static int spapr_switch_one_vga(DeviceState *dev, void *opaque)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void spapr_pci_switch_vga(bool big_endian)
|
||||
void spapr_pci_switch_vga(SpaprMachineState *spapr, bool big_endian)
|
||||
{
|
||||
SpaprMachineState *spapr = SPAPR_MACHINE(qdev_get_machine());
|
||||
SpaprPhbState *sphb;
|
||||
|
||||
/*
|
||||
|
@ -834,7 +834,7 @@ int spapr_dma_dt(void *fdt, int node_off, const char *propname,
|
||||
uint32_t liobn, uint64_t window, uint32_t size);
|
||||
int spapr_tcet_dma_dt(void *fdt, int node_off, const char *propname,
|
||||
SpaprTceTable *tcet);
|
||||
void spapr_pci_switch_vga(bool big_endian);
|
||||
void spapr_pci_switch_vga(SpaprMachineState *spapr, bool big_endian);
|
||||
void spapr_hotplug_req_add_by_index(SpaprDrc *drc);
|
||||
void spapr_hotplug_req_remove_by_index(SpaprDrc *drc);
|
||||
void spapr_hotplug_req_add_by_count(SpaprDrcType drc_type,
|
||||
|
Loading…
x
Reference in New Issue
Block a user