1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Improve naming of thread stacksize/priority constants

As discussed in #2725, this commit renames a number of stacksize constants to
better convey their intended usage. In addition, constants for thread priority
are given a `THREAD_` prefix. Changes are:

* KERNEL_CONF_STACKSIZE_PRINTF renamed to THREAD_EXTRA_STACKSIZE_PRINTF
* KERNEL_CONF_STACKSIZE_DEFAULT renamed to THREAD_STACKSIZE_DEFAULT
* KERNEL_CONF_STACKSIZE_IDLE renamed to THREAD_STACKSIZE_IDLE
* KERNEL_CONF_STACKSIZE_MAIN renamed to THREAD_STACKSIZE_MAIN
* Move thread stacksizes from kernel.h to thread.h, since the prefix changed
* PRIORITY_MIN renamed to THREAD_PRIORITY_MIN
* PRIORITY_IDLE renamed to THREAD_PRIORITY_IDLE
* PRIORITY_MAIN renamed to THREAD_PRIORITY_MAIN
* Move thread priorities from kernel.h to thread.h since the prefix has changed
* MINIMUM_STACK_SIZE renamed to THREAD_STACKSIZE_MINIMUM for consistency
This commit is contained in:
Lucas Jenss 2015-04-28 20:02:05 +02:00
parent b0e73b9a8c
commit 426170b064
95 changed files with 630 additions and 312 deletions

View File

@ -0,0 +1,63 @@
/*
* Copyright (C) 2015 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.
*/
/**
* @ingroup boards_iot-lab_M3
* @{
*
* @file
* @brief Network device initialization code
*
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
*
* @}
*/
#include <stdio.h>
#include "board.h"
#include "auto_init.h"
#include "ng_at86rf2xx.h"
#include "net/ng_nomac.h"
#include "net/ng_netbase.h"
#define ENABLE_DEBUG (0)
#include "debug.h"
/**
* @brief Define stack parameters for the MAC layer thread
* @{
*/
#define MAC_STACKSIZE (THREAD_STACKSIZE_DEFAULT)
#define MAC_PRIO (THREAD_PRIORITY_MAIN - 3)
/** @} */
/**
* @brief Device descriptor for the Atmel radio
*/
static ng_at86rf2xx_t radio;
/**
* @brief Stack for the MAC layer thread
*/
static char nomac_stack[MAC_STACKSIZE];
void auto_init_ng_netif(void)
{
/* initialize the radio */
DEBUG("Initializing AT86RF231 radio\n");
ng_at86rf2xx_init(&radio, AT86RF231_SPI, AT86RF231_SPI_CLK,
AT86RF231_CS, AT86RF231_INT,
AT86RF231_SLEEP, AT86RF231_RESET);
/* starting NOMAC */
DEBUG("Starting the MAC layer\n");
ng_nomac_init(nomac_stack, sizeof(nomac_stack), MAC_PRIO, "at86rf233",
(ng_netdev_t *)(&radio));
DEBUG("Auto init of on-board radio complete\n");
}

View File

@ -25,12 +25,11 @@ extern "C" {
/* FIXME: This file is just a filler. The numbers are entirely random ... */
#define KERNEL_CONF_STACKSIZE_DEFAULT (8192)
#define KERNEL_CONF_STACKSIZE_IDLE (8192)
#define KERNEL_CONF_STACKSIZE_PRINTF (8192)
#define KERNEL_CONF_STACKSIZE_PRINTF_FLOAT (8192)
#define MINIMUM_STACK_SIZE (8192)
#define THREAD_STACKSIZE_DEFAULT (8192)
#define THREAD_STACKSIZE_IDLE (8192)
#define THREAD_EXTRA_STACKSIZE_PRINTF (8192)
#define THREAD_EXTRA_STACKSIZE_PRINTF_FLOAT (8192)
#define THREAD_STACKSIZE_MINIMUM (8192)
#define UART0_BUFSIZE (16)

View File

@ -33,8 +33,8 @@
* @brief Define stack parameters for the MAC layer thread
* @{
*/
#define MAC_STACKSIZE (KERNEL_CONF_STACKSIZE_DEFAULT)
#define MAC_PRIO (PRIORITY_MAIN - 3)
#define MAC_STACKSIZE (THREAD_STACKSIZE_DEFAULT)
#define MAC_PRIO (THREAD_PRIORITY_MAIN - 3)
/** @} */
/**

View File

@ -57,7 +57,7 @@ extern "C" {
#include "cpu-conf.h"
#define DEBUG_PRINT(...) \
do { \
if ((sched_active_thread == NULL) || (sched_active_thread->stack_size > KERNEL_CONF_STACKSIZE_PRINTF)) { \
if ((sched_active_thread == NULL) || (sched_active_thread->stack_size > THREAD_EXTRA_STACKSIZE_PRINTF)) { \
printf(__VA_ARGS__); \
} \
else { \

View File

@ -37,57 +37,7 @@
extern "C" {
#endif
/**
* @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
/**
* @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
/**
* @def KERNEL_CONF_STACKSIZE_MAIN
* @brief Size of the main task's stack in bytes
*/
#ifndef KERNEL_CONF_STACKSIZE_MAIN
#define KERNEL_CONF_STACKSIZE_MAIN (KERNEL_CONF_STACKSIZE_DEFAULT + KERNEL_CONF_STACKSIZE_PRINTF)
#endif
/* ------------------------------------------------------------------------- */
/**
* @def PRIORITY_MIN
* @brief Least priority a thread can have
*/
#define PRIORITY_MIN (SCHED_PRIO_LEVELS-1)
/**
* @def PRIORITY_IDLE
* @brief Priority of the idle thread
*/
#define PRIORITY_IDLE PRIORITY_MIN
/**
* @def PRIORITY_MAIN
* @brief Priority of the main thread
*/
#define PRIORITY_MAIN (PRIORITY_MIN - (SCHED_PRIO_LEVELS/2))
/**
* @def LPM_PREVENT_SLEEP_UART

View File

@ -35,13 +35,64 @@
*/
#define STATUS_NOT_FOUND (-1)
/**
* @def THREAD_STACKSIZE_DEFAULT
* @brief A reasonable default stack size that will suffice most smaller tasks
*/
#ifndef THREAD_STACKSIZE_DEFAULT
#error THREAD_STACKSIZE_DEFAULT must be defined per CPU
#endif
/**
* @def THREAD_STACKSIZE_IDLE
* @brief Size of the idle task's stack in bytes
*/
#ifndef THREAD_STACKSIZE_IDLE
#error THREAD_STACKSIZE_IDLE must be defined per CPU
#endif
/**
* @def THREAD_EXTRA_STACKSIZE_PRINTF
* @ingroup conf
* @brief Size of the task's printf stack in bytes
*/
#ifndef THREAD_EXTRA_STACKSIZE_PRINTF
#error THREAD_EXTRA_STACKSIZE_PRINTF must be defined per CPU
#endif
/**
* @def THREAD_STACKSIZE_MAIN
* @brief Size of the main task's stack in bytes
*/
#ifndef THREAD_STACKSIZE_MAIN
#define THREAD_STACKSIZE_MAIN (THREAD_STACKSIZE_DEFAULT + THREAD_EXTRA_STACKSIZE_PRINTF)
#endif
/**
* @brief Minimum stack size
*/
#ifndef MINIMUM_STACK_SIZE
#define MINIMUM_STACK_SIZE (sizeof(tcb_t))
#ifndef THREAD_STACKSIZE_MINIMUM
#define THREAD_STACKSIZE_MINIMUM (sizeof(tcb_t))
#endif
/**
* @def THREAD_PRIORITY_MIN
* @brief Least priority a thread can have
*/
#define THREAD_PRIORITY_MIN (SCHED_PRIO_LEVELS-1)
/**
* @def THREAD_PRIORITY_IDLE
* @brief Priority of the idle thread
*/
#define THREAD_PRIORITY_IDLE (THREAD_PRIORITY_MIN)
/**
* @def THREAD_PRIORITY_MAIN
* @brief Priority of the main thread
*/
#define THREAD_PRIORITY_MAIN (THREAD_PRIORITY_MIN - (SCHED_PRIO_LEVELS/2))
/**
* @brief Creates a new thread
*
@ -56,7 +107,7 @@
* A low value for *priority* number means the thread having a high priority
* with 0 being the highest possible priority.
*
* The lowest possible priority is *PRIORITY_IDLE - 1*. The value is depending
* The lowest possible priority is *THREAD_PRIORITY_IDLE - 1*. The value is depending
* on the platforms architecture, e.g. 30 in 32-bit systems, 14 in 16-bit systems.
*
*

View File

@ -76,8 +76,8 @@ static void *idle_thread(void *arg)
const char *main_name = "main";
const char *idle_name = "idle";
static char main_stack[KERNEL_CONF_STACKSIZE_MAIN];
static char idle_stack[KERNEL_CONF_STACKSIZE_IDLE];
static char main_stack[THREAD_STACKSIZE_MAIN];
static char idle_stack[THREAD_STACKSIZE_IDLE];
void kernel_init(void)
{
@ -86,12 +86,12 @@ void kernel_init(void)
hwtimer_init();
if (thread_create(idle_stack, sizeof(idle_stack), PRIORITY_IDLE, CREATE_WOUT_YIELD | CREATE_STACKTEST, idle_thread, NULL, idle_name) < 0) {
LOG_ERROR("kernel_init(): error creating idle task.\n");
if (thread_create(idle_stack, sizeof(idle_stack), THREAD_PRIORITY_IDLE, CREATE_WOUT_YIELD | CREATE_STACKTEST, idle_thread, NULL, idle_name) < 0) {
printf("kernel_init(): error creating idle task.\n");
}
if (thread_create(main_stack, sizeof(main_stack), PRIORITY_MAIN, CREATE_WOUT_YIELD | CREATE_STACKTEST, main_trampoline, NULL, main_name) < 0) {
LOG_ERROR("kernel_init(): error creating main task.\n");
if (thread_create(main_stack, sizeof(main_stack), THREAD_PRIORITY_MAIN, CREATE_WOUT_YIELD | CREATE_STACKTEST, main_trampoline, NULL, main_name) < 0) {
printf("kernel_init(): error creating main task.\n");
}
LOG_INFO("kernel_init(): jumping into first task...\n");

View File

@ -351,7 +351,7 @@ static int _msg_receive(msg_t *m, int block)
*m = *sender_msg;
/* remove sender from queue */
uint16_t sender_prio = PRIORITY_IDLE;
uint16_t sender_prio = THREAD_PRIORITY_IDLE;
if (sender->status != STATUS_REPLY_BLOCKED) {
sender->wait_data = NULL;
sched_set_status(sender, STATUS_PENDING);
@ -359,7 +359,7 @@ static int _msg_receive(msg_t *m, int block)
}
restoreIRQ(state);
if (sender_prio < PRIORITY_IDLE) {
if (sender_prio < THREAD_PRIORITY_IDLE) {
sched_switch(sender_prio);
}
return 1;

View File

@ -31,13 +31,13 @@ extern "C" {
* size tested sucessfully even with pretty small stacks.k
* @{
*/
#define KERNEL_CONF_STACKSIZE_PRINTF (128)
#define THREAD_EXTRA_STACKSIZE_PRINTF (128)
#ifndef KERNEL_CONF_STACKSIZE_DEFAULT
#define KERNEL_CONF_STACKSIZE_DEFAULT (256)
#ifndef THREAD_STACKSIZE_DEFAULT
#define THREAD_STACKSIZE_DEFAULT (256)
#endif
#define KERNEL_CONF_STACKSIZE_IDLE (128)
#define THREAD_STACKSIZE_IDLE (128)
/** @} */
/**

View File

@ -36,13 +36,13 @@ extern "C" {
* @name Kernel configuration
* @{
*/
#define KERNEL_CONF_STACKSIZE_PRINTF 1024
#define THREAD_EXTRA_STACKSIZE_PRINTF 1024
#ifndef KERNEL_CONF_STACKSIZE_DEFAULT
#define KERNEL_CONF_STACKSIZE_DEFAULT 1024
#ifndef THREAD_STACKSIZE_DEFAULT
#define THREAD_STACKSIZE_DEFAULT 1024
#endif
#define KERNEL_CONF_STACKSIZE_IDLE 512
#define THREAD_STACKSIZE_IDLE 512
/** @} */
/**

View File

@ -82,13 +82,13 @@ extern "C"
* TODO: Tune this
* @{
*/
#define KERNEL_CONF_STACKSIZE_PRINTF (1024)
#define THREAD_EXTRA_STACKSIZE_PRINTF (1024)
#ifndef KERNEL_CONF_STACKSIZE_DEFAULT
#define KERNEL_CONF_STACKSIZE_DEFAULT (1024)
#ifndef THREAD_STACKSIZE_DEFAULT
#define THREAD_STACKSIZE_DEFAULT (1024)
#endif
#define KERNEL_CONF_STACKSIZE_IDLE (256)
#define THREAD_STACKSIZE_IDLE (256)
/** @} */
/**

View File

@ -47,13 +47,13 @@ extern "C"
*
* @{
*/
#define KERNEL_CONF_STACKSIZE_PRINTF (1024)
#define THREAD_EXTRA_STACKSIZE_PRINTF (1024)
#ifndef KERNEL_CONF_STACKSIZE_DEFAULT
#define KERNEL_CONF_STACKSIZE_DEFAULT (1024)
#ifndef THREAD_STACKSIZE_DEFAULT
#define THREAD_STACKSIZE_DEFAULT (1024)
#endif
#define KERNEL_CONF_STACKSIZE_IDLE (256)
#define THREAD_STACKSIZE_IDLE (256)
/** @} */
/**

View File

@ -36,13 +36,13 @@ extern "C" {
* TODO: measure and adjust for the Cortex-M3
* @{
*/
#define KERNEL_CONF_STACKSIZE_PRINTF (1024)
#define THREAD_EXTRA_STACKSIZE_PRINTF (1024)
#ifndef KERNEL_CONF_STACKSIZE_DEFAULT
#define KERNEL_CONF_STACKSIZE_DEFAULT (1024)
#ifndef THREAD_STACKSIZE_DEFAULT
#define THREAD_STACKSIZE_DEFAULT (1024)
#endif
#define KERNEL_CONF_STACKSIZE_IDLE (256)
#define THREAD_STACKSIZE_IDLE (256)
/** @} */
/**

View File

@ -43,14 +43,14 @@ extern "C" {
* @name Kernel configuration
* @{
*/
#define KERNEL_CONF_STACKSIZE_PRINTF_FLOAT (4096)
#define KERNEL_CONF_STACKSIZE_PRINTF (2048)
#define THREAD_EXTRA_STACKSIZE_PRINTF_FLOAT (4096)
#define THREAD_EXTRA_STACKSIZE_PRINTF (2048)
#ifndef KERNEL_CONF_STACKSIZE_DEFAULT
#define KERNEL_CONF_STACKSIZE_DEFAULT (512)
#ifndef THREAD_STACKSIZE_DEFAULT
#define THREAD_STACKSIZE_DEFAULT (512)
#endif
#define KERNEL_CONF_STACKSIZE_IDLE (160)
#define THREAD_STACKSIZE_IDLE (160)
/** @} */
/**

View File

@ -40,14 +40,14 @@ extern "C" {
* @name Kernel configuration
* @{
*/
#define KERNEL_CONF_STACKSIZE_PRINTF_FLOAT (4096)
#define KERNEL_CONF_STACKSIZE_PRINTF (2048)
#define THREAD_EXTRA_STACKSIZE_PRINTF_FLOAT (4096)
#define THREAD_EXTRA_STACKSIZE_PRINTF (2048)
#ifndef KERNEL_CONF_STACKSIZE_DEFAULT
#define KERNEL_CONF_STACKSIZE_DEFAULT (512)
#ifndef THREAD_STACKSIZE_DEFAULT
#define THREAD_STACKSIZE_DEFAULT (512)
#endif
#define KERNEL_CONF_STACKSIZE_IDLE (160)
#define THREAD_STACKSIZE_IDLE (160)
/** @} */
/**

View File

@ -17,14 +17,14 @@ extern "C" {
* @name Kernel configuration
* @{
*/
#define KERNEL_CONF_STACKSIZE_PRINTF (256)
#define KERNEL_CONF_STACKSIZE_PRINTF_FLOAT (KERNEL_CONF_STACKSIZE_PRINTF)
#define THREAD_EXTRA_STACKSIZE_PRINTF (256)
#define THREAD_EXTRA_STACKSIZE_PRINTF_FLOAT (THREAD_EXTRA_STACKSIZE_PRINTF)
#ifndef KERNEL_CONF_STACKSIZE_DEFAULT
#define KERNEL_CONF_STACKSIZE_DEFAULT (256)
#ifndef THREAD_STACKSIZE_DEFAULT
#define THREAD_STACKSIZE_DEFAULT (256)
#endif
#define KERNEL_CONF_STACKSIZE_IDLE (96)
#define THREAD_STACKSIZE_IDLE (96)
#define MSP430_ISR_STACK_SIZE (256)
#define RX_BUF_SIZE (3)

View File

@ -22,28 +22,28 @@ extern "C" {
/* TODO: tighten stack sizes */
#ifdef __MACH__ /* OSX */
#define KERNEL_CONF_STACKSIZE_DEFAULT (163840)
#define KERNEL_CONF_STACKSIZE_IDLE (163840)
#define KERNEL_CONF_STACKSIZE_PRINTF (163840)
#define KERNEL_CONF_STACKSIZE_PRINTF_FLOAT (163840)
#define THREAD_STACKSIZE_DEFAULT (163840)
#define THREAD_STACKSIZE_IDLE (163840)
#define THREAD_EXTRA_STACKSIZE_PRINTF (163840)
#define THREAD_EXTRA_STACKSIZE_PRINTF_FLOAT (163840)
/* for core/include/thread.h */
#define MINIMUM_STACK_SIZE (163840)
#define THREAD_STACKSIZE_MINIMUM (163840)
/* undefine the TRANSCEIVER_STACK_SIZE (2048 or 512) defined in transceiver.h */
#ifdef TRANSCEIVER_STACK_SIZE
#undef TRANSCEIVER_STACK_SIZE
#endif
#define TRANSCEIVER_STACK_SIZE (163840)
/* native internal */
#define MINIMUM_STACK_SIZE (163840)
#define THREAD_STACKSIZE_MINIMUM (163840)
#define NATIVE_ISR_STACKSIZE (163840)
#else /* Linux etc. */
#define KERNEL_CONF_STACKSIZE_DEFAULT (8192)
#define KERNEL_CONF_STACKSIZE_IDLE (8192)
#define KERNEL_CONF_STACKSIZE_PRINTF (8192)
#define KERNEL_CONF_STACKSIZE_PRINTF_FLOAT (8192)
#define THREAD_STACKSIZE_DEFAULT (8192)
#define THREAD_STACKSIZE_IDLE (8192)
#define THREAD_EXTRA_STACKSIZE_PRINTF (8192)
#define THREAD_EXTRA_STACKSIZE_PRINTF_FLOAT (8192)
/* for core/include/thread.h */
#define MINIMUM_STACK_SIZE (8192)
#define THREAD_STACKSIZE_MINIMUM (8192)
/* undefine the TRANSCEIVER_STACK_SIZE (2048 or 512) defined in transceiver.h */
#ifdef TRANSCEIVER_STACK_SIZE
#undef TRANSCEIVER_STACK_SIZE

View File

@ -30,13 +30,13 @@ extern "C" {
* @name Kernel configuration
* @{
*/
#define KERNEL_CONF_STACKSIZE_PRINTF (512)
#define THREAD_EXTRA_STACKSIZE_PRINTF (512)
#ifndef KERNEL_CONF_STACKSIZE_DEFAULT
#define KERNEL_CONF_STACKSIZE_DEFAULT (1024)
#ifndef THREAD_STACKSIZE_DEFAULT
#define THREAD_STACKSIZE_DEFAULT (1024)
#endif
#define KERNEL_CONF_STACKSIZE_IDLE (256)
#define THREAD_STACKSIZE_IDLE (256)
/** @} */
/**

View File

@ -30,13 +30,13 @@ extern "C" {
* TODO: measure and adjust for the cortex-m3
* @{
*/
#define KERNEL_CONF_STACKSIZE_PRINTF (2500)
#define THREAD_EXTRA_STACKSIZE_PRINTF (2500)
#ifndef KERNEL_CONF_STACKSIZE_DEFAULT
#define KERNEL_CONF_STACKSIZE_DEFAULT (2500)
#ifndef THREAD_STACKSIZE_DEFAULT
#define THREAD_STACKSIZE_DEFAULT (2500)
#endif
#define KERNEL_CONF_STACKSIZE_IDLE (512)
#define THREAD_STACKSIZE_IDLE (512)
/** @} */
/**

View File

@ -30,13 +30,13 @@ extern "C" {
* TODO: measure and adjust for the cortex-m0
* @{
*/
#define KERNEL_CONF_STACKSIZE_PRINTF (512)
#define THREAD_EXTRA_STACKSIZE_PRINTF (512)
#ifndef KERNEL_CONF_STACKSIZE_DEFAULT
#define KERNEL_CONF_STACKSIZE_DEFAULT (1024)
#ifndef THREAD_STACKSIZE_DEFAULT
#define THREAD_STACKSIZE_DEFAULT (1024)
#endif
#define KERNEL_CONF_STACKSIZE_IDLE (256)
#define THREAD_STACKSIZE_IDLE (256)
/** @} */
/**

View File

@ -41,13 +41,13 @@ extern "C" {
* TODO: measure and adjust for the Cortex-M0
* @{
*/
#define KERNEL_CONF_STACKSIZE_PRINTF (512)
#define THREAD_EXTRA_STACKSIZE_PRINTF (512)
#ifndef KERNEL_CONF_STACKSIZE_DEFAULT
#define KERNEL_CONF_STACKSIZE_DEFAULT (512)
#ifndef THREAD_STACKSIZE_DEFAULT
#define THREAD_STACKSIZE_DEFAULT (512)
#endif
#define KERNEL_CONF_STACKSIZE_IDLE (192)
#define THREAD_STACKSIZE_IDLE (192)
/** @} */
/**

View File

@ -35,13 +35,13 @@ extern "C" {
* TODO: measure and adjust for the cortex-m3
* @{
*/
#define KERNEL_CONF_STACKSIZE_PRINTF (1024)
#define THREAD_EXTRA_STACKSIZE_PRINTF (1024)
#ifndef KERNEL_CONF_STACKSIZE_DEFAULT
#define KERNEL_CONF_STACKSIZE_DEFAULT (1024)
#ifndef THREAD_STACKSIZE_DEFAULT
#define THREAD_STACKSIZE_DEFAULT (1024)
#endif
#define KERNEL_CONF_STACKSIZE_IDLE (256)
#define THREAD_STACKSIZE_IDLE (256)
/** @} */
/**

View File

@ -34,13 +34,13 @@
* TODO: measure and adjust for the Cortex-M4f
* @{
*/
#define KERNEL_CONF_STACKSIZE_PRINTF (1024)
#define THREAD_EXTRA_STACKSIZE_PRINTF (1024)
#ifndef KERNEL_CONF_STACKSIZE_DEFAULT
#define KERNEL_CONF_STACKSIZE_DEFAULT (1024)
#ifndef THREAD_STACKSIZE_DEFAULT
#define THREAD_STACKSIZE_DEFAULT (1024)
#endif
#define KERNEL_CONF_STACKSIZE_IDLE (256)
#define THREAD_STACKSIZE_IDLE (256)
/** @} */
/**

View File

@ -33,13 +33,13 @@
* TODO: measure and adjust for the Cortex-M4f
* @{
*/
#define KERNEL_CONF_STACKSIZE_PRINTF (2500)
#define THREAD_EXTRA_STACKSIZE_PRINTF (2500)
#ifndef KERNEL_CONF_STACKSIZE_DEFAULT
#define KERNEL_CONF_STACKSIZE_DEFAULT (2500)
#ifndef THREAD_STACKSIZE_DEFAULT
#define THREAD_STACKSIZE_DEFAULT (2500)
#endif
#define KERNEL_CONF_STACKSIZE_IDLE (512)
#define THREAD_STACKSIZE_IDLE (512)
/** @} */
/**

View File

@ -32,13 +32,13 @@ extern "C" {
*
* @{
*/
#define KERNEL_CONF_STACKSIZE_PRINTF (1024)
#define THREAD_EXTRA_STACKSIZE_PRINTF (1024)
#ifndef KERNEL_CONF_STACKSIZE_DEFAULT
#define KERNEL_CONF_STACKSIZE_DEFAULT (1024)
#ifndef THREAD_STACKSIZE_DEFAULT
#define THREAD_STACKSIZE_DEFAULT (1024)
#endif
#define KERNEL_CONF_STACKSIZE_IDLE (256)
#define THREAD_STACKSIZE_IDLE (256)
/** @} */
/**

View File

@ -166,7 +166,7 @@ void x86_init_hwtimer(void)
static void (*hwtimer_callback)(int timer);
static char hwtimer_stack[KERNEL_CONF_STACKSIZE_DEFAULT];
static char hwtimer_stack[THREAD_STACKSIZE_DEFAULT];
static kernel_pid_t hwtimer_pid = KERNEL_PID_UNDEF;
struct alarm_time {

View File

@ -138,24 +138,24 @@
* `cpu-conf.` (which should be provided by the implementation for all
* supported MCUs). The constants for these stack sizes are
*
* * `KERNEL_CONF_STACKSIZE_IDLE`
* * `KERNEL_CONF_STACKSIZE_DEFAULT`
* * `KERNEL_CONF_STACKSIZE_PRINTF`
* * `KERNEL_CONF_STACKSIZE_MAIN`
* * `THREAD_STACKSIZE_IDLE`
* * `THREAD_STACKSIZE_DEFAULT`
* * `THREAD_EXTRA_STACKSIZE_PRINTF`
* * `THREAD_STACKSIZE_MAIN`
*
* and can be used by including `kernel.h`. ARM based platforms additionally
* define `KERNEL_CONF_STACKSIZE_PRINTF_FLOAT`, because newlibs printf
* define `THREAD_EXTRA_STACKSIZE_PRINTF_FLOAT`, because newlibs printf
* implementation uses more memory for printing floating point numbers.
*
* `KERNEL_CONF_STACKSIZE_IDLE` is the stack size for the idle thread and
* probably the smallest sensible stack size. `KERNEL_CONF_STACKSIZE_DEFAULT`
* `THREAD_STACKSIZE_IDLE` is the stack size for the idle thread and
* probably the smallest sensible stack size. `THREAD_STACKSIZE_DEFAULT`
* is a default size for any typical thread, _not_ using printf.
* `KERNEL_CONF_STACKSIZE_PRINTF` defines additional stack space needed if the
* `THREAD_EXTRA_STACKSIZE_PRINTF` defines additional stack space needed if the
* thread needs to call printf (which requires additional memory when using
* newlib). `KERNEL_CONF_STACKSIZE_MAIN` is the stack size for the main thread
* newlib). `THREAD_STACKSIZE_MAIN` is the stack size for the main thread
* and probably a good size for your application. (Note, that on most
* non-newlib dependent platforms this will probably equal
* `KERNEL_CONF_STACKSIZE_DEFAULT`.
* `THREAD_STACKSIZE_DEFAULT`.
*
* ####The IPC
*

View File

@ -42,7 +42,7 @@
#include "msg.h"
#include "debug.h"
#define PRIORITY_CC1100 PRIORITY_MAIN-1
#define PRIORITY_CC1100 THREAD_PRIORITY_MAIN-1
#define MSG_POLL 12346
@ -83,7 +83,7 @@ static timex_t cc1100_watch_dog_period;
static kernel_pid_t cc1100_event_handler_pid;
static void *cc1100_event_handler_function(void *);
static char event_handler_stack[KERNEL_CONF_STACKSIZE_MAIN];
static char event_handler_stack[THREAD_STACKSIZE_MAIN];
/*---------------------------------------------------------------------------*/
/* Sequence number buffer management data structures */

View File

@ -44,10 +44,10 @@
static const char DEFAULT_INTEREST[] = "/ccnx/0.7.1/doc/technical/CanonicalOrder.txt";
char relay_stack[KERNEL_CONF_STACKSIZE_MAIN];
char relay_stack[THREAD_STACKSIZE_MAIN];
#if RIOT_CCN_APPSERVER
char appserver_stack[KERNEL_CONF_STACKSIZE_MAIN];
char appserver_stack[THREAD_STACKSIZE_MAIN];
#endif
static volatile kernel_pid_t _relay_pid = KERNEL_PID_UNDEF, _appserver_pid = KERNEL_PID_UNDEF;
@ -72,7 +72,7 @@ static int riot_ccn_appserver(int argc, char **argv)
_appserver_pid = thread_create(
appserver_stack, sizeof(appserver_stack),
PRIORITY_MAIN - 1, CREATE_STACKTEST,
THREAD_PRIORITY_MAIN - 1, CREATE_STACKTEST,
ccnl_riot_appserver_start, (void *) &_relay_pid, "appserver");
DEBUG("ccn-lite appserver on thread_id %" PRIkernel_pid "...\n", _appserver_pid);
@ -186,7 +186,7 @@ static int riot_ccn_relay_start(void)
_relay_pid = thread_create(
relay_stack, sizeof(relay_stack),
PRIORITY_MAIN - 2, CREATE_STACKTEST,
THREAD_PRIORITY_MAIN - 2, CREATE_STACKTEST,
ccnl_riot_relay_start, NULL, "relay");
DEBUG("ccn-lite relay on thread_id %" PRIkernel_pid "...\n", _relay_pid);

View File

@ -33,7 +33,7 @@
static kernel_pid_t _relay_pid = KERNEL_PID_UNDEF;
char t2_stack[KERNEL_CONF_STACKSIZE_MAIN];
char t2_stack[THREAD_STACKSIZE_MAIN];
void set_address_handler(uint16_t a)
{
@ -75,7 +75,7 @@ int main(void)
_relay_pid = thread_getpid();
thread_create(t2_stack, sizeof(t2_stack), PRIORITY_MAIN + 1,
thread_create(t2_stack, sizeof(t2_stack), THREAD_PRIORITY_MAIN + 1,
CREATE_STACKTEST, second_thread, NULL, "helper thread");
printf("starting ccn-lite relay...\n");

View File

@ -49,7 +49,7 @@
#define SND_BUFFER_SIZE (100)
#define RCV_BUFFER_SIZE (64)
#define RADIO_STACK_SIZE (KERNEL_CONF_STACKSIZE_MAIN)
#define RADIO_STACK_SIZE (THREAD_STACKSIZE_MAIN)
#ifdef MODULE_TRANSCEIVER
@ -121,7 +121,7 @@ void init_transceiver(void)
kernel_pid_t radio_pid = thread_create(
radio_stack_buffer,
sizeof(radio_stack_buffer),
PRIORITY_MAIN - 2,
THREAD_PRIORITY_MAIN - 2,
CREATE_STACKTEST,
radio,
NULL,

View File

@ -41,7 +41,7 @@ void *second_thread(void *arg)
return NULL;
}
char second_thread_stack[KERNEL_CONF_STACKSIZE_MAIN];
char second_thread_stack[THREAD_STACKSIZE_MAIN];
int main(void)
{
@ -51,7 +51,7 @@ int main(void)
msg_t m;
kernel_pid_t pid = thread_create(second_thread_stack, sizeof(second_thread_stack),
PRIORITY_MAIN - 1, CREATE_STACKTEST,
THREAD_PRIORITY_MAIN - 1, CREATE_STACKTEST,
second_thread, NULL, "pong");
m.content.value = 1;

View File

@ -37,7 +37,7 @@ extern "C" {
using namespace std;
/* thread's stack */
char threadA_stack [KERNEL_CONF_STACKSIZE_MAIN];
char threadA_stack [THREAD_STACKSIZE_MAIN];
/* thread's function */
void *threadA_func(void *arg);

View File

@ -144,7 +144,7 @@ int rpl_udp_init(int argc, char **argv)
DEBUGF("Start monitor\n");
kernel_pid_t monitor_pid = thread_create(monitor_stack_buffer,
sizeof(monitor_stack_buffer),
PRIORITY_MAIN - 2,
THREAD_PRIORITY_MAIN - 2,
CREATE_STACKTEST,
rpl_udp_monitor,
NULL,

View File

@ -17,7 +17,7 @@ extern "C" {
#define RADIO_CHANNEL (10)
#define MONITOR_STACK_SIZE (KERNEL_CONF_STACKSIZE_MAIN)
#define MONITOR_STACK_SIZE (THREAD_STACKSIZE_MAIN)
#define RCV_BUFFER_SIZE (32)
/* RPL shell command handlers */

View File

@ -35,7 +35,7 @@
#define UDP_BUFFER_SIZE (128)
#define SERVER_PORT (0xFF01)
static char udp_server_stack_buffer[KERNEL_CONF_STACKSIZE_MAIN];
static char udp_server_stack_buffer[THREAD_STACKSIZE_MAIN];
char addr_str[IPV6_MAX_ADDR_STR_LEN];
static void *init_udp_server(void *);
@ -48,7 +48,7 @@ int udp_server(int argc, char **argv)
kernel_pid_t udp_server_thread_pid = thread_create(udp_server_stack_buffer,
sizeof(udp_server_stack_buffer),
PRIORITY_MAIN, CREATE_STACKTEST,
THREAD_PRIORITY_MAIN, CREATE_STACKTEST,
init_udp_server,
NULL,
"init_udp_server");

View File

@ -35,8 +35,8 @@
* @brief Define stack parameters for the MAC layer thread
* @{
*/
#define KW2XRF_MAC_STACKSIZE (KERNEL_CONF_STACKSIZE_DEFAULT)
#define KW2XRF_MAC_PRIO (PRIORITY_MAIN - 3)
#define KW2XRF_MAC_STACKSIZE (THREAD_STACKSIZE_DEFAULT)
#define KW2XRF_MAC_PRIO (THREAD_PRIORITY_MAIN - 3)
#define KW2XRF_NUM (sizeof(kw2xrf_params)/sizeof(kw2xrf_params[0]))

View File

@ -33,8 +33,8 @@
* @brief Define stack parameters for the MAC layer thread
* @{
*/
#define AT86RF2XX_MAC_STACKSIZE (KERNEL_CONF_STACKSIZE_DEFAULT)
#define AT86RF2XX_MAC_PRIO (PRIORITY_MAIN - 3)
#define AT86RF2XX_MAC_STACKSIZE (THREAD_STACKSIZE_DEFAULT)
#define AT86RF2XX_MAC_PRIO (THREAD_PRIORITY_MAIN - 3)
#define AT86RF2XX_NUM (sizeof(at86rf2xx_params)/sizeof(at86rf2xx_params[0]))

View File

@ -37,8 +37,8 @@ static xbee_t xbee_devs[XBEE_NUM];
* @brief Define stack parameters for the MAC layer thread
* @{
*/
#define XBEE_MAC_STACKSIZE (KERNEL_CONF_STACKSIZE_DEFAULT)
#define XBEE_MAC_PRIO (PRIORITY_MAIN - 3)
#define XBEE_MAC_STACKSIZE (THREAD_STACKSIZE_DEFAULT)
#define XBEE_MAC_PRIO (THREAD_PRIORITY_MAIN - 3)
/**
* @brief Stacks for the MAC layer threads

View File

@ -47,7 +47,7 @@ namespace riot {
namespace {
constexpr kernel_pid_t thread_uninitialized = -1;
constexpr size_t stack_size = KERNEL_CONF_STACKSIZE_MAIN;
constexpr size_t stack_size = THREAD_STACKSIZE_MAIN;
}
struct thread_data {
@ -228,7 +228,7 @@ thread::thread(F&& f, Args&&... args)
std::unique_ptr<func_and_args> p(
new func_and_args(m_data.get(), forward<F>(f), forward<Args>(args)...));
m_handle = thread_create(
m_data->stack, stack_size, PRIORITY_MAIN - 1, 0, // CREATE_WOUT_YIELD
m_data->stack, stack_size, THREAD_PRIORITY_MAIN - 1, 0, // CREATE_WOUT_YIELD
&thread_proxy<func_and_args>, p.get(), "riot_cpp_thread");
if (m_handle >= 0) {
p.release();

View File

@ -45,14 +45,14 @@ extern "C" {
* @brief Default stack size to use for the IPv6 thread
*/
#ifndef NG_IPV6_STACK_SIZE
#define NG_IPV6_STACK_SIZE (KERNEL_CONF_STACKSIZE_DEFAULT)
#define NG_IPV6_STACK_SIZE (THREAD_STACKSIZE_DEFAULT)
#endif
/**
* @brief Default priority for the IPv6 thread
*/
#ifndef NG_IPV6_PRIO
#define NG_IPV6_PRIO (PRIORITY_MAIN - 3)
#define NG_IPV6_PRIO (THREAD_PRIORITY_MAIN - 3)
#endif
/**

View File

@ -39,14 +39,14 @@ extern "C" {
* @brief Priority of the pktdump thread
*/
#ifndef NG_PKTDUMP_PRIO
#define NG_PKTDUMP_PRIO (PRIORITY_MAIN - 1)
#define NG_PKTDUMP_PRIO (THREAD_PRIORITY_MAIN - 1)
#endif
/**
* @brief Stack size used for the pktdump thread
*/
#ifndef NG_PKTDUMP_STACKSIZE
#define NG_PKTDUMP_STACKSIZE (KERNEL_CONF_STACKSIZE_MAIN)
#define NG_PKTDUMP_STACKSIZE (THREAD_STACKSIZE_MAIN)
#endif
/**

View File

@ -34,14 +34,14 @@ extern "C" {
* @brief Default stack size to use for the 6LoWPAN thread
*/
#ifndef NG_SIXLOWPAN_STACK_SIZE
#define NG_SIXLOWPAN_STACK_SIZE (KERNEL_CONF_STACKSIZE_DEFAULT)
#define NG_SIXLOWPAN_STACK_SIZE (THREAD_STACKSIZE_DEFAULT)
#endif
/**
* @brief Default priority for the 6LoWPAN thread
*/
#ifndef NG_SIXLOWPAN_PRIO
#define NG_SIXLOWPAN_PRIO (PRIORITY_MAIN - 4)
#define NG_SIXLOWPAN_PRIO (THREAD_PRIORITY_MAIN - 4)
#endif
/**

View File

@ -42,14 +42,14 @@ extern "C" {
* @brief Priority of the pktdump thread
*/
#ifndef NG_UDP_PRIO
#define NG_UDP_PRIO (PRIORITY_MAIN - 2)
#define NG_UDP_PRIO (THREAD_PRIORITY_MAIN - 2)
#endif
/**
* @brief Default stack size to use for the UDP thread
*/
#ifndef NG_UDP_STACK_SIZE
#define NG_UDP_STACK_SIZE (KERNEL_CONF_STACKSIZE_DEFAULT)
#define NG_UDP_STACK_SIZE (THREAD_STACKSIZE_DEFAULT)
#endif
/**

View File

@ -95,7 +95,7 @@ extern "C" {
* @brief Stack size for transceiver thread
*/
#ifndef TRANSCEIVER_STACK_SIZE
#define TRANSCEIVER_STACK_SIZE (KERNEL_CONF_STACKSIZE_DEFAULT)
#define TRANSCEIVER_STACK_SIZE (THREAD_STACKSIZE_DEFAULT)
#endif
/**

View File

@ -40,7 +40,7 @@ radio_packet_t p;
transceiver_command_t tcmd;
msg_t mesg, rep;
char relay_helper_stack[KERNEL_CONF_STACKSIZE_MAIN];
char relay_helper_stack[THREAD_STACKSIZE_MAIN];
int riot_send_transceiver(uint8_t *buf, uint16_t size, uint16_t to)
{
@ -117,7 +117,7 @@ void *ccnl_riot_relay_helper_start(void *);
kernel_pid_t riot_start_helper_thread(void)
{
return thread_create(relay_helper_stack, sizeof(relay_helper_stack),
PRIORITY_MAIN - 2, CREATE_STACKTEST,
THREAD_PRIORITY_MAIN - 2, CREATE_STACKTEST,
ccnl_riot_relay_helper_start, NULL, "relay-helper");
}

View File

@ -42,7 +42,7 @@ extern "C" {
#define CC1100_RADIO_MODE CC1100_MODE_WOR
#define RPL_PKT_RECV_BUF_SIZE 16
#define RPL_PROCESS_STACKSIZE KERNEL_CONF_STACKSIZE_MAIN
#define RPL_PROCESS_STACKSIZE THREAD_STACKSIZE_MAIN
/* global variables */
extern kernel_pid_t rpl_process_pid;

View File

@ -34,7 +34,7 @@
/*--------------------------------------------------------------------------------------*/
/* interal defines */
#define RCV_BUFFER_SIZE (64)
#define RADIO_STACK_SIZE (KERNEL_CONF_STACKSIZE_DEFAULT)
#define RADIO_STACK_SIZE (THREAD_STACKSIZE_DEFAULT)
#define MAX_PROB_STATS (64)
/* internal prototypes */
@ -71,7 +71,7 @@ void l2_ping_init(void)
mutex_init(&ping_sender_mutex);
kernel_pid_t l2_pkt_handler_pid = thread_create(l2_pkt_handler_stack_buffer,
RADIO_STACK_SIZE,
PRIORITY_MAIN - 2,
THREAD_PRIORITY_MAIN - 2,
CREATE_STACKTEST,
l2_pkt_handler, NULL,
"l2_pkt_handler");

View File

@ -41,7 +41,7 @@
#define ENABLE_DEBUG (0)
#include "debug.h"
#define READER_STACK_SIZE (KERNEL_CONF_STACKSIZE_DEFAULT)
#define READER_STACK_SIZE (THREAD_STACKSIZE_DEFAULT)
char serial_reader_stack[READER_STACK_SIZE];
kernel_pid_t serial_reader_pid = KERNEL_PID_UNDEF;
@ -130,10 +130,10 @@ int sixlowpan_lowpan_border_init(int if_id)
serial_reader_pid = thread_create(
serial_reader_stack, READER_STACK_SIZE,
PRIORITY_MAIN - 1, CREATE_STACKTEST,
THREAD_PRIORITY_MAIN - 1, CREATE_STACKTEST,
serial_reader_f, "serial_reader");
ip_process_pid = thread_create(ip_process_buf, IP_PROCESS_STACKSIZE,
PRIORITY_MAIN - 1, CREATE_STACKTEST,
THREAD_PRIORITY_MAIN - 1, CREATE_STACKTEST,
border_process_lowpan,
"border_process_lowpan");

View File

@ -59,7 +59,7 @@ ipv6_addr_t init_threeway_handshake(void)
synack->type = BORDER_PACKET_CONF_TYPE;
synack->conftype = BORDER_CONF_SYNACK;
sending_slot_pid = thread_create(sending_slot_stack, SENDING_SLOT_STACK_SIZE, PRIORITY_MAIN - 1, CREATE_SLEEPING, sending_slot, "sending slot");
sending_slot_pid = thread_create(sending_slot_stack, SENDING_SLOT_STACK_SIZE, THREAD_PRIORITY_MAIN - 1, CREATE_SLEEPING, sending_slot, "sending slot");
flowcontrol_send_over_uart((border_packet_t *)synack, sizeof(border_conf_header_t));
synack_seqnum = synack->seq_num;

View File

@ -43,7 +43,7 @@ extern "C" {
#define BORDER_RWS (1)
#define BORDER_SL_TIMEOUT (500) // microseconds, maybe smaller
#define SENDING_SLOT_STACK_SIZE (MINIMUM_STACK_SIZE + 256)
#define SENDING_SLOT_STACK_SIZE (THREAD_STACKSIZE_MINIMUM + 256)
typedef struct {
/* Sender state */

View File

@ -26,6 +26,7 @@
#include <stdint.h>
#include "kernel.h"
#include "thread.h"
#include "timex.h"
#include "mutex.h"
#include "net_if.h"
@ -45,7 +46,7 @@ extern "C" {
#define MULTIHOP_HOPLIMIT (64)
#define SIXLOWIP_MAX_REGISTERED (4)
#define IP_PROCESS_STACKSIZE (KERNEL_CONF_STACKSIZE_MAIN)
#define IP_PROCESS_STACKSIZE (THREAD_STACKSIZE_MAIN)
/* extern variables */
extern uint8_t ipv6_ext_hdr_len;

View File

@ -52,8 +52,8 @@ static char addr_str[IPV6_MAX_ADDR_STR_LEN];
#endif
#include "debug.h"
#define CON_STACKSIZE (KERNEL_CONF_STACKSIZE_DEFAULT)
#define LOWPAN_TRANSFER_BUF_STACKSIZE (KERNEL_CONF_STACKSIZE_DEFAULT)
#define CON_STACKSIZE (THREAD_STACKSIZE_DEFAULT)
#define LOWPAN_TRANSFER_BUF_STACKSIZE (THREAD_STACKSIZE_DEFAULT)
#define SIXLOWPAN_MAX_REGISTERED (4)
@ -1748,7 +1748,7 @@ int sixlowpan_lowpan_init(void)
if (ip_process_pid == KERNEL_PID_UNDEF) {
ip_process_pid = thread_create(ip_process_buf, IP_PROCESS_STACKSIZE,
PRIORITY_MAIN - 1, CREATE_STACKTEST,
THREAD_PRIORITY_MAIN - 1, CREATE_STACKTEST,
ipv6_process, NULL, "ip_process");
}
@ -1759,7 +1759,7 @@ int sixlowpan_lowpan_init(void)
nbr_cache_auto_rem();
contexts_rem_pid = thread_create(con_buf, CON_STACKSIZE,
PRIORITY_MAIN + 1, CREATE_STACKTEST,
THREAD_PRIORITY_MAIN + 1, CREATE_STACKTEST,
lowpan_context_auto_remove, NULL, "lowpan_context_rem");
if (contexts_rem_pid == KERNEL_PID_UNDEF) {
@ -1767,7 +1767,7 @@ int sixlowpan_lowpan_init(void)
}
transfer_pid = thread_create(lowpan_transfer_buf, LOWPAN_TRANSFER_BUF_STACKSIZE,
PRIORITY_MAIN - 1, CREATE_STACKTEST,
THREAD_PRIORITY_MAIN - 1, CREATE_STACKTEST,
lowpan_transfer, NULL, "lowpan_transfer");
if (transfer_pid == KERNEL_PID_UNDEF) {

View File

@ -39,7 +39,7 @@
#define ENABLE_DEBUG (0)
#include "debug.h"
#define RADIO_STACK_SIZE (KERNEL_CONF_STACKSIZE_MAIN)
#define RADIO_STACK_SIZE (THREAD_STACKSIZE_MAIN)
#define RADIO_RCV_BUF_SIZE (64)
#define RADIO_SENDING_DELAY (1000)
@ -326,7 +326,7 @@ int sixlowpan_mac_send_ieee802154_frame(int if_id,
kernel_pid_t sixlowpan_mac_init(void)
{
kernel_pid_t recv_pid = thread_create(radio_stack_buffer, RADIO_STACK_SIZE,
PRIORITY_MAIN - 2, CREATE_STACKTEST,
THREAD_PRIORITY_MAIN - 2, CREATE_STACKTEST,
recv_ieee802154_frame, NULL, "radio");
int if_id = -1;

View File

@ -41,8 +41,8 @@ char addr_str[IPV6_MAX_ADDR_STR_LEN];
static struct netaddr_str nbuf;
#endif
static char aodv_rcv_stack_buf[KERNEL_CONF_STACKSIZE_MAIN];
static char aodv_snd_stack_buf[KERNEL_CONF_STACKSIZE_MAIN];
static char aodv_rcv_stack_buf[THREAD_STACKSIZE_MAIN];
static char aodv_snd_stack_buf[THREAD_STACKSIZE_MAIN];
static aodvv2_metric_t _metric_type;
static int sender_thread;
@ -89,11 +89,11 @@ void aodv_init(void)
aodv_packet_writer_init(_write_packet);
/* start listening & enable sending */
thread_create(aodv_rcv_stack_buf, sizeof(aodv_rcv_stack_buf), PRIORITY_MAIN,
thread_create(aodv_rcv_stack_buf, sizeof(aodv_rcv_stack_buf), THREAD_PRIORITY_MAIN,
CREATE_STACKTEST, _aodv_receiver_thread, NULL, "_aodv_receiver_thread");
AODV_DEBUG("listening on port %d\n", HTONS(MANET_PORT));
sender_thread = thread_create(aodv_snd_stack_buf, sizeof(aodv_snd_stack_buf),
PRIORITY_MAIN, CREATE_STACKTEST, _aodv_sender_thread,
THREAD_PRIORITY_MAIN, CREATE_STACKTEST, _aodv_sender_thread,
NULL, "_aodv_sender_thread");
/* register aodv for routing */

View File

@ -38,13 +38,13 @@
#include "debug.h"
#if ENABLE_DEBUG
#define ETX_BEACON_STACKSIZE (KERNEL_CONF_STACKSIZE_DEFAULT + KERNEL_CONF_STACKSIZE_PRINTF_FLOAT)
#define ETX_RADIO_STACKSIZE (KERNEL_CONF_STACKSIZE_DEFAULT + KERNEL_CONF_STACKSIZE_PRINTF_FLOAT)
#define ETX_CLOCK_STACKSIZE (KERNEL_CONF_STACKSIZE_DEFAULT)
#define ETX_BEACON_STACKSIZE (THREAD_STACKSIZE_DEFAULT + THREAD_EXTRA_STACKSIZE_PRINTF_FLOAT)
#define ETX_RADIO_STACKSIZE (THREAD_STACKSIZE_DEFAULT + THREAD_EXTRA_STACKSIZE_PRINTF_FLOAT)
#define ETX_CLOCK_STACKSIZE (THREAD_STACKSIZE_DEFAULT)
#else
#define ETX_BEACON_STACKSIZE (KERNEL_CONF_STACKSIZE_MAIN)
#define ETX_RADIO_STACKSIZE (KERNEL_CONF_STACKSIZE_MAIN)
#define ETX_CLOCK_STACKSIZE (KERNEL_CONF_STACKSIZE_DEFAULT)
#define ETX_BEACON_STACKSIZE (THREAD_STACKSIZE_MAIN)
#define ETX_RADIO_STACKSIZE (THREAD_STACKSIZE_MAIN)
#define ETX_CLOCK_STACKSIZE (THREAD_STACKSIZE_DEFAULT)
#endif
/* prototytpes */
@ -148,15 +148,15 @@ void etx_init_beaconing(ipv6_addr_t *address)
etx_send_buf[0] = ETX_PKT_OPTVAL;
etx_beacon_pid = thread_create(etx_beacon_buf, sizeof(etx_beacon_buf),
PRIORITY_MAIN - 1, CREATE_STACKTEST,
THREAD_PRIORITY_MAIN - 1, CREATE_STACKTEST,
etx_beacon, NULL, "etx_beacon");
etx_radio_pid = thread_create(etx_radio_buf, sizeof(etx_radio_buf),
PRIORITY_MAIN - 1, CREATE_STACKTEST,
THREAD_PRIORITY_MAIN - 1, CREATE_STACKTEST,
etx_radio, NULL, "etx_radio");
etx_clock_pid = thread_create(etx_clock_buf, sizeof(etx_clock_buf),
PRIORITY_MAIN - 1, CREATE_STACKTEST,
THREAD_PRIORITY_MAIN - 1, CREATE_STACKTEST,
etx_clock, NULL, "etx_clock");
//register at transceiver
transceiver_register(TRANSCEIVER_CC1100, etx_radio_pid);

View File

@ -88,7 +88,7 @@ kernel_pid_t nhdp_start(void)
sock_rcv = socket_base_socket(PF_INET6, SOCK_DGRAM, IPPROTO_UDP);
/* Start the NHDP thread */
nhdp_pid = thread_create(nhdp_stack, sizeof(nhdp_stack), PRIORITY_MAIN - 1,
nhdp_pid = thread_create(nhdp_stack, sizeof(nhdp_stack), THREAD_PRIORITY_MAIN - 1,
CREATE_STACKTEST, _nhdp_runner, NULL, "NHDP");
}
@ -179,7 +179,7 @@ int nhdp_register_if(kernel_pid_t if_pid, uint8_t *addr, size_t addr_size, uint8
helper_pid = if_pid;
/* Start the receiving thread */
nhdp_rcv_pid = thread_create(nhdp_rcv_stack, sizeof(nhdp_rcv_stack), PRIORITY_MAIN - 1,
nhdp_rcv_pid = thread_create(nhdp_rcv_stack, sizeof(nhdp_rcv_stack), THREAD_PRIORITY_MAIN - 1,
CREATE_STACKTEST, _nhdp_receiver, NULL, "nhdp_rcv_thread");
/* Start sending periodic HELLO */

View File

@ -47,9 +47,9 @@ extern "C" {
/** @brief Stack size for NHDP thread */
#if ENABLE_DEBUG
#define NHDP_STACK_SIZE (KERNEL_CONF_STACKSIZE_DEFAULT + KERNEL_CONF_STACKSIZE_PRINTF)
#define NHDP_STACK_SIZE (THREAD_STACKSIZE_DEFAULT + THREAD_EXTRA_STACKSIZE_PRINTF)
#else
#define NHDP_STACK_SIZE (KERNEL_CONF_STACKSIZE_DEFAULT)
#define NHDP_STACK_SIZE (THREAD_STACKSIZE_DEFAULT)
#endif
/** @brief Buffer size in bytes for NHDP writer's msg buffer */

View File

@ -83,7 +83,7 @@ uint8_t rpl_init(int if_id, ipv6_addr_t *address)
#endif
rpl_process_pid = thread_create(rpl_process_buf, sizeof(rpl_process_buf),
PRIORITY_MAIN - 1, CREATE_STACKTEST,
THREAD_PRIORITY_MAIN - 1, CREATE_STACKTEST,
rpl_process, NULL, "rpl_process");
sixlowpan_lowpan_init_interface(if_id);

View File

@ -1405,7 +1405,7 @@ int tcp_init_transport_layer(void)
global_sequence_counter = rand();
int tcp_thread_pid = thread_create(tcp_stack_buffer, TCP_STACK_SIZE,
PRIORITY_MAIN, CREATE_STACKTEST, tcp_packet_handler, NULL, "tcp_packet_handler");
THREAD_PRIORITY_MAIN, CREATE_STACKTEST, tcp_packet_handler, NULL, "tcp_packet_handler");
if (tcp_thread_pid < 0) {
return -1;
@ -1413,7 +1413,7 @@ int tcp_init_transport_layer(void)
ipv6_register_next_header_handler(IPV6_PROTO_NUM_TCP, tcp_thread_pid);
if (thread_create(tcp_timer_stack, TCP_TIMER_STACKSIZE, PRIORITY_MAIN + 1,
if (thread_create(tcp_timer_stack, TCP_TIMER_STACKSIZE, THREAD_PRIORITY_MAIN + 1,
CREATE_STACKTEST, tcp_general_timer, NULL, "tcp_general_timer") < 0) {
return -1;
}

View File

@ -85,7 +85,7 @@ enum tcp_codes {
#define SET_TCP_FIN(a) (a) = TCP_FIN
#define SET_TCP_FIN_ACK(a) (a) = TCP_FIN_ACK
#define TCP_STACK_SIZE (KERNEL_CONF_STACKSIZE_MAIN)
#define TCP_STACK_SIZE (THREAD_STACKSIZE_MAIN)
typedef struct __attribute__((packed)) tcp_mms_o_t {
uint8_t kind;

View File

@ -22,7 +22,7 @@ extern "C" {
#define TCP_TIMER_RESOLUTION 500*1000
#define SECOND 1000.0f*1000.0f
#define TCP_TIMER_STACKSIZE KERNEL_CONF_STACKSIZE_DEFAULT
#define TCP_TIMER_STACKSIZE THREAD_STACKSIZE_DEFAULT
#define TCP_SYN_INITIAL_TIMEOUT 6*SECOND
#define TCP_SYN_TIMEOUT 24*SECOND
#define TCP_MAX_SYN_RETRIES 3

View File

@ -204,7 +204,7 @@ int udp_init_transport_layer(void)
/* SOCKETS */
memset(socket_base_sockets, 0, MAX_SOCKETS * sizeof(socket_internal_t));
int udp_thread_pid = thread_create(udp_stack_buffer, UDP_STACK_SIZE, PRIORITY_MAIN,
int udp_thread_pid = thread_create(udp_stack_buffer, UDP_STACK_SIZE, THREAD_PRIORITY_MAIN,
CREATE_STACKTEST, udp_packet_handler, NULL, "udp_packet_handler");
if (udp_thread_pid < 0) {

View File

@ -32,7 +32,7 @@ extern "C" {
/**
* @brief Stack size used for the UDP thread
*/
#define UDP_STACK_SIZE KERNEL_CONF_STACKSIZE_MAIN
#define UDP_STACK_SIZE THREAD_STACKSIZE_MAIN
/**
* @brief Size of the UDP receive buffer

View File

@ -38,11 +38,11 @@
#define ENABLE_DEBUG (0)
#if ENABLE_DEBUG
# define PTHREAD_REAPER_STACKSIZE KERNEL_CONF_STACKSIZE_MAIN
# define PTHREAD_STACKSIZE KERNEL_CONF_STACKSIZE_MAIN
# define PTHREAD_REAPER_STACKSIZE THREAD_STACKSIZE_MAIN
# define PTHREAD_STACKSIZE THREAD_STACKSIZE_MAIN
#else
# define PTHREAD_REAPER_STACKSIZE KERNEL_CONF_STACKSIZE_DEFAULT
# define PTHREAD_STACKSIZE KERNEL_CONF_STACKSIZE_DEFAULT
# define PTHREAD_REAPER_STACKSIZE THREAD_STACKSIZE_DEFAULT
# define PTHREAD_STACKSIZE THREAD_STACKSIZE_DEFAULT
#endif
#include "debug.h"
@ -154,7 +154,7 @@ int pthread_create(pthread_t *newthread, const pthread_attr_t *attr, void *(*sta
pt->thread_pid = thread_create(stack,
stack_size,
PRIORITY_MAIN,
THREAD_PRIORITY_MAIN,
CREATE_WOUT_YIELD | CREATE_STACKTEST,
pthread_start_routine,
pt,
@ -166,7 +166,7 @@ int pthread_create(pthread_t *newthread, const pthread_attr_t *attr, void *(*sta
return -1;
}
sched_switch(PRIORITY_MAIN);
sched_switch(THREAD_PRIORITY_MAIN);
return 0;
}

View File

@ -67,7 +67,7 @@
#define ENABLE_DEBUG (0)
#if ENABLE_DEBUG
#undef TRANSCEIVER_STACK_SIZE
#define TRANSCEIVER_STACK_SIZE (KERNEL_CONF_STACKSIZE_MAIN)
#define TRANSCEIVER_STACK_SIZE (THREAD_STACKSIZE_MAIN)
#endif
#include "debug.h"
@ -186,7 +186,7 @@ void transceiver_init(transceiver_type_t t)
/* Start the transceiver thread */
kernel_pid_t transceiver_start(void)
{
transceiver_pid = thread_create(transceiver_stack, TRANSCEIVER_STACK_SIZE, PRIORITY_MAIN - 3, CREATE_STACKTEST, run, NULL, "Transceiver");
transceiver_pid = thread_create(transceiver_stack, TRANSCEIVER_STACK_SIZE, THREAD_PRIORITY_MAIN - 3, CREATE_STACKTEST, run, NULL, "Transceiver");
if (transceiver_pid == KERNEL_PID_UNDEF) {
puts("Error creating transceiver thread");

View File

@ -36,7 +36,7 @@
#endif
/* increase when ENABLE_DEBUG in chardev_thread is set to 1! */
#define UART0_STACKSIZE (KERNEL_CONF_STACKSIZE_DEFAULT)
#define UART0_STACKSIZE (THREAD_STACKSIZE_DEFAULT)
ringbuffer_t uart0_ringbuffer;
kernel_pid_t uart0_handler_pid = KERNEL_PID_UNDEF;
@ -51,7 +51,7 @@ void board_uart0_init(void)
kernel_pid_t pid = thread_create(
uart0_thread_stack,
sizeof(uart0_thread_stack),
PRIORITY_MAIN - 1,
THREAD_PRIORITY_MAIN - 1,
CREATE_STACKTEST | CREATE_SLEEPING,
chardev_thread_entry,
&uart0_ringbuffer,

View File

@ -0,0 +1,91 @@
/*
* Copyright (C) 2015 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.
*/
/**
* @ingroup tests
* @{
*
* @file
* @brief Test application for AT86RF2xx network device driver
*
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
*
* @}
*/
#include <stdio.h>
#include "kernel.h"
#include "ng_at86rf2xx.h"
#include "net/ng_nomac.h"
#include "net/ng_netbase.h"
/* make sure the SPI port and the needed GPIO pins are defined */
#ifndef ATRF_SPI
#error "SPI not defined"
#endif
#ifndef ATRF_CS
#error "Chip select pin not defined"
#endif
#ifndef ATRF_INT
#error "Interrupt pin not defined"
#endif
#ifndef ATRF_SLEEP
#error "Sleep pin not defined"
#endif
#ifndef ATRF_RESET
#error "Reset pin not defined"
#endif
#ifndef ATRF_SPI_SPEED
#define ATRF_SPI_SPEED (SPI_SPEED_5MHZ)
#endif
/**
* @brief MAC layer stack configuration
* @{
*/
#define STACKSIZE (THREAD_STACKSIZE_MAIN)
#define PRIO (0)
/** @} */
/**
* @brief Allocate the AT86RF2xx device descriptor
*/
static ng_at86rf2xx_t dev;
/**
* @brief Stack for the nomac thread
*/
static char nomac_stack[STACKSIZE];
void auto_init_ng_netif(void)
{
kernel_pid_t iface;
int res;
/* initialize the AT86RF2xx device */
printf("Initializing the AT86RF2xx radio at SPI_%i... \n", ATRF_SPI);
res = ng_at86rf2xx_init(&dev, ATRF_SPI, ATRF_SPI_SPEED,
ATRF_CS, ATRF_INT,
ATRF_SLEEP, ATRF_RESET);
if (res < 0) {
puts("Error initializing AT86RF2xx radio device");
return;
}
/* start MAC layer */
puts("Starting the NOMAC layer on top of the driver");
iface = ng_nomac_init(nomac_stack, sizeof(nomac_stack), PRIO, "at86rf2xx",
(ng_netdev_t *)(&dev));
if (iface <= KERNEL_PID_UNDEF) {
puts("Error initializing MAC layer");
return;
}
}

View File

@ -0,0 +1,86 @@
/*
* Copyright (C) 2015 Freie Universität Berlin
* Copyright (C) 2015 PHYTEC Messtechnik GmbH
*
* 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.
*/
/**
* @ingroup tests
* @{
*
* @file
* @brief Test application for KW2xRF network device driver
*
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
* @author Jonas Remmert <j.remmert@phytec.de>
*
* @}
*/
#include <stdio.h>
#include "kernel.h"
#include "kw2xrf.h"
#include "net/ng_nomac.h"
#include "net/ng_netbase.h"
/* make sure the SPI port and the needed GPIO pins are defined */
#ifndef KWRF_SPI
#error "SPI not defined"
#endif
#ifndef KWRF_CS
#error "Chip select pin not defined"
#endif
#ifndef KWRF_INT
#error "Interrupt pin not defined"
#endif
#ifndef KWRF_SPI_SPEED
#define KWRF_SPI_SPEED (SPI_SPEED_10MHZ)
#endif
/**
* @brief MAC layer stack configuration
* @{
*/
#define STACKSIZE (THREAD_STACKSIZE_MAIN)
#define PRIO (0)
/** @} */
/**
* @brief Allocate the KW2XRF device descriptor
*/
static kw2xrf_t dev;
/**
* @brief Stack for the nomac thread
*/
static char nomac_stack[STACKSIZE];
void auto_init_ng_netif(void)
{
kernel_pid_t iface;
int res;
/* initialize the KW2XRF device */
printf("Initializing the KW2XRF radio at SPI_%i... \n", KWRF_SPI);
res = kw2xrf_init(&dev, KWRF_SPI, KWRF_SPI_SPEED,
KWRF_CS, KWRF_INT);
if (res < 0) {
puts("Error initializing KW2XRF radio device");
return;
}
/* start MAC layer */
puts("Starting the NOMAC layer on top of the driver");
iface = ng_nomac_init(nomac_stack, sizeof(nomac_stack), PRIO, "kw2xrf",
(ng_netdev_t *)(&dev));
if (iface <= KERNEL_PID_UNDEF) {
puts("Error initializing MAC layer");
return;
}
}

View File

@ -125,7 +125,7 @@ void print_register(char reg, int num_bytes)
}
}
char rx_handler_stack[KERNEL_CONF_STACKSIZE_MAIN];
char rx_handler_stack[THREAD_STACKSIZE_MAIN];
/* RX handler that waits for a message from the ISR */
void *nrf24l01p_rx_handler(void *arg)
@ -197,7 +197,7 @@ int cmd_its(int argc, char **argv)
/* create thread that gets msg when data arrives */
if (thread_create(
rx_handler_stack, sizeof(rx_handler_stack), PRIORITY_MAIN - 1, 0,
rx_handler_stack, sizeof(rx_handler_stack), THREAD_PRIORITY_MAIN - 1, 0,
nrf24l01p_rx_handler, 0, "nrf24l01p_rx_handler") < 0) {
puts("Error in thread_create");
return;

View File

@ -28,7 +28,7 @@
#include "vtimer.h"
#include "pir.h"
char pir_handler_stack[KERNEL_CONF_STACKSIZE_MAIN];
char pir_handler_stack[THREAD_STACKSIZE_MAIN];
pir_t dev;
void* pir_handler(void *arg)
@ -79,7 +79,7 @@ int main(void)
}
#else
thread_create(
pir_handler_stack, sizeof(pir_handler_stack), PRIORITY_MAIN - 1,
pir_handler_stack, sizeof(pir_handler_stack), THREAD_PRIORITY_MAIN - 1,
CREATE_WOUT_YIELD | CREATE_STACKTEST,
pir_handler, NULL, "pir_handler");
#endif

View File

@ -0,0 +1,77 @@
/*
* Copyright (C) 2015 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.
*/
/**
* @ingroup tests
* @{
*
* @file
* @brief Xbee device initialization
*
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
*
* @}
*/
#include <stdio.h>
#include "kernel.h"
#include "xbee.h"
#include "net/ng_nomac.h"
#include "net/ng_netbase.h"
/* make sure an UART to device is defined in the Makefile */
#ifndef XBEE_UART
#error "XBEE_UART not defined"
#endif
/**
* @brief This is the default baudrate the Xbee modules are programmed to
* when you buy them
*/
#define XBEE_BAUDRATE (9600U)
/**
* @brief MAC layer stack configuration
* @{
*/
#define STACKSIZE (THREAD_STACKSIZE_DEFAULT)
#define PRIO (0)
/** @} */
/**
* @brief The Xbee device descriptor
*/
static xbee_t dev;
/**
* @brief Stack for the nomac thread
*/
static char nomac_stack[STACKSIZE];
void auto_init_ng_netif(void)
{
int res;
kernel_pid_t iface;
/* setup Xbee device */
printf("Initializing the Xbee S1 device UART_%i... \n", XBEE_UART);
res = xbee_init(&dev, XBEE_UART, XBEE_BAUDRATE, GPIO_NUMOF, GPIO_NUMOF);
if (res < 0) {
puts("Error initializing xbee device driver");
return;
}
/* start MAC layer */
iface = ng_nomac_init(nomac_stack, sizeof(nomac_stack), PRIO, "xbee",
(ng_netdev_t *)(&dev));
if (iface <= KERNEL_PID_UNDEF) {
puts("Error initializing MAC layer");
return;
}
}

View File

@ -23,7 +23,7 @@
#include "hwtimer.h"
#include "thread.h"
char busy_stack[KERNEL_CONF_STACKSIZE_MAIN];
char busy_stack[THREAD_STACKSIZE_MAIN];
volatile int busy, i, k;
void *busy_thread(void *arg)
@ -54,7 +54,7 @@ int main(void)
busy = 1;
k = 23;
thread_create(busy_stack, sizeof(busy_stack),
PRIORITY_MAIN + 1, CREATE_WOUT_YIELD,
THREAD_PRIORITY_MAIN + 1, CREATE_WOUT_YIELD,
busy_thread, NULL, "busy_thread");
puts("busy_thread created");

View File

@ -24,8 +24,8 @@
#include "cpu-conf.h"
#include "thread.h"
#define THREAD1_STACKSIZE (KERNEL_CONF_STACKSIZE_PRINTF)
#define THREAD2_STACKSIZE (KERNEL_CONF_STACKSIZE_PRINTF)
#define THREAD1_STACKSIZE (THREAD_EXTRA_STACKSIZE_PRINTF)
#define THREAD2_STACKSIZE (THREAD_EXTRA_STACKSIZE_PRINTF)
#ifndef TEST_EXECUTION_NUM
#define TEST_EXECUTION_NUM (10)
@ -93,9 +93,9 @@ static void *thread2(void *args)
int main(void)
{
thread2_pid = thread_create(thread2_stack, THREAD2_STACKSIZE, PRIORITY_MAIN - 1,
thread2_pid = thread_create(thread2_stack, THREAD2_STACKSIZE, THREAD_PRIORITY_MAIN - 1,
0, thread2, NULL, "thread2");
thread1_pid = thread_create(thread1_stack, THREAD1_STACKSIZE, PRIORITY_MAIN - 2,
thread1_pid = thread_create(thread1_stack, THREAD1_STACKSIZE, THREAD_PRIORITY_MAIN - 2,
0, thread1, NULL, "thread1");
return 0;
}

View File

@ -26,7 +26,7 @@ static mutex_t mutex = MUTEX_INIT;
static volatile int indicator, count;
static kernel_pid_t main_pid;
static char stack[KERNEL_CONF_STACKSIZE_MAIN];
static char stack[THREAD_STACKSIZE_MAIN];
static void *second_thread(void *arg)
{
(void) arg;
@ -48,7 +48,7 @@ int main(void)
kernel_pid_t second_pid = thread_create(stack,
sizeof(stack),
PRIORITY_MAIN - 1,
THREAD_PRIORITY_MAIN - 1,
CREATE_WOUT_YIELD | CREATE_STACKTEST,
second_thread,
NULL,

View File

@ -39,7 +39,7 @@
#define SENDING_DELAY (10 * 1000)
#define RCV_BUFFER_SIZE (64)
#define RADIO_STACK_SIZE (KERNEL_CONF_STACKSIZE_DEFAULT)
#define RADIO_STACK_SIZE (THREAD_STACKSIZE_DEFAULT)
static char radio_stack_buffer[RADIO_STACK_SIZE];
static msg_t msg_q[RCV_BUFFER_SIZE];
@ -145,7 +145,7 @@ int main(void)
printf("\n\tmain(): starting radio thread\n");
kernel_pid_t radio_pid = thread_create(
radio_stack_buffer, sizeof(radio_stack_buffer),
PRIORITY_MAIN - 2, CREATE_STACKTEST,
THREAD_PRIORITY_MAIN - 2, CREATE_STACKTEST,
radio, NULL, "radio");
transceiver_register(TRANSCEIVER_NATIVE, radio_pid);
#endif

View File

@ -47,7 +47,7 @@
static volatile int main_pid;
static char uart_stack[KERNEL_CONF_STACKSIZE_MAIN];
static char uart_stack[THREAD_STACKSIZE_MAIN];
static char rx_mem[128];
static char tx_mem[128];
@ -111,7 +111,7 @@ int main(void)
}
puts("Starting timer thread that triggers UART output...");
thread_create(uart_stack, KERNEL_CONF_STACKSIZE_MAIN, PRIORITY_MAIN - 1,
thread_create(uart_stack, THREAD_STACKSIZE_MAIN, THREAD_PRIORITY_MAIN - 1,
0, uart_thread, 0, "uart");
while (1) {

View File

@ -36,7 +36,7 @@
#define BYTES_TOTAL (26)
static char stacks[2][KERNEL_CONF_STACKSIZE_MAIN];
static char stacks[2][THREAD_STACKSIZE_MAIN];
static char pipe_bufs[2][6];
static ringbuffer_t rbs[2];
@ -101,10 +101,10 @@ int main(void)
}
thread_create(stacks[0], sizeof (stacks[0]),
PRIORITY_MAIN, CREATE_WOUT_YIELD | CREATE_STACKTEST,
THREAD_PRIORITY_MAIN, CREATE_WOUT_YIELD | CREATE_STACKTEST,
run_middle, NULL, "middle");
thread_create(stacks[1], sizeof (stacks[1]),
PRIORITY_MAIN, CREATE_WOUT_YIELD | CREATE_STACKTEST,
THREAD_PRIORITY_MAIN, CREATE_WOUT_YIELD | CREATE_STACKTEST,
run_end, NULL, "end");
unsigned total = 0;

View File

@ -26,8 +26,8 @@
#include "semaphore.h"
#define SEMAPHORE_TEST_THREADS 5
char test1_thread_stack[KERNEL_CONF_STACKSIZE_MAIN];
char test2_thread_stack[SEMAPHORE_TEST_THREADS][KERNEL_CONF_STACKSIZE_MAIN];
char test1_thread_stack[THREAD_STACKSIZE_MAIN];
char test2_thread_stack[SEMAPHORE_TEST_THREADS][THREAD_STACKSIZE_MAIN];
sem_t s;
@ -65,7 +65,7 @@ static void test1(void)
puts("first: thread create");
kernel_pid_t pid = thread_create(test1_thread_stack,
sizeof(test1_thread_stack),
PRIORITY_MAIN - 1,
THREAD_PRIORITY_MAIN - 1,
CREATE_STACKTEST | CREATE_WOUT_YIELD,
test1_second_thread,
NULL,
@ -134,7 +134,7 @@ void test2(void)
}
for (int i = 0; i < SEMAPHORE_TEST_THREADS; i++) {
int priority = PRIORITY_MAIN - (i + 3) % 10 + 1;
int priority = THREAD_PRIORITY_MAIN - (i + 3) % 10 + 1;
snprintf(names[i], sizeof(names[i]), "priority %d", priority);
printf("first: thread create: %d\n", priority);

View File

@ -27,7 +27,7 @@ static struct pthread_cond_t cv;
static volatile int is_finished;
static volatile long count;
static volatile long expected_value;
static char stack[KERNEL_CONF_STACKSIZE_MAIN];
static char stack[THREAD_STACKSIZE_MAIN];
/**
* @brief This thread tries to lock the mutex to enter the critical section.
@ -57,7 +57,7 @@ int main(void)
expected_value = 1000*1000;
pthread_cond_init(&cv, NULL);
kernel_pid_t pid = thread_create(stack,sizeof(stack), PRIORITY_MAIN - 1,
kernel_pid_t pid = thread_create(stack,sizeof(stack), THREAD_PRIORITY_MAIN - 1,
CREATE_WOUT_YIELD | CREATE_STACKTEST,
second_thread, NULL, "second_thread");

View File

@ -97,7 +97,7 @@ static void *reader(void *arg)
int main(void)
{
static char stacks[NUM_CHILDREN][KERNEL_CONF_STACKSIZE_MAIN];
static char stacks[NUM_CHILDREN][THREAD_STACKSIZE_MAIN];
puts("Main start.");
@ -108,20 +108,20 @@ int main(void)
if (i < NUM_READERS) {
if (i < NUM_READERS_HIGH) {
prio = PRIORITY_MAIN + 1;
prio = THREAD_PRIORITY_MAIN + 1;
}
else {
prio = PRIORITY_MAIN + 2;
prio = THREAD_PRIORITY_MAIN + 2;
}
fun = reader;
name = "reader";
}
else {
if (i - NUM_READERS < NUM_WRITERS_HIGH) {
prio = PRIORITY_MAIN + 1;
prio = THREAD_PRIORITY_MAIN + 1;
}
else {
prio = PRIORITY_MAIN + 2;
prio = THREAD_PRIORITY_MAIN + 2;
}
fun = writer;
name = "writer";

View File

@ -19,7 +19,7 @@
#include <stdio.h>
#include "thread.h"
char snd_thread_stack[KERNEL_CONF_STACKSIZE_MAIN];
char snd_thread_stack[THREAD_STACKSIZE_MAIN];
void *snd_thread(void *unused)
{
@ -33,7 +33,7 @@ int main(void)
puts("The output should be: yield 1, snd_thread running, yield 2, done");
puts("----------------------------------------------------------------");
thread_create(snd_thread_stack, sizeof(snd_thread_stack), PRIORITY_MAIN,
thread_create(snd_thread_stack, sizeof(snd_thread_stack), THREAD_PRIORITY_MAIN,
CREATE_WOUT_YIELD, snd_thread, NULL, "snd");
puts("yield 1");

View File

@ -21,7 +21,7 @@
#include <stdio.h>
#include "thread.h"
char t2_stack[KERNEL_CONF_STACKSIZE_MAIN];
char t2_stack[THREAD_STACKSIZE_MAIN];
void *second_thread(void *arg)
{
@ -34,7 +34,7 @@ int main(void)
{
(void) thread_create(
t2_stack, sizeof(t2_stack),
PRIORITY_MAIN - 1, CREATE_WOUT_YIELD | CREATE_STACKTEST,
THREAD_PRIORITY_MAIN - 1, CREATE_WOUT_YIELD | CREATE_STACKTEST,
second_thread, NULL, "nr2");
puts("first thread\n");
return 0;

View File

@ -31,7 +31,7 @@ mutex_t mtx = MUTEX_INIT;
volatile int storage = 1;
kernel_pid_t main_id = KERNEL_PID_UNDEF;
kernel_pid_t ths[PROBLEM];
char stacks[PROBLEM][KERNEL_CONF_STACKSIZE_MAIN];
char stacks[PROBLEM][THREAD_STACKSIZE_MAIN];
void *run(void *arg)
{
@ -70,7 +70,7 @@ int main(void)
for (int i = 0; i < PROBLEM; ++i) {
printf("Creating thread with arg %d\n", (i + 1));
ths[i] = thread_create(stacks[i], sizeof(stacks[i]),
PRIORITY_MAIN - 1, CREATE_WOUT_YIELD | CREATE_STACKTEST,
THREAD_PRIORITY_MAIN - 1, CREATE_WOUT_YIELD | CREATE_STACKTEST,
run, NULL, "thread");
if (ths[i] < 0) {

View File

@ -22,8 +22,8 @@
#include "thread.h"
char second_thread_stack[KERNEL_CONF_STACKSIZE_MAIN];
char third_thread_stack[KERNEL_CONF_STACKSIZE_MAIN];
char second_thread_stack[THREAD_STACKSIZE_MAIN];
char third_thread_stack[THREAD_STACKSIZE_MAIN];
void *fourth_thread(void *arg)
{
@ -49,7 +49,7 @@ void *second_thread(void *arg)
if ((thread_create(
third_thread_stack,
sizeof(third_thread_stack),
PRIORITY_MAIN - 2,
THREAD_PRIORITY_MAIN - 2,
CREATE_STACKTEST,
third_thread,
NULL,
@ -63,7 +63,7 @@ void *second_thread(void *arg)
if ((thread_create(
third_thread_stack,
sizeof(third_thread_stack),
PRIORITY_MAIN - 1,
THREAD_PRIORITY_MAIN - 1,
CREATE_WOUT_YIELD | CREATE_STACKTEST,
fourth_thread,
NULL,
@ -83,7 +83,7 @@ int main(void)
if ((thread_create(
second_thread_stack,
sizeof(second_thread_stack),
PRIORITY_MAIN - 1,
THREAD_PRIORITY_MAIN - 1,
CREATE_WOUT_YIELD | CREATE_STACKTEST,
second_thread,
NULL,

View File

@ -24,9 +24,9 @@
#include "thread.h"
#include "msg.h"
char t1_stack[KERNEL_CONF_STACKSIZE_MAIN];
char t2_stack[KERNEL_CONF_STACKSIZE_MAIN];
char t3_stack[KERNEL_CONF_STACKSIZE_MAIN];
char t1_stack[THREAD_STACKSIZE_MAIN];
char t2_stack[THREAD_STACKSIZE_MAIN];
char t3_stack[THREAD_STACKSIZE_MAIN];
kernel_pid_t p1, p2, p3;
@ -83,13 +83,13 @@ void *thread3(void *arg)
int main(void)
{
p1 = thread_create(t1_stack, sizeof(t1_stack), PRIORITY_MAIN - 1,
p1 = thread_create(t1_stack, sizeof(t1_stack), THREAD_PRIORITY_MAIN - 1,
CREATE_WOUT_YIELD | CREATE_STACKTEST,
thread1, NULL, "nr1");
p2 = thread_create(t2_stack, sizeof(t2_stack), PRIORITY_MAIN - 1,
p2 = thread_create(t2_stack, sizeof(t2_stack), THREAD_PRIORITY_MAIN - 1,
CREATE_WOUT_YIELD | CREATE_STACKTEST,
thread2, NULL, "nr2");
p3 = thread_create(t3_stack, sizeof(t3_stack), PRIORITY_MAIN - 1,
p3 = thread_create(t3_stack, sizeof(t3_stack), THREAD_PRIORITY_MAIN - 1,
CREATE_WOUT_YIELD | CREATE_STACKTEST,
thread3, NULL, "nr3");
puts("THREADS CREATED\n");

View File

@ -25,7 +25,7 @@
#include "thread.h"
#include "msg.h"
char t1_stack[KERNEL_CONF_STACKSIZE_MAIN];
char t1_stack[THREAD_STACKSIZE_MAIN];
kernel_pid_t p1 = KERNEL_PID_UNDEF, p_main = KERNEL_PID_UNDEF;
@ -59,7 +59,7 @@ int main(void)
msg_t msg_q[1];
msg_init_queue(msg_q, 1);
p1 = thread_create(t1_stack, sizeof(t1_stack), PRIORITY_MAIN - 1,
p1 = thread_create(t1_stack, sizeof(t1_stack), THREAD_PRIORITY_MAIN - 1,
CREATE_WOUT_YIELD | CREATE_STACKTEST,
thread1, NULL, "nr1");

View File

@ -25,7 +25,7 @@
#include "thread.h"
#include "msg.h"
char t1_stack[KERNEL_CONF_STACKSIZE_MAIN];
char t1_stack[THREAD_STACKSIZE_MAIN];
kernel_pid_t p1 = KERNEL_PID_UNDEF, p_main = KERNEL_PID_UNDEF;
@ -56,7 +56,7 @@ int main(void)
msg_t msg;
p_main = sched_active_pid;
p1 = thread_create(t1_stack, sizeof(t1_stack), PRIORITY_MAIN - 1,
p1 = thread_create(t1_stack, sizeof(t1_stack), THREAD_PRIORITY_MAIN - 1,
CREATE_WOUT_YIELD | CREATE_STACKTEST,
thread1, NULL, "nr1");

View File

@ -25,9 +25,9 @@
#include "thread.h"
#include "msg.h"
char t1_stack[KERNEL_CONF_STACKSIZE_MAIN];
char t2_stack[KERNEL_CONF_STACKSIZE_MAIN];
char t3_stack[KERNEL_CONF_STACKSIZE_MAIN];
char t1_stack[THREAD_STACKSIZE_MAIN];
char t2_stack[THREAD_STACKSIZE_MAIN];
char t3_stack[THREAD_STACKSIZE_MAIN];
kernel_pid_t p_main = KERNEL_PID_UNDEF, p1 = KERNEL_PID_UNDEF,
p2 = KERNEL_PID_UNDEF, p3 = KERNEL_PID_UNDEF;
@ -55,13 +55,13 @@ int main(void)
p_main = sched_active_pid;
p1 = thread_create(t1_stack, sizeof(t1_stack), PRIORITY_MAIN - 1,
p1 = thread_create(t1_stack, sizeof(t1_stack), THREAD_PRIORITY_MAIN - 1,
CREATE_WOUT_YIELD | CREATE_STACKTEST,
sub_thread, "nr1", "nr1");
p2 = thread_create(t2_stack, sizeof(t2_stack), PRIORITY_MAIN - 1,
p2 = thread_create(t2_stack, sizeof(t2_stack), THREAD_PRIORITY_MAIN - 1,
CREATE_WOUT_YIELD | CREATE_STACKTEST,
sub_thread, "nr2", "nr2");
p3 = thread_create(t3_stack, sizeof(t3_stack), PRIORITY_MAIN - 1,
p3 = thread_create(t3_stack, sizeof(t3_stack), THREAD_PRIORITY_MAIN - 1,
CREATE_WOUT_YIELD | CREATE_STACKTEST,
sub_thread, "nr3", "nr3");

View File

@ -28,7 +28,7 @@
#define ITERATIONS 15
#define BUF_SIZE 7
static char stack_get[KERNEL_CONF_STACKSIZE_DEFAULT];
static char stack_get[THREAD_STACKSIZE_DEFAULT];
static char rb_buf[BUF_SIZE];
static ringbuffer_t rb = RINGBUFFER_INIT(rb_buf);
@ -110,7 +110,7 @@ static void tests_core_ringbuffer(void)
{
pid_add = sched_active_pid;
pid_get = thread_create(stack_get, sizeof (stack_get),
PRIORITY_MAIN, CREATE_SLEEPING | CREATE_STACKTEST,
THREAD_PRIORITY_MAIN, CREATE_SLEEPING | CREATE_STACKTEST,
run_get, NULL, "get");
run_add();
}

View File

@ -29,7 +29,7 @@ static pipe_t communication_pipe;
static ringbuffer_t pipe_rb;
static char pipe_buffer[16];
static char receiver_stack[KERNEL_CONF_STACKSIZE_DEFAULT];
static char receiver_stack[THREAD_STACKSIZE_DEFAULT];
typedef struct {
void (*run)(void);
@ -87,7 +87,7 @@ void test_ubjson_test(void (*sender_fun)(void), void (*receiver_fun)(void))
},
};
kernel_pid_t receiver_pid = thread_create(receiver_stack, sizeof(receiver_stack),
PRIORITY_MAIN, CREATE_WOUT_YIELD,
THREAD_PRIORITY_MAIN, CREATE_WOUT_YIELD,
test_ubjson_receiver_trampoline, &data, "receiver");
TEST_ASSERT(pid_is_valid(receiver_pid));

View File

@ -26,8 +26,8 @@
#include "thread.h"
#include "msg.h"
char timer_stack[KERNEL_CONF_STACKSIZE_MAIN];
char timer_stack_local[KERNEL_CONF_STACKSIZE_MAIN];
char timer_stack[THREAD_STACKSIZE_MAIN];
char timer_stack_local[THREAD_STACKSIZE_MAIN];
struct timer_msg {
vtimer_t timer;
@ -90,7 +90,7 @@ int main(void)
kernel_pid_t pid = thread_create(
timer_stack,
sizeof(timer_stack),
PRIORITY_MAIN - 1,
THREAD_PRIORITY_MAIN - 1,
CREATE_STACKTEST,
timer_thread,
NULL,
@ -107,7 +107,7 @@ int main(void)
kernel_pid_t pid2 = thread_create(
timer_stack_local,
sizeof(timer_stack_local),
PRIORITY_MAIN - 1,
THREAD_PRIORITY_MAIN - 1,
CREATE_STACKTEST,
timer_thread_local,
NULL,

View File

@ -31,7 +31,7 @@
#define MAXCOUNT 100
#define MAXDIFF 10000
char timer_stack[KERNEL_CONF_STACKSIZE_MAIN*4];
char timer_stack[THREAD_STACKSIZE_MAIN*4];
struct timer_msg {
vtimer_t timer;
@ -104,7 +104,7 @@ int main(void)
kernel_pid_t pid = thread_create(
timer_stack,
sizeof(timer_stack),
PRIORITY_MAIN - 1,
THREAD_PRIORITY_MAIN - 1,
CREATE_STACKTEST,
timer_thread,
NULL,