From 8b88928dd3a933a6ff08b0dbe62472e88da58b4b Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Thu, 3 Nov 2005 20:34:34 +0000 Subject: [PATCH] Coldfire: The memory guard configuration routine didn't correctly return the old mode when setting a new one. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7744 a1c6a512-1295-4272-9138-f99709370657 --- firmware/system.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/firmware/system.c b/firmware/system.c index a14d112eb2..32ea3c0c03 100644 --- a/firmware/system.c +++ b/firmware/system.c @@ -549,15 +549,14 @@ int system_memory_guard(int newmode) /* Note: CPU space accesses (movec instruction), interrupt acknowledges and emulator mode accesses are never caught. */ }; - static int oldmode = MEMGUARD_NONE; + static int cur_mode = MEMGUARD_NONE; + int oldmode = cur_mode; const unsigned long *ptr; int i; if (newmode == MEMGUARD_KEEP) newmode = oldmode; - else - oldmode = newmode; /* Always set the new mode, we don't know the old settings as we cannot read back */ @@ -567,6 +566,7 @@ int system_memory_guard(int newmode) asm ( "wdebug (%0) \n" : : "a"(ptr)); ptr += 2; } + cur_mode = newmode; return oldmode; }