
72 changed files with 100 additions and 222 deletions
@ -1,72 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 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 Kernel compile time configuration |
||||
* |
||||
* A reboot() function is also provided |
||||
* (and used by core_panic() when needed). |
||||
* |
||||
* @author Kaspar Schleiser <kaspar@schleiser.de> |
||||
*/ |
||||
|
||||
#ifndef KERNEL_H_ |
||||
#define KERNEL_H_ |
||||
|
||||
#include <stdbool.h> |
||||
#include <stdint.h> |
||||
|
||||
#include "attributes.h" |
||||
#include "config.h" |
||||
#include "tcb.h" |
||||
#include "cpu.h" |
||||
#include "sched.h" |
||||
#include "cpu_conf.h" |
||||
|
||||
#ifdef __cplusplus |
||||
extern "C" { |
||||
#endif |
||||
|
||||
/* ------------------------------------------------------------------------- */ |
||||
|
||||
/**
|
||||
* @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. |
||||
*/ |
||||
#define LPM_PREVENT_SLEEP_UART BIT2 |
||||
|
||||
/**
|
||||
* @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`. |
||||
*/ |
||||
extern volatile int lpm_prevent_sleep; |
||||
|
||||
/**
|
||||
* @brief Variable used to store system configuration |
||||
* |
||||
* @details This contains e.g. the node ID, name, default channel and so on |
||||
*/ |
||||
extern config_t sysconfig; |
||||
|
||||
/* ------------------------------------------------------------------------- */ |
||||
|
||||
#ifdef __cplusplus |
||||
} |
||||
#endif |
||||
|
||||
#endif /* KERNEL_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 */ |
||||
/** @} */ |
@ -1,70 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 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 internal functions |
||||
* |
||||
* @author Oliver Hahm <oliver.hahm@inria.fr> |
||||
*/ |
||||
|
||||
#ifndef KERNEL_INTERNAL_H_ |
||||
#define KERNEL_INTERNAL_H_ |
||||
|
||||
#include "attributes.h" |
||||
|
||||
#ifdef __cplusplus |
||||
extern "C" { |
||||
#endif |
||||
|
||||
/**
|
||||
* @brief Initializes scheduler and creates main and idle task |
||||
*/ |
||||
void kernel_init(void); |
||||
|
||||
/**
|
||||
* @brief Optionally: initializes platform specifics (devices, pin configuration etc.) |
||||
*/ |
||||
void board_init(void); |
||||
|
||||
/**
|
||||
* @brief Prototype for a thread entry function |
||||
*/ |
||||
typedef void *(*thread_task_func_t)(void *arg); |
||||
|
||||
/**
|
||||
* @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 Removes thread from scheduler and set status to #STATUS_STOPPED |
||||
*/ |
||||
NORETURN void sched_task_exit(void); |
||||
|
||||
/**
|
||||
* @brief Prints human readable, ps-like thread information for debugging purposes |
||||
*/ |
||||
void thread_print_stack(void); |
||||
|
||||
#ifdef __cplusplus |
||||
} |
||||
#endif |
||||
|
||||
#endif /* KERNEL_INTERNAL_H_ */ |
||||
/** @} */ |
Loading…
Reference in new issue