zephyr/lib/os/reboot.c
Gerard Marull-Paretas 78dc8ce338 drivers: timer: improve sys_timer_disable usage
- Remove the weak symbol definition
- Notify about the capability of disabling via a selected Kconfig option
  (CONFIG_SYSTEM_TIMER_HAS_DISABLE_SUPPORT)
- Provide a dummy inline function when the functionality is not
  available

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-12-04 07:34:53 -05:00

27 lines
471 B
C

/*
* Copyright (c) 2015 Wind River Systems, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <drivers/timer/system_timer.h>
#include <sys/reboot.h>
#include <kernel.h>
#include <sys/printk.h>
extern void sys_arch_reboot(int type);
FUNC_NORETURN void sys_reboot(int type)
{
(void)irq_lock();
sys_clock_disable();
sys_arch_reboot(type);
/* should never get here */
printk("Failed to reboot: spinning endlessly...\n");
for (;;) {
k_cpu_idle();
}
}