diff options
Diffstat (limited to 'nuttx/include')
-rw-r--r-- | nuttx/include/nuttx/kmalloc.h | 26 | ||||
-rw-r--r-- | nuttx/include/nuttx/mm.h | 18 |
2 files changed, 25 insertions, 19 deletions
diff --git a/nuttx/include/nuttx/kmalloc.h b/nuttx/include/nuttx/kmalloc.h index 018d34888..40102ba55 100644 --- a/nuttx/include/nuttx/kmalloc.h +++ b/nuttx/include/nuttx/kmalloc.h @@ -96,20 +96,18 @@ extern "C" # define kumalloc(s) malloc(s) # define kuzalloc(s) zalloc(s) -# define kurealloc(p,s) realloc(p,s) -# define kumemalign(a,s) memalign(a,s) +# define umm_realloc(p,s) realloc(p,s) +# define umm_memalign(a,s) memalign(a,s) # define kufree(p) free(p) #else -/* In the kernel-phase of the kernel build, the following are defined - * in userspace.h as macros that call into user-space via a header at - * the begining of the user-space blob. +/* In the kernel-phase of the protected build, the same macros are defined + * in userspace.h as macros. Those versions call into user-space via a + * header at the beginning of the user-space blob. */ # define kumalloc(s) umm_malloc(s) # define kuzalloc(s) umm_zalloc(s) -# define kurealloc(p,s) umm_realloc(p,s) -# define kumemalign(a,s) umm_memalign(a,s) # define kufree(p) umm_free(p) #endif @@ -128,7 +126,7 @@ extern "C" # define kmalloc(s) malloc(s) # define kzalloc(s) zalloc(s) -# define krealloc(p,s) realloc(p,s) +# define kmm_realloc(p,s) realloc(p,s) # define kmm_memalign(a,s) memalign(a,s) # define kfree(p) free(p) @@ -145,7 +143,7 @@ extern "C" # define kmalloc(s) umm_malloc(s) # define kzalloc(s) umm_zalloc(s) -# define krealloc(p,s) umm_realloc(p,s) +# define kmm_realloc(p,s) umm_realloc(p,s) # define kmm_memalign(a,s) umm_memalign(a,s) # define kfree(p) umm_free(p) @@ -154,19 +152,9 @@ extern "C" * and we can call them directly. */ -void kmm_initialize(FAR void *heap_start, size_t heap_size); -void kmm_addregion(FAR void *heapstart, size_t heapsize); -int kmm_trysemaphore(void); -void kmm_givesemaphore(void); - FAR void *kmalloc(size_t size); FAR void *kzalloc(size_t size); -FAR void *krealloc(FAR void *oldmem, size_t newsize); void kfree(FAR void *mem); - -#ifdef CONFIG_DEBUG -bool kmm_heapmember(FAR void *mem); -#endif #endif /* Functions defined in sched/sched_kfree.c **********************************/ diff --git a/nuttx/include/nuttx/mm.h b/nuttx/include/nuttx/mm.h index 9e9c7631c..36c72ac3d 100644 --- a/nuttx/include/nuttx/mm.h +++ b/nuttx/include/nuttx/mm.h @@ -284,6 +284,12 @@ void kmm_initialize(FAR void *heap_start, size_t heap_size); void umm_addregion(FAR void *heapstart, size_t heapsize); #endif +/* Functions contained in kmm_addregion.c ***********************************/ + +#ifdef CONFIG_MM_USER_HEAP +void kmm_addregion(FAR void *heapstart, size_t heapsize); +#endif + /* Functions contained in mm_sem.c ******************************************/ void mm_seminitialize(FAR struct mm_heap_s *heap); @@ -318,6 +324,12 @@ void mm_free(FAR struct mm_heap_s *heap, FAR void *mem); FAR void *mm_realloc(FAR struct mm_heap_s *heap, FAR void *oldmem, size_t size); +/* Functions contained in kmm_realloc.c *************************************/ + +#ifdef CONFIG_MM_KERNEL_HEAP +FAR void *kmm_realloc(FAR void *oldmem, size_t newsize); +#endif + /* Functions contained in mm_calloc.c ***************************************/ FAR void *mm_calloc(FAR struct mm_heap_s *heap, size_t n, size_t elem_size); @@ -343,6 +355,12 @@ FAR void *mm_memalign(FAR struct mm_heap_s *heap, size_t alignment, FAR void *kmm_memalign(size_t alignment, size_t size); #endif +/* Functions contained in kmm_heapmember.c **********************************/ + +#if defined(CONFIG_MM_KERNEL_HEAP) && defined(CONFIG_DEBUG) +bool kmm_heapmember(FAR void *mem); +#endif + /* Functions contained in mm_brkaddr.c **************************************/ FAR void *mm_brkaddr(FAR struct mm_heap_s *heap, int region); |