summaryrefslogtreecommitdiffstats
path: root/target-arm/cpu.c
diff options
context:
space:
mode:
authorRob Herring <rob.herring@linaro.org>2014-10-24 12:19:12 +0100
committerPeter Maydell <peter.maydell@linaro.org>2014-10-24 12:19:12 +0100
commit543486db353b53f3601d0b5abf652ab330261107 (patch)
tree30ef6d4a8a7cd77c3e4d6cbf86f8c07bba3b4ad9 /target-arm/cpu.c
parent635117e71fc697824e82cc694ba4e44dda7a9216 (diff)
downloadhqemu-543486db353b53f3601d0b5abf652ab330261107.zip
hqemu-543486db353b53f3601d0b5abf652ab330261107.tar.gz
target-arm: add powered off cpu state
Add tracking of cpu power state in order to support powering off of cores in system emuluation. The initial state is determined by the start-powered-off QOM property. Signed-off-by: Rob Herring <rob.herring@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1412865028-17725-2-git-send-email-peter.maydell@linaro.org
Diffstat (limited to 'target-arm/cpu.c')
-rw-r--r--target-arm/cpu.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/target-arm/cpu.c b/target-arm/cpu.c
index edfd586..67cd176 100644
--- a/target-arm/cpu.c
+++ b/target-arm/cpu.c
@@ -40,7 +40,10 @@ static void arm_cpu_set_pc(CPUState *cs, vaddr value)
static bool arm_cpu_has_work(CPUState *cs)
{
- return cs->interrupt_request &
+ ARMCPU *cpu = ARM_CPU(cs);
+
+ return !cpu->powered_off
+ && cs->interrupt_request &
(CPU_INTERRUPT_FIQ | CPU_INTERRUPT_HARD
| CPU_INTERRUPT_VFIQ | CPU_INTERRUPT_VIRQ
| CPU_INTERRUPT_EXITTB);
@@ -93,6 +96,9 @@ static void arm_cpu_reset(CPUState *s)
env->vfp.xregs[ARM_VFP_MVFR1] = cpu->mvfr1;
env->vfp.xregs[ARM_VFP_MVFR2] = cpu->mvfr2;
+ cpu->powered_off = cpu->start_powered_off;
+ s->halted = cpu->start_powered_off;
+
if (arm_feature(env, ARM_FEATURE_IWMMXT)) {
env->iwmmxt.cregs[ARM_IWMMXT_wCID] = 0x69051000 | 'Q';
}
OpenPOWER on IntegriCloud