From a7813d2d913c3bb9feff15d1d63cd66c634f416d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Fr=C3=B6schle?= Date: Sun, 28 Sep 2014 16:44:39 +0000 Subject: [PATCH] for ITLB misses, map following page also since sometimes (prefetch?) the fault PC reported by the access error exceptions seems to be off a few instructions. --- Bas_gcc_mmu/sys/mmu.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Bas_gcc_mmu/sys/mmu.c b/Bas_gcc_mmu/sys/mmu.c index f22a909..11f9196 100644 --- a/Bas_gcc_mmu/sys/mmu.c +++ b/Bas_gcc_mmu/sys/mmu.c @@ -63,7 +63,7 @@ #error "unknown machine!" #endif /* MACHINE_FIREBEE */ -#define DBG_MMU +//#define DBG_MMU #ifdef DBG_MMU #define dbg(format, arg...) do { xprintf("DEBUG (%s()): " format, __FUNCTION__, ##arg);} while(0) #else @@ -686,6 +686,9 @@ uint32_t mmutr_miss(uint32_t mmu_sr, uint32_t fault_address, uint32_t pc, fault_address, format_status, mmu_sr, pc); dbg("fault = 0x%08x\r\n", fault); mmu_map_8k_instruction_page(pc, 0); + + /* due to prefetch, it makes sense to map the next adjacent page also for ITLBs */ + mmu_map_8k_instruction_page(pc + DEFAULT_PAGE_SIZE, 0); break; case 0x08020000: /* TLB miss on data write */