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 /user-exec.c | |
parent | 7372c2b926200db295412efbb53f93773b7f1754 (diff) | |
download | qemu-7510454e3e74aafa2e6c50388bf24904644b6a96.zip |
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 'user-exec.c')
-rw-r--r-- | user-exec.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/user-exec.c b/user-exec.c index 82bfa66ce3..d850d41d45 100644 --- a/user-exec.c +++ b/user-exec.c @@ -82,6 +82,8 @@ static inline int handle_cpu_signal(uintptr_t pc, unsigned long address, int is_write, sigset_t *old_set, void *puc) { + CPUState *cpu; + CPUClass *cc; CPUArchState *env; int ret; @@ -99,9 +101,12 @@ static inline int handle_cpu_signal(uintptr_t pc, unsigned long address, are still valid segv ones */ address = h2g_nocheck(address); - env = current_cpu->env_ptr; + cpu = current_cpu; + cc = CPU_GET_CLASS(cpu); + env = cpu->env_ptr; /* see if it is an MMU fault */ - ret = cpu_handle_mmu_fault(env, address, is_write, MMU_USER_IDX); + g_assert(cc->handle_mmu_fault); + ret = cc->handle_mmu_fault(cpu, address, is_write, MMU_USER_IDX); if (ret < 0) { return 0; /* not an MMU fault */ } |