aboutsummaryrefslogtreecommitdiff
path: root/hw/spapr_rtas.c
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2012-12-17 06:18:02 +0100
committerAndreas Färber <afaerber@suse.de>2013-01-15 04:09:13 +0100
commit55e5c2850293547203874098f7cec148ffd12dfa (patch)
treef9a9cc316999b7b52726b5186a925022b3747daa /hw/spapr_rtas.c
parent1b1ed8dc40635d60dd95c04658989af63542fcbf (diff)
cpu: Move cpu_index field to CPUState
Note that target-alpha accesses this field from TCG, now using a negative offset. Therefore the field is placed last in CPUState. Pass PowerPCCPU to [kvm]ppc_fixup_cpu() to facilitate this change. Move common parts of mips cpu_state_reset() to mips_cpu_reset(). Acked-by: Richard Henderson <rth@twiddle.net> (for alpha) [AF: Rebased onto ppc CPU subclasses and openpic changes] Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'hw/spapr_rtas.c')
-rw-r--r--hw/spapr_rtas.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/hw/spapr_rtas.c b/hw/spapr_rtas.c
index 81eecd0940..5ec787f29d 100644
--- a/hw/spapr_rtas.c
+++ b/hw/spapr_rtas.c
@@ -131,6 +131,7 @@ static void rtas_query_cpu_stopped_state(sPAPREnvironment *spapr,
{
target_ulong id;
CPUPPCState *env;
+ CPUState *cpu;
if (nargs != 1 || nret != 2) {
rtas_st(rets, 0, -3);
@@ -139,7 +140,8 @@ static void rtas_query_cpu_stopped_state(sPAPREnvironment *spapr,
id = rtas_ld(args, 0);
for (env = first_cpu; env; env = env->next_cpu) {
- if (env->cpu_index != id) {
+ cpu = CPU(ppc_env_get_cpu(env));
+ if (cpu->cpu_index != id) {
continue;
}
@@ -176,9 +178,9 @@ static void rtas_start_cpu(sPAPREnvironment *spapr,
r3 = rtas_ld(args, 2);
for (env = first_cpu; env; env = env->next_cpu) {
- cpu = ENV_GET_CPU(env);
+ cpu = CPU(ppc_env_get_cpu(env));
- if (env->cpu_index != id) {
+ if (cpu->cpu_index != id) {
continue;
}