@@ -393,4 +393,28 @@ static inline CPUState *env_cpu(CPUArchState *env)
return &env_archcpu(env)->parent_obj;
}
+/**
+ * env_neg(env)
+ * @env: The architecture environment
+ *
+ * Return the CPUNegativeOffsetState associated with the environment.
+ */
+static inline CPUNegativeOffsetState *env_neg(CPUArchState *env)
+{
+ ArchCPU *arch_cpu = container_of(env, ArchCPU, env);
+ return &arch_cpu->neg;
+}
+
+/**
+ * cpu_neg(cpu)
+ * @cpu: The generic CPUState
+ *
+ * Return the CPUNegativeOffsetState associated with the cpu.
+ */
+static inline CPUNegativeOffsetState *cpu_neg(CPUState *cpu)
+{
+ /* ??? The env_ptr can probably now be eliminated using ArchCPU. */
+ return env_neg(cpu->env_ptr);
+}
+
#endif /* CPU_ALL_H */
@@ -227,4 +227,12 @@ typedef struct CPUTLB {
#endif /* !CONFIG_USER_ONLY && CONFIG_TCG */
+/*
+ * This structure must be placed in ArchCPU immedately
+ * before CPUArchState, as a field named "neg".
+ */
+typedef struct CPUNegativeOffsetState {
+ /* Empty */
+} CPUNegativeOffsetState;
+
#endif
@@ -267,6 +267,7 @@ struct AlphaCPU {
CPUState parent_obj;
/*< public >*/
+ CPUNegativeOffsetState neg;
CPUAlphaState env;
/* This alarm doesn't exist in real hardware; we wish it did. */
@@ -711,6 +711,7 @@ struct ARMCPU {
CPUState parent_obj;
/*< public >*/
+ CPUNegativeOffsetState neg;
CPUARMState env;
/* Coprocessor information */
@@ -180,6 +180,7 @@ struct CRISCPU {
CPUState parent_obj;
/*< public >*/
+ CPUNegativeOffsetState neg;
CPUCRISState env;
};
@@ -218,6 +218,7 @@ struct HPPACPU {
CPUState parent_obj;
/*< public >*/
+ CPUNegativeOffsetState neg;
CPUHPPAState env;
QEMUTimer *alarm_timer;
};
@@ -1366,6 +1366,7 @@ struct X86CPU {
CPUState parent_obj;
/*< public >*/
+ CPUNegativeOffsetState neg;
CPUX86State env;
bool hyperv_vapic;
@@ -186,6 +186,7 @@ struct LM32CPU {
CPUState parent_obj;
/*< public >*/
+ CPUNegativeOffsetState neg;
CPULM32State env;
uint32_t revision;
@@ -160,6 +160,7 @@ struct M68kCPU {
CPUState parent_obj;
/*< public >*/
+ CPUNegativeOffsetState neg;
CPUM68KState env;
};
@@ -287,6 +287,9 @@ struct MicroBlazeCPU {
/*< public >*/
+ CPUNegativeOffsetState neg;
+ CPUMBState env;
+
/* Microblaze Configuration Settings */
struct {
bool stackprot;
@@ -306,8 +309,6 @@ struct MicroBlazeCPU {
char *version;
uint8_t pvr;
} cfg;
-
- CPUMBState env;
};
@@ -1048,6 +1048,7 @@ struct MIPSCPU {
CPUState parent_obj;
/*< public >*/
+ CPUNegativeOffsetState neg;
CPUMIPSState env;
};
@@ -87,6 +87,7 @@ typedef struct MoxieCPU {
CPUState parent_obj;
/*< public >*/
+ CPUNegativeOffsetState neg;
CPUMoxieState env;
} MoxieCPU;
@@ -181,7 +181,9 @@ typedef struct Nios2CPU {
CPUState parent_obj;
/*< public >*/
+ CPUNegativeOffsetState neg;
CPUNios2State env;
+
bool mmu_present;
uint32_t pid_num_bits;
uint32_t tlb_num_ways;
@@ -313,8 +313,8 @@ typedef struct OpenRISCCPU {
CPUState parent_obj;
/*< public >*/
+ CPUNegativeOffsetState neg;
CPUOpenRISCState env;
-
} OpenRISCCPU;
@@ -1172,7 +1172,9 @@ struct PowerPCCPU {
CPUState parent_obj;
/*< public >*/
+ CPUNegativeOffsetState neg;
CPUPPCState env;
+
int vcpu_id;
uint32_t compat_pvr;
PPCVirtualHypervisor *vhyp;
@@ -208,6 +208,7 @@ typedef struct RISCVCPU {
/*< private >*/
CPUState parent_obj;
/*< public >*/
+ CPUNegativeOffsetState neg;
CPURISCVState env;
} RISCVCPU;
@@ -156,6 +156,7 @@ struct S390CPU {
CPUState parent_obj;
/*< public >*/
+ CPUNegativeOffsetState neg;
CPUS390XState env;
S390CPUModel *model;
/* needed for live migration */
@@ -204,6 +204,7 @@ struct SuperHCPU {
CPUState parent_obj;
/*< public >*/
+ CPUNegativeOffsetState neg;
CPUSH4State env;
};
@@ -529,6 +529,7 @@ struct SPARCCPU {
CPUState parent_obj;
/*< public >*/
+ CPUNegativeOffsetState neg;
CPUSPARCState env;
};
@@ -135,6 +135,7 @@ typedef struct TileGXCPU {
CPUState parent_obj;
/*< public >*/
+ CPUNegativeOffsetState neg;
CPUTLGState env;
} TileGXCPU;
@@ -205,6 +205,7 @@ struct TriCoreCPU {
CPUState parent_obj;
/*< public >*/
+ CPUNegativeOffsetState neg;
CPUTriCoreState env;
};
@@ -73,6 +73,7 @@ struct UniCore32CPU {
CPUState parent_obj;
/*< public >*/
+ CPUNegativeOffsetState neg;
CPUUniCore32State env;
};
@@ -526,6 +526,7 @@ struct XtensaCPU {
CPUState parent_obj;
/*< public >*/
+ CPUNegativeOffsetState neg;
CPUXtensaState env;
};
Nothing in there so far, but all of the plumbing done within the target ArchCPU state. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> --- include/exec/cpu-all.h | 24 ++++++++++++++++++++++++ include/exec/cpu-defs.h | 8 ++++++++ target/alpha/cpu.h | 1 + target/arm/cpu.h | 1 + target/cris/cpu.h | 1 + target/hppa/cpu.h | 1 + target/i386/cpu.h | 1 + target/lm32/cpu.h | 1 + target/m68k/cpu.h | 1 + target/microblaze/cpu.h | 5 +++-- target/mips/cpu.h | 1 + target/moxie/cpu.h | 1 + target/nios2/cpu.h | 2 ++ target/openrisc/cpu.h | 2 +- target/ppc/cpu.h | 2 ++ target/riscv/cpu.h | 1 + target/s390x/cpu.h | 1 + target/sh4/cpu.h | 1 + target/sparc/cpu.h | 1 + target/tilegx/cpu.h | 1 + target/tricore/cpu.h | 1 + target/unicore32/cpu.h | 1 + target/xtensa/cpu.h | 1 + 23 files changed, 57 insertions(+), 3 deletions(-) -- 2.17.1