@@ -44,6 +44,7 @@ typedef struct UniCore32CPUClass {
struct {
uint32_t c0_cpuid;
+ uint32_t c0_cachetype;
} cp0;
} UniCore32CPUClass;
@@ -17,12 +17,14 @@
typedef struct UniCore32CPUInfo {
const char *name;
uint32_t cp0_c0_cpuid;
+ uint32_t cp0_c0_cachetype;
} UniCore32CPUInfo;
static const UniCore32CPUInfo uc32_cpus[] = {
{
.name = "UniCore-II",
.cp0_c0_cpuid = 0x40010863,
+ .cp0_c0_cachetype = 0x1dd20d2,
},
{
.name = "any",
@@ -40,6 +42,7 @@ static void uc32_cpu_initfn(Object *obj)
cpu_exec_init(env);
env->cpu_model_str = object_get_typename(obj);
env->cp0.c0_cpuid = klass->cp0.c0_cpuid;
+ env->cp0.c0_cachetype = klass->cp0.c0_cachetype;
env->uncached_asr = ASR_MODE_USER;
env->regs[31] = 0;
@@ -53,6 +56,7 @@ static void uc32_cpu_class_init(ObjectClass *klass, void *data)
const UniCore32CPUInfo *info = data;
k->cp0.c0_cpuid = info->cp0_c0_cpuid;
+ k->cp0.c0_cachetype = info->cp0_c0_cachetype;
}
static void uc32_register_cpu(const UniCore32CPUInfo *info)
@@ -35,7 +35,6 @@ CPUUniCore32State *uc32_cpu_init(const char *cpu_model)
set_feature(env, UC32_HWCAP_CMOV);
set_feature(env, UC32_HWCAP_UCF64);
env->ucf64.xregs[UC32_UCF64_FPSCR] = 0;
- env->cp0.c0_cachetype = 0x1dd20d2;
env->cp0.c1_sys = 0x00090078;
break;
case UC32_CPUID_ANY: /* For userspace emulation. */
Contributed under GPLv2+. Signed-off-by: Andreas Färber <afaerber@suse.de> --- target-unicore32/cpu-qom.h | 1 + target-unicore32/cpu.c | 4 ++++ target-unicore32/helper.c | 1 - 3 files changed, 5 insertions(+), 1 deletions(-)