diff options
Diffstat (limited to 'target-alpha')
-rw-r--r-- | target-alpha/cpu.c | 4 | ||||
-rw-r--r-- | target-alpha/cpu.h | 5 | ||||
-rw-r--r-- | target-alpha/helper.c | 12 | ||||
-rw-r--r-- | target-alpha/mem_helper.c | 3 |
4 files changed, 15 insertions, 9 deletions
diff --git a/target-alpha/cpu.c b/target-alpha/cpu.c index cf2a3156d1..4d8263f37d 100644 --- a/target-alpha/cpu.c +++ b/target-alpha/cpu.c @@ -288,7 +288,9 @@ static void alpha_cpu_class_init(ObjectClass *oc, void *data) cc->set_pc = alpha_cpu_set_pc; cc->gdb_read_register = alpha_cpu_gdb_read_register; cc->gdb_write_register = alpha_cpu_gdb_write_register; -#ifndef CONFIG_USER_ONLY +#ifdef CONFIG_USER_ONLY + cc->handle_mmu_fault = alpha_cpu_handle_mmu_fault; +#else cc->do_unassigned_access = alpha_cpu_unassigned_access; cc->get_phys_page_debug = alpha_cpu_get_phys_page_debug; dc->vmsd = &vmstate_alpha_cpu; diff --git a/target-alpha/cpu.h b/target-alpha/cpu.h index a172124170..07d9f63d1f 100644 --- a/target-alpha/cpu.h +++ b/target-alpha/cpu.h @@ -446,9 +446,8 @@ int cpu_alpha_exec(CPUAlphaState *s); is returned if the signal was handled by the virtual CPU. */ int cpu_alpha_signal_handler(int host_signum, void *pinfo, void *puc); -int cpu_alpha_handle_mmu_fault (CPUAlphaState *env, uint64_t address, int rw, - int mmu_idx); -#define cpu_handle_mmu_fault cpu_alpha_handle_mmu_fault +int alpha_cpu_handle_mmu_fault(CPUState *cpu, vaddr address, int rw, + int mmu_idx); void do_restore_state(CPUAlphaState *, uintptr_t retaddr); void QEMU_NORETURN dynamic_excp(CPUAlphaState *, uintptr_t, int, int); void QEMU_NORETURN arith_excp(CPUAlphaState *, uintptr_t, int, uint64_t); diff --git a/target-alpha/helper.c b/target-alpha/helper.c index 98ddcdf4e3..9c94b4382c 100644 --- a/target-alpha/helper.c +++ b/target-alpha/helper.c @@ -168,11 +168,13 @@ void helper_store_fpcr(CPUAlphaState *env, uint64_t val) } #if defined(CONFIG_USER_ONLY) -int cpu_alpha_handle_mmu_fault(CPUAlphaState *env, target_ulong address, +int alpha_cpu_handle_mmu_fault(CPUState *cs, vaddr address, int rw, int mmu_idx) { - env->exception_index = EXCP_MMFAULT; - env->trap_arg0 = address; + AlphaCPU *cpu = ALPHA_CPU(cs); + + cpu->env.exception_index = EXCP_MMFAULT; + cpu->env.trap_arg0 = address; return 1; } #else @@ -326,9 +328,11 @@ hwaddr alpha_cpu_get_phys_page_debug(CPUState *cs, vaddr addr) return (fail >= 0 ? -1 : phys); } -int cpu_alpha_handle_mmu_fault(CPUAlphaState *env, target_ulong addr, int rw, +int alpha_cpu_handle_mmu_fault(CPUState *cs, vaddr addr, int rw, int mmu_idx) { + AlphaCPU *cpu = ALPHA_CPU(cs); + CPUAlphaState *env = &cpu->env; target_ulong phys; int prot, fail; diff --git a/target-alpha/mem_helper.c b/target-alpha/mem_helper.c index e1aba64416..d195935a96 100644 --- a/target-alpha/mem_helper.c +++ b/target-alpha/mem_helper.c @@ -153,9 +153,10 @@ void alpha_cpu_unassigned_access(CPUState *cs, hwaddr addr, void tlb_fill(CPUAlphaState *env, target_ulong addr, int is_write, int mmu_idx, uintptr_t retaddr) { + AlphaCPU *cpu = alpha_env_get_cpu(env); int ret; - ret = cpu_alpha_handle_mmu_fault(env, addr, is_write, mmu_idx); + ret = alpha_cpu_handle_mmu_fault(CPU(cpu), addr, is_write, mmu_idx); if (unlikely(ret != 0)) { if (retaddr) { cpu_restore_state(env, retaddr); |