diff options
28 files changed, 49 insertions, 45 deletions
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 39dca0cb9..bd58de76c 100755 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -8332,3 +8332,5 @@ * mm/*mm_brkaddr.c, *mm_extend.c, Makefile, and include/nuttx/mm.h: Add low-level memory management hooks that will be needed to support brk() and sbrk() (2014-8-31). + * Rename krealloc(0 to kmm_realloc() and kmemalign to kmm_memalign() for + consistency with the rest of the naming conventions (2014-8-31). diff --git a/nuttx/arch/arm/src/lpc31xx/lpc31_ehci.c b/nuttx/arch/arm/src/lpc31xx/lpc31_ehci.c index bbac7edfa..2af7e0c13 100755 --- a/nuttx/arch/arm/src/lpc31xx/lpc31_ehci.c +++ b/nuttx/arch/arm/src/lpc31xx/lpc31_ehci.c @@ -3813,7 +3813,7 @@ static int lpc31_ioalloc(FAR struct usbhost_driver_s *drvr, FAR uint8_t **buffer * Some hardware supports special memory in which IO data can be accessed more * efficiently. This method provides a mechanism to free that IO buffer * memory. If the underlying hardware does not support such "special" memory, - * this functions may simply map to kufree(). + * this functions may simply map to kumm_free(). * * Input Parameters: * drvr - The USB host driver instance obtained as a parameter from the call to @@ -3835,7 +3835,7 @@ static int lpc31_iofree(FAR struct usbhost_driver_s *drvr, FAR uint8_t *buffer) /* No special action is require to free the I/O buffer memory */ - kufree(buffer); + kumm_free(buffer); return OK; } diff --git a/nuttx/arch/arm/src/sam34/sam_udp.c b/nuttx/arch/arm/src/sam34/sam_udp.c index 4c290835e..4b30c4afd 100644 --- a/nuttx/arch/arm/src/sam34/sam_udp.c +++ b/nuttx/arch/arm/src/sam34/sam_udp.c @@ -3052,7 +3052,7 @@ static void sam_ep_freebuffer(struct usbdev_ep_s *ep, void *buf) { /* There is not special buffer allocation requirement */ - kufree(buf); + kumm_free(buf); } #endif diff --git a/nuttx/arch/arm/src/sama5/sam_ehci.c b/nuttx/arch/arm/src/sama5/sam_ehci.c index 025b27e77..f3e8e6887 100755 --- a/nuttx/arch/arm/src/sama5/sam_ehci.c +++ b/nuttx/arch/arm/src/sama5/sam_ehci.c @@ -3653,7 +3653,7 @@ static int sam_ioalloc(FAR struct usbhost_driver_s *drvr, FAR uint8_t **buffer, * Some hardware supports special memory in which IO data can be accessed more * efficiently. This method provides a mechanism to free that IO buffer * memory. If the underlying hardware does not support such "special" memory, - * this functions may simply map to kufree(). + * this functions may simply map to kumm_free(). * * Input Parameters: * drvr - The USB host driver instance obtained as a parameter from the call to @@ -3675,7 +3675,7 @@ static int sam_iofree(FAR struct usbhost_driver_s *drvr, FAR uint8_t *buffer) /* No special action is require to free the I/O buffer memory */ - kufree(buffer); + kumm_free(buffer); return OK; } diff --git a/nuttx/arch/arm/src/sama5/sam_ohci.c b/nuttx/arch/arm/src/sama5/sam_ohci.c index 286750440..f946fb138 100644 --- a/nuttx/arch/arm/src/sama5/sam_ohci.c +++ b/nuttx/arch/arm/src/sama5/sam_ohci.c @@ -2715,7 +2715,7 @@ static int sam_ioalloc(FAR struct usbhost_driver_s *drvr, FAR uint8_t **buffer, * Some hardware supports special memory in which IO data can be accessed more * efficiently. This method provides a mechanism to free that IO buffer * memory. If the underlying hardware does not support such "special" memory, - * this functions may simply map to kufree(). + * this functions may simply map to kumm_free(). * * Input Parameters: * drvr - The USB host driver instance obtained as a parameter from the call to @@ -2735,9 +2735,9 @@ static int sam_iofree(FAR struct usbhost_driver_s *drvr, FAR uint8_t *buffer) { DEBUGASSERT(drvr && buffer); - /* kufree is all that is required */ + /* kumm_free is all that is required */ - kufree(buffer); + kumm_free(buffer); return OK; } diff --git a/nuttx/arch/arm/src/sama5/sam_udphs.c b/nuttx/arch/arm/src/sama5/sam_udphs.c index f61f2e221..cc6c86b1c 100644 --- a/nuttx/arch/arm/src/sama5/sam_udphs.c +++ b/nuttx/arch/arm/src/sama5/sam_udphs.c @@ -3541,7 +3541,7 @@ static void sam_ep_freebuffer(struct usbdev_ep_s *ep, void *buf) { /* There is not special buffer allocation requirement */ - kufree(buf); + kumm_free(buf); } #endif diff --git a/nuttx/arch/rgmp/src/nuttx.c b/nuttx/arch/rgmp/src/nuttx.c index 338940be3..579acab15 100644 --- a/nuttx/arch/rgmp/src/nuttx.c +++ b/nuttx/arch/rgmp/src/nuttx.c @@ -216,7 +216,7 @@ void up_release_stack(struct tcb_s *dtcb, uint8_t ttype) { /* Use the user-space allocator if this is a task or pthread */ - kufree(dtcb->stack_alloc_ptr); + kumm_free(dtcb->stack_alloc_ptr); } } diff --git a/nuttx/audio/audio.c b/nuttx/audio/audio.c index c198f089d..252531677 100644 --- a/nuttx/audio/audio.c +++ b/nuttx/audio/audio.c @@ -553,7 +553,7 @@ static int audio_ioctl(FAR struct file *filep, int cmd, unsigned long arg) } else { - /* Perform a simple kufree operation */ + /* Perform a simple apb_free operation */ DEBUGASSERT(bufdesc->u.pBuffer != NULL); apb_free(bufdesc->u.pBuffer); diff --git a/nuttx/binfmt/binfmt_execmodule.c b/nuttx/binfmt/binfmt_execmodule.c index 00637d45c..c9e16818e 100644 --- a/nuttx/binfmt/binfmt_execmodule.c +++ b/nuttx/binfmt/binfmt_execmodule.c @@ -250,7 +250,7 @@ errout_with_stack: #ifndef CONFIG_CUSTOM_STACK tcb->cmn.stack_alloc_ptr = NULL; sched_releasetcb(&tcb->cmn, TCB_FLAG_TTYPE_TASK); - kufree(stack); + kumm_free(stack); #else sched_releasetcb(&tcb->cmn, TCB_FLAG_TTYPE_TASK); #endif diff --git a/nuttx/binfmt/binfmt_unloadmodule.c b/nuttx/binfmt/binfmt_unloadmodule.c index 20de9d50a..067e72796 100644 --- a/nuttx/binfmt/binfmt_unloadmodule.c +++ b/nuttx/binfmt/binfmt_unloadmodule.c @@ -195,7 +195,7 @@ int unload_module(FAR struct binary_s *binp) if (binp->alloc[i]) { bvdbg("Freeing alloc[%d]: %p\n", i, binp->alloc[i]); - kufree((FAR void *)binp->alloc[i]); + kumm_free((FAR void *)binp->alloc[i]); } } diff --git a/nuttx/binfmt/libelf/libelf_addrenv.c b/nuttx/binfmt/libelf/libelf_addrenv.c index a67070fd1..66479bf42 100644 --- a/nuttx/binfmt/libelf/libelf_addrenv.c +++ b/nuttx/binfmt/libelf/libelf_addrenv.c @@ -175,7 +175,7 @@ void elf_addrenv_free(FAR struct elf_loadinfo_s *loadinfo) if (loadinfo->textalloc != 0) { - kufree((FAR void *)loadinfo->textalloc); + kumm_free((FAR void *)loadinfo->textalloc); } #endif diff --git a/nuttx/binfmt/libelf/libelf_unload.c b/nuttx/binfmt/libelf/libelf_unload.c index eadc24b15..28767e412 100644 --- a/nuttx/binfmt/libelf/libelf_unload.c +++ b/nuttx/binfmt/libelf/libelf_unload.c @@ -92,7 +92,7 @@ int elf_unload(struct elf_loadinfo_s *loadinfo) #ifdef CONFIG_BINFMT_CONSTRUCTORS if (loadinfo->ctoralloc != 0) { - kufree(loadinfo->ctoralloc); + kumm_free(loadinfo->ctoralloc); loadinfo->ctoralloc = NULL; } @@ -101,7 +101,7 @@ int elf_unload(struct elf_loadinfo_s *loadinfo) if (loadinfo->dtoralloc != 0) { - kufree(loadinfo->dtoralloc); + kumm_free(loadinfo->dtoralloc); loadinfo->dtoralloc = NULL; } diff --git a/nuttx/binfmt/libnxflat/libnxflat_addrenv.c b/nuttx/binfmt/libnxflat/libnxflat_addrenv.c index 86c50d7a2..1690d0ae0 100644 --- a/nuttx/binfmt/libnxflat/libnxflat_addrenv.c +++ b/nuttx/binfmt/libnxflat/libnxflat_addrenv.c @@ -220,7 +220,7 @@ void nxflat_addrenv_free(FAR struct nxflat_loadinfo_s *loadinfo) if (dspace->region) { - kufree(dspace->region); + kumm_free(dspace->region); } #endif diff --git a/nuttx/fs/fs_closedir.c b/nuttx/fs/fs_closedir.c index f6b6edcf3..353b1a447 100644 --- a/nuttx/fs/fs_closedir.c +++ b/nuttx/fs/fs_closedir.c @@ -146,13 +146,13 @@ int closedir(FAR DIR *dirp) /* Then release the container */ - kufree(idir); + kumm_free(idir); return OK; #ifndef CONFIG_DISABLE_MOUNTPOINT errout_with_inode: inode_release(inode); - kufree(idir); + kumm_free(idir); #endif errout: diff --git a/nuttx/fs/fs_opendir.c b/nuttx/fs/fs_opendir.c index 46421c37e..a74c776d1 100644 --- a/nuttx/fs/fs_opendir.c +++ b/nuttx/fs/fs_opendir.c @@ -354,7 +354,7 @@ FAR DIR *opendir(FAR const char *path) /* Nasty goto's make error handling simpler */ errout_with_direntry: - kufree(dir); + kumm_free(dir); errout_with_semaphore: inode_semgive(); diff --git a/nuttx/fs/mmap/fs_munmap.c b/nuttx/fs/mmap/fs_munmap.c index ba1d99f79..df38bd14d 100644 --- a/nuttx/fs/mmap/fs_munmap.c +++ b/nuttx/fs/mmap/fs_munmap.c @@ -151,7 +151,7 @@ int munmap(FAR void *start, size_t length) /* Get the offset from the beginning of the region and the actual number * of bytes to "unmap". All mappings must extend to the end of the region. * There is no support for free a block of memory but leaving a block of - * memory at the end. This is a consequence of using umm_realloc() to + * memory at the end. This is a consequence of using kumm_realloc() to * simulate the unmapping. */ @@ -186,7 +186,7 @@ int munmap(FAR void *start, size_t length) /* Then free the region */ - kufree(curr); + kumm_free(curr); } /* No.. We have been asked to "unmap' only a portion of the memory @@ -195,7 +195,7 @@ int munmap(FAR void *start, size_t length) else { - newaddr = umm_realloc(curr->addr, sizeof(struct fs_rammap_s) + length); + newaddr = kumm_realloc(curr->addr, sizeof(struct fs_rammap_s) + length); DEBUGASSERT(newaddr == (FAR void*)(curr->addr)); curr->length = length; } diff --git a/nuttx/fs/mmap/fs_rammap.c b/nuttx/fs/mmap/fs_rammap.c index 8a75c3d61..f0335f4a8 100644 --- a/nuttx/fs/mmap/fs_rammap.c +++ b/nuttx/fs/mmap/fs_rammap.c @@ -232,13 +232,13 @@ FAR void *rammap(int fd, size_t length, off_t offset) return map->addr; errout_with_region: - kufree(alloc); + kumm_free(alloc); errout: set_errno(err); return MAP_FAILED; errout_with_errno: - kufree(alloc); + kumm_free(alloc); return MAP_FAILED; } diff --git a/nuttx/graphics/nxbe/nxbe_closewindow.c b/nuttx/graphics/nxbe/nxbe_closewindow.c index ae6580e3c..e42db3760 100644 --- a/nuttx/graphics/nxbe/nxbe_closewindow.c +++ b/nuttx/graphics/nxbe/nxbe_closewindow.c @@ -137,5 +137,5 @@ void nxbe_closewindow(struct nxbe_window_s *wnd) * allocator was used. */ - kufree(wnd); + kumm_free(wnd); } diff --git a/nuttx/graphics/nxsu/nx_close.c b/nuttx/graphics/nxsu/nx_close.c index 05c6acdd1..5891fd791 100644 --- a/nuttx/graphics/nxsu/nx_close.c +++ b/nuttx/graphics/nxsu/nx_close.c @@ -90,6 +90,6 @@ void nx_close(NXHANDLE handle) { /* For consistency, we use the user-space allocate (if available) */ - kufree(handle); + kumm_free(handle); } diff --git a/nuttx/graphics/nxsu/nx_constructwindow.c b/nuttx/graphics/nxsu/nx_constructwindow.c index f5f5720a9..d19b6ba23 100644 --- a/nuttx/graphics/nxsu/nx_constructwindow.c +++ b/nuttx/graphics/nxsu/nx_constructwindow.c @@ -116,7 +116,7 @@ int nx_constructwindow(NXHANDLE handle, NXWINDOW hwnd, if (!fe || !cb) { - kufree(wnd); + kumm_free(wnd); errno = EINVAL; return ERROR; } diff --git a/nuttx/include/nuttx/kmalloc.h b/nuttx/include/nuttx/kmalloc.h index 40102ba55..71b0db5f6 100644 --- a/nuttx/include/nuttx/kmalloc.h +++ b/nuttx/include/nuttx/kmalloc.h @@ -96,19 +96,21 @@ extern "C" # define kumalloc(s) malloc(s) # define kuzalloc(s) zalloc(s) -# define umm_realloc(p,s) realloc(p,s) -# define umm_memalign(a,s) memalign(a,s) -# define kufree(p) free(p) +# define kumm_realloc(p,s) realloc(p,s) +# define kumm_memalign(a,s) memalign(a,s) +# define kumm_free(p) free(p) #else -/* 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. +/* In the kernel-phase of the protected build, the these macros are defined + * in userspace.h. These macros 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 kufree(p) umm_free(p) +# define kumm_realloc(p,s) umm_realloc(p,s) +# define kumm_memalign(a,s) umm_memalign(a,s) +# define kumm_free(p) umm_free(p) #endif @@ -160,7 +162,7 @@ void kfree(FAR void *mem); /* Functions defined in sched/sched_kfree.c **********************************/ /* Handles memory freed from an interrupt handler. In that context, kfree() - * (or kufree()) cannot be called. Instead, the allocations are saved in a + * (or kumm_free()) cannot be called. Instead, the allocations are saved in a * list of delayed allocations that will be periodically cleaned up by * sched_garbagecollection(). */ diff --git a/nuttx/libc/lib_internal.h b/nuttx/libc/lib_internal.h index 46aaf9abe..8a10a524c 100644 --- a/nuttx/libc/lib_internal.h +++ b/nuttx/libc/lib_internal.h @@ -96,8 +96,8 @@ # define lib_umalloc(s) kumalloc(s) # define lib_uzalloc(s) kuzalloc(s) -# define lib_urealloc(p,s) umm_realloc(p,s) -# define lib_ufree(p) kufree(p) +# define lib_urealloc(p,s) kumm_realloc(p,s) +# define lib_ufree(p) kumm_free(p) #else # include <stdlib.h> diff --git a/nuttx/libnx/nxcontext.h b/nuttx/libnx/nxcontext.h index 52c166205..f128a9173 100644 --- a/nuttx/libnx/nxcontext.h +++ b/nuttx/libnx/nxcontext.h @@ -78,8 +78,8 @@ # define lib_umalloc(s) kumalloc(s) # define lib_uzalloc(s) kuzalloc(s) -# define lib_urealloc(p,s) umm_realloc(p,s) -# define lib_ufree(p) kufree(p) +# define lib_urealloc(p,s) kumm_realloc(p,s) +# define lib_ufree(p) kumm_free(p) #else # include <stdlib.h> diff --git a/nuttx/sched/environ/env_setenv.c b/nuttx/sched/environ/env_setenv.c index 4c9b70250..7a7259c51 100644 --- a/nuttx/sched/environ/env_setenv.c +++ b/nuttx/sched/environ/env_setenv.c @@ -161,7 +161,7 @@ int setenv(FAR const char *name, FAR const char *value, int overwrite) if (group->tg_envp) { newsize = group->tg_envsize + varlen; - newenvp = (FAR char *)umm_realloc(group->tg_envp, newsize); + newenvp = (FAR char *)kumm_realloc(group->tg_envp, newsize); if (!newenvp) { ret = ENOMEM; diff --git a/nuttx/sched/environ/env_unsetenv.c b/nuttx/sched/environ/env_unsetenv.c index 53f984dfb..013b9e680 100644 --- a/nuttx/sched/environ/env_unsetenv.c +++ b/nuttx/sched/environ/env_unsetenv.c @@ -98,7 +98,7 @@ int unsetenv(FAR const char *name) /* Reallocate the new environment buffer */ newsize = group->tg_envsize; - newenvp = (FAR char *)umm_realloc(group->tg_envp, newsize); + newenvp = (FAR char *)kumm_realloc(group->tg_envp, newsize); if (!newenvp) { set_errno(ENOMEM); diff --git a/nuttx/sched/group/group_create.c b/nuttx/sched/group/group_create.c index 9d4f92a2a..1aaf6acba 100644 --- a/nuttx/sched/group/group_create.c +++ b/nuttx/sched/group/group_create.c @@ -228,7 +228,7 @@ int group_allocate(FAR struct task_tcb_s *tcb) { #if CONFIG_NFILE_STREAMS > 0 && (defined(CONFIG_BUILD_PROTECTED) || \ defined(CONFIG_BUILD_KERNEL)) && defined(CONFIG_MM_KERNEL_HEAP) - kufree(group->tg_streamlist); + kumm_free(group->tg_streamlist); #endif kfree(group); tcb->cmn.group = NULL; diff --git a/nuttx/sched/sched/sched_free.c b/nuttx/sched/sched/sched_free.c index 6456d099b..f38cc4814 100644 --- a/nuttx/sched/sched/sched_free.c +++ b/nuttx/sched/sched/sched_free.c @@ -119,7 +119,7 @@ void sched_ufree(FAR void *address) { /* No.. just deallocate the memory now. */ - kufree(address); + kumm_free(address); kumm_givesemaphore(); } } diff --git a/nuttx/sched/sched/sched_garbage.c b/nuttx/sched/sched/sched_garbage.c index 06de3d577..2ab8a5460 100644 --- a/nuttx/sched/sched/sched_garbage.c +++ b/nuttx/sched/sched/sched_garbage.c @@ -103,7 +103,7 @@ static inline void sched_kucleanup(void) { /* Return the memory to the user heap */ - kufree(address); + kumm_free(address); } } } |