Skip to content
Snippets Groups Projects
Commit 0532d98b authored by Martine Lenders's avatar Martine Lenders
Browse files

Merge pull request #3934 from locicontrols/sched-test-stack2

core: fix stack test when SCHED_TEST_STACK=1 but DEVELHELP=0
parents 63770e17 2579e64e
No related branches found
No related tags found
No related merge requests found
...@@ -147,7 +147,7 @@ kernel_pid_t thread_create(char *stack, int stacksize, char priority, int flags, ...@@ -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 */ /* allocate our thread control block at the top of our stackspace */
tcb_t *cb = (tcb_t *) (stack + stacksize); tcb_t *cb = (tcb_t *) (stack + stacksize);
#ifdef DEVELHELP #if defined(DEVELHELP) || defined(SCHED_TEST_STACK)
if (flags & CREATE_STACKTEST) { if (flags & CREATE_STACKTEST) {
/* assign each int of the stack the value of it's address */ /* assign each int of the stack the value of it's address */
uintptr_t *stackmax = (uintptr_t *) (stack + stacksize); uintptr_t *stackmax = (uintptr_t *) (stack + stacksize);
...@@ -186,8 +186,11 @@ kernel_pid_t thread_create(char *stack, int stacksize, char priority, int flags, ...@@ -186,8 +186,11 @@ kernel_pid_t thread_create(char *stack, int stacksize, char priority, int flags,
cb->pid = pid; cb->pid = pid;
cb->sp = thread_stack_init(function, arg, stack, stacksize); cb->sp = thread_stack_init(function, arg, stack, stacksize);
#ifdef DEVELHELP #if defined(DEVELHELP) || defined(SCHED_TEST_STACK)
cb->stack_start = stack; cb->stack_start = stack;
#endif
#ifdef DEVELHELP
cb->stack_size = total_stacksize; cb->stack_size = total_stacksize;
cb->name = name; cb->name = name;
#endif #endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment