1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Jens Arnold 2005-11-03 20:34:34 +00:00
parent 8f71973918
commit 8b88928dd3

View file

@ -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;
}