[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH qom-cpu 56/59] spapr_rtas: Abstract rtas_start_cpu()
From: |
Andreas Färber |
Subject: |
[Qemu-devel] [PATCH qom-cpu 56/59] spapr_rtas: Abstract rtas_start_cpu() with qemu_get_cpu() |
Date: |
Sun, 9 Jun 2013 21:13:23 +0200 |
Signed-off-by: Andreas Färber <address@hidden>
---
hw/ppc/spapr_rtas.c | 21 +++++++++------------
1 file changed, 9 insertions(+), 12 deletions(-)
diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c
index a67ffcd..42ed7dc 100644
--- a/hw/ppc/spapr_rtas.c
+++ b/hw/ppc/spapr_rtas.c
@@ -160,8 +160,7 @@ static void rtas_start_cpu(sPAPREnvironment *spapr,
uint32_t nret, target_ulong rets)
{
target_ulong id, start, r3;
- CPUState *cpu;
- CPUPPCState *env;
+ CPUState *cs;
if (nargs != 3 || nret != 1) {
rtas_st(rets, 0, -3);
@@ -172,14 +171,12 @@ static void rtas_start_cpu(sPAPREnvironment *spapr,
start = rtas_ld(args, 1);
r3 = rtas_ld(args, 2);
- for (env = first_cpu; env; env = env->next_cpu) {
- cpu = CPU(ppc_env_get_cpu(env));
-
- if (cpu->cpu_index != id) {
- continue;
- }
+ cs = qemu_get_cpu(id);
+ if (cs != NULL) {
+ PowerPCCPU *cpu = POWERPC_CPU(cs);
+ CPUPPCState *env = &cpu->env;
- if (!cpu->halted) {
+ if (!cs->halted) {
rtas_st(rets, 0, -1);
return;
}
@@ -187,14 +184,14 @@ static void rtas_start_cpu(sPAPREnvironment *spapr,
/* This will make sure qemu state is up to date with kvm, and
* mark it dirty so our changes get flushed back before the
* new cpu enters */
- kvm_cpu_synchronize_state(cpu);
+ kvm_cpu_synchronize_state(cs);
env->msr = (1ULL << MSR_SF) | (1ULL << MSR_ME);
env->nip = start;
env->gpr[3] = r3;
- cpu->halted = 0;
+ cs->halted = 0;
- qemu_cpu_kick(cpu);
+ qemu_cpu_kick(cs);
rtas_st(rets, 0, 0);
return;
--
1.8.1.4
- [Qemu-devel] [PATCH qom-cpu 47/59] spapr: Abstract spapr_fix_cpu_dt() with qemu_for_each_cpu(), (continued)
- [Qemu-devel] [PATCH qom-cpu 49/59] cpus: Abstract all_vcpus_paused() with qemu_for_each_cpu(), Andreas Färber, 2013/06/09
- [Qemu-devel] [PATCH qom-cpu 50/59] cpus: Abstract qmp_query_cpus() with qemu_for_each_cpu(), Andreas Färber, 2013/06/09
- [Qemu-devel] [PATCH qom-cpu 51/59] exec: Abstract qemu_get_cpu() with qemu_for_each_cpu(), Andreas Färber, 2013/06/09
- [Qemu-devel] [PATCH qom-cpu 52/59] gdbstub: Abstract gdb_breakpoint_{insert, remove}() with qemu_for_each_cpu(), Andreas Färber, 2013/06/09
- [Qemu-devel] [PATCH qom-cpu 53/59] gdbstub: Abstract gdb_breakpoint_remove_all() with qemu_for_each_cpu(), Andreas Färber, 2013/06/09
- [Qemu-devel] [PATCH qom-cpu 55/59] spapr_rtas: Abstract rtas_query_cpu_stopped_state() with qemu_get_cpu(), Andreas Färber, 2013/06/09
- [Qemu-devel] [PATCH qom-cpu 56/59] spapr_rtas: Abstract rtas_start_cpu() with qemu_get_cpu(),
Andreas Färber <=
- [Qemu-devel] [PATCH qom-cpu 54/59] spapr: Abstract spapr_create_fdt_skel() with qemu_for_each_cpu(), Andreas Färber, 2013/06/09
- [Qemu-devel] [PATCH qom-cpu 58/59] linux-user: Change thread_env to CPUState, Andreas Färber, 2013/06/09
- [Qemu-devel] [PATCH qom-cpu 57/59] cpu: Make first_cpu and next_cpu CPUState (WIP), Andreas Färber, 2013/06/09
- [Qemu-devel] [PATCH qom-cpu 59/59] bsd-user: Change thread_env to CPUState, Andreas Färber, 2013/06/09
- Re: [Qemu-devel] [PATCH qom-cpu 00/59] QOM CPUState, part 10: CPU loops, Stefano Stabellini, 2013/06/10
- Re: [Qemu-devel] [PATCH qom-cpu 00/59] QOM CPUState, part 10: CPU loops, Andreas Färber, 2013/06/12