diff options
-rw-r--r-- | nuttx/include/nuttx/mm.h | 14 | ||||
-rw-r--r-- | nuttx/mm/Kconfig | 2 | ||||
-rw-r--r-- | nuttx/mm/mm_calloc.c | 4 | ||||
-rw-r--r-- | nuttx/mm/mm_free.c | 4 | ||||
-rw-r--r-- | nuttx/mm/mm_kernel.c | 2 | ||||
-rw-r--r-- | nuttx/mm/mm_mallinfo.c | 6 | ||||
-rw-r--r-- | nuttx/mm/mm_malloc.c | 4 | ||||
-rw-r--r-- | nuttx/mm/mm_memalign.c | 6 | ||||
-rw-r--r-- | nuttx/mm/mm_realloc.c | 7 | ||||
-rw-r--r-- | nuttx/mm/mm_user.c | 4 | ||||
-rw-r--r-- | nuttx/mm/mm_zalloc.c | 4 |
11 files changed, 26 insertions, 31 deletions
diff --git a/nuttx/include/nuttx/mm.h b/nuttx/include/nuttx/mm.h index 7eac6b930..50ad068f9 100644 --- a/nuttx/include/nuttx/mm.h +++ b/nuttx/include/nuttx/mm.h @@ -1,7 +1,7 @@ /**************************************************************************** * include/nuttx/mm.h * - * Copyright (C) 2007-2009, 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2013-2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -65,10 +65,10 @@ # define CONFIG_MM_SMALL 1 #endif -#undef HAVE_USER_HEAP +#undef CONFIG_MM_USER_HEAP #if (!defined(CONFIG_BUILD_PROTECTED) || !defined(__KERNEL__)) && \ !defined(CONFIG_BUILD_KERNEL) -# define HAVE_USER_HEAP +# define CONFIG_MM_USER_HEAP #endif /* Chunk Header Definitions *************************************************/ @@ -226,7 +226,7 @@ extern "C" #define EXTERN extern #endif -#ifdef HAVE_USER_HEAP +#ifdef CONFIG_MM_USER_HEAP /* This is the user heap */ EXTERN struct mm_heap_s g_mmheap; @@ -246,13 +246,13 @@ void mm_addregion(FAR struct mm_heap_s *heap, FAR void *heapstart, /* Functions contained in umm_initialize.c **********************************/ -#ifdef HAVE_USER_HEAP +#ifdef CONFIG_MM_USER_HEAP void umm_initialize(FAR void *heap_start, size_t heap_size); #endif /* Functions contained in umm_addregion.c ***********************************/ -#ifdef HAVE_USER_HEAP +#ifdef CONFIG_MM_USER_HEAP void umm_addregion(FAR void *heapstart, size_t heapsize); #endif @@ -265,7 +265,7 @@ void mm_givesemaphore(FAR struct mm_heap_s *heap); /* Functions contained in umm_semaphore.c ***********************************/ -#ifdef HAVE_USER_HEAP +#ifdef CONFIG_MM_USER_HEAP int umm_trysemaphore(void); void umm_givesemaphore(void); #endif diff --git a/nuttx/mm/Kconfig b/nuttx/mm/Kconfig index 3812971de..006b8cf52 100644 --- a/nuttx/mm/Kconfig +++ b/nuttx/mm/Kconfig @@ -18,7 +18,7 @@ config MM_MULTIHEAP config MM_KERNEL_HEAP bool "Support a protected, kernel heap" default y - depends on (BUILD_PROTECTED || BUILD_KERNEL) && MM_MULTIHEAP + depends on (BUILD_PROTECTED && MM_MULTIHEAP) || BUILD_KERNEL ---help--- Partition heap memory into two parts: (1) a protected, kernel-mode heap accessible only by the NuttX kernel, and (2) an unprotected diff --git a/nuttx/mm/mm_calloc.c b/nuttx/mm/mm_calloc.c index 3dd501aec..90276dd6a 100644 --- a/nuttx/mm/mm_calloc.c +++ b/nuttx/mm/mm_calloc.c @@ -1,7 +1,7 @@ /**************************************************************************** * mm/mm_calloc.c * - * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009, 2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -81,7 +81,7 @@ FAR void *mm_calloc(FAR struct mm_heap_s *heap, size_t n, size_t elem_size) * ****************************************************************************/ -#if !defined(CONFIG_BUILD_PROTECTED) || !defined(__KERNEL__) +#ifdef CONFIG_MM_USER_HEAP FAR void *calloc(size_t n, size_t elem_size) { #ifdef CONFIG_MM_MULTIHEAP diff --git a/nuttx/mm/mm_free.c b/nuttx/mm/mm_free.c index 9d04619b1..a75564b35 100644 --- a/nuttx/mm/mm_free.c +++ b/nuttx/mm/mm_free.c @@ -1,7 +1,7 @@ /**************************************************************************** * mm/mm_free.c * - * Copyright (C) 2007, 2009, 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009, 2013-2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -167,7 +167,7 @@ void mm_free(FAR struct mm_heap_s *heap, FAR void *mem) * ****************************************************************************/ -#if !defined(CONFIG_BUILD_PROTECTED) || !defined(__KERNEL__) +#ifdef CONFIG_MM_USER_HEAP void free(FAR void *mem) { mm_free(&g_mmheap, mem); diff --git a/nuttx/mm/mm_kernel.c b/nuttx/mm/mm_kernel.c index eb3c7fd7d..fcb7f1380 100644 --- a/nuttx/mm/mm_kernel.c +++ b/nuttx/mm/mm_kernel.c @@ -44,7 +44,7 @@ #include <nuttx/kmalloc.h> #if ((defined(CONFIG_BUILD_PROTECTED) && defined(__KERNEL__)) || \ - defined(CONFIG_BUILD_KERNEL)) && defined(CONFIG_MM_KERNEL_HEAP) + defined(CONFIG_BUILD_KERNEL)) && defined(CONFIG_MM_KERNEL_HEAP) /************************************************************************ * Pre-processor definition diff --git a/nuttx/mm/mm_mallinfo.c b/nuttx/mm/mm_mallinfo.c index 4b152c354..e89408f36 100644 --- a/nuttx/mm/mm_mallinfo.c +++ b/nuttx/mm/mm_mallinfo.c @@ -1,7 +1,7 @@ /**************************************************************************** * mm/mm_mallinfo.c * - * Copyright (C) 2007, 2009, 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009, 2013-2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -151,7 +151,7 @@ int mm_mallinfo(FAR struct mm_heap_s *heap, FAR struct mallinfo *info) * ****************************************************************************/ -#if !defined(CONFIG_BUILD_PROTECTED) || !defined(__KERNEL__) +#ifdef CONFIG_MM_USER_HEAP # ifdef CONFIG_CAN_PASS_STRUCTS struct mallinfo mallinfo(void) @@ -170,4 +170,4 @@ int mallinfo(struct mallinfo *info) } #endif -#endif /* !CONFIG_BUILD_PROTECTED || !__KERNEL__ */ +#endif /* CONFIG_MM_USER_HEAP */ diff --git a/nuttx/mm/mm_malloc.c b/nuttx/mm/mm_malloc.c index 354a30e02..2566e1511 100644 --- a/nuttx/mm/mm_malloc.c +++ b/nuttx/mm/mm_malloc.c @@ -1,7 +1,7 @@ /**************************************************************************** * mm/mm_malloc.c * - * Copyright (C) 2007, 2009, 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009, 2013-2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -228,7 +228,7 @@ FAR void *mm_malloc(FAR struct mm_heap_s *heap, size_t size) * ****************************************************************************/ -#if !defined(CONFIG_BUILD_PROTECTED) || !defined(__KERNEL__) +#ifdef CONFIG_MM_USER_HEAP FAR void *malloc(size_t size) { return mm_malloc(&g_mmheap, size); diff --git a/nuttx/mm/mm_memalign.c b/nuttx/mm/mm_memalign.c index 7fe1d0c74..6846350b4 100644 --- a/nuttx/mm/mm_memalign.c +++ b/nuttx/mm/mm_memalign.c @@ -1,7 +1,7 @@ /**************************************************************************** * mm/mm_memalign.c * - * Copyright (C) 2007, 2009, 2011, 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009, 2011, 2013-2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -240,11 +240,9 @@ FAR void *mm_memalign(FAR struct mm_heap_s *heap, size_t alignment, * ****************************************************************************/ -#if !defined(CONFIG_BUILD_PROTECTED) || !defined(__KERNEL__) - +#ifdef CONFIG_MM_USER_HEAP FAR void *memalign(size_t alignment, size_t size) { return mm_memalign(&g_mmheap, alignment, size); } - #endif diff --git a/nuttx/mm/mm_realloc.c b/nuttx/mm/mm_realloc.c index 0c7346521..658ea1df1 100644 --- a/nuttx/mm/mm_realloc.c +++ b/nuttx/mm/mm_realloc.c @@ -1,7 +1,7 @@ /**************************************************************************** * mm/mm_realloc.c * - * Copyright (C) 2007, 2009, 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009, 2013-2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -399,12 +399,9 @@ FAR void *mm_realloc(FAR struct mm_heap_s *heap, FAR void *oldmem, * ****************************************************************************/ -#if !defined(CONFIG_BUILD_PROTECTED) || !defined(__KERNEL__) - +#ifdef CONFIG_MM_USER_HEAP FAR void *realloc(FAR void *oldmem, size_t size) { return mm_realloc(&g_mmheap, oldmem, size); } - #endif - diff --git a/nuttx/mm/mm_user.c b/nuttx/mm/mm_user.c index bc99ee839..8a733de26 100644 --- a/nuttx/mm/mm_user.c +++ b/nuttx/mm/mm_user.c @@ -41,7 +41,7 @@ #include <assert.h> #include <nuttx/mm.h> -#if !defined(CONFIG_BUILD_PROTECTED) || !defined(__KERNEL__) +#ifdef CONFIG_MM_USER_HEAP /************************************************************************ * Pre-processor definition @@ -153,4 +153,4 @@ void umm_givesemaphore(void) mm_givesemaphore(&g_mmheap); } -#endif /* !CONFIG_BUILD_PROTECTED || !__KERNEL__ */ +#endif /* CONFIG_MM_USER_HEAP */ diff --git a/nuttx/mm/mm_zalloc.c b/nuttx/mm/mm_zalloc.c index 2cef9f436..805fab82d 100644 --- a/nuttx/mm/mm_zalloc.c +++ b/nuttx/mm/mm_zalloc.c @@ -1,7 +1,7 @@ /**************************************************************************** * mm/mm_zalloc.c * - * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009, 2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -81,7 +81,7 @@ FAR void *mm_zalloc(FAR struct mm_heap_s *heap, size_t size) * ****************************************************************************/ -#if !defined(CONFIG_BUILD_PROTECTED) || !defined(__KERNEL__) +#ifdef CONFIG_MM_USER_HEAP FAR void *zalloc(size_t size) { #ifdef CONFIG_MM_MULTIHEAP |