aboutsummaryrefslogtreecommitdiff
path: root/target-s390x/helper.c
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2013-08-26 03:01:33 +0200
committerAndreas Färber <afaerber@suse.de>2014-03-13 19:20:46 +0100
commit7510454e3e74aafa2e6c50388bf24904644b6a96 (patch)
treed529c51ffa5633e8e067ae092bbc33bcf9a7bd8f /target-s390x/helper.c
parent7372c2b926200db295412efbb53f93773b7f1754 (diff)
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-s390x/helper.c')
-rw-r--r--target-s390x/helper.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/target-s390x/helper.c b/target-s390x/helper.c
index 0bae0a32fd..e71e5fd563 100644
--- a/target-s390x/helper.c
+++ b/target-s390x/helper.c
@@ -91,14 +91,16 @@ void s390_cpu_do_interrupt(CPUState *cs)
env->exception_index = -1;
}
-int cpu_s390x_handle_mmu_fault(CPUS390XState *env, target_ulong address,
- int rw, int mmu_idx)
+int s390_cpu_handle_mmu_fault(CPUState *cs, vaddr address,
+ int rw, int mmu_idx)
{
- env->exception_index = EXCP_PGM;
- env->int_pgm_code = PGM_ADDRESSING;
+ S390CPU *cpu = S390_CPU(cs);
+
+ cpu->env.exception_index = EXCP_PGM;
+ cpu->env.int_pgm_code = PGM_ADDRESSING;
/* On real machines this value is dropped into LowMem. Since this
is userland, simply put this someplace that cpu_loop can find it. */
- env->__excp_addr = address;
+ cpu->env.__excp_addr = address;
return 1;
}
@@ -379,14 +381,16 @@ int mmu_translate(CPUS390XState *env, target_ulong vaddr, int rw, uint64_t asc,
return r;
}
-int cpu_s390x_handle_mmu_fault(CPUS390XState *env, target_ulong orig_vaddr,
- int rw, int mmu_idx)
+int s390_cpu_handle_mmu_fault(CPUState *cs, vaddr orig_vaddr,
+ int rw, int mmu_idx)
{
+ S390CPU *cpu = S390_CPU(cs);
+ CPUS390XState *env = &cpu->env;
uint64_t asc = env->psw.mask & PSW_MASK_ASC;
target_ulong vaddr, raddr;
int prot;
- DPRINTF("%s: address 0x%" PRIx64 " rw %d mmu_idx %d\n",
+ DPRINTF("%s: address 0x%" VADDR_PRIx " rw %d mmu_idx %d\n",
__func__, orig_vaddr, rw, mmu_idx);
orig_vaddr &= TARGET_PAGE_MASK;