diff options
author | Andreas Färber <afaerber@suse.de> | 2013-08-26 03:01:33 +0200 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2014-03-13 19:20:46 +0100 |
commit | 7510454e3e74aafa2e6c50388bf24904644b6a96 (patch) | |
tree | d529c51ffa5633e8e067ae092bbc33bcf9a7bd8f /target-alpha/helper.c | |
parent | 7372c2b926200db295412efbb53f93773b7f1754 (diff) | |
download | qemu-7510454e3e74aafa2e6c50388bf24904644b6a96.zip qemu-7510454e3e74aafa2e6c50388bf24904644b6a96.tar.gz qemu-7510454e3e74aafa2e6c50388bf24904644b6a96.tar.bz2 |
cpu: Turn cpu_handle_mmu_fault() into a CPUClass hook
Note that while such functions may exist both for *-user and softmmu,
only *-user uses the CPUState hook, while softmmu reuses the prototype
for calling it directly.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'target-alpha/helper.c')
-rw-r--r-- | target-alpha/helper.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/target-alpha/helper.c b/target-alpha/helper.c index 98ddcdf..9c94b43 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; |