1
0
Fork 0
forked from len0rd/rockbox

panicf doesn't return so why not tell GCC and $AVE :

Change-Id: I6096576f539bfb02b340b82fabc5019f6756b722
This commit is contained in:
Michael Sevakis 2014-08-25 13:55:16 -04:00
parent 6ffb8ffeee
commit 2cb274ca77
3 changed files with 4 additions and 7 deletions

View file

@ -25,9 +25,6 @@
#include "config.h" #include "config.h"
#include "gcc_extensions.h" #include "gcc_extensions.h"
#if defined(CPU_ARM) void panicf( const char *fmt, ... ) ATTRIBUTE_PRINTF(1, 2) NORETURN_ATTR;
void panicf( const char *fmt, ... ) __attribute__ ((naked)) ATTRIBUTE_PRINTF(1, 2);
#else
void panicf( const char *fmt, ... ) ATTRIBUTE_PRINTF(1, 2);
#endif
#endif /* __PANIC_H__ */ #endif /* __PANIC_H__ */

View file

@ -193,7 +193,6 @@ static NO_INLINE NORETURN_ATTR
static char name[sizeof (((struct thread_debug_info *)0)->name)]; static char name[sizeof (((struct thread_debug_info *)0)->name)];
format_thread_name(name, sizeof (name), thread); format_thread_name(name, sizeof (name), thread);
panicf ("%s %s" IF_COP(" (%d)"), msg, name IF_COP(, core)); panicf ("%s %s" IF_COP(" (%d)"), msg, name IF_COP(, core));
while (1);
} }
static NO_INLINE void thread_stkov(struct thread_entry *thread) static NO_INLINE void thread_stkov(struct thread_entry *thread)

View file

@ -44,12 +44,13 @@ static char panic_buf[128];
void panicf_f( const char *fmt, ...); void panicf_f( const char *fmt, ...);
/* we wrap panicf() here with naked function to catch SP value */ /* 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; (void)fmt;
asm volatile ("mov r4, sp \n" asm volatile ("mov r4, sp \n"
"b panicf_f \n" "b panicf_f \n"
); );
while (1);
} }
/* /*