提交 53574064 编写于 作者: D Dunrong Huang 提交者: Blue Swirl

target-moxie: set do_interrupt to a target-specific helper function

The value of "do_interrupt" member of CPUClass shoule be set to a
target-specific function, or it will lead to a segfault like below:

$ moxie-softmmu/qemu-system-moxie -M moxiesim
Segmentation fault

Cc: Anthony Green <green@moxielogic.com>
Cc: Blue Swirl <blauwirbel@gmail.com>
Cc: Andreas Färber <afaerber@suse.de>
Signed-off-by: NDunrong Huang <huangdr@cloud-times.com>
Signed-of-by: NAnthony Green <green@moxielogic.com>
Reviewed-by: NAndreas Färber <afaerber@suse.de>
Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
上级 5e3a0f41
......@@ -98,6 +98,7 @@ static void moxie_cpu_class_init(ObjectClass *oc, void *data)
cc->class_by_name = moxie_cpu_class_by_name;
dc->vmsd = &vmstate_moxie_cpu;
cc->do_interrupt = moxie_cpu_do_interrupt;
}
static void moxielite_initfn(Object *obj)
......
......@@ -117,7 +117,7 @@ static inline MoxieCPU *moxie_env_get_cpu(CPUMoxieState *env)
MoxieCPU *cpu_moxie_init(const char *cpu_model);
int cpu_moxie_exec(CPUMoxieState *s);
void do_interrupt(CPUMoxieState *env);
void moxie_cpu_do_interrupt(CPUState *cs);
void moxie_translate_init(void);
int cpu_moxie_signal_handler(int host_signum, void *pinfo,
void *puc);
......
......@@ -102,7 +102,7 @@ void helper_debug(CPUMoxieState *env)
#if defined(CONFIG_USER_ONLY)
void do_interrupt(CPUState *env)
void moxie_cpu_do_interrupt(CPUState *env)
{
env->exception_index = -1;
}
......@@ -147,8 +147,11 @@ int cpu_moxie_handle_mmu_fault(CPUMoxieState *env, target_ulong address,
}
void do_interrupt(CPUMoxieState *env)
void moxie_cpu_do_interrupt(CPUState *cs)
{
MoxieCPU *cpu = MOXIE_CPU(cs);
CPUMoxieState *env = &cpu->env;
switch (env->exception_index) {
case MOXIE_EX_BREAK:
break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册