]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
target-arm: Add GICv3CPUState in CPUARMState struct
authorVijaya Kumar K <Vijaya.Kumar@cavium.com>
Thu, 23 Feb 2017 11:51:12 +0000 (17:21 +0530)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 28 Feb 2017 17:10:00 +0000 (17:10 +0000)
Add gicv3state void pointer to CPUARMState struct
to store GICv3CPUState.

In case of usecase like CPU reset, we need to reset
GICv3CPUState of the CPU. In such scenario, this pointer
becomes handy.

Signed-off-by: Vijaya Kumar K <Vijaya.Kumar@cavium.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Message-id: 1487850673-26455-5-git-send-email-vijay.kilari@gmail.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/intc/arm_gicv3_common.c
hw/intc/arm_gicv3_cpuif.c
hw/intc/gicv3_internal.h
target/arm/cpu.h

index 5b0e456383f453c32e9f73656f7cc1a0c66b3e97..c6493d6c074aabea1078f2d4594367d89b10fe3a 100644 (file)
@@ -252,6 +252,8 @@ static void arm_gicv3_common_realize(DeviceState *dev, Error **errp)
 
         s->cpu[i].cpu = cpu;
         s->cpu[i].gic = s;
+        /* Store GICv3CPUState in CPUARMState gicv3state pointer */
+        gicv3_set_gicv3state(cpu, &s->cpu[i]);
 
         /* Pre-construct the GICR_TYPER:
          * For our implementation:
index f775aba507cbcd3813ff477d484dfd769a166a53..0b208560bde4c8c7125edde3703379f650f72270 100644 (file)
 #include "gicv3_internal.h"
 #include "cpu.h"
 
+void gicv3_set_gicv3state(CPUState *cpu, GICv3CPUState *s)
+{
+    ARMCPU *arm_cpu = ARM_CPU(cpu);
+    CPUARMState *env = &arm_cpu->env;
+
+    env->gicv3state = (void *)s;
+};
+
 static GICv3CPUState *icc_cs_from_env(CPUARMState *env)
 {
     /* Given the CPU, find the right GICv3CPUState struct.
index 457118ed390dd371698125993b46c288e3240abf..05303a55c889aa745f2bdd099dc4315ce1e2abae 100644 (file)
@@ -408,4 +408,6 @@ static inline void gicv3_cache_all_target_cpustates(GICv3State *s)
     }
 }
 
+void gicv3_set_gicv3state(CPUState *cpu, GICv3CPUState *s);
+
 #endif /* QEMU_ARM_GICV3_INTERNAL_H */
index 9e7b2dfc8345eac1b1fddc4612a9d4bd0230c6fc..25ceaabb5ded391907e7f12bf43b6b11a75b7bf7 100644 (file)
@@ -521,6 +521,8 @@ typedef struct CPUARMState {
 
     void *nvic;
     const struct arm_boot_info *boot_info;
+    /* Store GICv3CPUState to access from this struct */
+    void *gicv3state;
 } CPUARMState;
 
 /**