From 06cb237af682fbc45a72c4e43e3f8126b2c9cac6 Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Mon, 30 Aug 2004 19:52:45 +0000 Subject: 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 --- firmware/export/system.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'firmware/export/system.h') diff --git a/firmware/export/system.h b/firmware/export/system.h index 0d601e3..0c4a8f1 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 -- cgit v1.1