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
|
|
|
*
|
2014-08-23 15:43:13 +02:00
|
|
|
* 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.
|
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
|
|
|
*
|
2015-05-22 07:34:41 +02:00
|
|
|
* @file
|
2013-11-27 16:28:31 +01:00
|
|
|
* @brief Kernel compile time configuration
|
|
|
|
*
|
2014-04-06 17:26:51 +02:00
|
|
|
* A reboot() function is also provided
|
|
|
|
* (and used by core_panic() when needed).
|
2014-02-12 12:42:12 +01:00
|
|
|
*
|
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-07-06 22:57:56 +02:00
|
|
|
#include <stdint.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"
|
2015-05-22 14:31:23 +02:00
|
|
|
#include "cpu_conf.h"
|
2010-09-22 15:10:42 +02:00
|
|
|
|
2014-10-13 14:44:28 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2010-09-22 15:10:42 +02:00
|
|
|
/* ------------------------------------------------------------------------- */
|
|
|
|
|
2014-04-06 17:26:51 +02:00
|
|
|
/**
|
|
|
|
* @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.
|
|
|
|
*/
|
2010-11-08 21:39:30 +01:00
|
|
|
#define LPM_PREVENT_SLEEP_UART BIT2
|
2014-04-06 17:26:51 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @def LPM_PREVENT_SLEEP_HWTIMER
|
|
|
|
* @brief This flag tells the kernel that the deepest power saving
|
|
|
|
* mode that currently can be used must still allow the hwtimer
|
|
|
|
* to run. Bitmask to use with `lpm_prevent_sleep` in power management.
|
|
|
|
*/
|
2010-09-22 15:10:42 +02:00
|
|
|
#define LPM_PREVENT_SLEEP_HWTIMER BIT1
|
|
|
|
|
2014-04-06 17:26:51 +02:00
|
|
|
/**
|
|
|
|
* @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`.
|
|
|
|
*/
|
2010-09-22 15:10:42 +02:00
|
|
|
extern volatile int lpm_prevent_sleep;
|
|
|
|
|
2014-04-06 17:26:51 +02:00
|
|
|
/**
|
2014-08-05 17:08:53 +02:00
|
|
|
* @brief Variable used to store system configuration
|
2014-04-06 17:26:51 +02:00
|
|
|
*
|
2014-10-19 23:05:36 +02:00
|
|
|
* @details This contains e.g. the node ID, name, default channel and so on
|
2014-04-06 17:26:51 +02:00
|
|
|
*/
|
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);
|
|
|
|
|
2014-04-06 17:26:51 +02:00
|
|
|
/**
|
|
|
|
* @def RB_AUTOBOOT
|
|
|
|
* @brief Reboot the system in the usual fashion
|
|
|
|
*/
|
|
|
|
#define RB_AUTOBOOT 0
|
2014-02-12 12:42:12 +01:00
|
|
|
|
2014-10-09 01:18:16 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2010-09-22 15:10:42 +02:00
|
|
|
#endif /* KERNEL_H_ */
|
2014-04-06 17:26:51 +02:00
|
|
|
/** @} */
|