aboutsummaryrefslogtreecommitdiff
path: root/target-arm/cpu-qom.h
diff options
context:
space:
mode:
Diffstat (limited to 'target-arm/cpu-qom.h')
-rw-r--r--target-arm/cpu-qom.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/target-arm/cpu-qom.h b/target-arm/cpu-qom.h
index b2917ea935..9e33b6a2e3 100644
--- a/target-arm/cpu-qom.h
+++ b/target-arm/cpu-qom.h
@@ -21,6 +21,7 @@
#define QEMU_ARM_CPU_QOM_H
#include "qemu/cpu.h"
+#include "cpu.h"
#define TYPE_ARM_CPU "arm-cpu"
@@ -51,6 +52,7 @@ typedef struct ARMCPUClass {
/**
* ARMCPU:
+ * @env: Legacy CPU state.
*
* An ARM CPU core.
*/
@@ -58,7 +60,17 @@ typedef struct ARMCPU {
/*< private >*/
CPUState parent_obj;
/*< public >*/
+
+ /* TODO Inline this and split off common state */
+ CPUARMState env;
} ARMCPU;
+static inline ARMCPU *arm_env_get_cpu(CPUARMState *env)
+{
+ return ARM_CPU(container_of(env, ARMCPU, env));
+}
+
+#define ENV_GET_CPU(e) CPU(arm_env_get_cpu(e))
+
#endif