POSIX arch: Add stub for sys_arch_reboot()

To allow apps to compile with CONFIG_REBOOT,
add a weak stub for sys_arch_reboot which does nothing
in the POSIX arch
POSIX boards may choose to provide a more sensible implementation
if relevant.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
This commit is contained in:
Alberto Escolar Piedras 2018-09-30 14:00:21 +02:00 committed by Anas Nashif
commit 8eb51a309d

View file

@ -7,14 +7,17 @@
/**
* @file CPU power management code for POSIX
*
* This module provides an implementation of the architecture-specific
* This module provides:
*
* An implementation of the architecture-specific
* k_cpu_idle() primitive required by the kernel idle loop component.
* It can be called within an implementation of _sys_power_save_idle(),
* which is provided for the kernel by the platform.
*
* The module also provides an implementation of k_cpu_atomic_idle(), which
* An implementation of k_cpu_atomic_idle(), which
* atomically re-enables interrupts and enters low power mode.
*
* A weak stub for sys_arch_reboot(), which does nothing
*/
#include "posix_core.h"
@ -59,9 +62,23 @@ void k_cpu_idle(void)
*
* @return N/A
*/
void k_cpu_atomic_idle(unsigned int key)
{
z_sys_trace_idle();
posix_atomic_halt_cpu(key);
}
#if defined(CONFIG_REBOOT)
/**
*
* @brief Stub for sys_arch_reboot
*
* Does nothing
*
* @return N/A
*/
void __weak sys_arch_reboot(int type)
{
ARG_UNUSED(type);
}
#endif /* CONFIG_REBOOT */