2013-11-27 16:28:31 +01:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2013 Freie Universität Berlin
|
|
|
|
*
|
|
|
|
* This file subject to the terms and conditions of the GNU Lesser General
|
|
|
|
* Public License. See the file LICENSE in the top level directory for more
|
|
|
|
* details.
|
|
|
|
*/
|
|
|
|
|
2010-09-22 15:10:42 +02:00
|
|
|
/**
|
2013-11-27 16:28:31 +01:00
|
|
|
* @addtogroup core_internal
|
2010-09-22 15:10:42 +02:00
|
|
|
* @{
|
2013-11-27 16:28:31 +01:00
|
|
|
*
|
2013-07-16 16:36:37 +02:00
|
|
|
* @file kernel_internal.h
|
|
|
|
* @brief prototypes for kernel internal functions
|
2013-11-27 16:28:31 +01:00
|
|
|
*
|
|
|
|
* @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
|
|
|
|
2014-04-30 09:41:37 +02:00
|
|
|
#include "attributes.h"
|
|
|
|
|
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);
|
|
|
|
|
2014-03-04 20:20:01 +01:00
|
|
|
typedef void *(*thread_task_func_t)(void *arg);
|
|
|
|
|
2013-03-27 16:58:07 +01:00
|
|
|
/**
|
|
|
|
* @brief Gets called upon thread creation to set CPU registers
|
|
|
|
*
|
|
|
|
* @param[in] task_func First function to call within the thread
|
2014-03-04 20:20:01 +01:00
|
|
|
* @param[in] arg Argument to supply to task_func
|
2013-03-27 16:58:07 +01:00
|
|
|
* @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
|
|
|
*/
|
2014-03-04 20:20:01 +01:00
|
|
|
char *thread_stack_init(thread_task_func_t task_func, void *arg, void *stack_start, int stack_size);
|
2013-03-27 16:58:07 +01:00
|
|
|
|
|
|
|
/**
|
2014-01-22 18:31:33 +01:00
|
|
|
* @brief Removes thread from scheduler and set status to #STATUS_STOPPED
|
2013-03-27 16:58:07 +01:00
|
|
|
*/
|
2014-04-30 09:41:37 +02:00
|
|
|
NORETURN 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
|
|
|
|
2013-07-16 16:36:37 +02:00
|
|
|
#endif /* KERNEL_INTERNAL_H_ */
|
2014-04-06 17:26:51 +02:00
|
|
|
/** @} */
|