power: move z_pm_save_idle_exit prototype to power.h
Maintain power prototypes in power.h instead of kernel and arch headers.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
diff --git a/arch/arm/core/aarch32/irq_manage.c b/arch/arm/core/aarch32/irq_manage.c
index 4b688fe..1576c07 100644
--- a/arch/arm/core/aarch32/irq_manage.c
+++ b/arch/arm/core/aarch32/irq_manage.c
@@ -27,6 +27,7 @@
#include <sw_isr_table.h>
#include <irq.h>
#include <tracing/tracing.h>
+#include <power/power.h>
extern void z_arm_reserved(void);
diff --git a/arch/posix/core/swap.c b/arch/posix/core/swap.c
index 824b63f..5877e2e 100644
--- a/arch/posix/core/swap.c
+++ b/arch/posix/core/swap.c
@@ -18,6 +18,7 @@
#include "posix_core.h"
#include "irq.h"
#include "kswap.h"
+#include <power/power.h>
int arch_swap(unsigned int key)
{
diff --git a/include/arch/x86/ia32/arch.h b/include/arch/x86/ia32/arch.h
index 7dcc9b4..a643fe9 100644
--- a/include/arch/x86/ia32/arch.h
+++ b/include/arch/x86/ia32/arch.h
@@ -28,6 +28,7 @@
#include <arch/common/addr_types.h>
#include <arch/x86/ia32/segmentation.h>
+#include <power/power.h>
#endif /* _ASMLANGUAGE */
@@ -234,12 +235,6 @@
}
#ifdef CONFIG_PM
-/*
- * FIXME: z_pm_save_idle_exit is defined in kernel.h, which cannot be
- * included here due to circular dependency
- */
-extern void z_pm_save_idle_exit(int32_t ticks);
-
static inline void arch_irq_direct_pm(void)
{
if (_kernel.idle) {
diff --git a/include/kernel.h b/include/kernel.h
index 8a3de24..378f1d8 100644
--- a/include/kernel.h
+++ b/include/kernel.h
@@ -4939,8 +4939,6 @@
/**
* @internal
*/
-extern void z_pm_save_idle_exit(int32_t ticks);
-
#ifdef ARCH_EXCEPT
/* This architecture has direct support for triggering a CPU exception */
#define z_except_reason(reason) ARCH_EXCEPT(reason)
diff --git a/include/power/power.h b/include/power/power.h
index b09b435..56baafe 100644
--- a/include/power/power.h
+++ b/include/power/power.h
@@ -318,6 +318,8 @@
* @}
*/
+
+void z_pm_save_idle_exit(int32_t ticks);
#endif /* CONFIG_PM */
#ifdef __cplusplus