mirror of https://github.com/xemu-project/xemu.git
target/hppa: Introduce TYPE_HPPA64_CPU
Prepare for the qemu binary supporting both pa10 and pa20 at the same time. Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
d781cb7798
commit
bd6243a33f
|
@ -24,6 +24,7 @@
|
||||||
#include "qom/object.h"
|
#include "qom/object.h"
|
||||||
|
|
||||||
#define TYPE_HPPA_CPU "hppa-cpu"
|
#define TYPE_HPPA_CPU "hppa-cpu"
|
||||||
|
#define TYPE_HPPA64_CPU "hppa64-cpu"
|
||||||
|
|
||||||
OBJECT_DECLARE_CPU_TYPE(HPPACPU, HPPACPUClass, HPPA_CPU)
|
OBJECT_DECLARE_CPU_TYPE(HPPACPU, HPPACPUClass, HPPA_CPU)
|
||||||
|
|
||||||
|
|
|
@ -209,7 +209,8 @@ static void hppa_cpu_class_init(ObjectClass *oc, void *data)
|
||||||
cc->tcg_ops = &hppa_tcg_ops;
|
cc->tcg_ops = &hppa_tcg_ops;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const TypeInfo hppa_cpu_type_info = {
|
static const TypeInfo hppa_cpu_type_infos[] = {
|
||||||
|
{
|
||||||
.name = TYPE_HPPA_CPU,
|
.name = TYPE_HPPA_CPU,
|
||||||
.parent = TYPE_CPU,
|
.parent = TYPE_CPU,
|
||||||
.instance_size = sizeof(HPPACPU),
|
.instance_size = sizeof(HPPACPU),
|
||||||
|
@ -218,11 +219,13 @@ static const TypeInfo hppa_cpu_type_info = {
|
||||||
.abstract = false,
|
.abstract = false,
|
||||||
.class_size = sizeof(HPPACPUClass),
|
.class_size = sizeof(HPPACPUClass),
|
||||||
.class_init = hppa_cpu_class_init,
|
.class_init = hppa_cpu_class_init,
|
||||||
|
},
|
||||||
|
#ifdef TARGET_HPPA64
|
||||||
|
{
|
||||||
|
.name = TYPE_HPPA64_CPU,
|
||||||
|
.parent = TYPE_HPPA_CPU,
|
||||||
|
},
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
static void hppa_cpu_register_types(void)
|
DEFINE_TYPES(hppa_cpu_type_infos)
|
||||||
{
|
|
||||||
type_register_static(&hppa_cpu_type_info);
|
|
||||||
}
|
|
||||||
|
|
||||||
type_init(hppa_cpu_register_types)
|
|
||||||
|
|
|
@ -272,6 +272,11 @@ struct ArchCPU {
|
||||||
|
|
||||||
#include "exec/cpu-all.h"
|
#include "exec/cpu-all.h"
|
||||||
|
|
||||||
|
static inline bool hppa_is_pa20(CPUHPPAState *env)
|
||||||
|
{
|
||||||
|
return object_dynamic_cast(OBJECT(env_cpu(env)), TYPE_HPPA64_CPU) != NULL;
|
||||||
|
}
|
||||||
|
|
||||||
static inline int cpu_mmu_index(CPUHPPAState *env, bool ifetch)
|
static inline int cpu_mmu_index(CPUHPPAState *env, bool ifetch)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_USER_ONLY
|
#ifdef CONFIG_USER_ONLY
|
||||||
|
|
|
@ -262,6 +262,7 @@ typedef struct DisasContext {
|
||||||
int mmu_idx;
|
int mmu_idx;
|
||||||
int privilege;
|
int privilege;
|
||||||
bool psw_n_nonzero;
|
bool psw_n_nonzero;
|
||||||
|
bool is_pa20;
|
||||||
|
|
||||||
#ifdef CONFIG_USER_ONLY
|
#ifdef CONFIG_USER_ONLY
|
||||||
MemOp unalign;
|
MemOp unalign;
|
||||||
|
@ -4091,6 +4092,7 @@ static void hppa_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs)
|
||||||
|
|
||||||
ctx->cs = cs;
|
ctx->cs = cs;
|
||||||
ctx->tb_flags = ctx->base.tb->flags;
|
ctx->tb_flags = ctx->base.tb->flags;
|
||||||
|
ctx->is_pa20 = hppa_is_pa20(cpu_env(cs));
|
||||||
|
|
||||||
#ifdef CONFIG_USER_ONLY
|
#ifdef CONFIG_USER_ONLY
|
||||||
ctx->privilege = MMU_IDX_TO_PRIV(MMU_USER_IDX);
|
ctx->privilege = MMU_IDX_TO_PRIV(MMU_USER_IDX);
|
||||||
|
|
Loading…
Reference in New Issue