From d785f552ee034aedb26aefc3e47e5c78cdcce065 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=98yvind=20Harboe?= <oyvind.harboe@zylin.com>
Date: Sun, 25 Oct 2009 18:24:18 +0100
Subject: [PATCH] check if mmu is enabled before using mmu code path

---
 src/target/arm926ejs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/target/arm926ejs.c b/src/target/arm926ejs.c
index 906117479..ef9a49413 100644
--- a/src/target/arm926ejs.c
+++ b/src/target/arm926ejs.c
@@ -713,7 +713,7 @@ int arm926ejs_write_memory(struct target_s *target, uint32_t address, uint32_t s
 	/* FIX!!!! this should be cleaned up and made much more general. The
 	 * plan is to write up and test on arm926ejs specifically and
 	 * then generalize and clean up afterwards. */
-	if ((count == 1) && ((size==2) || (size==4)))
+	if (arm926ejs->armv4_5_mmu.mmu_enabled && (count == 1) && ((size==2) || (size==4)))
 	{
 		/* special case the handling of single word writes to bypass MMU
 		 * to allow implementation of breakpoints in memory marked read only
-- 
GitLab