kernel: add z_fatal_halt() to interface
Intended to be called from application-level implementations of k_sys_fatal_error_handler(). Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
parent
882503f913
commit
00bf76eaa7
2 changed files with 15 additions and 0 deletions
|
@ -31,6 +31,16 @@ enum k_fatal_error_reason {
|
||||||
*/
|
*/
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Halt the system on a fatal error
|
||||||
|
*
|
||||||
|
* Invokes architecture-specific code to power off or halt the system in
|
||||||
|
* a low power state. Lacking that, lock interupts and sit in an idle loop.
|
||||||
|
*
|
||||||
|
* @param reason Fatal exception reason code
|
||||||
|
*/
|
||||||
|
FUNC_NORETURN void k_fatal_halt(unsigned int reason);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Fatal error policy handler
|
* @brief Fatal error policy handler
|
||||||
*
|
*
|
||||||
|
|
|
@ -95,6 +95,11 @@ void z_fatal_print(const char *fmt, ...)
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_LOG || CONFIG_PRINTK */
|
#endif /* CONFIG_LOG || CONFIG_PRINTK */
|
||||||
|
|
||||||
|
FUNC_NORETURN void k_fatal_halt(unsigned int reason)
|
||||||
|
{
|
||||||
|
z_arch_system_halt(reason);
|
||||||
|
}
|
||||||
|
|
||||||
void z_fatal_error(unsigned int reason, const z_arch_esf_t *esf)
|
void z_fatal_error(unsigned int reason, const z_arch_esf_t *esf)
|
||||||
{
|
{
|
||||||
struct k_thread *thread = k_current_get();
|
struct k_thread *thread = k_current_get();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue