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 <benjamin.walsh@windriver.com>
This commit is contained in:
Benjamin Walsh 2016-09-02 16:59:34 -04:00
commit 5d23818070
4 changed files with 29 additions and 7 deletions

View file

@ -451,11 +451,15 @@ int device_busy_check(struct device *chk_dev);
* Synchronous calls API * Synchronous calls API
*/ */
#include <stdbool.h> #ifdef CONFIG_KERNEL_V2
#include <kernel.h>
#else
#include <nanokernel.h> #include <nanokernel.h>
#ifdef CONFIG_MICROKERNEL #ifdef CONFIG_MICROKERNEL
#include <microkernel.h> #include <microkernel.h>
#endif #endif
#endif
#include <stdbool.h>
/** /**
* Specific type for synchronizing calls among the 2 possible contexts * Specific type for synchronizing calls among the 2 possible contexts

View file

@ -27,6 +27,8 @@ extern "C" {
#include <nanokernel.h> #include <nanokernel.h>
#if !defined(CONFIG_KERNEL_V2)
/* /*
* microkernel private APIs that are exposed via the public API * microkernel private APIs that are exposed via the public API
* *
@ -60,6 +62,8 @@ extern "C" {
* @} * @}
*/ */
#endif /* !CONFIG_KERNEL_V2 */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View file

@ -39,11 +39,18 @@
#include <sys_clock.h> #include <sys_clock.h>
#include <drivers/rand32.h> #include <drivers/rand32.h>
#include <misc/slist.h> #include <misc/slist.h>
#include <misc/dlist.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#ifdef CONFIG_KERNEL_V2
#include <kernel.h>
#else
struct tcs; struct tcs;
/* /*
@ -58,8 +65,6 @@ struct _nano_queue {
void *tail; void *tail;
}; };
#include <misc/dlist.h>
struct _nano_timeout; struct _nano_timeout;
typedef void (*_nano_timeout_func_t)(struct _nano_timeout *t); 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); extern uint32_t sys_tick_delta_32(int64_t *reftime);
#endif /* CONFIG_KERNEL_V2 */
/** /**
* @} * @}
* @} nanokernel services * @} nanokernel services

View file

@ -17,11 +17,18 @@
#ifndef _ZEPHYR__H #ifndef _ZEPHYR__H
#define _ZEPHYR__H #define _ZEPHYR__H
#if CONFIG_MICROKERNEL #ifdef CONFIG_KERNEL_V2
#include <kernel.h>
#elif CONFIG_MICROKERNEL
#include <microkernel.h> #include <microkernel.h>
#include <sysgen.h> #elif CONFIG_NANOKERNEL
#else
#include <nanokernel.h> #include <nanokernel.h>
#endif /* CONFIG_MICROKERNEL */ #else
#error "unknown kernel type!"
#endif
#ifdef CONFIG_MDEF
#include <sysgen.h>
#endif
#endif /* _ZEPHYR__H */ #endif /* _ZEPHYR__H */