From b632a148b677b773ff155f9de840b37a653567b9 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Wed, 13 Mar 2013 11:40:33 +1100 Subject: target-ppc: Use QOM method dispatch for MMU fault handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After previous cleanups, the many scattered checks of env->mmu_model in the ppc MMU implementation have, at least for "classic" hash MMUs been reduced (almost) to a single switch at the top of cpu_ppc_handle_mmu_fault(). An explicit switch is still a pretty ugly way of handling this though. Now that Andreas Färber's CPU QOM cleanups for ppc have gone in, it's quite straightforward to instead make the handle_mmu_fault function a QOM method on the CPU object. This patch implements such a scheme, initializing the method pointer at the same time as the mmu_model variable. We need to keep the latter around for now, because of the MMU types (BookE, 4xx, et al) which haven't been converted to the new scheme yet, and also for a few other uses. It would be good to clean those up eventually. Signed-off-by: David Gibson Signed-off-by: Alexander Graf --- target-ppc/cpu-qom.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'target-ppc/cpu-qom.h') diff --git a/target-ppc/cpu-qom.h b/target-ppc/cpu-qom.h index 09bfae3d54..c27cef7e32 100644 --- a/target-ppc/cpu-qom.h +++ b/target-ppc/cpu-qom.h @@ -68,6 +68,10 @@ typedef struct PowerPCCPUClass { #endif void (*init_proc)(CPUPPCState *env); int (*check_pow)(CPUPPCState *env); +#if defined(CONFIG_SOFTMMU) + int (*handle_mmu_fault)(CPUPPCState *env, target_ulong eaddr, int rwx, + int mmu_idx); +#endif } PowerPCCPUClass; /** -- cgit v1.2.3