mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-02-02 04:41:03 +00:00
mips: replace cpu_mips_init() with cpu_generic_init()
now cpu_mips_init() reimplements subset of cpu_generic_init() tasks, so just drop it and use cpu_generic_init() directly. Backports commit c4c8146cfd0fc3f95418fbc82a2eded594675022 from qemu
This commit is contained in:
parent
97b525a794
commit
00d52414c1
|
@ -3506,7 +3506,6 @@ mips_symbols = (
|
||||||
'cpu_mips_exec',
|
'cpu_mips_exec',
|
||||||
'cpu_mips_get_count',
|
'cpu_mips_get_count',
|
||||||
'cpu_mips_get_random',
|
'cpu_mips_get_random',
|
||||||
'cpu_mips_init',
|
|
||||||
'cpu_mips_kseg0_to_phys',
|
'cpu_mips_kseg0_to_phys',
|
||||||
'cpu_mips_kvm_um_phys_to_kseg0',
|
'cpu_mips_kvm_um_phys_to_kseg0',
|
||||||
'cpu_mips_phys_to_kseg0',
|
'cpu_mips_phys_to_kseg0',
|
||||||
|
|
|
@ -36,7 +36,7 @@ static int mips_r4k_init(struct uc_struct *uc, MachineState *machine)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
uc->cpu = (void*) cpu_mips_init(uc, cpu_model);
|
uc->cpu = cpu_generic_init(uc, TYPE_MIPS_CPU, cpu_model);
|
||||||
if (uc->cpu == NULL) {
|
if (uc->cpu == NULL) {
|
||||||
fprintf(stderr, "Unable to find CPU definition\n");
|
fprintf(stderr, "Unable to find CPU definition\n");
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
@ -744,8 +744,8 @@ enum {
|
||||||
*/
|
*/
|
||||||
#define CPU_INTERRUPT_WAKE CPU_INTERRUPT_TGT_INT_0
|
#define CPU_INTERRUPT_WAKE CPU_INTERRUPT_TGT_INT_0
|
||||||
|
|
||||||
|
#define cpu_init(uc, cpu_model) cpu_generic_init(uc, TYPE_MIPS_CPU, cpu_model)
|
||||||
int cpu_mips_exec(struct uc_struct *uc, CPUState *cpu);
|
int cpu_mips_exec(struct uc_struct *uc, CPUState *cpu);
|
||||||
MIPSCPU *cpu_mips_init(struct uc_struct *uc, const char *cpu_model);
|
|
||||||
int cpu_mips_signal_handler(int host_signum, void *pinfo, void *puc);
|
int cpu_mips_signal_handler(int host_signum, void *pinfo, void *puc);
|
||||||
bool cpu_supports_isa(const char *cpu_model, unsigned int isa);
|
bool cpu_supports_isa(const char *cpu_model, unsigned int isa);
|
||||||
void cpu_set_exception_base(struct uc_struct *uc, int vp_index, target_ulong address);
|
void cpu_set_exception_base(struct uc_struct *uc, int vp_index, target_ulong address);
|
||||||
|
|
|
@ -20727,23 +20727,6 @@ void cpu_mips_realize_env(CPUMIPSState *env)
|
||||||
mvp_init(env, env->cpu_model);
|
mvp_init(env, env->cpu_model);
|
||||||
}
|
}
|
||||||
|
|
||||||
MIPSCPU *cpu_mips_init(struct uc_struct *uc, const char *cpu_model)
|
|
||||||
{
|
|
||||||
ObjectClass *oc;
|
|
||||||
MIPSCPU *cpu;
|
|
||||||
|
|
||||||
oc = cpu_class_by_name(uc, TYPE_MIPS_CPU, cpu_model);
|
|
||||||
if (oc == NULL) {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
cpu = MIPS_CPU(uc, object_new(uc, object_class_get_name(oc)));
|
|
||||||
|
|
||||||
object_property_set_bool(uc, OBJECT(cpu), true, "realized", NULL);
|
|
||||||
|
|
||||||
return cpu;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool cpu_supports_isa(const char *cpu_model, unsigned int isa)
|
bool cpu_supports_isa(const char *cpu_model, unsigned int isa)
|
||||||
{
|
{
|
||||||
const mips_def_t *def = cpu_mips_find_by_name(cpu_model);
|
const mips_def_t *def = cpu_mips_find_by_name(cpu_model);
|
||||||
|
|
Loading…
Reference in a new issue