Rename kufree to kumm_free for consistency with other naming

This commit is contained in:
Gregory Nutt
2014-08-31 16:15:11 -06:00
parent 9cd1ddada4
commit 9ad7dae4c1
28 changed files with 49 additions and 45 deletions
+2
View File
@@ -8332,3 +8332,5 @@
* mm/*mm_brkaddr.c, *mm_extend.c, Makefile, and include/nuttx/mm.h: Add * 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() low-level memory management hooks that will be needed to support brk()
and sbrk() (2014-8-31). 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).
+2 -2
View File
@@ -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 * Some hardware supports special memory in which IO data can be accessed more
* efficiently. This method provides a mechanism to free that IO buffer * efficiently. This method provides a mechanism to free that IO buffer
* memory. If the underlying hardware does not support such "special" memory, * 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: * Input Parameters:
* drvr - The USB host driver instance obtained as a parameter from the call to * 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 */ /* No special action is require to free the I/O buffer memory */
kufree(buffer); kumm_free(buffer);
return OK; return OK;
} }
+1 -1
View File
@@ -3052,7 +3052,7 @@ static void sam_ep_freebuffer(struct usbdev_ep_s *ep, void *buf)
{ {
/* There is not special buffer allocation requirement */ /* There is not special buffer allocation requirement */
kufree(buf); kumm_free(buf);
} }
#endif #endif
+2 -2
View File
@@ -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 * Some hardware supports special memory in which IO data can be accessed more
* efficiently. This method provides a mechanism to free that IO buffer * efficiently. This method provides a mechanism to free that IO buffer
* memory. If the underlying hardware does not support such "special" memory, * 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: * Input Parameters:
* drvr - The USB host driver instance obtained as a parameter from the call to * 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 */ /* No special action is require to free the I/O buffer memory */
kufree(buffer); kumm_free(buffer);
return OK; return OK;
} }
+3 -3
View File
@@ -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 * Some hardware supports special memory in which IO data can be accessed more
* efficiently. This method provides a mechanism to free that IO buffer * efficiently. This method provides a mechanism to free that IO buffer
* memory. If the underlying hardware does not support such "special" memory, * 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: * Input Parameters:
* drvr - The USB host driver instance obtained as a parameter from the call to * 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); DEBUGASSERT(drvr && buffer);
/* kufree is all that is required */ /* kumm_free is all that is required */
kufree(buffer); kumm_free(buffer);
return OK; return OK;
} }
+1 -1
View File
@@ -3541,7 +3541,7 @@ static void sam_ep_freebuffer(struct usbdev_ep_s *ep, void *buf)
{ {
/* There is not special buffer allocation requirement */ /* There is not special buffer allocation requirement */
kufree(buf); kumm_free(buf);
} }
#endif #endif
+1 -1
View File
@@ -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 */ /* Use the user-space allocator if this is a task or pthread */
kufree(dtcb->stack_alloc_ptr); kumm_free(dtcb->stack_alloc_ptr);
} }
} }
+1 -1
View File
@@ -553,7 +553,7 @@ static int audio_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
} }
else else
{ {
/* Perform a simple kufree operation */ /* Perform a simple apb_free operation */
DEBUGASSERT(bufdesc->u.pBuffer != NULL); DEBUGASSERT(bufdesc->u.pBuffer != NULL);
apb_free(bufdesc->u.pBuffer); apb_free(bufdesc->u.pBuffer);
+1 -1
View File
@@ -250,7 +250,7 @@ errout_with_stack:
#ifndef CONFIG_CUSTOM_STACK #ifndef CONFIG_CUSTOM_STACK
tcb->cmn.stack_alloc_ptr = NULL; tcb->cmn.stack_alloc_ptr = NULL;
sched_releasetcb(&tcb->cmn, TCB_FLAG_TTYPE_TASK); sched_releasetcb(&tcb->cmn, TCB_FLAG_TTYPE_TASK);
kufree(stack); kumm_free(stack);
#else #else
sched_releasetcb(&tcb->cmn, TCB_FLAG_TTYPE_TASK); sched_releasetcb(&tcb->cmn, TCB_FLAG_TTYPE_TASK);
#endif #endif
+1 -1
View File
@@ -195,7 +195,7 @@ int unload_module(FAR struct binary_s *binp)
if (binp->alloc[i]) if (binp->alloc[i])
{ {
bvdbg("Freeing alloc[%d]: %p\n", i, 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]);
} }
} }
+1 -1
View File
@@ -175,7 +175,7 @@ void elf_addrenv_free(FAR struct elf_loadinfo_s *loadinfo)
if (loadinfo->textalloc != 0) if (loadinfo->textalloc != 0)
{ {
kufree((FAR void *)loadinfo->textalloc); kumm_free((FAR void *)loadinfo->textalloc);
} }
#endif #endif
+2 -2
View File
@@ -92,7 +92,7 @@ int elf_unload(struct elf_loadinfo_s *loadinfo)
#ifdef CONFIG_BINFMT_CONSTRUCTORS #ifdef CONFIG_BINFMT_CONSTRUCTORS
if (loadinfo->ctoralloc != 0) if (loadinfo->ctoralloc != 0)
{ {
kufree(loadinfo->ctoralloc); kumm_free(loadinfo->ctoralloc);
loadinfo->ctoralloc = NULL; loadinfo->ctoralloc = NULL;
} }
@@ -101,7 +101,7 @@ int elf_unload(struct elf_loadinfo_s *loadinfo)
if (loadinfo->dtoralloc != 0) if (loadinfo->dtoralloc != 0)
{ {
kufree(loadinfo->dtoralloc); kumm_free(loadinfo->dtoralloc);
loadinfo->dtoralloc = NULL; loadinfo->dtoralloc = NULL;
} }
+1 -1
View File
@@ -220,7 +220,7 @@ void nxflat_addrenv_free(FAR struct nxflat_loadinfo_s *loadinfo)
if (dspace->region) if (dspace->region)
{ {
kufree(dspace->region); kumm_free(dspace->region);
} }
#endif #endif
+2 -2
View File
@@ -146,13 +146,13 @@ int closedir(FAR DIR *dirp)
/* Then release the container */ /* Then release the container */
kufree(idir); kumm_free(idir);
return OK; return OK;
#ifndef CONFIG_DISABLE_MOUNTPOINT #ifndef CONFIG_DISABLE_MOUNTPOINT
errout_with_inode: errout_with_inode:
inode_release(inode); inode_release(inode);
kufree(idir); kumm_free(idir);
#endif #endif
errout: errout:
+1 -1
View File
@@ -354,7 +354,7 @@ FAR DIR *opendir(FAR const char *path)
/* Nasty goto's make error handling simpler */ /* Nasty goto's make error handling simpler */
errout_with_direntry: errout_with_direntry:
kufree(dir); kumm_free(dir);
errout_with_semaphore: errout_with_semaphore:
inode_semgive(); inode_semgive();
+3 -3
View File
@@ -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 /* 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. * 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 * 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. * simulate the unmapping.
*/ */
@@ -186,7 +186,7 @@ int munmap(FAR void *start, size_t length)
/* Then free the region */ /* Then free the region */
kufree(curr); kumm_free(curr);
} }
/* No.. We have been asked to "unmap' only a portion of the memory /* 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 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)); DEBUGASSERT(newaddr == (FAR void*)(curr->addr));
curr->length = length; curr->length = length;
} }
+2 -2
View File
@@ -232,13 +232,13 @@ FAR void *rammap(int fd, size_t length, off_t offset)
return map->addr; return map->addr;
errout_with_region: errout_with_region:
kufree(alloc); kumm_free(alloc);
errout: errout:
set_errno(err); set_errno(err);
return MAP_FAILED; return MAP_FAILED;
errout_with_errno: errout_with_errno:
kufree(alloc); kumm_free(alloc);
return MAP_FAILED; return MAP_FAILED;
} }
+1 -1
View File
@@ -137,5 +137,5 @@ void nxbe_closewindow(struct nxbe_window_s *wnd)
* allocator was used. * allocator was used.
*/ */
kufree(wnd); kumm_free(wnd);
} }
+1 -1
View File
@@ -90,6 +90,6 @@ void nx_close(NXHANDLE handle)
{ {
/* For consistency, we use the user-space allocate (if available) */ /* For consistency, we use the user-space allocate (if available) */
kufree(handle); kumm_free(handle);
} }
+1 -1
View File
@@ -116,7 +116,7 @@ int nx_constructwindow(NXHANDLE handle, NXWINDOW hwnd,
if (!fe || !cb) if (!fe || !cb)
{ {
kufree(wnd); kumm_free(wnd);
errno = EINVAL; errno = EINVAL;
return ERROR; return ERROR;
} }
+10 -8
View File
@@ -96,19 +96,21 @@ extern "C"
# define kumalloc(s) malloc(s) # define kumalloc(s) malloc(s)
# define kuzalloc(s) zalloc(s) # define kuzalloc(s) zalloc(s)
# define umm_realloc(p,s) realloc(p,s) # define kumm_realloc(p,s) realloc(p,s)
# define umm_memalign(a,s) memalign(a,s) # define kumm_memalign(a,s) memalign(a,s)
# define kufree(p) free(p) # define kumm_free(p) free(p)
#else #else
/* In the kernel-phase of the protected build, the same macros are defined /* In the kernel-phase of the protected build, the these macros are defined
* in userspace.h as macros. Those versions call into user-space via a * in userspace.h. These macros versions call into user-space via a header
* header at the beginning of the user-space blob. * at the beginning of the user-space blob.
*/ */
# define kumalloc(s) umm_malloc(s) # define kumalloc(s) umm_malloc(s)
# define kuzalloc(s) umm_zalloc(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 #endif
@@ -160,7 +162,7 @@ void kfree(FAR void *mem);
/* Functions defined in sched/sched_kfree.c **********************************/ /* Functions defined in sched/sched_kfree.c **********************************/
/* Handles memory freed from an interrupt handler. In that context, kfree() /* 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 * list of delayed allocations that will be periodically cleaned up by
* sched_garbagecollection(). * sched_garbagecollection().
*/ */
+2 -2
View File
@@ -96,8 +96,8 @@
# define lib_umalloc(s) kumalloc(s) # define lib_umalloc(s) kumalloc(s)
# define lib_uzalloc(s) kuzalloc(s) # define lib_uzalloc(s) kuzalloc(s)
# define lib_urealloc(p,s) umm_realloc(p,s) # define lib_urealloc(p,s) kumm_realloc(p,s)
# define lib_ufree(p) kufree(p) # define lib_ufree(p) kumm_free(p)
#else #else
# include <stdlib.h> # include <stdlib.h>
+2 -2
View File
@@ -78,8 +78,8 @@
# define lib_umalloc(s) kumalloc(s) # define lib_umalloc(s) kumalloc(s)
# define lib_uzalloc(s) kuzalloc(s) # define lib_uzalloc(s) kuzalloc(s)
# define lib_urealloc(p,s) umm_realloc(p,s) # define lib_urealloc(p,s) kumm_realloc(p,s)
# define lib_ufree(p) kufree(p) # define lib_ufree(p) kumm_free(p)
#else #else
# include <stdlib.h> # include <stdlib.h>
+1 -1
View File
@@ -161,7 +161,7 @@ int setenv(FAR const char *name, FAR const char *value, int overwrite)
if (group->tg_envp) if (group->tg_envp)
{ {
newsize = group->tg_envsize + varlen; 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) if (!newenvp)
{ {
ret = ENOMEM; ret = ENOMEM;
+1 -1
View File
@@ -98,7 +98,7 @@ int unsetenv(FAR const char *name)
/* Reallocate the new environment buffer */ /* Reallocate the new environment buffer */
newsize = group->tg_envsize; newsize = group->tg_envsize;
newenvp = (FAR char *)umm_realloc(group->tg_envp, newsize); newenvp = (FAR char *)kumm_realloc(group->tg_envp, newsize);
if (!newenvp) if (!newenvp)
{ {
set_errno(ENOMEM); set_errno(ENOMEM);
+1 -1
View File
@@ -228,7 +228,7 @@ int group_allocate(FAR struct task_tcb_s *tcb)
{ {
#if CONFIG_NFILE_STREAMS > 0 && (defined(CONFIG_BUILD_PROTECTED) || \ #if CONFIG_NFILE_STREAMS > 0 && (defined(CONFIG_BUILD_PROTECTED) || \
defined(CONFIG_BUILD_KERNEL)) && defined(CONFIG_MM_KERNEL_HEAP) defined(CONFIG_BUILD_KERNEL)) && defined(CONFIG_MM_KERNEL_HEAP)
kufree(group->tg_streamlist); kumm_free(group->tg_streamlist);
#endif #endif
kfree(group); kfree(group);
tcb->cmn.group = NULL; tcb->cmn.group = NULL;
+1 -1
View File
@@ -119,7 +119,7 @@ void sched_ufree(FAR void *address)
{ {
/* No.. just deallocate the memory now. */ /* No.. just deallocate the memory now. */
kufree(address); kumm_free(address);
kumm_givesemaphore(); kumm_givesemaphore();
} }
} }
+1 -1
View File
@@ -103,7 +103,7 @@ static inline void sched_kucleanup(void)
{ {
/* Return the memory to the user heap */ /* Return the memory to the user heap */
kufree(address); kumm_free(address);
} }
} }
} }