summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2005-11-03 20:34:34 +0000
committerJens Arnold <amiconn@rockbox.org>2005-11-03 20:34:34 +0000
commit8b88928dd3a933a6ff08b0dbe62472e88da58b4b (patch)
treeebdc81ee3f60ab1a43aaf893b2a47df534cc5b0f
parent8f71973918e02ba19e76472d7ca3a2a5604d6c0c (diff)
downloadrockbox-8b88928dd3a933a6ff08b0dbe62472e88da58b4b.zip
rockbox-8b88928dd3a933a6ff08b0dbe62472e88da58b4b.tar.gz
rockbox-8b88928dd3a933a6ff08b0dbe62472e88da58b4b.tar.bz2
rockbox-8b88928dd3a933a6ff08b0dbe62472e88da58b4b.tar.xz
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
-rw-r--r--firmware/system.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/firmware/system.c b/firmware/system.c
index a14d112e..32ea3c0 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;
}