From 90822737466354c397b0aa9648011f5163295203 Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Sat, 27 Feb 2016 01:12:02 +0100 Subject: [PATCH 1/3] core: header cleanup --- boards/avsextrem/drivers/avsextrem-smb380.c | 1 - boards/msb-430-common/board_init.c | 1 - boards/wsn430-common/board_init.c | 1 - core/include/arch/thread_arch.h | 5 +- core/include/kernel.h | 72 ------------------- core/include/kernel_init.h | 38 ++++++++++ core/include/kernel_internal.h | 70 ------------------ core/include/lpm.h | 5 ++ core/include/panic.h | 2 +- core/include/sched.h | 9 ++- core/include/thread.h | 23 +++++- core/kernel_init.c | 7 +- core/msg.c | 1 - core/mutex.c | 1 - core/panic.c | 1 + core/sched.c | 2 - core/thread.c | 2 - cpu/arm7_common/arm_cpu.c | 4 +- cpu/arm7_common/bootloader.c | 1 - cpu/atmega2560/reboot_arch.c | 1 - cpu/atmega_common/thread_arch.c | 1 - cpu/cortexm_common/reboot_arch.c | 1 - cpu/cortexm_common/thread_arch.c | 1 - cpu/cortexm_common/vectors_cortexm.c | 3 +- cpu/lm4f120/cpu.c | 2 - cpu/lpc1768/reboot_arch.c | 1 - cpu/lpc2387/periph/uart.c | 1 - cpu/msp430-common/cpu.c | 2 - cpu/msp430-common/startup.c | 4 +- cpu/native/include/native_internal.h | 2 - cpu/native/native_cpu.c | 2 - cpu/native/startup.c | 2 +- cpu/native/syscalls.c | 1 - cpu/nrf51/radio/nrfmin/nrfmin.c | 1 - cpu/saml21/lpm_arch.c | 2 +- cpu/x86/include/x86_reboot.h | 3 +- cpu/x86/x86_glue.c | 1 - cpu/x86/x86_rtc.c | 1 - cpu/x86/x86_startup.c | 3 +- cpu/x86/x86_threading.c | 1 - drivers/include/xbee.h | 1 - examples/gnrc_networking/udp.c | 1 - examples/gnrc_tftp/tftp_client.c | 1 - sys/cpp11-compat/include/riot/thread.hpp | 1 - sys/crypto/modes/ecb.c | 3 + sys/include/crypto/helper.h | 3 +- sys/include/crypto/modes/cbc.h | 1 - sys/include/crypto/modes/ccm.h | 1 - sys/include/crypto/modes/ctr.h | 1 - sys/include/crypto/modes/ecb.h | 1 - sys/include/net/gnrc/netapi.h | 1 - sys/include/net/gnrc/netdev.h | 1 - sys/include/net/gnrc/netif/hdr.h | 1 - sys/include/net/gnrc/nomac.h | 1 - sys/include/net/gnrc/pktdump.h | 2 +- sys/net/gnrc/application_layer/zep/gnrc_zep.c | 1 - .../gnrc/link_layer/netdev2/gnrc_netdev2.c | 1 - sys/net/gnrc/link_layer/nomac/gnrc_nomac.c | 1 - sys/net/gnrc/link_layer/slip/gnrc_slip.c | 1 - sys/net/gnrc/netapi/gnrc_netapi.c | 1 - sys/net/gnrc/pktdump/gnrc_pktdump.c | 1 - sys/net/gnrc/transport_layer/udp/gnrc_udp.c | 1 - sys/posix/pthread/include/pthread.h | 1 - sys/posix/pthread/include/pthread_mutex.h | 1 - sys/posix/pthread/pthread.c | 1 - tests/pipe/main.c | 1 - .../unittests/tests-checksum/tests-checksum.h | 1 - .../tests-core/tests-core-ringbuffer.c | 1 - tests/unittests/tests-crypto/tests-crypto.h | 4 +- .../tests-ubjson/test-ubjson-empty-array.c | 1 - .../tests-ubjson/test-ubjson-empty-object.c | 1 - tests/unittests/tests-ubjson/tests-ubjson.h | 1 + 72 files changed, 100 insertions(+), 222 deletions(-) delete mode 100644 core/include/kernel.h create mode 100644 core/include/kernel_init.h delete mode 100644 core/include/kernel_internal.h diff --git a/boards/avsextrem/drivers/avsextrem-smb380.c b/boards/avsextrem/drivers/avsextrem-smb380.c index a36e3f141372..e25c80f3a22d 100644 --- a/boards/avsextrem/drivers/avsextrem-smb380.c +++ b/boards/avsextrem/drivers/avsextrem-smb380.c @@ -31,7 +31,6 @@ #include "cpu.h" #include "lpm.h" #include "VIC.h" -#include "kernel.h" #include "ssp0-board.h" #include "smb380-board.h" #include "xtimer.h" diff --git a/boards/msb-430-common/board_init.c b/boards/msb-430-common/board_init.c index 21ff475d89b0..f2597697e072 100644 --- a/boards/msb-430-common/board_init.c +++ b/boards/msb-430-common/board_init.c @@ -25,7 +25,6 @@ #include "board.h" #include "uart_stdio.h" #include "periph_conf.h" -#include "kernel_internal.h" #include "msp430.h" #include "debug.h" diff --git a/boards/wsn430-common/board_init.c b/boards/wsn430-common/board_init.c index 738230b51aa1..df420f61d16f 100644 --- a/boards/wsn430-common/board_init.c +++ b/boards/wsn430-common/board_init.c @@ -10,7 +10,6 @@ #include "cpu.h" #include "irq.h" #include "board.h" -#include "kernel_internal.h" #include "msp430.h" #include "debug.h" #include "uart_stdio.h" diff --git a/core/include/arch/thread_arch.h b/core/include/arch/thread_arch.h index 0f60ad0c716f..10507a073b7a 100644 --- a/core/include/arch/thread_arch.h +++ b/core/include/arch/thread_arch.h @@ -25,7 +25,6 @@ extern "C" { #endif -#include "kernel_internal.h" /** * @name Define the mapping between the architecture independent interfaces * and the kernel internal interfaces @@ -42,6 +41,10 @@ #endif /** @} */ +/** + * @brief Prototype for a thread entry function + */ +typedef void *(*thread_task_func_t)(void *arg); /** * @brief Initialize a thread's stack diff --git a/core/include/kernel.h b/core/include/kernel.h deleted file mode 100644 index 7ead76272143..000000000000 --- a/core/include/kernel.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (C) 2013 Freie Universität Berlin - * - * This file is subject to the terms and conditions of the GNU Lesser - * General Public License v2.1. See the file LICENSE in the top level - * directory for more details. - */ - -/** - * @addtogroup core_internal - * @{ - * - * @file - * @brief Kernel compile time configuration - * - * A reboot() function is also provided - * (and used by core_panic() when needed). - * - * @author Kaspar Schleiser - */ - -#ifndef KERNEL_H_ -#define KERNEL_H_ - -#include -#include - -#include "attributes.h" -#include "config.h" -#include "tcb.h" -#include "cpu.h" -#include "sched.h" -#include "cpu_conf.h" - -#ifdef __cplusplus - extern "C" { -#endif - -/* ------------------------------------------------------------------------- */ - -/** - * @def LPM_PREVENT_SLEEP_UART - * @brief This flag tells the kernel that the deepest power saving - * mode that currently can be used must still allow UART - * communication. Bitmask to use with `lpm_prevent_sleep` - * in power management. - */ -#define LPM_PREVENT_SLEEP_UART BIT2 - -/** - * @brief This bitfield is used to configure which modules are - * currently active and prevent the kernel to go to the - * deepest power modes. It is used with `LPM_PREVENT_SLEEP_HWTIMER` - * and/or `LPM_PREVENT_SLEEP_UART`. - */ -extern volatile int lpm_prevent_sleep; - -/** - * @brief Variable used to store system configuration - * - * @details This contains e.g. the node ID, name, default channel and so on - */ -extern config_t sysconfig; - -/* ------------------------------------------------------------------------- */ - -#ifdef __cplusplus -} -#endif - -#endif /* KERNEL_H_ */ -/** @} */ diff --git a/core/include/kernel_init.h b/core/include/kernel_init.h new file mode 100644 index 000000000000..b055919ee49a --- /dev/null +++ b/core/include/kernel_init.h @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2016 Kaspar Schleiser + * 2013 Freie Universität Berlin + * + * This file is subject to the terms and conditions of the GNU Lesser + * General Public License v2.1. See the file LICENSE in the top level + * directory for more details. + */ + +/** + * @addtogroup core_internal + * @{ + * + * @file + * @brief prototypes for kernel intitialization + * + * @author Oliver Hahm + * @author Kaspar Schleiser + */ + +#ifndef KERNEL_INIT_H +#define KERNEL_INIT_H + +#ifdef __cplusplus + extern "C" { +#endif + +/** + * @brief Initializes scheduler and creates main and idle task + */ +void kernel_init(void); + +#ifdef __cplusplus +} +#endif + +#endif /* KERNEL_INIT_H */ +/** @} */ diff --git a/core/include/kernel_internal.h b/core/include/kernel_internal.h deleted file mode 100644 index d225ca684a3b..000000000000 --- a/core/include/kernel_internal.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (C) 2013 Freie Universität Berlin - * - * This file is subject to the terms and conditions of the GNU Lesser - * General Public License v2.1. See the file LICENSE in the top level - * directory for more details. - */ - -/** - * @addtogroup core_internal - * @{ - * - * @file - * @brief prototypes for kernel internal functions - * - * @author Oliver Hahm - */ - -#ifndef KERNEL_INTERNAL_H_ -#define KERNEL_INTERNAL_H_ - -#include "attributes.h" - -#ifdef __cplusplus - extern "C" { -#endif - -/** - * @brief Initializes scheduler and creates main and idle task - */ -void kernel_init(void); - -/** - * @brief Optionally: initializes platform specifics (devices, pin configuration etc.) - */ -void board_init(void); - -/** - * @brief Prototype for a thread entry function - */ -typedef void *(*thread_task_func_t)(void *arg); - -/** - * @brief Gets called upon thread creation to set CPU registers - * - * @param[in] task_func First function to call within the thread - * @param[in] arg Argument to supply to task_func - * @param[in] stack_start Start address of the stack - * @param[in] stack_size Stack size - * - * @return stack pointer - */ -char *thread_stack_init(thread_task_func_t task_func, void *arg, void *stack_start, int stack_size); - -/** - * @brief Removes thread from scheduler and set status to #STATUS_STOPPED - */ -NORETURN void sched_task_exit(void); - -/** - * @brief Prints human readable, ps-like thread information for debugging purposes - */ -void thread_print_stack(void); - -#ifdef __cplusplus -} -#endif - -#endif /* KERNEL_INTERNAL_H_ */ -/** @} */ diff --git a/core/include/lpm.h b/core/include/lpm.h index 24d7ee4d7f23..524fa2808950 100644 --- a/core/include/lpm.h +++ b/core/include/lpm.h @@ -64,6 +64,11 @@ void lpm_end_awake(void); */ enum lpm_mode lpm_get(void); +/** + * @name LPM-internal variable + */ +extern volatile int lpm_prevent_sleep; + #ifdef __cplusplus } #endif diff --git a/core/include/panic.h b/core/include/panic.h index 2465f2f72d58..aa3658fa6036 100644 --- a/core/include/panic.h +++ b/core/include/panic.h @@ -22,7 +22,7 @@ #ifndef PANIC_H #define PANIC_H -#include "kernel.h" +#include "attributes.h" #ifdef __cplusplus extern "C" { diff --git a/core/include/sched.h b/core/include/sched.h index 53b883c7fbb8..aeb0a307f2cf 100644 --- a/core/include/sched.h +++ b/core/include/sched.h @@ -81,6 +81,7 @@ #define SCHEDULER_H #include +#include "attributes.h" #include "bitarithm.h" #include "tcb.h" #include "attributes.h" @@ -164,6 +165,11 @@ extern volatile kernel_pid_t sched_active_pid; */ extern clist_node_t *sched_runqueues[SCHED_PRIO_LEVELS]; +/** + * @brief Removes thread from scheduler and set status to #STATUS_STOPPED + */ +NORETURN void sched_task_exit(void); + #ifdef MODULE_SCHEDSTATISTICS /** * Scheduler statistics @@ -186,8 +192,7 @@ extern schedstat sched_pidlist[KERNEL_PID_LAST + 1]; * @param[in] callback The callback functions the will be called */ void sched_register_cb(void (*callback)(uint32_t, uint32_t)); - -#endif +#endif /* MODULE_SCHEDSTATISTICS */ #ifdef __cplusplus } diff --git a/core/include/thread.h b/core/include/thread.h index 13540a6b743b..a79413dea23f 100644 --- a/core/include/thread.h +++ b/core/include/thread.h @@ -22,9 +22,11 @@ #ifndef THREAD_H #define THREAD_H -#include "kernel.h" +#include "cpu.h" +#include "cpu_conf.h" #include "tcb.h" #include "arch/thread_arch.h" +#include "sched.h" #ifdef __cplusplus extern "C" { @@ -243,6 +245,18 @@ static inline kernel_pid_t thread_getpid(void) return sched_active_pid; } +/** + * @brief Gets called upon thread creation to set CPU registers + * + * @param[in] task_func First function to call within the thread + * @param[in] arg Argument to supply to task_func + * @param[in] stack_start Start address of the stack + * @param[in] stack_size Stack size + * + * @return stack pointer + */ +char *thread_stack_init(thread_task_func_t task_func, void *arg, void *stack_start, int stack_size); + /** * @brief Prints the message queue of the current thread. */ @@ -269,7 +283,12 @@ const char *thread_getname(kernel_pid_t pid); * @return the amount of unused space of the thread's stack */ uintptr_t thread_measure_stack_free(char *stack); -#endif +#endif /* DEVELHELP */ + +/** + * @brief Prints human readable, ps-like thread information for debugging purposes + */ +void thread_print_stack(void); #ifdef __cplusplus } diff --git a/core/kernel_init.c b/core/kernel_init.c index 41ce1027265c..d50c7eb9fc78 100644 --- a/core/kernel_init.c +++ b/core/kernel_init.c @@ -21,13 +21,10 @@ #include #include #include -#include "tcb.h" -#include "kernel.h" -#include "kernel_internal.h" +#include "kernel_init.h" #include "sched.h" -#include "cpu.h" -#include "lpm.h" #include "thread.h" +#include "lpm.h" #include "irq.h" #include "log.h" diff --git a/core/msg.c b/core/msg.c index 1afa19eb76da..66c3611ae878 100644 --- a/core/msg.c +++ b/core/msg.c @@ -23,7 +23,6 @@ #include #include #include -#include "kernel.h" #include "sched.h" #include "msg.h" #include "priority_queue.h" diff --git a/core/mutex.c b/core/mutex.c index 0e5fa42b5dfb..bca8af55a696 100644 --- a/core/mutex.c +++ b/core/mutex.c @@ -25,7 +25,6 @@ #include "mutex.h" #include "tcb.h" #include "atomic.h" -#include "kernel.h" #include "sched.h" #include "thread.h" #include "irq.h" diff --git a/core/panic.c b/core/panic.c index 998be10e42b1..86dc502838b1 100644 --- a/core/panic.c +++ b/core/panic.c @@ -25,6 +25,7 @@ #include #include "assert.h" +#include "attributes.h" #include "cpu.h" #include "irq.h" #include "lpm.h" diff --git a/core/sched.c b/core/sched.c index 2429496bdcfc..538c661f551b 100644 --- a/core/sched.c +++ b/core/sched.c @@ -22,8 +22,6 @@ #include #include "sched.h" -#include "kernel.h" -#include "kernel_internal.h" #include "clist.h" #include "bitarithm.h" #include "irq.h" diff --git a/core/thread.c b/core/thread.c index 1180cbbb2d1b..7e70bd086145 100644 --- a/core/thread.c +++ b/core/thread.c @@ -22,12 +22,10 @@ #include #include "thread.h" -#include "kernel.h" #include "irq.h" #define ENABLE_DEBUG (0) #include "debug.h" -#include "kernel_internal.h" #include "bitarithm.h" #include "sched.h" diff --git a/cpu/arm7_common/arm_cpu.c b/cpu/arm7_common/arm_cpu.c index e3d05e47845b..4289b0817f23 100644 --- a/cpu/arm7_common/arm_cpu.c +++ b/cpu/arm7_common/arm_cpu.c @@ -18,9 +18,7 @@ #include #include "arm_cpu.h" -#include "sched.h" -#include "kernel.h" -#include "kernel_internal.h" +#include "thread.h" #define STACK_MARKER (0x77777777) #define REGISTER_CNT (12) diff --git a/cpu/arm7_common/bootloader.c b/cpu/arm7_common/bootloader.c index 22bd950b95fa..f7d48a052201 100644 --- a/cpu/arm7_common/bootloader.c +++ b/cpu/arm7_common/bootloader.c @@ -26,7 +26,6 @@ #include #include -#include "kernel.h" #include "thread.h" void FIQ_Routine(void) __attribute__((interrupt("FIQ"))); diff --git a/cpu/atmega2560/reboot_arch.c b/cpu/atmega2560/reboot_arch.c index f774efc3a48d..1f8f61569f52 100644 --- a/cpu/atmega2560/reboot_arch.c +++ b/cpu/atmega2560/reboot_arch.c @@ -22,7 +22,6 @@ #include -#include "kernel.h" #include "cpu.h" void reboot(void) diff --git a/cpu/atmega_common/thread_arch.c b/cpu/atmega_common/thread_arch.c index 9b9cd1106139..1b1922f6f14c 100644 --- a/cpu/atmega_common/thread_arch.c +++ b/cpu/atmega_common/thread_arch.c @@ -25,7 +25,6 @@ #include "sched.h" #include "irq.h" #include "cpu.h" -#include "kernel_internal.h" /* * local function declarations (prefixed with __) diff --git a/cpu/cortexm_common/reboot_arch.c b/cpu/cortexm_common/reboot_arch.c index a12a943223ef..bfa4e6230663 100644 --- a/cpu/cortexm_common/reboot_arch.c +++ b/cpu/cortexm_common/reboot_arch.c @@ -22,7 +22,6 @@ #include -#include "kernel.h" #include "cpu.h" void reboot(void) diff --git a/cpu/cortexm_common/thread_arch.c b/cpu/cortexm_common/thread_arch.c index eaa69b02a2a8..8daef1471bcd 100644 --- a/cpu/cortexm_common/thread_arch.c +++ b/cpu/cortexm_common/thread_arch.c @@ -99,7 +99,6 @@ #include "thread.h" #include "irq.h" #include "cpu.h" -#include "kernel_internal.h" /** * @brief Noticeable marker marking the beginning of a stack segment diff --git a/cpu/cortexm_common/vectors_cortexm.c b/cpu/cortexm_common/vectors_cortexm.c index 07a197020430..58aca9f26e1e 100644 --- a/cpu/cortexm_common/vectors_cortexm.c +++ b/cpu/cortexm_common/vectors_cortexm.c @@ -23,11 +23,12 @@ #include #include +#include #include "cpu.h" +#include "kernel_init.h" #include "board.h" #include "panic.h" -#include "kernel_internal.h" #include "vectors_cortexm.h" /** diff --git a/cpu/lm4f120/cpu.c b/cpu/lm4f120/cpu.c index dfb671b11e20..05ffbdaa116b 100644 --- a/cpu/lm4f120/cpu.c +++ b/cpu/lm4f120/cpu.c @@ -19,8 +19,6 @@ #include "cpu.h" #include "irq.h" -#include "kernel.h" -#include "kernel_internal.h" #include "sched.h" #include "thread.h" #include "arch/thread_arch.h" diff --git a/cpu/lpc1768/reboot_arch.c b/cpu/lpc1768/reboot_arch.c index 455e613c6be2..328894375b3c 100644 --- a/cpu/lpc1768/reboot_arch.c +++ b/cpu/lpc1768/reboot_arch.c @@ -23,7 +23,6 @@ #include -#include "kernel.h" #include "cpu.h" void reboot(void) diff --git a/cpu/lpc2387/periph/uart.c b/cpu/lpc2387/periph/uart.c index a0637816a514..011d42eb9e11 100644 --- a/cpu/lpc2387/periph/uart.c +++ b/cpu/lpc2387/periph/uart.c @@ -26,7 +26,6 @@ #include "lpc23xx.h" #include "VIC.h" -#include "kernel.h" #include "periph/uart.h" /* for now, we only support one UART device... */ diff --git a/cpu/msp430-common/cpu.c b/cpu/msp430-common/cpu.c index 278d341df1a4..f39ac458f45d 100644 --- a/cpu/msp430-common/cpu.c +++ b/cpu/msp430-common/cpu.c @@ -10,8 +10,6 @@ #include "cpu.h" #include "irq.h" -#include "kernel.h" -#include "kernel_internal.h" #include "sched.h" #include "thread.h" diff --git a/cpu/msp430-common/startup.c b/cpu/msp430-common/startup.c index d3fc0d41717f..41d7d4d39290 100644 --- a/cpu/msp430-common/startup.c +++ b/cpu/msp430-common/startup.c @@ -19,9 +19,9 @@ * @} */ -#include "irq.h" #include -#include "kernel_internal.h" +#include "kernel_init.h" +#include "irq.h" extern void board_init(void); diff --git a/cpu/native/include/native_internal.h b/cpu/native/include/native_internal.h index ffd78b7e1211..98a506f51c2d 100644 --- a/cpu/native/include/native_internal.h +++ b/cpu/native/include/native_internal.h @@ -174,9 +174,7 @@ int unregister_interrupt(int sig); } #endif -#include "kernel_internal.h" #include "sched.h" - /** @} */ #endif /* _NATIVE_INTERNAL_H */ diff --git a/cpu/native/native_cpu.c b/cpu/native/native_cpu.c index 41c4d2656085..290cb4227445 100644 --- a/cpu/native/native_cpu.c +++ b/cpu/native/native_cpu.c @@ -46,8 +46,6 @@ #include -#include "kernel_internal.h" -#include "kernel.h" #include "irq.h" #include "sched.h" diff --git a/cpu/native/startup.c b/cpu/native/startup.c index 2d138daeec6c..42b0edc01363 100644 --- a/cpu/native/startup.c +++ b/cpu/native/startup.c @@ -30,7 +30,7 @@ #include #include -#include "kernel_internal.h" +#include "kernel_init.h" #include "cpu.h" #include "board_internal.h" diff --git a/cpu/native/syscalls.c b/cpu/native/syscalls.c index d9385b40d6fe..63302bdcfa85 100644 --- a/cpu/native/syscalls.c +++ b/cpu/native/syscalls.c @@ -36,7 +36,6 @@ #include #include -#include "kernel.h" #include "cpu.h" #include "irq.h" #include "xtimer.h" diff --git a/cpu/nrf51/radio/nrfmin/nrfmin.c b/cpu/nrf51/radio/nrfmin/nrfmin.c index 9b1edd3fb445..295c0927bfe8 100644 --- a/cpu/nrf51/radio/nrfmin/nrfmin.c +++ b/cpu/nrf51/radio/nrfmin/nrfmin.c @@ -22,7 +22,6 @@ #include "mutex.h" #include "thread.h" #include "sched.h" -#include "kernel.h" #include "periph_conf.h" #include "periph/cpuid.h" #include "nrfmin.h" diff --git a/cpu/saml21/lpm_arch.c b/cpu/saml21/lpm_arch.c index 1f504485642b..42ec81e42f07 100644 --- a/cpu/saml21/lpm_arch.c +++ b/cpu/saml21/lpm_arch.c @@ -20,9 +20,9 @@ #include +#include "lpm.h" #include "arch/lpm_arch.h" #include "cpu.h" -#include "kernel.h" #define ENABLE_DEBUG 0 #include "debug.h" diff --git a/cpu/x86/include/x86_reboot.h b/cpu/x86/include/x86_reboot.h index a2785118d12e..824e9a6afa2f 100644 --- a/cpu/x86/include/x86_reboot.h +++ b/cpu/x86/include/x86_reboot.h @@ -28,7 +28,8 @@ #ifndef CPU__X86__REBOOT__H__ #define CPU__X86__REBOOT__H__ -#include "kernel.h" +#include +#include "attributes.h" #ifdef __cplusplus extern "C" { diff --git a/cpu/x86/x86_glue.c b/cpu/x86/x86_glue.c index 8ed9fe9bebc3..cb835c9b9e61 100644 --- a/cpu/x86/x86_glue.c +++ b/cpu/x86/x86_glue.c @@ -30,7 +30,6 @@ #include "attributes.h" #include "cpu.h" -#include "kernel_internal.h" #include "sched.h" #include "x86_uart.h" diff --git a/cpu/x86/x86_rtc.c b/cpu/x86/x86_rtc.c index 81813766da0d..1d875fb3c688 100644 --- a/cpu/x86/x86_rtc.c +++ b/cpu/x86/x86_rtc.c @@ -34,7 +34,6 @@ #include -#include "kernel.h" #define ENABLE_DEBUG (0) #include "debug.h" diff --git a/cpu/x86/x86_startup.c b/cpu/x86/x86_startup.c index c8a1fbd8aec2..53663ec5d417 100644 --- a/cpu/x86/x86_startup.c +++ b/cpu/x86/x86_startup.c @@ -38,11 +38,12 @@ #include "x86_uart.h" #include -#include #include #include +#include "kernel_init.h" + /* Must be <= 0x1000 because otherwise x86_map_physical_pages() might get a page out of this pool. * Because static memory has the PT_G flag, flushing the TLB would cause a stale PT * after calling add_pages_to_pool() in x86_map_physical_pages(). diff --git a/cpu/x86/x86_threading.c b/cpu/x86/x86_threading.c index 69d8a3485b1a..90037cbf5678 100644 --- a/cpu/x86/x86_threading.c +++ b/cpu/x86/x86_threading.c @@ -34,7 +34,6 @@ #include "x86_threading.h" #include "cpu.h" #include "irq.h" -#include "kernel_internal.h" #include "ucontext.h" #include "sched.h" #include "stdbool.h" diff --git a/drivers/include/xbee.h b/drivers/include/xbee.h index 3b355a1d3709..eea9d87e7cfa 100644 --- a/drivers/include/xbee.h +++ b/drivers/include/xbee.h @@ -25,7 +25,6 @@ #include -#include "kernel.h" #include "mutex.h" #include "periph/uart.h" #include "periph/gpio.h" diff --git a/examples/gnrc_networking/udp.c b/examples/gnrc_networking/udp.c index af1065150403..a03770e4fdba 100644 --- a/examples/gnrc_networking/udp.c +++ b/examples/gnrc_networking/udp.c @@ -21,7 +21,6 @@ #include #include -#include "kernel.h" #include "net/gnrc.h" #include "net/gnrc/ipv6.h" #include "net/gnrc/udp.h" diff --git a/examples/gnrc_tftp/tftp_client.c b/examples/gnrc_tftp/tftp_client.c index 838b67f5b2bb..5e89530eebe5 100644 --- a/examples/gnrc_tftp/tftp_client.c +++ b/examples/gnrc_tftp/tftp_client.c @@ -22,7 +22,6 @@ #include #include -#include "kernel.h" #include "net/gnrc/tftp.h" static const char *_tftp_default_host = "::1"; diff --git a/sys/cpp11-compat/include/riot/thread.hpp b/sys/cpp11-compat/include/riot/thread.hpp index a18e580ced3c..82ab32e5e7ee 100644 --- a/sys/cpp11-compat/include/riot/thread.hpp +++ b/sys/cpp11-compat/include/riot/thread.hpp @@ -26,7 +26,6 @@ #include "time.h" #include "thread.h" -#include "kernel_internal.h" #include #include diff --git a/sys/crypto/modes/ecb.c b/sys/crypto/modes/ecb.c index 627d9ae72b40..a2c0da884334 100644 --- a/sys/crypto/modes/ecb.c +++ b/sys/crypto/modes/ecb.c @@ -18,6 +18,9 @@ * @} */ +#include +#include + #include "crypto/modes/ecb.h" int cipher_encrypt_ecb(cipher_t* cipher, uint8_t* input, diff --git a/sys/include/crypto/helper.h b/sys/include/crypto/helper.h index 9b1efa8c8965..81b72ab10548 100644 --- a/sys/include/crypto/helper.h +++ b/sys/include/crypto/helper.h @@ -20,7 +20,8 @@ #ifndef __CRYPTO_MODES_HELPER_H_ #define __CRYPTO_MODES_HELPER_H_ -#include "kernel.h" +#include +#include #ifdef __cplusplus extern "C" { diff --git a/sys/include/crypto/modes/cbc.h b/sys/include/crypto/modes/cbc.h index edb21f53790f..79a9db7621e0 100644 --- a/sys/include/crypto/modes/cbc.h +++ b/sys/include/crypto/modes/cbc.h @@ -20,7 +20,6 @@ #ifndef __CRYPTO_MODES_CBC_H_ #define __CRYPTO_MODES_CBC_H_ -#include "kernel.h" #include "crypto/ciphers.h" #ifdef __cplusplus diff --git a/sys/include/crypto/modes/ccm.h b/sys/include/crypto/modes/ccm.h index b5a65d2e5240..7c36d2fe91ed 100644 --- a/sys/include/crypto/modes/ccm.h +++ b/sys/include/crypto/modes/ccm.h @@ -20,7 +20,6 @@ #ifndef __CRYPTO_MODES_CCM_H_ #define __CRYPTO_MODES_CCM_H_ -#include "kernel.h" #include "crypto/ciphers.h" #ifdef __cplusplus diff --git a/sys/include/crypto/modes/ctr.h b/sys/include/crypto/modes/ctr.h index 2599aae8da61..de1bdd658dc7 100644 --- a/sys/include/crypto/modes/ctr.h +++ b/sys/include/crypto/modes/ctr.h @@ -20,7 +20,6 @@ #ifndef __CRYPTO_MODES_CTR_H_ #define __CRYPTO_MODES_CTR_H_ -#include "kernel.h" #include "crypto/ciphers.h" #ifdef __cplusplus diff --git a/sys/include/crypto/modes/ecb.h b/sys/include/crypto/modes/ecb.h index 59d6783f7ebe..a7d8524a8dac 100644 --- a/sys/include/crypto/modes/ecb.h +++ b/sys/include/crypto/modes/ecb.h @@ -20,7 +20,6 @@ #ifndef __CRYPTO_MODES_ECB_H_ #define __CRYPTO_MODES_ECB_H_ -#include "kernel.h" #include "crypto/ciphers.h" #ifdef __cplusplus diff --git a/sys/include/net/gnrc/netapi.h b/sys/include/net/gnrc/netapi.h index 0915eb2e1faa..52ce4ae7a945 100644 --- a/sys/include/net/gnrc/netapi.h +++ b/sys/include/net/gnrc/netapi.h @@ -28,7 +28,6 @@ #ifndef GNRC_NETAPI_H_ #define GNRC_NETAPI_H_ -#include "kernel.h" #include "thread.h" #include "net/netopt.h" #include "net/gnrc/nettype.h" diff --git a/sys/include/net/gnrc/netdev.h b/sys/include/net/gnrc/netdev.h index 39027e0f4e25..f703091a0dfc 100644 --- a/sys/include/net/gnrc/netdev.h +++ b/sys/include/net/gnrc/netdev.h @@ -27,7 +27,6 @@ #include #include -#include "kernel.h" #include "net/gnrc/pkt.h" #include "net/netopt.h" diff --git a/sys/include/net/gnrc/netif/hdr.h b/sys/include/net/gnrc/netif/hdr.h index f5f000b5070e..6909b3d838d8 100644 --- a/sys/include/net/gnrc/netif/hdr.h +++ b/sys/include/net/gnrc/netif/hdr.h @@ -24,7 +24,6 @@ #include #include -#include "kernel.h" #include "net/gnrc/pkt.h" #include "net/gnrc/pktbuf.h" diff --git a/sys/include/net/gnrc/nomac.h b/sys/include/net/gnrc/nomac.h index 15ca439cf036..dcbefda65f62 100644 --- a/sys/include/net/gnrc/nomac.h +++ b/sys/include/net/gnrc/nomac.h @@ -22,7 +22,6 @@ #ifndef GNRC_NOMAC_H_ #define GNRC_NOMAC_H_ -#include "kernel.h" #include "net/gnrc/netdev.h" #ifdef __cplusplus diff --git a/sys/include/net/gnrc/pktdump.h b/sys/include/net/gnrc/pktdump.h index 02b5da9d5698..47bbb20e1188 100644 --- a/sys/include/net/gnrc/pktdump.h +++ b/sys/include/net/gnrc/pktdump.h @@ -22,7 +22,7 @@ #ifndef GNRC_PKTDUMP_H_ #define GNRC_PKTDUMP_H_ -#include "kernel.h" +#include "kernel_types.h" #ifdef __cplusplus extern "C" { diff --git a/sys/net/gnrc/application_layer/zep/gnrc_zep.c b/sys/net/gnrc/application_layer/zep/gnrc_zep.c index e4f3d9434afb..9521cb7c23dd 100644 --- a/sys/net/gnrc/application_layer/zep/gnrc_zep.c +++ b/sys/net/gnrc/application_layer/zep/gnrc_zep.c @@ -21,7 +21,6 @@ #include "ringbuffer.h" #include "hashes.h" -#include "kernel.h" #include "msg.h" #include "net/ieee802154.h" #include "net/ipv6/addr.h" diff --git a/sys/net/gnrc/link_layer/netdev2/gnrc_netdev2.c b/sys/net/gnrc/link_layer/netdev2/gnrc_netdev2.c index 278f4044e727..10a010fdc496 100644 --- a/sys/net/gnrc/link_layer/netdev2/gnrc_netdev2.c +++ b/sys/net/gnrc/link_layer/netdev2/gnrc_netdev2.c @@ -20,7 +20,6 @@ #include -#include "kernel.h" #include "msg.h" #include "thread.h" diff --git a/sys/net/gnrc/link_layer/nomac/gnrc_nomac.c b/sys/net/gnrc/link_layer/nomac/gnrc_nomac.c index 101549a8675b..7e5f9f9ee1dc 100644 --- a/sys/net/gnrc/link_layer/nomac/gnrc_nomac.c +++ b/sys/net/gnrc/link_layer/nomac/gnrc_nomac.c @@ -18,7 +18,6 @@ #include -#include "kernel.h" #include "msg.h" #include "thread.h" #include "net/gnrc/nomac.h" diff --git a/sys/net/gnrc/link_layer/slip/gnrc_slip.c b/sys/net/gnrc/link_layer/slip/gnrc_slip.c index 366479366086..ccf55d74f378 100644 --- a/sys/net/gnrc/link_layer/slip/gnrc_slip.c +++ b/sys/net/gnrc/link_layer/slip/gnrc_slip.c @@ -24,7 +24,6 @@ #include #include -#include "kernel.h" #include "kernel_types.h" #include "msg.h" #include "net/gnrc.h" diff --git a/sys/net/gnrc/netapi/gnrc_netapi.c b/sys/net/gnrc/netapi/gnrc_netapi.c index a88666c0793f..d96b4014a4fc 100644 --- a/sys/net/gnrc/netapi/gnrc_netapi.c +++ b/sys/net/gnrc/netapi/gnrc_netapi.c @@ -18,7 +18,6 @@ * @} */ -#include "kernel.h" #include "msg.h" #include "net/gnrc/netreg.h" #include "net/gnrc/pktbuf.h" diff --git a/sys/net/gnrc/pktdump/gnrc_pktdump.c b/sys/net/gnrc/pktdump/gnrc_pktdump.c index a454791b966c..3224563d508d 100644 --- a/sys/net/gnrc/pktdump/gnrc_pktdump.c +++ b/sys/net/gnrc/pktdump/gnrc_pktdump.c @@ -25,7 +25,6 @@ #include "byteorder.h" #include "thread.h" #include "msg.h" -#include "kernel.h" #include "net/gnrc/pktdump.h" #include "net/gnrc.h" #include "net/ipv6/addr.h" diff --git a/sys/net/gnrc/transport_layer/udp/gnrc_udp.c b/sys/net/gnrc/transport_layer/udp/gnrc_udp.c index d3b66416ee4a..daf6fb4e73c3 100644 --- a/sys/net/gnrc/transport_layer/udp/gnrc_udp.c +++ b/sys/net/gnrc/transport_layer/udp/gnrc_udp.c @@ -20,7 +20,6 @@ #include #include -#include "kernel.h" #include "byteorder.h" #include "msg.h" #include "thread.h" diff --git a/sys/posix/pthread/include/pthread.h b/sys/posix/pthread/include/pthread.h index 262b53928913..079534327825 100644 --- a/sys/posix/pthread/include/pthread.h +++ b/sys/posix/pthread/include/pthread.h @@ -22,7 +22,6 @@ #include -#include "kernel.h" #include "mutex.h" #include "sched.h" diff --git a/sys/posix/pthread/include/pthread_mutex.h b/sys/posix/pthread/include/pthread_mutex.h index 0b2fea8fb956..4c0d602dc56a 100644 --- a/sys/posix/pthread/include/pthread_mutex.h +++ b/sys/posix/pthread/include/pthread_mutex.h @@ -19,7 +19,6 @@ #include -#include "kernel.h" #include "mutex.h" #ifdef __cplusplus diff --git a/sys/posix/pthread/pthread.c b/sys/posix/pthread/pthread.c index 2d72161245fd..a5917d947da1 100644 --- a/sys/posix/pthread/pthread.c +++ b/sys/posix/pthread/pthread.c @@ -26,7 +26,6 @@ #include "cpu_conf.h" #include "irq.h" -#include "kernel_internal.h" #include "msg.h" #include "mutex.h" #include "priority_queue.h" diff --git a/tests/pipe/main.c b/tests/pipe/main.c index 41805a305e13..e7e05a8c23c4 100644 --- a/tests/pipe/main.c +++ b/tests/pipe/main.c @@ -29,7 +29,6 @@ #include #include "thread.h" -#include "kernel.h" #include "pipe.h" #include "pipe.h" diff --git a/tests/unittests/tests-checksum/tests-checksum.h b/tests/unittests/tests-checksum/tests-checksum.h index 10c90e13669e..98e0a611b4a1 100644 --- a/tests/unittests/tests-checksum/tests-checksum.h +++ b/tests/unittests/tests-checksum/tests-checksum.h @@ -19,7 +19,6 @@ #define TESTS_CHECKSUM_H #include "embUnit.h" -#include "kernel.h" #ifdef __cplusplus extern "C" { diff --git a/tests/unittests/tests-core/tests-core-ringbuffer.c b/tests/unittests/tests-core/tests-core-ringbuffer.c index f4b3525bed62..e447469e7fbd 100644 --- a/tests/unittests/tests-core/tests-core-ringbuffer.c +++ b/tests/unittests/tests-core/tests-core-ringbuffer.c @@ -17,7 +17,6 @@ */ #include "thread.h" -#include "kernel.h" #include "ringbuffer.h" #include "mutex.h" diff --git a/tests/unittests/tests-crypto/tests-crypto.h b/tests/unittests/tests-crypto/tests-crypto.h index e03a18bca09e..9c6524d02170 100644 --- a/tests/unittests/tests-crypto/tests-crypto.h +++ b/tests/unittests/tests-crypto/tests-crypto.h @@ -19,8 +19,10 @@ #ifndef TESTS_CRYPTO_H_ #define TESTS_CRYPTO_H_ +#include +#include + #include "embUnit.h" -#include "kernel.h" #ifdef __cplusplus extern "C" { diff --git a/tests/unittests/tests-ubjson/test-ubjson-empty-array.c b/tests/unittests/tests-ubjson/test-ubjson-empty-array.c index 56aba63fc065..585a9da63f90 100644 --- a/tests/unittests/tests-ubjson/test-ubjson-empty-array.c +++ b/tests/unittests/tests-ubjson/test-ubjson-empty-array.c @@ -17,7 +17,6 @@ */ #include "tests-ubjson.h" -#include "kernel.h" typedef enum { BEFORE_ARRAY_1 = __LINE__, diff --git a/tests/unittests/tests-ubjson/test-ubjson-empty-object.c b/tests/unittests/tests-ubjson/test-ubjson-empty-object.c index 5e8f46a4930c..359c61a74e03 100644 --- a/tests/unittests/tests-ubjson/test-ubjson-empty-object.c +++ b/tests/unittests/tests-ubjson/test-ubjson-empty-object.c @@ -17,7 +17,6 @@ */ #include "tests-ubjson.h" -#include "kernel.h" typedef enum { BEFORE_ARRAY_1 = __LINE__, diff --git a/tests/unittests/tests-ubjson/tests-ubjson.h b/tests/unittests/tests-ubjson/tests-ubjson.h index 69d6e2b505fd..4aca04eddd97 100644 --- a/tests/unittests/tests-ubjson/tests-ubjson.h +++ b/tests/unittests/tests-ubjson/tests-ubjson.h @@ -30,6 +30,7 @@ #define TESTS_UBJSON_H_ #include "embUnit.h" +#include "kernel_macros.h" #include "ubjson.h" From 2567feebf27ba6eafad0960e099c071ca48ff3ad Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Sun, 28 Feb 2016 22:22:03 +0100 Subject: [PATCH 2/3] sys: fmt: fix includes --- sys/fmt/fmt.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/fmt/fmt.c b/sys/fmt/fmt.c index 9f7903617858..346ba8f3f0fd 100644 --- a/sys/fmt/fmt.c +++ b/sys/fmt/fmt.c @@ -18,8 +18,12 @@ #include #include +#ifdef __WITH_AVRLIBC__ +#include /* for fwrite() */ +#else /* work around broken sys/posix/unistd.h */ ssize_t write(int fildes, const void *buf, size_t nbyte); +#endif #include "fmt.h" From 9b7ebb9f30e0741595a2f15e850b6afffd3eb139 Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Sun, 28 Feb 2016 22:41:48 +0100 Subject: [PATCH 3/3] cpu: msp430-common: fix unistd.h --- cpu/msp430-common/include/unistd.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cpu/msp430-common/include/unistd.h b/cpu/msp430-common/include/unistd.h index a207def04b38..d7f05053f9c0 100644 --- a/cpu/msp430-common/include/unistd.h +++ b/cpu/msp430-common/include/unistd.h @@ -15,6 +15,8 @@ extern "C" { #endif +#include "msp430_types.h" + #define STDIN_FILENO 0 ///< stdin file descriptor #define STDOUT_FILENO 1 ///< stdout file descriptor #define STDERR_FILENO 2 ///< stderr file descriptor