diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2013-03-13 11:40:33 +1100 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2013-03-22 15:28:53 +0100 |
commit | b632a148b677b773ff155f9de840b37a653567b9 (patch) | |
tree | aab465efcff6575e29d7505ef15b485a45fa8836 /target-ppc/cpu-qom.h | |
parent | eb20c1c6da60c8c75f08def03b0822a48af620ac (diff) |
target-ppc: Use QOM method dispatch for MMU fault handling
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 <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'target-ppc/cpu-qom.h')
-rw-r--r-- | target-ppc/cpu-qom.h | 4 |
1 files changed, 4 insertions, 0 deletions
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; /** |