@@ -197,6 +197,7 @@ static void hppa_cpu_initfn(Object *obj)
HPPACPU *cpu = HPPA_CPU(obj);
CPUHPPAState *env = &cpu->env;
+ env->is_pa20 = !!object_dynamic_cast(obj, TYPE_HPPA64_CPU);
cpu_hppa_loaded_fr0(env);
cpu_hppa_put_psw(env, PSW_W);
}
@@ -266,6 +266,8 @@ typedef struct CPUArchState {
/* Fields up to this point are cleared by a CPU reset */
struct {} end_reset_fields;
+
+ bool is_pa20;
} CPUHPPAState;
/**
@@ -299,7 +301,7 @@ struct HPPACPUClass {
static inline bool hppa_is_pa20(CPUHPPAState *env)
{
- return object_dynamic_cast(OBJECT(env_cpu(env)), TYPE_HPPA64_CPU) != NULL;
+ return env->is_pa20;
}
static inline int HPPA_BTLB_ENTRIES(CPUHPPAState *env)