From 5d2381807045bc28080fce1b5d64b5f91dadd06f Mon Sep 17 00:00:00 2001 From: Benjamin Walsh Date: Fri, 2 Sep 2016 16:59:34 -0400 Subject: [PATCH] unified: include kernel.h via major top-level header files This allows current code to build but using the definitions from kernel.h instead of the original headers. Change-Id: I8f51a83bab4448cd63aa6c54b8e357a8ad6cc1e2 Signed-off-by: Benjamin Walsh --- include/device.h | 6 +++++- include/microkernel.h | 4 ++++ include/nanokernel.h | 11 +++++++++-- include/zephyr.h | 15 +++++++++++---- 4 files changed, 29 insertions(+), 7 deletions(-) diff --git a/include/device.h b/include/device.h index 42db3022d6a..0ecb19c6e45 100644 --- a/include/device.h +++ b/include/device.h @@ -451,11 +451,15 @@ int device_busy_check(struct device *chk_dev); * Synchronous calls API */ -#include +#ifdef CONFIG_KERNEL_V2 +#include +#else #include #ifdef CONFIG_MICROKERNEL #include #endif +#endif +#include /** * Specific type for synchronizing calls among the 2 possible contexts diff --git a/include/microkernel.h b/include/microkernel.h index 2f0b9146abc..53be1e08af9 100644 --- a/include/microkernel.h +++ b/include/microkernel.h @@ -27,6 +27,8 @@ extern "C" { #include +#if !defined(CONFIG_KERNEL_V2) + /* * microkernel private APIs that are exposed via the public API * @@ -60,6 +62,8 @@ extern "C" { * @} */ +#endif /* !CONFIG_KERNEL_V2 */ + #ifdef __cplusplus } #endif diff --git a/include/nanokernel.h b/include/nanokernel.h index 01358333744..0a6ea7db26f 100644 --- a/include/nanokernel.h +++ b/include/nanokernel.h @@ -39,11 +39,18 @@ #include #include #include +#include #ifdef __cplusplus extern "C" { #endif +#ifdef CONFIG_KERNEL_V2 + +#include + +#else + struct tcs; /* @@ -58,8 +65,6 @@ struct _nano_queue { void *tail; }; -#include - struct _nano_timeout; typedef void (*_nano_timeout_func_t)(struct _nano_timeout *t); @@ -1719,6 +1724,8 @@ extern int64_t sys_tick_delta(int64_t *reftime); */ extern uint32_t sys_tick_delta_32(int64_t *reftime); +#endif /* CONFIG_KERNEL_V2 */ + /** * @} * @} nanokernel services diff --git a/include/zephyr.h b/include/zephyr.h index bc5f352d9b3..a5dc4b03226 100644 --- a/include/zephyr.h +++ b/include/zephyr.h @@ -17,11 +17,18 @@ #ifndef _ZEPHYR__H #define _ZEPHYR__H -#if CONFIG_MICROKERNEL +#ifdef CONFIG_KERNEL_V2 +#include +#elif CONFIG_MICROKERNEL #include -#include -#else +#elif CONFIG_NANOKERNEL #include -#endif /* CONFIG_MICROKERNEL */ +#else +#error "unknown kernel type!" +#endif + +#ifdef CONFIG_MDEF +#include +#endif #endif /* _ZEPHYR__H */