diff options
Diffstat (limited to 'nuttx/arch/z16/src/common/up_createstack.c')
-rw-r--r-- | nuttx/arch/z16/src/common/up_createstack.c | 26 |
1 files changed, 2 insertions, 24 deletions
diff --git a/nuttx/arch/z16/src/common/up_createstack.c b/nuttx/arch/z16/src/common/up_createstack.c index 0a7fecd3b..5daf8cc76 100644 --- a/nuttx/arch/z16/src/common/up_createstack.c +++ b/nuttx/arch/z16/src/common/up_createstack.c @@ -93,11 +93,6 @@ * however, there are certain contexts where the TCB may not be fully * initialized when up_create_stack is called. * - * If CONFIG_NUTTX_KERNEL is defined, then this thread type may affect - * how the stack is allocated. For example, kernel thread stacks should - * be allocated from protected kernel memory. Stacks for user tasks and - * threads must come from memory that is accessible to user code. - * ****************************************************************************/ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype) @@ -122,28 +117,11 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype) * then create a zeroed stack to make stack dumps easier to trace. */ -#if defined(CONFIG_NUTTX_KERNEL) && defined(CONFIG_MM_KERNEL_HEAP) - /* Use the kernel allocator if this is a kernel thread */ - - if (ttype == TCB_FLAG_TTYPE_KERNEL) - { #if defined(CONFIG_DEBUG) && !defined(CONFIG_DEBUG_STACK) - tcb->stack_alloc_ptr = (uint32_t *)kzalloc(stack_size); + tcb->stack_alloc_ptr = (uint32_t *)kuzalloc(stack_size); #else - tcb->stack_alloc_ptr = (uint32_t *)kmalloc(stack_size); + tcb->stack_alloc_ptr = (uint32_t *)kumalloc(stack_size); #endif - } - else -#endif - { - /* Use the user-space allocator if this is a task or pthread */ - -#if defined(CONFIG_DEBUG) && !defined(CONFIG_DEBUG_STACK) - tcb->stack_alloc_ptr = (uint32_t *)kuzalloc(stack_size); -#else - tcb->stack_alloc_ptr = (uint32_t *)kumalloc(stack_size); -#endif - } #ifdef CONFIG_DEBUG /* Was the allocation successful? */ |