Skip to content

Commit

Permalink
cleanup: include/: move misc/reboot.h to power/reboot.h
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
nashif committed Jun 28, 2019
1 parent efb8df5 commit 5b0aa79
Show file tree
Hide file tree
Showing 12 changed files with 56 additions and 41 deletions.
2 changes: 1 addition & 1 deletion arch/arm/core/cortex_m/nmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
2 changes: 1 addition & 1 deletion arch/x86/core/reboot_rst_cnt.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/

#include <kernel.h>
#include <misc/reboot.h>
#include <power/reboot.h>

/* reboot through Reset Control Register (I/O port 0xcf9) */

Expand Down
2 changes: 1 addition & 1 deletion drivers/watchdog/wdt_cmsdk_apb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
35 changes: 4 additions & 31 deletions include/misc/reboot.h
Original file line number Diff line number Diff line change
@@ -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 changes: 42 additions & 0 deletions include/power/reboot.h
Original file line number Diff line number Diff line change
@@ -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_ */
2 changes: 1 addition & 1 deletion lib/updatehub/updatehub.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
2 changes: 1 addition & 1 deletion samples/subsys/nvs/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion subsys/net/lib/openthread/platform/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

#include <kernel.h>
#include <misc/reboot.h>
#include <power/reboot.h>
#include <openthread/instance.h>
#include <openthread/platform/misc.h>

Expand Down
2 changes: 1 addition & 1 deletion subsys/power/reboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion subsys/shell/modules/kernel_service.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion tests/kernel/arm_runtime_nmi/src/arm_runtime_nmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 5b0aa79

Please sign in to comment.