mirror of
https://github.com/zephyrproject-rtos/zephyr
synced 2025-09-13 17:51:57 +00:00
sys_reboot doesn't return so mark it with noreturn Signed-off-by: Christoph Thurnheer <c.thurnheer@gmx.ch>
29 lines
506 B
C
29 lines
506 B
C
/*
|
|
* Copyright (c) 2015 Wind River Systems, Inc.
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
#include <sys/reboot.h>
|
|
#include <kernel.h>
|
|
#include <sys/printk.h>
|
|
|
|
extern void sys_arch_reboot(int type);
|
|
extern void sys_clock_disable(void);
|
|
|
|
FUNC_NORETURN void sys_reboot(int type)
|
|
{
|
|
(void)irq_lock();
|
|
#ifdef CONFIG_SYS_CLOCK_EXISTS
|
|
sys_clock_disable();
|
|
#endif
|
|
|
|
sys_arch_reboot(type);
|
|
|
|
/* should never get here */
|
|
printk("Failed to reboot: spinning endlessly...\n");
|
|
for (;;) {
|
|
k_cpu_idle();
|
|
}
|
|
}
|