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

applications: set stack size correctly

The correct stack size for all examples and test applications correctly.
KERNEL_CONF_STACKSIZE_MAIN is the correct stack size for any thread
using printf.

Also adapted black lists accordingly.
This commit is contained in:
Oleg Hahm 2014-07-04 15:39:43 +02:00
parent 53f7bea52f
commit 13028b41bf
15 changed files with 38 additions and 34 deletions

View File

@ -45,10 +45,10 @@
#define CCNL_DEFAULT_THRESHOLD_PREFIX 1
#define CCNL_DEFAULT_THRESHOLD_AGGREGATE 2
char relay_stack[KERNEL_CONF_STACKSIZE_PRINTF];
char relay_stack[KERNEL_CONF_STACKSIZE_MAIN];
#if RIOT_CCN_APPSERVER
char appserver_stack[KERNEL_CONF_STACKSIZE_PRINTF];
char appserver_stack[KERNEL_CONF_STACKSIZE_MAIN];
#endif
int relay_pid, appserver_pid;
@ -78,7 +78,7 @@ static void riot_ccn_appserver(int argc, char **argv)
return;
}
appserver_pid = thread_create(appserver_stack, KERNEL_CONF_STACKSIZE_PRINTF, PRIORITY_MAIN - 1, CREATE_STACKTEST, appserver_thread, "appserver");
appserver_pid = thread_create(appserver_stack, KERNEL_CONF_STACKSIZE_MAIN, PRIORITY_MAIN - 1, CREATE_STACKTEST, appserver_thread, "appserver");
DEBUG("ccn-lite appserver on thread_id %d...\n", appserver_pid);
}
#endif
@ -163,7 +163,7 @@ static void riot_ccn_relay_start(int argc, char **argv)
shell_threshold_aggregate = atoi(argv[3]);
}
relay_pid = thread_create(relay_stack, KERNEL_CONF_STACKSIZE_PRINTF, PRIORITY_MAIN - 2, CREATE_STACKTEST, relay_thread, "relay");
relay_pid = thread_create(relay_stack, KERNEL_CONF_STACKSIZE_MAIN, PRIORITY_MAIN - 2, CREATE_STACKTEST, relay_thread, "relay");
DEBUG("ccn-lite relay on thread_id %d...\n", relay_pid);
}

View File

@ -33,7 +33,7 @@
int relay_pid;
char t2_stack[KERNEL_CONF_STACKSIZE_PRINTF];
char t2_stack[KERNEL_CONF_STACKSIZE_MAIN];
#define CCNL_DEFAULT_MAX_CACHE_ENTRIES 1
#define CCNL_DEFAULT_THRESHOLD_PREFIX 1
@ -77,7 +77,7 @@ int main(void)
relay_pid = thread_getpid();
thread_create(t2_stack, KERNEL_CONF_STACKSIZE_PRINTF, PRIORITY_MAIN + 1, CREATE_STACKTEST, second_thread, "helper thread");
thread_create(t2_stack, KERNEL_CONF_STACKSIZE_MAIN, PRIORITY_MAIN + 1, CREATE_STACKTEST, second_thread, "helper thread");
printf("starting ccn-lite relay...\n");
ccnl_riot_relay_start(CCNL_DEFAULT_MAX_CACHE_ENTRIES,

View File

@ -23,7 +23,7 @@
#include "hwtimer.h"
#include "thread.h"
char busy_stack[KERNEL_CONF_STACKSIZE_PRINTF];
char busy_stack[KERNEL_CONF_STACKSIZE_MAIN];
volatile int busy, i, k;
void busy_thread(void)
@ -49,7 +49,7 @@ int main(void)
{
busy = 1;
k = 23;
thread_create(busy_stack, KERNEL_CONF_STACKSIZE_PRINTF,
thread_create(busy_stack, KERNEL_CONF_STACKSIZE_MAIN,
PRIORITY_MAIN + 1, CREATE_WOUT_YIELD, busy_thread,
"busy_thread");
puts("busy_thread created");

View File

@ -1,7 +1,7 @@
export APPLICATION = test_posix_semaphore
include ../Makefile.tests_common
BOARD_INSUFFICIENT_RAM := mbed_lpc1768 redbee-econotag chronos
BOARD_INSUFFICIENT_RAM := msb-430 msb-430h mbed_lpc1768 redbee-econotag chronos
USEMODULE += posix

View File

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

View File

@ -1,6 +1,8 @@
APPLICATION = test_queue_fairness
include ../Makefile.tests_common
BOARD_INSUFFICIENT_RAM := mbed_lpc1768
USEMODULE += vtimer
DISABLE_MODULE += auto_init

View File

@ -24,7 +24,7 @@
#include "thread.h"
#include "vtimer.h"
#define STACK_SIZE (KERNEL_CONF_STACKSIZE_DEFAULT + KERNEL_CONF_STACKSIZE_PRINTF)
#define STACK_SIZE (KERNEL_CONF_STACKSIZE_DEFAULT + KERNEL_CONF_STACKSIZE_MAIN)
#define NUM_CHILDREN (3)
#define NUM_ITERATIONS (10)

View File

@ -23,7 +23,7 @@
#include <flags.h>
#include <kernel.h>
#define STACK_SIZE (KERNEL_CONF_STACKSIZE_DEFAULT + KERNEL_CONF_STACKSIZE_PRINTF)
#define STACK_SIZE (KERNEL_CONF_STACKSIZE_DEFAULT + KERNEL_CONF_STACKSIZE_MAIN)
char t2_stack[STACK_SIZE];

View File

@ -23,9 +23,9 @@
#include "thread.h"
#include "msg.h"
char t1_stack[KERNEL_CONF_STACKSIZE_PRINTF];
char t2_stack[KERNEL_CONF_STACKSIZE_PRINTF];
char t3_stack[KERNEL_CONF_STACKSIZE_PRINTF];
char t1_stack[KERNEL_CONF_STACKSIZE_MAIN];
char t2_stack[KERNEL_CONF_STACKSIZE_MAIN];
char t3_stack[KERNEL_CONF_STACKSIZE_MAIN];
uint16_t p1, p2, p3;
@ -75,11 +75,11 @@ void thread3(void)
int main(void)
{
p1 = thread_create(t1_stack, KERNEL_CONF_STACKSIZE_PRINTF, PRIORITY_MAIN - 1,
p1 = thread_create(t1_stack, KERNEL_CONF_STACKSIZE_MAIN, PRIORITY_MAIN - 1,
CREATE_WOUT_YIELD | CREATE_STACKTEST, thread1, "nr1");
p2 = thread_create(t2_stack, KERNEL_CONF_STACKSIZE_PRINTF, PRIORITY_MAIN - 1,
p2 = thread_create(t2_stack, KERNEL_CONF_STACKSIZE_MAIN, PRIORITY_MAIN - 1,
CREATE_WOUT_YIELD | CREATE_STACKTEST, thread2, "nr2");
p3 = thread_create(t3_stack, KERNEL_CONF_STACKSIZE_PRINTF, PRIORITY_MAIN - 1,
p3 = thread_create(t3_stack, KERNEL_CONF_STACKSIZE_MAIN, PRIORITY_MAIN - 1,
CREATE_WOUT_YIELD | CREATE_STACKTEST, thread3, "nr3");
puts("THREADS CREATED\n");
return 0;

View File

@ -25,7 +25,7 @@
#include "thread.h"
#include "msg.h"
char t1_stack[KERNEL_CONF_STACKSIZE_PRINTF];
char t1_stack[KERNEL_CONF_STACKSIZE_MAIN];
uint16_t p1, p_main;
@ -55,7 +55,7 @@ int main(void)
msg_t msg_q[1];
msg_init_queue(msg_q, 1);
p1 = thread_create(t1_stack, KERNEL_CONF_STACKSIZE_PRINTF, PRIORITY_MAIN - 1,
p1 = thread_create(t1_stack, KERNEL_CONF_STACKSIZE_MAIN, PRIORITY_MAIN - 1,
CREATE_WOUT_YIELD | CREATE_STACKTEST, thread1, "nr1");
/* step 3: receive a msg */

View File

@ -25,7 +25,7 @@
#include "thread.h"
#include "msg.h"
char t1_stack[KERNEL_CONF_STACKSIZE_PRINTF];
char t1_stack[KERNEL_CONF_STACKSIZE_MAIN];
uint16_t p1, p_main;
@ -52,7 +52,7 @@ int main(void)
msg_t msg;
p_main = sched_active_pid;
p1 = thread_create(t1_stack, KERNEL_CONF_STACKSIZE_PRINTF, PRIORITY_MAIN - 1,
p1 = thread_create(t1_stack, KERNEL_CONF_STACKSIZE_MAIN, PRIORITY_MAIN - 1,
CREATE_WOUT_YIELD | CREATE_STACKTEST, thread1, "nr1");
/* step 3: receive a msg */

View File

@ -25,9 +25,9 @@
#include "thread.h"
#include "msg.h"
char t1_stack[KERNEL_CONF_STACKSIZE_PRINTF];
char t2_stack[KERNEL_CONF_STACKSIZE_PRINTF];
char t3_stack[KERNEL_CONF_STACKSIZE_PRINTF];
char t1_stack[KERNEL_CONF_STACKSIZE_MAIN];
char t2_stack[KERNEL_CONF_STACKSIZE_MAIN];
char t3_stack[KERNEL_CONF_STACKSIZE_MAIN];
uint16_t p1, p2, p3;
@ -50,11 +50,11 @@ int main(void)
{
msg_t msg;
p1 = thread_create(t1_stack, KERNEL_CONF_STACKSIZE_PRINTF, PRIORITY_MAIN - 1,
p1 = thread_create(t1_stack, KERNEL_CONF_STACKSIZE_MAIN, PRIORITY_MAIN - 1,
CREATE_WOUT_YIELD | CREATE_STACKTEST, sub_thread, "nr1");
p2 = thread_create(t2_stack, KERNEL_CONF_STACKSIZE_PRINTF, PRIORITY_MAIN - 1,
p2 = thread_create(t2_stack, KERNEL_CONF_STACKSIZE_MAIN, PRIORITY_MAIN - 1,
CREATE_WOUT_YIELD | CREATE_STACKTEST, sub_thread, "nr2");
p3 = thread_create(t3_stack, KERNEL_CONF_STACKSIZE_PRINTF, PRIORITY_MAIN - 1,
p3 = thread_create(t3_stack, KERNEL_CONF_STACKSIZE_MAIN, PRIORITY_MAIN - 1,
CREATE_WOUT_YIELD | CREATE_STACKTEST, sub_thread, "nr3");
puts("THREADS CREATED\n");

View File

@ -26,8 +26,8 @@
#include "thread.h"
#include "msg.h"
char timer_stack[KERNEL_CONF_STACKSIZE_PRINTF];
char timer_stack_local[KERNEL_CONF_STACKSIZE_PRINTF];
char timer_stack[KERNEL_CONF_STACKSIZE_MAIN];
char timer_stack_local[KERNEL_CONF_STACKSIZE_MAIN];
struct timer_msg {
vtimer_t timer;

View File

@ -1,6 +1,8 @@
export APPLICATION = test_vtimer_msg_diff
include ../Makefile.tests_common
BOARD_INSUFFICIENT_RAM := mbed_lpc1768
USEMODULE += vtimer
include $(RIOTBASE)/Makefile.include

View File

@ -31,7 +31,7 @@
#define MAXCOUNT 100
#define MAXDIFF 10000
char timer_stack[KERNEL_CONF_STACKSIZE_PRINTF*4];
char timer_stack[KERNEL_CONF_STACKSIZE_MAIN*4];
struct timer_msg {
vtimer_t timer;