diff options
author | Jens Arnold <amiconn@rockbox.org> | 2004-08-30 19:52:45 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2004-08-30 19:52:45 +0000 |
commit | 06cb237af682fbc45a72c4e43e3f8126b2c9cac6 (patch) | |
tree | a0eb1898429941f00da446e1e8c8efdd35864ff9 /firmware/export | |
parent | 56fd6f9316ee196bfd16a2f102469cb6b040d397 (diff) |
New debug feature: Use the SH1 user break controller to catch illegal memory accesses
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5026 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/export')
-rw-r--r-- | firmware/export/system.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/firmware/export/system.h b/firmware/export/system.h index 0d601e3d47..0c4a8f1a86 100644 --- a/firmware/export/system.h +++ b/firmware/export/system.h @@ -164,6 +164,17 @@ static inline int cas2 (volatile int *pointer1,volatile int *pointer2,int reques set_irq_level(oldlevel); return 0; } + +/* Utilize the user break controller to catch invalid memory accesses. */ +int system_memory_guard(int newmode); + +enum { + MEMGUARD_KEEP = -1, /* don't change the mode; for reading */ + MEMGUARD_NONE = 0, /* catch nothing */ + MEMGUARD_FLASH_WRITES, /* catch writes to area 02 (flash ROM) */ + MEMGUARD_ZERO_AREA, /* catch all accesses to areas 00 and 01 */ + MAXMEMGUARD +}; #endif |