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>
This commit is contained in:
Anas Nashif 2019-06-26 10:44:43 -04:00
commit 5b0aa794b2
12 changed files with 56 additions and 41 deletions

View file

@ -16,7 +16,7 @@
#include <kernel.h>
#include <arch/cpu.h>
#include <sys/printk.h>
#include <misc/reboot.h>
#include <power/reboot.h>
#include <toolchain.h>
#include <linker/sections.h>

View file

@ -11,7 +11,7 @@
*/
#include <kernel.h>
#include <misc/reboot.h>
#include <power/reboot.h>
/* reboot through Reset Control Register (I/O port 0xcf9) */

View file

@ -12,7 +12,7 @@
#include <soc.h>
#include <drivers/watchdog.h>
#include <sys/printk.h>
#include <misc/reboot.h>
#include <power/reboot.h>
struct wdog_cmsdk_apb {
/* offset: 0x000 (r/w) watchdog load register */

View file

@ -1,42 +1,15 @@
/*
* Copyright (c) 2015 Wind River Systems, Inc.
* Copyright (c) 2019 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
/**
* @file
* @brief Common target reboot functionality
*
* @details See misc/Kconfig and the reboot help for details.
*/
#ifndef ZEPHYR_INCLUDE_MISC_REBOOT_H_
#define ZEPHYR_INCLUDE_MISC_REBOOT_H_
#ifdef __cplusplus
extern "C" {
#ifndef CONFIG_COMPAT_INCLUDES
#warning "This header file has moved, include <power/reboot.h> instead."
#endif
#define SYS_REBOOT_WARM 0
#define SYS_REBOOT_COLD 1
/**
* @brief Reboot the system
*
* Reboot the system in the manner specified by @a type. Not all architectures
* or platforms support the various reboot types (SYS_REBOOT_COLD,
* SYS_REBOOT_WARM).
*
* When successful, this routine does not return.
*
* @return N/A
*/
extern void sys_reboot(int type);
#ifdef __cplusplus
}
#endif
#include <power/reboot.h>
#endif /* ZEPHYR_INCLUDE_MISC_REBOOT_H_ */

42
include/power/reboot.h Normal file
View file

@ -0,0 +1,42 @@
/*
* Copyright (c) 2015 Wind River Systems, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/
/**
* @file
* @brief Common target reboot functionality
*
* @details See misc/Kconfig and the reboot help for details.
*/
#ifndef ZEPHYR_INCLUDE_POWER_REBOOT_H_
#define ZEPHYR_INCLUDE_POWER_REBOOT_H_
#ifdef __cplusplus
extern "C" {
#endif
#define SYS_REBOOT_WARM 0
#define SYS_REBOOT_COLD 1
/**
* @brief Reboot the system
*
* Reboot the system in the manner specified by @a type. Not all architectures
* or platforms support the various reboot types (SYS_REBOOT_COLD,
* SYS_REBOOT_WARM).
*
* When successful, this routine does not return.
*
* @return N/A
*/
extern void sys_reboot(int type);
#ifdef __cplusplus
}
#endif
#endif /* ZEPHYR_INCLUDE_POWER_REBOOT_H_ */

View file

@ -18,7 +18,7 @@ LOG_MODULE_REGISTER(updatehub);
#include <net/coap.h>
#include <net/dns_resolve.h>
#include <drivers/flash.h>
#include <misc/reboot.h>
#include <power/reboot.h>
#include <tinycrypt/sha256.h>
#include <data/json.h>

View file

@ -39,7 +39,7 @@
#include <zephyr.h>
#include <misc/reboot.h>
#include <power/reboot.h>
#include <device.h>
#include <string.h>
#include <drivers/flash.h>

View file

@ -5,7 +5,7 @@
*/
#include <kernel.h>
#include <misc/reboot.h>
#include <power/reboot.h>
#include <openthread/instance.h>
#include <openthread/platform/misc.h>

View file

@ -13,7 +13,7 @@
#include <kernel.h>
#include <drivers/timer/system_timer.h>
#include <sys/printk.h>
#include <misc/reboot.h>
#include <power/reboot.h>
extern void sys_arch_reboot(int type);
extern void sys_clock_disable(void);

View file

@ -9,7 +9,7 @@
#include <shell/shell.h>
#include <init.h>
#include <debug/object_tracing.h>
#include <misc/reboot.h>
#include <power/reboot.h>
#include <debug/stack.h>
#include <string.h>
#include <device.h>

View file

@ -6,7 +6,7 @@
#include <zephyr.h>
#include <sys/printk.h>
#include <misc/reboot.h>
#include <power/reboot.h>
#include <arch/arm/cortex_m/cmsis.h>
#include <ztest.h>
#include <tc_util.h>

View file

@ -8,7 +8,7 @@
#include <ztest.h>
#include <zephyr.h>
#include <misc/reboot.h>
#include <power/reboot.h>
#include <string.h>
#include <settings/settings.h>