2013-11-27 16:28:31 +01:00
|
|
|
/*
|
2013-06-18 17:21:38 +02:00
|
|
|
* Copyright (C) 2013 Freie Universität Berlin
|
2010-09-22 15:10:42 +02:00
|
|
|
*
|
2013-11-22 20:47:05 +01:00
|
|
|
* This file is subject to the terms and conditions of the GNU Lesser General
|
2013-06-18 17:21:38 +02:00
|
|
|
* 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
|
|
|
*
|
|
|
|
* @file kernel.h
|
|
|
|
* @brief Kernel compile time configuration
|
|
|
|
*
|
2014-03-01 09:36:17 +01:00
|
|
|
* A int reboot(int mode) function is also provided (and used by core_panic() when needed).
|
2014-02-12 12:42:12 +01:00
|
|
|
*
|
2013-11-27 16:28:31 +01:00
|
|
|
* @author Freie Universität Berlin, Computer Systems & Telematics
|
2014-01-28 11:50:12 +01:00
|
|
|
* @author Kaspar Schleiser <kaspar@schleiser.de>
|
2010-09-22 15:10:42 +02:00
|
|
|
*/
|
|
|
|
|
2013-11-27 16:28:31 +01:00
|
|
|
#ifndef KERNEL_H_
|
|
|
|
#define KERNEL_H_
|
|
|
|
|
2010-09-22 15:10:42 +02:00
|
|
|
#include <stdbool.h>
|
2014-02-12 15:02:50 +01:00
|
|
|
|
|
|
|
#include "attributes.h"
|
2011-06-27 11:34:21 +02:00
|
|
|
#include "config.h"
|
2010-09-22 15:10:42 +02:00
|
|
|
#include "tcb.h"
|
|
|
|
#include "cpu.h"
|
|
|
|
#include "flags.h"
|
2010-10-28 11:22:57 +02:00
|
|
|
#include "sched.h"
|
2010-09-22 15:10:42 +02:00
|
|
|
#include "cpu-conf.h"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @def KERNEL_CONF_STACKSIZE_DEFAULT
|
|
|
|
* @brief A reasonable default stack size that will suffice most smaller tasks
|
|
|
|
*/
|
|
|
|
#ifndef KERNEL_CONF_STACKSIZE_DEFAULT
|
|
|
|
#error KERNEL_CONF_STACKSIZE_DEFAULT must be defined per CPU
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @def KERNEL_CONF_STACKSIZE_IDLE
|
|
|
|
* @brief Size of the idle task's stack in bytes
|
|
|
|
*/
|
|
|
|
#ifndef KERNEL_CONF_STACKSIZE_IDLE
|
|
|
|
#error KERNEL_CONF_STACKSIZE_IDLE must be defined per CPU
|
|
|
|
#endif
|
|
|
|
|
2013-12-03 13:09:38 +01:00
|
|
|
/**
|
|
|
|
* @def KERNEL_CONF_STACKSIZE_PRINTF
|
|
|
|
* @ingroup conf
|
|
|
|
* @brief Size of the task's printf stack in bytes
|
|
|
|
*/
|
|
|
|
#ifndef KERNEL_CONF_STACKSIZE_PRINTF
|
|
|
|
#error KERNEL_CONF_STACKSIZE_PRINTF must be defined per CPU
|
|
|
|
#endif
|
|
|
|
|
2010-09-22 15:10:42 +02:00
|
|
|
/**
|
|
|
|
* @def KERNEL_CONF_STACKSIZE_MAIN
|
|
|
|
* @brief Size of the main task's stack in bytes
|
|
|
|
*/
|
|
|
|
#ifndef KERNEL_CONF_STACKSIZE_MAIN
|
2013-08-14 18:04:25 +02:00
|
|
|
#define KERNEL_CONF_STACKSIZE_MAIN (KERNEL_CONF_STACKSIZE_DEFAULT + KERNEL_CONF_STACKSIZE_PRINTF)
|
2010-09-22 15:10:42 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/* ------------------------------------------------------------------------- */
|
|
|
|
|
|
|
|
|
|
|
|
#define PID_NULL -1
|
|
|
|
|
|
|
|
#define PRIORITY_MIN SCHED_PRIO_LEVELS-1
|
|
|
|
|
|
|
|
#define PRIORITY_IDLE PRIORITY_MIN
|
2010-11-05 19:33:45 +01:00
|
|
|
#define PRIORITY_MAIN (PRIORITY_MIN - (SCHED_PRIO_LEVELS/2))
|
2010-09-22 15:10:42 +02:00
|
|
|
|
2010-11-08 21:39:30 +01:00
|
|
|
#define LPM_PREVENT_SLEEP_UART BIT2
|
2010-09-22 15:10:42 +02:00
|
|
|
#define LPM_PREVENT_SLEEP_HWTIMER BIT1
|
|
|
|
|
|
|
|
extern volatile int lpm_prevent_sleep;
|
|
|
|
|
2010-12-03 18:42:03 +01:00
|
|
|
extern config_t sysconfig;
|
|
|
|
|
2014-02-12 12:42:12 +01:00
|
|
|
/* ------------------------------------------------------------------------- */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Immediately reboots the system.
|
|
|
|
*
|
2014-02-26 16:48:44 +01:00
|
|
|
* This function is used by core_panic() when the DEVELHELP macro is not defined.
|
2014-02-12 12:42:12 +01:00
|
|
|
*
|
2014-03-01 09:36:17 +01:00
|
|
|
* @param mode The reboot mode (unused for now)
|
|
|
|
*
|
|
|
|
* @return This call never returns when successful. -1 is returned otherwise.
|
2014-02-12 12:42:12 +01:00
|
|
|
*/
|
2014-03-01 09:36:17 +01:00
|
|
|
int reboot(int mode);
|
|
|
|
|
|
|
|
#define RB_AUTOBOOT 0 /* << Reboot the system in the usual fashion */
|
2014-02-12 12:42:12 +01:00
|
|
|
|
2010-09-22 15:10:42 +02:00
|
|
|
/** @} */
|
|
|
|
#endif /* KERNEL_H_ */
|