Skip to content

Commit

Permalink
use zephyr.h instead of microkernel/nanokernel.h
Browse files Browse the repository at this point in the history
Cleanup header inclusion and only include zephyr.h in samples
and applications.

Change-Id: If7460f4c6305a1c1cfcfdcf6a9bb7423f410c5c6
Signed-off-by: Anas Nashif <[email protected]>
  • Loading branch information
nashif committed Feb 6, 2016
1 parent 8b45f4e commit 3657987
Show file tree
Hide file tree
Showing 51 changed files with 45 additions and 152 deletions.
4 changes: 1 addition & 3 deletions samples/bluetooth/shell/src/btshell.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@
* limitations under the License.
*/

#include <zephyr.h>
#include <stdio.h>
#include <string.h>

#include <nanokernel.h>
#include <arch/cpu.h>

#include <console/uart_console.h>
#include <misc/printk.h>
#include <misc/util.h>
Expand Down
5 changes: 2 additions & 3 deletions samples/bluetooth/test_bluetooth/bluetooth.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,11 @@
* limitations under the License.
*/

#include <zephyr.h>

#include <errno.h>
#include <tc_util.h>

#include <nanokernel.h>
#include <arch/cpu.h>

#include <bluetooth/bluetooth.h>
#include <bluetooth/driver.h>

Expand Down
2 changes: 1 addition & 1 deletion samples/bluetooth/tester/src/bttester.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
* limitations under the License.
*/

#include <zephyr.h>
#include <stdio.h>
#include <string.h>
#include <stdint.h>

#include <toolchain.h>
#include <misc/printk.h>
#include <nanokernel.h>
#include <misc/byteorder.h>
#include <simple/uart.h>

Expand Down
2 changes: 1 addition & 1 deletion samples/bluetooth/tester/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
* limitations under the License.
*/

#include <zephyr.h>
#include <stdint.h>
#include <nanokernel.h>
#include <toolchain.h>

#include "bttester.h"
Expand Down
6 changes: 1 addition & 5 deletions samples/include/tc_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@
#ifndef __TC_UTIL_H__
#define __TC_UTIL_H__

#if defined(CONFIG_NANOKERNEL)
#include <nanokernel.h>
#else
#include <microkernel.h>
#endif
#include <zephyr.h>

#include <misc/printk.h>
#include <string.h>
Expand Down
5 changes: 2 additions & 3 deletions samples/microkernel/apps/hello_world/src/hello.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
* limitations under the License.
*/

#include <zephyr.h>

#if defined(CONFIG_STDOUT_CONSOLE)
#include <stdio.h>
#define PRINT printf
Expand All @@ -32,7 +34,6 @@
* a controlled rate.
*/

#include <zephyr.h>

/* specify delay between greetings (in ms); compute equivalent in ticks */

Expand Down Expand Up @@ -83,8 +84,6 @@ void taskB(void)
* a controlled rate.
*/

#include <nanokernel.h>
#include <arch/cpu.h>

/* specify delay between greetings (in ms); compute equivalent in ticks */

Expand Down
3 changes: 1 addition & 2 deletions samples/microkernel/apps/nfc_hello/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@
* limitations under the License.
*/

#include <zephyr.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>

#include <nanokernel.h>
#include <arch/cpu.h>
#include <board.h>
#include <uart.h>

Expand Down
5 changes: 1 addition & 4 deletions samples/microkernel/apps/pci_enum/src/pci_enum.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <zephyr.h>

#include <stdint.h>
#include <pci/pci.h>
Expand Down Expand Up @@ -48,7 +49,6 @@ void pci_enumerate(void)

#ifdef CONFIG_MICROKERNEL

#include <zephyr.h>

static int done = 0;

Expand All @@ -65,9 +65,6 @@ void task_enum_pci(void)

#else /* CONFIG_NANOKERNEL */

#include <nanokernel.h>
#include <arch/cpu.h>

void main(void)
{
pci_enumerate();
Expand Down
11 changes: 2 additions & 9 deletions samples/microkernel/apps/philosophers/src/phil_fiber.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifdef CONFIG_NANOKERNEL
#include <nanokernel.h>
#include "phil.h"
#else /* ! CONFIG_NANOKERNEL */
#include <zephyr.h>
#include "phil.h"
#endif /* CONFIG_NANOKERNEL */

#include <arch/cpu.h> /* irq_lock/irq_unlock */
#include <zephyr.h>
#include "phil.h"

#ifdef CONFIG_NANOKERNEL
#define FORK(x) &forks[x]
Expand Down
6 changes: 0 additions & 6 deletions samples/microkernel/apps/philosophers/src/phil_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,8 @@
* limitations under the License.
*/

#ifdef CONFIG_NANOKERNEL
#include <nanokernel.h>
#include <arch/cpu.h>
#include "phil.h"
#else
#include <zephyr.h>
#include "phil.h"
#endif

#define DEMO_DESCRIPTION \
"\x1b[2J\x1b[15;1H" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,7 @@
* limitations under the License.
*/

#ifdef CONFIG_NANOKERNEL
#include <nanokernel.h>
#include <arch/cpu.h>
#else
#include <zephyr.h>
#endif

#include "phil.h"
#include <misc/profiler.h>
Expand Down
2 changes: 1 addition & 1 deletion samples/microkernel/benchmark/app_kernel/src/master.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#ifndef _MASTER_H
#define _MASTER_H

#include <microkernel.h>
#include <zephyr.h>

#include <stdio.h>

Expand Down
6 changes: 0 additions & 6 deletions samples/microkernel/benchmark/boot_time/src/boot_time.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,7 @@ Measure boot time for both nanokernel and microkernel project which includes
- from _start to idle (for microkernel)
*/

#ifdef CONFIG_NANOKERNEL
#include <nanokernel.h>
#else
#include <zephyr.h>
#include <version.h>
#endif
#include <arch/cpu.h>
#include <tc_util.h>

/* externs */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* limitations under the License.
*/

#include <microkernel.h>
#include <zephyr.h>
#include <toolchain.h>

#ifdef TEST_min
Expand All @@ -25,7 +25,6 @@

#else

#include <arch/cpu.h>
#include <misc/printk.h>
#include <stdio.h>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

#ifndef _TIMESTAMP_H_
#define _TIMESTAMP_H_
#include <zephyr.h>

#include <limits.h>
#if defined(__GNUC__)
Expand All @@ -34,7 +35,6 @@

#if defined(CONFIG_NANOKERNEL)

#include <nanokernel.h>

#define OS_GET_TIME() nano_cycle_get_32()

Expand All @@ -54,8 +54,6 @@ static inline void TICK_SYNCH(void)
}

#elif (defined(CONFIG_MICROKERNEL) && defined(KERNEL))
#include <zephyr.h>

#define OS_GET_TIME() task_cycle_get_32()

typedef int64_t TICK_TYPE;
Expand Down
11 changes: 2 additions & 9 deletions samples/microkernel/benchmark/latency_measure/src/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,11 @@
* this file contains commonly used functions
*/

#include <zephyr.h>

#include "timestamp.h"
#include "utils.h"

#ifdef CONFIG_NANOKERNEL

#elif defined(CONFIG_MICROKERNEL)

#include <microkernel.h>

#endif /* CONFIG_NANOKERNEL */

#include <arch/cpu.h>

static uint8_t vector; /* the interrupt vector we allocate */

Expand Down
3 changes: 0 additions & 3 deletions samples/microkernel/test/test_events/src/test_fiber.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ DESCRIPTION
The module implements functions for the fiber that tests
event signaling
*/

#include <nanokernel.h>
#include <arch/cpu.h>
#include <zephyr.h>

#define N_TESTS 10 /* number of tests to run */
Expand Down
6 changes: 1 addition & 5 deletions samples/microkernel/test/test_fp_sharing/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,7 @@ x87 FPU registers are being saved/restored.
#endif /* CONFIG_ISA_IA32 */


#ifdef CONFIG_MICROKERNEL
#include <microkernel.h>
#else
#include <nanokernel.h>
#endif
#include <zephyr.h>

#if defined(__GNUC__)
#include <float_regs_x86_gcc.h>
Expand Down
3 changes: 2 additions & 1 deletion samples/microkernel/test/test_fp_sharing/src/pi.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ subsequent computations must produce the same value, otherwise an error
has occurred.
*/

#include <zephyr.h>

#ifdef CONFIG_MICROKERNEL
#include <microkernel.h>
#include <stdio.h>
#include <tc_util.h>

Expand Down
2 changes: 1 addition & 1 deletion samples/microkernel/test/test_libs/src/libraries.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ NOT guarantee that ALL standards-defined functionality is present, nor does
it guarantee that ALL functionality provided is working correctly.
*/

#include <microkernel.h>
#include <zephyr.h>
#include <tc_util.h>

#include <limits.h>
Expand Down
2 changes: 1 addition & 1 deletion samples/microkernel/test/test_mail/src/mail.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ are not (yet) tested include:
to ensure higher priority tasks get preference.
*/

#include <microkernel.h>
#include <zephyr.h>

#include <tc_util.h>

Expand Down
4 changes: 1 addition & 3 deletions samples/microkernel/test/test_pipe/src/pipe.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,8 @@ The following target pipe routine does not yet have a test case:
task_pipe_block_put()
*/

#include <nanokernel.h>
#include <arch/cpu.h>
#include <tc_util.h>
#include <zephyr.h>
#include <tc_util.h>
#include <misc/util.h>

#define ONE_SECOND (sys_clock_ticks_per_sec)
Expand Down
4 changes: 1 addition & 3 deletions samples/microkernel/test/test_pool/src/pool.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,8 @@ This modules tests the following memory pool routines:
task_mem_pool_free()
*/

#include <tc_util.h>
#include <nanokernel.h>
#include <arch/cpu.h>
#include <zephyr.h>
#include <tc_util.h>
#include <misc/util.h>

#define ONE_SECOND (sys_clock_ticks_per_sec)
Expand Down
2 changes: 0 additions & 2 deletions samples/microkernel/test/test_sema/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ these semaphores until it detects a failure or the completion of all test tasks,
then announces the result of the test.
*/

#include <nanokernel.h>
#include <arch/cpu.h>
#include <zephyr.h>
#include <tc_util.h>

Expand Down
2 changes: 0 additions & 2 deletions samples/microkernel/test/test_sema/src/sema.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ This modules tests the following semaphore routines:
isr_sem_give(), fiber_sem_give()
*/

#include <nanokernel.h>
#include <arch/cpu.h>
#include <zephyr.h>
#include <tc_util.h>

Expand Down
2 changes: 0 additions & 2 deletions samples/microkernel/test/test_sema/src/test_fiber.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ The module implements functions for the fiber that tests
semaphore signaling
*/

#include <nanokernel.h>
#include <arch/cpu.h>
#include <zephyr.h>

#define N_TESTS 10 /* number of tests to run */
Expand Down
7 changes: 1 addition & 6 deletions samples/microkernel/test/test_static_idt/src/static_idt.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,16 @@ DESCRIPTION
Ensures interrupt and exception stubs are installed correctly.
*/

#include <zephyr.h>
#include <tc_util.h>

#include <nanokernel.h>
#include <arch/cpu.h>
#include <nano_private.h>
#if defined(__GNUC__)
#include <test_asm_inline_gcc.h>
#else
#include <test_asm_inline_other.h>
#endif

#ifdef CONFIG_MICROKERNEL
#include <zephyr.h>
#endif

/* These vectors are somewhat arbitrary. We try and use unused vectors */
#define TEST_SOFT_INT 62
#define TEST_SPUR_INT 63
Expand Down
Loading

0 comments on commit 3657987

Please sign in to comment.