summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2014-08-25 13:55:16 -0400
committerMichael Sevakis <jethead71@rockbox.org>2014-08-25 13:55:16 -0400
commit2cb274ca77815eab565106d16f2e7592cd5c3650 (patch)
treeff323c5d0cd8ea4e96fcd6b5826f383957e02b23
parent6ffb8ffeeed9aca75c278906785a957d72b3ef57 (diff)
panicf doesn't return so why not tell GCC and $AVE :
Change-Id: I6096576f539bfb02b340b82fabc5019f6756b722
-rw-r--r--firmware/export/panic.h7
-rw-r--r--firmware/kernel/thread.c1
-rw-r--r--firmware/panic.c3
3 files changed, 4 insertions, 7 deletions
diff --git a/firmware/export/panic.h b/firmware/export/panic.h
index 7767c675cf..8e35bfff16 100644
--- a/firmware/export/panic.h
+++ b/firmware/export/panic.h
@@ -25,9 +25,6 @@
#include "config.h"
#include "gcc_extensions.h"
-#if defined(CPU_ARM)
-void panicf( const char *fmt, ... ) __attribute__ ((naked)) ATTRIBUTE_PRINTF(1, 2);
-#else
-void panicf( const char *fmt, ... ) ATTRIBUTE_PRINTF(1, 2);
-#endif
+void panicf( const char *fmt, ... ) ATTRIBUTE_PRINTF(1, 2) NORETURN_ATTR;
+
#endif /* __PANIC_H__ */
diff --git a/firmware/kernel/thread.c b/firmware/kernel/thread.c
index 01395a9d6d..05c09dc594 100644
--- a/firmware/kernel/thread.c
+++ b/firmware/kernel/thread.c
@@ -193,7 +193,6 @@ static NO_INLINE NORETURN_ATTR
static char name[sizeof (((struct thread_debug_info *)0)->name)];
format_thread_name(name, sizeof (name), thread);
panicf ("%s %s" IF_COP(" (%d)"), msg, name IF_COP(, core));
- while (1);
}
static NO_INLINE void thread_stkov(struct thread_entry *thread)
diff --git a/firmware/panic.c b/firmware/panic.c
index 3f01689922..7b2c79a872 100644
--- a/firmware/panic.c
+++ b/firmware/panic.c
@@ -44,12 +44,13 @@ static char panic_buf[128];
void panicf_f( const char *fmt, ...);
/* we wrap panicf() here with naked function to catch SP value */
-void panicf( const char *fmt, ...)
+void __attribute__((naked)) panicf( const char *fmt, ...)
{
(void)fmt;
asm volatile ("mov r4, sp \n"
"b panicf_f \n"
);
+ while (1);
}
/*