|
|
|
@ -92,6 +92,7 @@ int thread_wakeup(kernel_pid_t pid)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#ifdef DEVELHELP
|
|
|
|
|
int thread_measure_stack_free(char *stack)
|
|
|
|
|
{
|
|
|
|
|
unsigned int *stackp = (unsigned int *)stack;
|
|
|
|
@ -105,6 +106,7 @@ int thread_measure_stack_free(char *stack)
|
|
|
|
|
int space_free = (unsigned int)stackp - (unsigned int)stack;
|
|
|
|
|
return space_free;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
kernel_pid_t thread_create(char *stack, int stacksize, char priority, int flags, void *(*function)(void *arg), void *arg, const char *name)
|
|
|
|
|
{
|
|
|
|
@ -133,6 +135,7 @@ kernel_pid_t thread_create(char *stack, int stacksize, char priority, int flags,
|
|
|
|
|
return -EINVAL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#ifdef DEVELHELP
|
|
|
|
|
if (flags & CREATE_STACKTEST) {
|
|
|
|
|
/* assign each int of the stack the value of it's address */
|
|
|
|
|
unsigned int *stackmax = (unsigned int *)((char *)stack + stacksize);
|
|
|
|
@ -147,6 +150,7 @@ kernel_pid_t thread_create(char *stack, int stacksize, char priority, int flags,
|
|
|
|
|
/* create stack guard */
|
|
|
|
|
*stack = (unsigned int)stack;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
if (!inISR()) {
|
|
|
|
|
dINT();
|
|
|
|
|