aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAurelien Jarno <aurelien@aurel32.net>2010-02-01 20:02:23 +0100
committerAurelien Jarno <aurelien@aurel32.net>2010-02-09 21:08:05 +0100
commit0f3f1ec787009388b6fd77141ceb568d9bce05f7 (patch)
tree5c17cae7e07c5a906679c792b3e8d631bde2f6fc
parent1f486815aea9d5482772fc0cf60c4ef186f08cba (diff)
target-sh4: MMU: simplify call to tlb_set_page()
tlb_set_page() doesn't need addresses with offset, but simply the page aligned addresses. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
-rw-r--r--target-sh4/helper.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/target-sh4/helper.c b/target-sh4/helper.c
index e7c494fb9a..f9bf5e2084 100644
--- a/target-sh4/helper.c
+++ b/target-sh4/helper.c
@@ -464,7 +464,7 @@ static int get_physical_address(CPUState * env, target_ulong * physical,
int cpu_sh4_handle_mmu_fault(CPUState * env, target_ulong address, int rw,
int mmu_idx, int is_softmmu)
{
- target_ulong physical, page_offset, page_size;
+ target_ulong physical;
int prot, ret, access_type;
access_type = ACCESS_INT;
@@ -511,11 +511,8 @@ int cpu_sh4_handle_mmu_fault(CPUState * env, target_ulong address, int rw,
return 1;
}
- page_size = TARGET_PAGE_SIZE;
- page_offset =
- (address - (address & TARGET_PAGE_MASK)) & ~(page_size - 1);
- address = (address & TARGET_PAGE_MASK) + page_offset;
- physical = (physical & TARGET_PAGE_MASK) + page_offset;
+ address &= TARGET_PAGE_MASK;
+ physical &= TARGET_PAGE_MASK;
return tlb_set_page(env, address, physical, prot, mmu_idx, is_softmmu);
}