diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-08-29 14:47:22 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-08-29 14:47:22 -0600 |
commit | 64892e44f2ce2612c77b1b20497fb007adafafb8 (patch) | |
tree | 2c917f29727a017b85193ac85959663d504b26e5 /nuttx/arch/avr | |
parent | c48af0eb9c61462f59a7ba63ca7a73e8df146f49 (diff) | |
download | nuttx-64892e44f2ce2612c77b1b20497fb007adafafb8.tar.gz nuttx-64892e44f2ce2612c77b1b20497fb007adafafb8.tar.bz2 nuttx-64892e44f2ce2612c77b1b20497fb007adafafb8.zip |
Rename CONFIG_NUTTX_KERNEL to CONFIG_BUILD_PROTECTED; Partially integrate new CONFIG_BUILD_KERNEL
Diffstat (limited to 'nuttx/arch/avr')
-rw-r--r-- | nuttx/arch/avr/src/avr/up_createstack.c | 26 | ||||
-rw-r--r-- | nuttx/arch/avr/src/avr32/up_createstack.c | 4 | ||||
-rw-r--r-- | nuttx/arch/avr/src/avr32/up_initialstate.c | 4 | ||||
-rw-r--r-- | nuttx/arch/avr/src/common/up_allocateheap.c | 2 | ||||
-rw-r--r-- | nuttx/arch/avr/src/common/up_releasestack.c | 4 |
5 files changed, 9 insertions, 31 deletions
diff --git a/nuttx/arch/avr/src/avr/up_createstack.c b/nuttx/arch/avr/src/avr/up_createstack.c index 1dd7e5006..d14ec63fd 100644 --- a/nuttx/arch/avr/src/avr/up_createstack.c +++ b/nuttx/arch/avr/src/avr/up_createstack.c @@ -96,11 +96,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) @@ -125,28 +120,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? */ diff --git a/nuttx/arch/avr/src/avr32/up_createstack.c b/nuttx/arch/avr/src/avr32/up_createstack.c index fd1af6782..9082d796f 100644 --- a/nuttx/arch/avr/src/avr32/up_createstack.c +++ b/nuttx/arch/avr/src/avr32/up_createstack.c @@ -95,7 +95,7 @@ * 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 + * If CONFIG_BUILD_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. @@ -124,7 +124,7 @@ 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) +#if defined(CONFIG_BUILD_KERNEL) && defined(CONFIG_MM_KERNEL_HEAP) /* Use the kernel allocator if this is a kernel thread */ if (ttype == TCB_FLAG_TTYPE_KERNEL) diff --git a/nuttx/arch/avr/src/avr32/up_initialstate.c b/nuttx/arch/avr/src/avr32/up_initialstate.c index 86138b616..821637423 100644 --- a/nuttx/arch/avr/src/avr32/up_initialstate.c +++ b/nuttx/arch/avr/src/avr32/up_initialstate.c @@ -115,8 +115,8 @@ void up_initial_state(struct tcb_s *tcb) * supervisor-mode. */ -#ifdef CONFIG_NUTTX_KERNEL -# error "Missing logic for the CONFIG_NUTTX_KERNEL build" +#ifdef CONFIG_BUILD_KERNEL +# error "Missing logic for the CONFIG_BUILD_KERNEL build" #endif /* Enable or disable interrupts, based on user configuration */ diff --git a/nuttx/arch/avr/src/common/up_allocateheap.c b/nuttx/arch/avr/src/common/up_allocateheap.c index b5a080d43..4076d97d1 100644 --- a/nuttx/arch/avr/src/common/up_allocateheap.c +++ b/nuttx/arch/avr/src/common/up_allocateheap.c @@ -70,7 +70,7 @@ * Description: * This function will be called to dynamically set aside the heap region. * - * For the kernel build (CONFIG_NUTTX_KERNEL=y) with both kernel- and + * For the kernel build (CONFIG_BUILD_KERNEL=y) with both kernel- and * user-space heaps (CONFIG_MM_KERNEL_HEAP=y), this function provides the * size of the unprotected, user-space heap. * diff --git a/nuttx/arch/avr/src/common/up_releasestack.c b/nuttx/arch/avr/src/common/up_releasestack.c index 11b5181c4..7595f1e0a 100644 --- a/nuttx/arch/avr/src/common/up_releasestack.c +++ b/nuttx/arch/avr/src/common/up_releasestack.c @@ -79,7 +79,7 @@ * however, there are certain error recovery contexts where the TCB may * not be fully initialized when up_release_stack is called. * - * If CONFIG_NUTTX_KERNEL is defined, then this thread type may affect + * If CONFIG_BUILD_KERNEL is defined, then this thread type may affect * how the stack is freed. For example, kernel thread stacks may have * been allocated from protected kernel memory. Stacks for user tasks * and threads must have come from memory that is accessible to user @@ -96,7 +96,7 @@ void up_release_stack(FAR struct tcb_s *dtcb, uint8_t ttype) if (dtcb->stack_alloc_ptr) { -#if defined(CONFIG_NUTTX_KERNEL) && defined(CONFIG_MM_KERNEL_HEAP) +#if defined(CONFIG_BUILD_KERNEL) && defined(CONFIG_MM_KERNEL_HEAP) /* Use the kernel allocator if this is a kernel thread */ if (ttype == TCB_FLAG_TTYPE_KERNEL) |