zephyr/subsys/power/reboot.c
Anas Nashif 5b0aa794b2 cleanup: include/: move misc/reboot.h to power/reboot.h
move misc/reboot.h to power/reboot.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00

36 lines
652 B
C

/*
* Copyright (c) 2015 Wind River Systems, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/
/**
* @file common target reboot functionality
*
* @details See misc/Kconfig and the reboot help for details.
*/
#include <kernel.h>
#include <drivers/timer/system_timer.h>
#include <sys/printk.h>
#include <power/reboot.h>
extern void sys_arch_reboot(int type);
extern void sys_clock_disable(void);
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();
}
}