From 7510454e3e74aafa2e6c50388bf24904644b6a96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Mon, 26 Aug 2013 03:01:33 +0200 Subject: cpu: Turn cpu_handle_mmu_fault() into a CPUClass hook MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- user-exec.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'user-exec.c') 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 */ } -- cgit v1.2.1