summaryrefslogtreecommitdiff
path: root/hw/arm_gic.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/arm_gic.c')
-rw-r--r--hw/arm_gic.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/arm_gic.c b/hw/arm_gic.c
index 466dbf7398..90e43d0728 100644
--- a/hw/arm_gic.c
+++ b/hw/arm_gic.c
@@ -39,7 +39,8 @@ static const uint8_t gic_id[] = {
static inline int gic_get_current_cpu(GICState *s)
{
if (s->num_cpu > 1) {
- return cpu_single_env->cpu_index;
+ CPUState *cpu = ENV_GET_CPU(cpu_single_env);
+ return cpu->cpu_index;
}
return 0;
}