Rename kumalloc to kumm_malloc and kuzalloc to kumm_zalloc for consistency with other naming

This commit is contained in:
Gregory Nutt 2014-08-31 16:24:24 -06:00
parent 7aefc6d3a1
commit 9aca0c1c84
35 changed files with 54 additions and 54 deletions

View File

@ -174,9 +174,9 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
/* 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);
tcb->stack_alloc_ptr = (uint32_t *)kumm_zalloc(stack_size);
#else
tcb->stack_alloc_ptr = (uint32_t *)kumalloc(stack_size);
tcb->stack_alloc_ptr = (uint32_t *)kumm_malloc(stack_size);
#endif
}

View File

@ -3773,7 +3773,7 @@ static int lpc31_free(FAR struct usbhost_driver_s *drvr, FAR uint8_t *buffer)
* Some hardware supports special memory in which larger IO buffers can
* be accessed more efficiently. This method provides a mechanism to allocate
* the request/descriptor memory. If the underlying hardware does not support
* such "special" memory, this functions may simply map to kumalloc.
* such "special" memory, this functions may simply map to kumm_malloc.
*
* This interface differs from DRVR_ALLOC in that the buffers are variable-sized.
*
@ -3802,7 +3802,7 @@ static int lpc31_ioalloc(FAR struct usbhost_driver_s *drvr, FAR uint8_t **buffer
* accessible (depending on how the class driver implements its buffering).
*/
*buffer = (FAR uint8_t *)kumalloc(buflen);
*buffer = (FAR uint8_t *)kumm_malloc(buflen);
return *buffer ? OK : -ENOMEM;
}

View File

@ -3035,7 +3035,7 @@ static void *sam_ep_allocbuffer(struct usbdev_ep_s *ep, uint16_t nbytes)
{
/* There is not special buffer allocation requirement */
return kumalloc(nbytes);
return kumm_malloc(nbytes);
}
#endif

View File

@ -3613,7 +3613,7 @@ static int sam_free(FAR struct usbhost_driver_s *drvr, FAR uint8_t *buffer)
* Some hardware supports special memory in which larger IO buffers can
* be accessed more efficiently. This method provides a mechanism to allocate
* the request/descriptor memory. If the underlying hardware does not support
* such "special" memory, this functions may simply map to kumalloc.
* such "special" memory, this functions may simply map to kumm_malloc.
*
* This interface differs from DRVR_ALLOC in that the buffers are variable-sized.
*
@ -3642,7 +3642,7 @@ static int sam_ioalloc(FAR struct usbhost_driver_s *drvr, FAR uint8_t **buffer,
* accessible (depending on how the class driver implements its buffering).
*/
*buffer = (FAR uint8_t *)kumalloc(buflen);
*buffer = (FAR uint8_t *)kumm_malloc(buflen);
return *buffer ? OK : -ENOMEM;
}

View File

@ -2677,7 +2677,7 @@ static int sam_free(FAR struct usbhost_driver_s *drvr, FAR uint8_t *buffer)
* Some hardware supports special memory in which larger IO buffers can
* be accessed more efficiently. This method provides a mechanism to allocate
* the request/descriptor memory. If the underlying hardware does not support
* such "special" memory, this functions may simply map to kumalloc.
* such "special" memory, this functions may simply map to kumm_malloc.
*
* This interface differs from DRVR_ALLOC in that the buffers are variable-sized.
*
@ -2702,9 +2702,9 @@ static int sam_ioalloc(FAR struct usbhost_driver_s *drvr, FAR uint8_t **buffer,
{
DEBUGASSERT(drvr && buffer);
/* kumalloc() should return user accessible, DMA-able memory */
/* kumm_malloc() should return user accessible, DMA-able memory */
*buffer = kumalloc(buflen);
*buffer = kumm_malloc(buflen);
return *buffer ? OK : -ENOMEM;
}

View File

@ -3524,7 +3524,7 @@ static void *sam_ep_allocbuffer(struct usbdev_ep_s *ep, uint16_t nbytes)
{
/* There is not special buffer allocation requirement */
return kumalloc(nbytes);
return kumm_malloc(nbytes);
}
#endif

View File

@ -121,9 +121,9 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
*/
#if defined(CONFIG_DEBUG) && !defined(CONFIG_DEBUG_STACK)
tcb->stack_alloc_ptr = (uint32_t *)kuzalloc(stack_size);
tcb->stack_alloc_ptr = (uint32_t *)kumm_zalloc(stack_size);
#else
tcb->stack_alloc_ptr = (uint32_t *)kumalloc(stack_size);
tcb->stack_alloc_ptr = (uint32_t *)kumm_malloc(stack_size);
#endif
#ifdef CONFIG_DEBUG

View File

@ -141,9 +141,9 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
/* 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);
tcb->stack_alloc_ptr = (uint32_t *)kumm_zalloc(stack_size);
#else
tcb->stack_alloc_ptr = (uint32_t *)kumalloc(stack_size);
tcb->stack_alloc_ptr = (uint32_t *)kumm_malloc(stack_size);
#endif
}

View File

@ -138,9 +138,9 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
/* 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);
tcb->stack_alloc_ptr = (uint32_t *)kumm_zalloc(stack_size);
#else
tcb->stack_alloc_ptr = (uint32_t *)kumalloc(stack_size);
tcb->stack_alloc_ptr = (uint32_t *)kumm_malloc(stack_size);
#endif
}

View File

@ -159,9 +159,9 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
/* 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);
tcb->stack_alloc_ptr = (uint32_t *)kumm_zalloc(stack_size);
#else
tcb->stack_alloc_ptr = (uint32_t *)kumalloc(stack_size);
tcb->stack_alloc_ptr = (uint32_t *)kumm_malloc(stack_size);
#endif
}

View File

@ -134,7 +134,7 @@ int up_create_stack(struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
} else
#endif
{
stack_alloc_ptr = (uint32_t*)kumalloc(adj_stack_size);
stack_alloc_ptr = (uint32_t*)kumm_malloc(adj_stack_size);
}
if (stack_alloc_ptr) {
/* This is the address of the last word in the allocation */

View File

@ -138,9 +138,9 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
/* 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);
tcb->stack_alloc_ptr = (uint32_t *)kumm_zalloc(stack_size);
#else
tcb->stack_alloc_ptr = (uint32_t *)kumalloc(stack_size);
tcb->stack_alloc_ptr = (uint32_t *)kumm_malloc(stack_size);
#endif
}

View File

@ -107,7 +107,7 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
/* Allocate the memory for the stack */
stack_alloc_ptr = (uint32_t*)kumalloc(adj_stack_size);
stack_alloc_ptr = (uint32_t*)kumm_malloc(adj_stack_size);
/* Was the allocation successful? */

View File

@ -140,9 +140,9 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
/* 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);
tcb->stack_alloc_ptr = (uint32_t *)kumm_zalloc(stack_size);
#else
tcb->stack_alloc_ptr = (uint32_t *)kumalloc(stack_size);
tcb->stack_alloc_ptr = (uint32_t *)kumm_malloc(stack_size);
#endif
}

View File

@ -118,9 +118,9 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
*/
#if defined(CONFIG_DEBUG) && !defined(CONFIG_DEBUG_STACK)
tcb->stack_alloc_ptr = (uint32_t *)kuzalloc(stack_size);
tcb->stack_alloc_ptr = (uint32_t *)kumm_zalloc(stack_size);
#else
tcb->stack_alloc_ptr = (uint32_t *)kumalloc(stack_size);
tcb->stack_alloc_ptr = (uint32_t *)kumm_malloc(stack_size);
#endif
#ifdef CONFIG_DEBUG

View File

@ -138,9 +138,9 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
/* 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);
tcb->stack_alloc_ptr = (uint32_t *)kumm_zalloc(stack_size);
#else
tcb->stack_alloc_ptr = (uint32_t *)kumalloc(stack_size);
tcb->stack_alloc_ptr = (uint32_t *)kumm_malloc(stack_size);
#endif
}

View File

@ -530,7 +530,7 @@ static int audio_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
}
else
{
/* Perform a simple kumalloc operation assuming 1 session */
/* Perform a simple kumm_malloc operation assuming 1 session */
ret = apb_alloc(bufdesc);
}

View File

@ -949,7 +949,7 @@ static int pcm_resume(FAR struct audio_lowerhalf_s *dev)
* lower-half driver with the opportunity to perform special buffer
* allocation if needed, such as allocating from a specific memory
* region (DMA-able, etc.). If not supplied, then the top-half
* driver will perform a standard kumalloc using normal user-space
* driver will perform a standard kumm_malloc using normal user-space
* memory region.
*
****************************************************************************/

View File

@ -166,7 +166,7 @@ int exec_module(FAR const struct binary_s *binp)
#ifndef CONFIG_CUSTOM_STACK
/* Allocate the stack for the new task (always from the user heap) */
stack = (FAR uint32_t*)kumalloc(binp->stacksize);
stack = (FAR uint32_t*)kumm_malloc(binp->stacksize);
if (!tcb)
{
err = ENOMEM;

View File

@ -129,7 +129,7 @@ int elf_addrenv_alloc(FAR struct elf_loadinfo_s *loadinfo, size_t textsize,
#else
/* Allocate memory to hold the ELF image */
loadinfo->textalloc = (uintptr_t)kuzalloc(textsize + datasize);
loadinfo->textalloc = (uintptr_t)kumm_zalloc(textsize + datasize);
if (!loadinfo->textalloc)
{
return -ENOMEM;

View File

@ -163,7 +163,7 @@ int elf_loadctors(FAR struct elf_loadinfo_s *loadinfo)
{
/* Allocate memory to hold a copy of the .ctor section */
loadinfo->ctoralloc = (binfmt_ctor_t*)kumalloc(ctorsize);
loadinfo->ctoralloc = (binfmt_ctor_t*)kumm_malloc(ctorsize);
if (!loadinfo->ctoralloc)
{
bdbg("Failed to allocate memory for .ctors\n");

View File

@ -163,7 +163,7 @@ int elf_loaddtors(FAR struct elf_loadinfo_s *loadinfo)
{
/* Allocate memory to hold a copy of the .dtor section */
loadinfo->ctoralloc = (binfmt_dtor_t*)kumalloc(dtorsize);
loadinfo->ctoralloc = (binfmt_dtor_t*)kumm_malloc(dtorsize);
if (!loadinfo->ctoralloc)
{
bdbg("Failed to allocate memory for .dtors\n");

View File

@ -162,7 +162,7 @@ errout_with_dspace:
#else
/* Allocate (and zero) memory to hold the ELF image */
dspace->region = (FAR uint8_t *)kuzalloc(envsize);
dspace->region = (FAR uint8_t *)kumm_zalloc(envsize);
if (!dspace->region)
{
kfree(dspace);

View File

@ -228,7 +228,7 @@ FAR struct file_struct *fs_fdopen(int fd, int oflags, FAR struct tcb_s *tcb)
/* Allocate the IO buffer */
stream->fs_bufstart = kumalloc(CONFIG_STDIO_BUFFER_SIZE);
stream->fs_bufstart = kumm_malloc(CONFIG_STDIO_BUFFER_SIZE);
if (!stream->fs_bufstart)
{
err = ENOMEM;

View File

@ -180,7 +180,7 @@ static inline void open_emptydir(FAR struct fs_dirent_s *dir)
* at the end of the list.
*/
#if 0 /* Already nullified by kuzalloc */
#if 0 /* Already nullified by kumm_zalloc */
dir->fd_root = NULL; /* Save the inode where we start */
dir->u.pseudo.fd_next = NULL; /* We are at the end of the list */
#endif
@ -270,7 +270,7 @@ FAR DIR *opendir(FAR const char *path)
* container.
*/
dir = (FAR struct fs_dirent_s *)kuzalloc(sizeof(struct fs_dirent_s));
dir = (FAR struct fs_dirent_s *)kumm_zalloc(sizeof(struct fs_dirent_s));
if (!dir)
{
/* Insufficient memory to complete the operation.*/

View File

@ -139,7 +139,7 @@ FAR void *rammap(int fd, size_t length, off_t offset)
/* Allocate a region of memory of the specified size */
alloc = (FAR uint8_t *)kumalloc(sizeof(struct fs_rammap_s) + length);
alloc = (FAR uint8_t *)kumm_malloc(sizeof(struct fs_rammap_s) + length);
if (!alloc)
{
fdbg("Region allocation failed, length: %d\n", (int)length);

View File

@ -199,7 +199,7 @@ NXHANDLE nx_open(FAR NX_DRIVERTYPE *dev)
* (if available) for compatibility with the multi-user implementation.
*/
fe = (FAR struct nxfe_state_s *)kuzalloc(sizeof(struct nxfe_state_s));
fe = (FAR struct nxfe_state_s *)kumm_zalloc(sizeof(struct nxfe_state_s));
if (!fe)
{
errno = ENOMEM;

View File

@ -107,7 +107,7 @@ NXWINDOW nx_openwindow(NXHANDLE handle, FAR const struct nx_callback_s *cb,
* available) for compatibility with the multi-user implementation.
*/
wnd = (FAR struct nxbe_window_s *)kuzalloc(sizeof(struct nxbe_window_s));
wnd = (FAR struct nxbe_window_s *)kumm_zalloc(sizeof(struct nxbe_window_s));
if (!wnd)
{
errno = ENOMEM;

View File

@ -532,7 +532,7 @@ struct audio_ops_s
* lower-half driver with the opportunity to perform special buffer
* allocation if needed, such as allocating from a specific memory
* region (DMA-able, etc.). If not supplied, then the top-half
* driver will perform a standard kumalloc using normal user-space
* driver will perform a standard kumm_malloc using normal user-space
* memory region.
*/

View File

@ -94,8 +94,8 @@ extern "C"
* directly callable.
*/
# define kumalloc(s) malloc(s)
# define kuzalloc(s) zalloc(s)
# define kumm_malloc(s) malloc(s)
# define kumm_zalloc(s) zalloc(s)
# define kumm_realloc(p,s) realloc(p,s)
# define kumm_memalign(a,s) memalign(a,s)
# define kumm_free(p) free(p)
@ -106,8 +106,8 @@ extern "C"
* at the beginning of the user-space blob.
*/
# define kumalloc(s) umm_malloc(s)
# define kuzalloc(s) umm_zalloc(s)
# define kumm_malloc(s) umm_malloc(s)
# define kumm_zalloc(s) umm_zalloc(s)
# 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)

View File

@ -94,8 +94,8 @@
/* User-accessible allocations */
# define lib_umalloc(s) kumalloc(s)
# define lib_uzalloc(s) kuzalloc(s)
# define lib_umalloc(s) kumm_malloc(s)
# define lib_uzalloc(s) kumm_zalloc(s)
# define lib_urealloc(p,s) kumm_realloc(p,s)
# define lib_ufree(p) kumm_free(p)

View File

@ -76,8 +76,8 @@
/* User-accessible allocations */
# define lib_umalloc(s) kumalloc(s)
# define lib_uzalloc(s) kuzalloc(s)
# define lib_umalloc(s) kumm_malloc(s)
# define lib_uzalloc(s) kumm_zalloc(s)
# define lib_urealloc(p,s) kumm_realloc(p,s)
# define lib_ufree(p) kumm_free(p)

View File

@ -101,7 +101,7 @@ int env_dup(FAR struct task_group_s *group)
/* Yes..The parent task has an environment, duplicate it */
envlen = ptcb->group->tg_envsize;
envp = (FAR char *)kumalloc(envlen);
envp = (FAR char *)kumm_malloc(envlen);
if (!envp)
{
ret = -ENOMEM;

View File

@ -173,7 +173,7 @@ int setenv(FAR const char *name, FAR const char *value, int overwrite)
else
{
newsize = varlen;
newenvp = (FAR char *)kumalloc(varlen);
newenvp = (FAR char *)kumm_malloc(varlen);
if (!newenvp)
{
ret = ENOMEM;

View File

@ -199,7 +199,7 @@ int group_allocate(FAR struct task_tcb_s *tcb)
*/
group->tg_streamlist = (FAR struct streamlist *)
kuzalloc(sizeof(struct streamlist));
kumm_zalloc(sizeof(struct streamlist));
if (!group->tg_streamlist)
{