sapi: New implementation of rtems_panic()

The previous rtems_panic() implementation was quite heavy weight.  It
depended on _exit() which calls the global destructors.  It used
fprintf(stderr, ...) for output which depends on an initialized console
device and the complex fprintf().

Introduce a new fatal source RTEMS_FATAL_SOURCE_PANIC for rtems_panic()
and output via vprintk().

Update #3244.
This commit is contained in:
Sebastian Huber
2017-11-22 09:40:23 +01:00
parent cd3e2204c7
commit 15e19273b2
7 changed files with 58 additions and 34 deletions
+12
View File
@@ -88,6 +88,18 @@ RTEMS_NO_RETURN RTEMS_INLINE_ROUTINE void rtems_fatal(
_Terminate( fatal_source, error_code );
}
/**
* @brief Prints the specified message via printk() and terminates the system.
*
* @param[in] fmt The message format.
* @param[in] ... The message parameters.
*
* @see _Terminate().
*/
RTEMS_NO_RETURN void rtems_panic(
const char *fmt, ...
) RTEMS_PRINTFLIKE( 1, 2 );
/**
* @brief Returns a text for a fatal source.
*