1 /*
2  * Copyright (c) 2015 Wind River Systems, Inc.
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #include <sys/reboot.h>
8 #include <kernel.h>
9 #include <sys/printk.h>
10 
11 extern void sys_arch_reboot(int type);
12 extern void sys_clock_disable(void);
13 
sys_reboot(int type)14 FUNC_NORETURN void sys_reboot(int type)
15 {
16 	(void)irq_lock();
17 #ifdef CONFIG_SYS_CLOCK_EXISTS
18 	sys_clock_disable();
19 #endif
20 
21 	sys_arch_reboot(type);
22 
23 	/* should never get here */
24 	printk("Failed to reboot: spinning endlessly...\n");
25 	for (;;) {
26 		k_cpu_idle();
27 	}
28 }
29