summaryrefslogtreecommitdiffstats
path: root/firmware/panic.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2007-05-12 05:20:04 +0000
committerMichael Sevakis <jethead71@rockbox.org>2007-05-12 05:20:04 +0000
commitbfb281ff63353f5a473af2b731f33e97b10ba391 (patch)
tree9f94a2918b075f6dedbcb21f06e83aea2c24ec8b /firmware/panic.c
parent87c70db578527384653fa71be29dccb486328b7f (diff)
downloadrockbox-bfb281ff63353f5a473af2b731f33e97b10ba391.tar.gz
rockbox-bfb281ff63353f5a473af2b731f33e97b10ba391.tar.bz2
rockbox-bfb281ff63353f5a473af2b731f33e97b10ba391.zip
Messages queues must be guarded on both ends or else it's a race between detecting a message present and missing a wakeup on thread about to wait. Keeping IRQs from interacting with the scheduler would be preferable but this should do at the moment. Add more detailed panic info regarding blocking violations so we know who. Make panicf function well enough on Gigabeat and PortalPlayer targets. Move the core sleep instructions into a CPU-specific inline to keep thing organized.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13374 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/panic.c')
-rw-r--r--firmware/panic.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/firmware/panic.c b/firmware/panic.c
index f9d1cd3083..58f6d1dcb5 100644
--- a/firmware/panic.c
+++ b/firmware/panic.c
@@ -45,13 +45,13 @@ void panicf( const char *fmt, ...)
#endif
/* Disable interrupts */
-#if CONFIG_CPU == SH7034
- asm volatile ("ldc\t%0,sr" : : "r"(15<<4));
-#elif defined(CPU_COLDFIRE)
- asm volatile ("move.w #0x2700,%sr");
-#endif
+#ifdef CPU_ARM
+ disable_fiq();
#endif
+ set_irq_level(DISABLE_INTERRUPTS);
+#endif /* SIMULATOR */
+
va_start( ap, fmt );
vsnprintf( panic_buf, sizeof(panic_buf), fmt, ap );
va_end( ap );
@@ -99,7 +99,16 @@ void panicf( const char *fmt, ...)
#endif
/* try to restart firmware if ON is pressed */
-#ifdef IRIVER_H100_SERIES
+#if defined (CPU_PP)
+ /* For now, just sleep the core */
+ if (CURRENT_CORE == CPU)
+ CPU_CTL = PROC_SLEEP;
+ else
+ COP_CTL = PROC_SLEEP;
+ #define system_reboot() nop
+#elif defined (TOSHIBA_GIGABEAT_F)
+ if ((GPGDAT & (1 << 0)) != 0)
+#elif defined (IRIVER_H100_SERIES)
if ((GPIO1_READ & 0x22) == 0) /* check for ON button and !hold */
#elif defined(IRIVER_H300_SERIES)
if ((GPIO1_READ & 0x22) == 0) /* check for ON button and !hold */