{
CPUState *env = opaque;
cpu_reset(env);
+ cpu_mips_register(env, NULL);
/* The bootload does not need to be rewritten as it is located in a
read only location. The kernel location and the arguments table
{
CPUState *env = opaque;
cpu_reset(env);
+ cpu_mips_register(env, NULL);
}
static
{
CPUState *env = opaque;
cpu_reset(env);
+ cpu_mips_register(env, NULL);
if (env->kernel_filename)
load_kernel (env, env->ram_size, env->kernel_filename,
target_ulong PFN[2];
};
+typedef struct mips_def_t mips_def_t;
+
typedef struct CPUMIPSState CPUMIPSState;
struct CPUMIPSState {
/* General integer registers */
const char *kernel_cmdline;
const char *initrd_filename;
+ mips_def_t *cpu_model;
+
struct QEMUTimer *timer; /* Internal timer */
};
void r4k_do_tlbwr (void);
void r4k_do_tlbp (void);
void r4k_do_tlbr (void);
-typedef struct mips_def_t mips_def_t;
int mips_find_by_name (const unsigned char *name, mips_def_t **def);
void mips_cpu_list (FILE *f, int (*cpu_fprintf)(FILE *f, const char *fmt, ...));
int cpu_mips_register (CPUMIPSState *env, mips_def_t *def);
int cpu_mips_register (CPUMIPSState *env, mips_def_t *def)
{
+ if (!def)
+ def = env->cpu_model;
if (!def)
cpu_abort(env, "Unable to find MIPS CPU definition\n");
+ env->cpu_model = def;
env->CP0_PRid = def->CP0_PRid;
-#ifdef TARGET_WORDS_BIGENDIAN
- env->CP0_Config0 = def->CP0_Config0 | (1 << CP0C0_BE);
-#else
env->CP0_Config0 = def->CP0_Config0;
+#ifdef TARGET_WORDS_BIGENDIAN
+ env->CP0_Config0 |= (1 << CP0C0_BE);
#endif
env->CP0_Config1 = def->CP0_Config1;
env->CP0_Config2 = def->CP0_Config2;