mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
exec: call cpu_exec_exit() from a CPU unrealize common function
As cpu_exec_exit() mirrors the cpu_exec_realizefn(), rename it as cpu_exec_unrealizefn(). Create and register a cpu_common_unrealizefn() function for the CPU device class and call cpu_exec_unrealizefn() from this function. Remove cpu_exec_exit() from cpu_common_finalize() (which mirrors init, not realize), and as x86_cpu_unrealizefn() and ppc_cpu_unrealizefn() overwrite the device class unrealize function, add a call to a parent_unrealize pointer. Signed-off-by: Laurent Vivier <lvivier@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
This commit is contained in:
parent
ce5b1bbf62
commit
7bbc124e7e
7 changed files with 28 additions and 4 deletions
|
@ -9906,11 +9906,17 @@ static void ppc_cpu_realizefn(DeviceState *dev, Error **errp)
|
|||
static void ppc_cpu_unrealizefn(DeviceState *dev, Error **errp)
|
||||
{
|
||||
PowerPCCPU *cpu = POWERPC_CPU(dev);
|
||||
PowerPCCPUClass *pcc = POWERPC_CPU_GET_CLASS(cpu);
|
||||
CPUPPCState *env = &cpu->env;
|
||||
Error *local_err = NULL;
|
||||
opc_handler_t **table, **table_2;
|
||||
int i, j, k;
|
||||
|
||||
cpu_exec_exit(CPU(dev));
|
||||
pcc->parent_unrealize(dev, &local_err);
|
||||
if (local_err != NULL) {
|
||||
error_propagate(errp, local_err);
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = 0; i < PPC_CPU_OPCODES_LEN; i++) {
|
||||
if (env->opcodes[i] == &invalid_handler) {
|
||||
|
@ -10521,6 +10527,7 @@ static void ppc_cpu_class_init(ObjectClass *oc, void *data)
|
|||
DeviceClass *dc = DEVICE_CLASS(oc);
|
||||
|
||||
pcc->parent_realize = dc->realize;
|
||||
pcc->parent_unrealize = dc->unrealize;
|
||||
pcc->pvr_match = ppc_pvr_match_default;
|
||||
pcc->interrupts_big_endian = ppc_cpu_interrupts_big_endian_always;
|
||||
dc->realize = ppc_cpu_realizefn;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue