panic.h

Crash handling header.

Define a panic.h::core_panic() function that allows to stop/reboot the system when an unrecoverable problem has occurred.

enum core_panic_t
PANIC_GENERAL_ERROR
PANIC_SOFT_REBOOT
PANIC_HARD_REBOOT
PANIC_ASSERT_FAIL
PANIC_SSP
stack smashing protector failure
PANIC_UNDEFINED
kernel_defines.h::NORETURN void core_panic(panic.h::core_panic_t crash_code, const char * message)

Handle an unrecoverable error by halting or rebooting the system.

A numeric code indicating the failure reason can be given as the crash_code parameter.

Detailing the failure is possible using the message parameter. This function should serve a similar purpose as the panic() function of Unix/Linux kernels.

If the DEVELHELP macro is defined, the system will be halted; the system will be rebooted otherwise.

Parameters

crash_code:a unique code for identifying the crash reason
message:a human readable reason for the crash

Return values

  • this function never returns
void panic_arch(void)

architecture dependent handling of a panic case

This function gives the CPU the possibility to execute architecture dependent code in case of a severe error.