Skip to content

Commit

Permalink
Merge pull request #4910 from kaspar030/core_header_cleanup
Browse files Browse the repository at this point in the history
core: header cleanup
  • Loading branch information
Joakim Nohlgård committed Feb 29, 2016
2 parents 1e14d6d + 9b7ebb9 commit 3af809b
Show file tree
Hide file tree
Showing 74 changed files with 106 additions and 222 deletions.
1 change: 0 additions & 1 deletion boards/avsextrem/drivers/avsextrem-smb380.c
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion boards/msb-430-common/board_init.c
Expand Up @@ -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"

Expand Down
1 change: 0 additions & 1 deletion boards/wsn430-common/board_init.c
Expand Up @@ -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"
Expand Down
5 changes: 4 additions & 1 deletion core/include/arch/thread_arch.h
Expand Up @@ -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
Expand All @@ -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
Expand Down
72 changes: 0 additions & 72 deletions core/include/kernel.h

This file was deleted.

38 changes: 38 additions & 0 deletions core/include/kernel_init.h
@@ -0,0 +1,38 @@
/*
* Copyright (C) 2016 Kaspar Schleiser <kaspar@schleiser.de>
* 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 <oliver.hahm@inria.fr>
* @author Kaspar Schleiser <kaspar@schleiser.de>
*/

#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 */
/** @} */
70 changes: 0 additions & 70 deletions core/include/kernel_internal.h

This file was deleted.

5 changes: 5 additions & 0 deletions core/include/lpm.h
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion core/include/panic.h
Expand Up @@ -22,7 +22,7 @@
#ifndef PANIC_H
#define PANIC_H

#include "kernel.h"
#include "attributes.h"

#ifdef __cplusplus
extern "C" {
Expand Down
9 changes: 7 additions & 2 deletions core/include/sched.h
Expand Up @@ -81,6 +81,7 @@
#define SCHEDULER_H

#include <stddef.h>
#include "attributes.h"
#include "bitarithm.h"
#include "tcb.h"
#include "attributes.h"
Expand Down Expand Up @@ -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
Expand All @@ -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
}
Expand Down
23 changes: 21 additions & 2 deletions core/include/thread.h
Expand Up @@ -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" {
Expand Down Expand Up @@ -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.
*/
Expand All @@ -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
}
Expand Down
7 changes: 2 additions & 5 deletions core/kernel_init.c
Expand Up @@ -21,13 +21,10 @@
#include <stdint.h>
#include <stdbool.h>
#include <errno.h>
#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"

Expand Down
1 change: 0 additions & 1 deletion core/msg.c
Expand Up @@ -23,7 +23,6 @@
#include <stddef.h>
#include <inttypes.h>
#include <assert.h>
#include "kernel.h"
#include "sched.h"
#include "msg.h"
#include "priority_queue.h"
Expand Down
1 change: 0 additions & 1 deletion core/mutex.c
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions core/panic.c
Expand Up @@ -25,6 +25,7 @@
#include <stdio.h>

#include "assert.h"
#include "attributes.h"
#include "cpu.h"
#include "irq.h"
#include "lpm.h"
Expand Down
2 changes: 0 additions & 2 deletions core/sched.c
Expand Up @@ -22,8 +22,6 @@
#include <stdint.h>

#include "sched.h"
#include "kernel.h"
#include "kernel_internal.h"
#include "clist.h"
#include "bitarithm.h"
#include "irq.h"
Expand Down
2 changes: 0 additions & 2 deletions core/thread.c
Expand Up @@ -22,12 +22,10 @@
#include <stdio.h>

#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"

Expand Down
4 changes: 1 addition & 3 deletions cpu/arm7_common/arm_cpu.c
Expand Up @@ -18,9 +18,7 @@

#include <stdio.h>
#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)
Expand Down

0 comments on commit 3af809b

Please sign in to comment.