2010-09-22 15:10:42 +02:00
|
|
|
/**
|
|
|
|
* @ingroup kernel
|
|
|
|
* @{
|
2013-07-16 16:36:37 +02:00
|
|
|
* @file kernel_internal.h
|
|
|
|
* @brief prototypes for kernel internal functions
|
2013-03-27 16:58:07 +01:00
|
|
|
* @author INRIA
|
|
|
|
* @author Oliver Hahm <oliver.hahm@inria.fr>
|
2010-09-22 15:10:42 +02:00
|
|
|
*/
|
|
|
|
|
2013-07-16 16:36:37 +02:00
|
|
|
#ifndef KERNEL_INTERNAL_H_
|
|
|
|
#define KERNEL_INTERNAL_H_
|
2010-09-22 15:10:42 +02:00
|
|
|
|
2013-03-27 16:58:07 +01:00
|
|
|
/**
|
|
|
|
* @brief Initializes scheduler and creates main and idle task
|
|
|
|
*/
|
2010-09-22 15:10:42 +02:00
|
|
|
void kernel_init(void);
|
2013-03-27 16:58:07 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Optionally: initializes platform specifics (devices, pin configuration etc.)
|
|
|
|
*/
|
|
|
|
void board_init(void);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Gets called upon thread creation to set CPU registers
|
|
|
|
*
|
|
|
|
* @param[in] task_func First function to call within the thread
|
|
|
|
* @param[in] stack_start Start address of the stack
|
|
|
|
* @param[in] stack_size Stack size
|
|
|
|
*
|
2013-06-20 18:18:29 +02:00
|
|
|
* @return stack pointer
|
2013-03-27 16:58:07 +01:00
|
|
|
*/
|
2013-03-06 01:08:15 +01:00
|
|
|
char *thread_stack_init(void *task_func, void *stack_start, int stack_size);
|
2013-03-27 16:58:07 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Removes thread from scheduler and set status to STATUS_STOPPED
|
|
|
|
*/
|
2010-10-28 11:22:57 +02:00
|
|
|
void sched_task_exit(void);
|
2013-03-27 16:58:07 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Prints human readable, ps-like thread information for debugging purposes
|
|
|
|
*/
|
2013-06-20 18:18:29 +02:00
|
|
|
void thread_print_stack(void);
|
2013-03-27 16:58:07 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Calculates stack usage if thread was created using CREATE_STACKTEST
|
|
|
|
*
|
|
|
|
* @param[in] stack The thread's stack
|
|
|
|
*
|
|
|
|
* @return The current usage (overwritten addresses) of the thread's stack
|
|
|
|
*/
|
2013-06-20 18:18:29 +02:00
|
|
|
int thread_measure_stack_usage(char *stack);
|
2010-09-22 15:10:42 +02:00
|
|
|
|
|
|
|
/** @} */
|
2013-07-16 16:36:37 +02:00
|
|
|
#endif /* KERNEL_INTERNAL_H_ */
|