mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-02-25 16:26:50 +00:00
target-i386: Eliminate cpu_init() function
Instead of putting extra logic inside cpu.h, just do everything inside cpu_x86_init_user(). Backports commit 15258d46baef5f8265ad5f1002905664cf58f051 from qem
This commit is contained in:
parent
68fa057b7c
commit
51b49a5b97
|
@ -1805,7 +1805,7 @@ out:
|
|||
return cpu;
|
||||
}
|
||||
|
||||
X86CPU *cpu_x86_init_user(struct uc_struct *uc, const char *cpu_model)
|
||||
CPUX86State *cpu_x86_init_user(struct uc_struct *uc, const char *cpu_model)
|
||||
{
|
||||
Error *error = NULL;
|
||||
X86CPU *cpu;
|
||||
|
@ -1822,10 +1822,10 @@ out:
|
|||
error_free(error);
|
||||
if (cpu != NULL) {
|
||||
object_unref(uc, OBJECT(cpu));
|
||||
cpu = NULL;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
return cpu;
|
||||
return &cpu->env;
|
||||
}
|
||||
|
||||
static void x86_cpu_cpudef_class_init(struct uc_struct *uc, ObjectClass *oc, void *data)
|
||||
|
|
|
@ -979,7 +979,6 @@ typedef struct CPUX86State {
|
|||
|
||||
#include "cpu-qom.h"
|
||||
|
||||
X86CPU *cpu_x86_init_user(struct uc_struct *uc, const char *cpu_model);
|
||||
X86CPU *cpu_x86_create(struct uc_struct *uc, const char *cpu_model, Error **errp);
|
||||
int cpu_x86_exec(struct uc_struct *uc, CPUX86State *s);
|
||||
void x86_cpudef_setup(void);
|
||||
|
@ -1165,14 +1164,8 @@ uint64_t cpu_get_tsc(CPUX86State *env);
|
|||
# define PHYS_ADDR_MASK 0xfffffffffLL
|
||||
# endif
|
||||
|
||||
static inline CPUX86State *cpu_init(struct uc_struct *uc, const char *cpu_model)
|
||||
{
|
||||
X86CPU *cpu = cpu_x86_init_user(uc, cpu_model);
|
||||
if (cpu == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
return &cpu->env;
|
||||
}
|
||||
CPUX86State *cpu_x86_init_user(struct uc_struct *uc, const char *cpu_model);
|
||||
#define cpu_init cpu_x86_init_user
|
||||
|
||||
#ifdef TARGET_I386
|
||||
#define cpu_exec cpu_x86_exec
|
||||
|
|
Loading…
Reference in a new issue