From 2579e64e9ff084089c06cc74828061d9862b4aef Mon Sep 17 00:00:00 2001 From: Ian Martin <ian@locicontrols.com> Date: Tue, 22 Sep 2015 11:59:21 -0400 Subject: [PATCH] core: fix stack test when SCHED_TEST_STACK=1 but DEVELHELP=0 --- core/thread.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/thread.c b/core/thread.c index 5d4a5ed469..f1a770dbfb 100644 --- a/core/thread.c +++ b/core/thread.c @@ -147,7 +147,7 @@ kernel_pid_t thread_create(char *stack, int stacksize, char priority, int flags, /* allocate our thread control block at the top of our stackspace */ tcb_t *cb = (tcb_t *) (stack + stacksize); -#ifdef DEVELHELP +#if defined(DEVELHELP) || defined(SCHED_TEST_STACK) if (flags & CREATE_STACKTEST) { /* assign each int of the stack the value of it's address */ uintptr_t *stackmax = (uintptr_t *) (stack + stacksize); @@ -186,8 +186,11 @@ kernel_pid_t thread_create(char *stack, int stacksize, char priority, int flags, cb->pid = pid; cb->sp = thread_stack_init(function, arg, stack, stacksize); -#ifdef DEVELHELP +#if defined(DEVELHELP) || defined(SCHED_TEST_STACK) cb->stack_start = stack; +#endif + +#ifdef DEVELHELP cb->stack_size = total_stacksize; cb->name = name; #endif -- GitLab