ppc: spapr: Make VCPU ID handling private to SPAPR

The concept of a VCPU ID that differs from the CPU's index
(cpu->cpu_index) exists only within SPAPR machines so, move the
functions ppc_get_vcpu_id() and ppc_get_cpu_by_vcpu_id() into spapr.c
and rename them appropriately.

Signed-off-by: Sam Bobroff <sam.bobroff@au1.ibm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
Sam Bobroff 2017-08-09 15:38:56 +10:00 committed by David Gibson
parent 81210c2009
commit 2e886fb391
7 changed files with 41 additions and 51 deletions

View file

@ -999,7 +999,7 @@ static target_ulong h_register_vpa(PowerPCCPU *cpu, sPAPRMachineState *spapr,
CPUPPCState *tenv;
PowerPCCPU *tcpu;
tcpu = ppc_get_cpu_by_vcpu_id(procno);
tcpu = spapr_find_cpu(procno);
if (!tcpu) {
return H_PARAMETER;
}
@ -1431,7 +1431,7 @@ static target_ulong h_signal_sys_reset(PowerPCCPU *cpu,
} else {
/* Unicast */
cs = CPU(ppc_get_cpu_by_vcpu_id(target));
cs = CPU(spapr_find_cpu(target));
if (cs) {
run_on_cpu(cs, spapr_do_system_reset_on_cpu, RUN_ON_CPU_NULL);
return H_SUCCESS;