@@ -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;
/**
@@ -297,9 +299,9 @@ struct HPPACPUClass {
#include "exec/cpu-all.h"
-static inline bool hppa_is_pa20(CPUHPPAState *env)
+static inline bool hppa_is_pa20(const 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)
@@ -209,6 +209,8 @@ static void hppa_cpu_reset_hold(Object *obj, ResetType type)
memset(env, 0, offsetof(CPUHPPAState, end_reset_fields));
+ env->is_pa20 = !!object_dynamic_cast(obj, TYPE_HPPA64_CPU);
+
cpu_hppa_loaded_fr0(env);
cpu_hppa_put_psw(env, PSW_M);
}