Rename kmalloc to kmm_malloc for consistency

This commit is contained in:
Gregory Nutt 2014-08-31 17:26:36 -06:00
parent 9023221f2b
commit 1780810d3d
111 changed files with 197 additions and 187 deletions

View file

@ -165,7 +165,7 @@ 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 *)kzalloc(stack_size);
#else
tcb->stack_alloc_ptr = (uint32_t *)kmalloc(stack_size);
tcb->stack_alloc_ptr = (uint32_t *)kmm_malloc(stack_size);
#endif
}
else

View file

@ -675,10 +675,10 @@ static int dm320_allocvideomemory(void)
{
#ifndef CONFIG_DM320_VID0_DISABLE
#ifndef CONFIG_DM320_DISABLE_PINGPONG
g_vid0base = (FAR void *)kmalloc(2 * DM320_VID0_FBLEN);
g_vid0base = (FAR void *)kmm_malloc(2 * DM320_VID0_FBLEN);
g_vid0ppbase = (FAR char*)g_vid0base + DM320_VID0_FBLEN;
#else
g_vid0base = (FAR void *)kmalloc(DM320_VID0_FBLEN);
g_vid0base = (FAR void *)kmm_malloc(DM320_VID0_FBLEN);
#endif
if (!g_vid0base)
{
@ -687,7 +687,7 @@ static int dm320_allocvideomemory(void)
#endif
#ifndef CONFIG_DM320_VID1_DISABLE
g_vid1base = (FAR void *)kmalloc(DM320_VID1_FBLEN);
g_vid1base = (FAR void *)kmm_malloc(DM320_VID1_FBLEN);
if (!g_vid1base)
{
goto errout;
@ -695,7 +695,7 @@ static int dm320_allocvideomemory(void)
#endif
#ifndef CONFIG_DM320_OSD0_DISABLE
g_osd0base = (FAR void *)kmalloc(DM320_OSD0_FBLEN);
g_osd0base = (FAR void *)kmm_malloc(DM320_OSD0_FBLEN);
if (!g_osd0base)
{
goto errout;
@ -703,7 +703,7 @@ static int dm320_allocvideomemory(void)
#endif
#ifndef CONFIG_DM320_OSD1_DISABLE
g_osd1base = (FAR void *)kmalloc(DM320_OSD1_FBLEN);
g_osd1base = (FAR void *)kmm_malloc(DM320_OSD1_FBLEN);
if (!g_osd1base)
{
goto errout;

View file

@ -1937,7 +1937,7 @@ static FAR struct usbdev_req_s *dm320_epallocreq(FAR struct usbdev_ep_s *ep)
#endif
usbtrace(TRACE_EPALLOCREQ, ((FAR struct dm320_ep_s *)ep)->epphy);
privreq = (FAR struct dm320_req_s *)kmalloc(sizeof(struct dm320_req_s));
privreq = (FAR struct dm320_req_s *)kmm_malloc(sizeof(struct dm320_req_s));
if (!privreq)
{
usbtrace(TRACE_DEVERROR(DM320_TRACEERR_ALLOCFAIL), 0);
@ -1988,7 +1988,7 @@ static void *dm320_epallocbuffer(FAR struct usbdev_ep_s *ep, unsigned bytes)
#ifdef CONFIG_USBDEV_DMAMEMORY
return usbdev_dma_alloc(bytes);
#else
return kmalloc(bytes);
return kmm_malloc(bytes);
#endif
}
#endif

View file

@ -2659,7 +2659,7 @@ static FAR struct usbdev_req_s *lpc17_epallocreq(FAR struct usbdev_ep_s *ep)
#endif
usbtrace(TRACE_EPALLOCREQ, ((FAR struct lpc17_ep_s *)ep)->epphy);
privreq = (FAR struct lpc17_req_s *)kmalloc(sizeof(struct lpc17_req_s));
privreq = (FAR struct lpc17_req_s *)kmm_malloc(sizeof(struct lpc17_req_s));
if (!privreq)
{
usbtrace(TRACE_DEVERROR(LPC17_TRACEERR_ALLOCFAIL), 0);
@ -2729,7 +2729,7 @@ static FAR void *lpc17_epallocbuffer(FAR struct usbdev_ep_s *ep, uint16_t nbytes
#else
usbtrace(TRACE_EPALLOCBUFFER, privep->epphy);
return kmalloc(bytes);
return kmm_malloc(bytes);
#endif
}

View file

@ -1949,7 +1949,7 @@ static int lpc17_epfree(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep)
* Some hardware supports special memory in which request and descriptor data 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 kmalloc.
* such "special" memory, this functions may simply map to kmm_malloc.
*
* This interface was optimized under a particular assumption. It was assumed
* that the driver maintains a pool of small, pre-allocated buffers for descriptor
@ -2039,7 +2039,7 @@ static int lpc17_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 kmalloc.
* such "special" memory, this functions may simply map to kmm_malloc.
*
* This interface differs from DRVR_ALLOC in that the buffers are variable-sized.
*

View file

@ -2623,7 +2623,7 @@ static FAR struct usbdev_req_s *lpc214x_epallocreq(FAR struct usbdev_ep_s *ep)
#endif
usbtrace(TRACE_EPALLOCREQ, ((FAR struct lpc214x_ep_s *)ep)->epphy);
privreq = (FAR struct lpc214x_req_s *)kmalloc(sizeof(struct lpc214x_req_s));
privreq = (FAR struct lpc214x_req_s *)kmm_malloc(sizeof(struct lpc214x_req_s));
if (!privreq)
{
usbtrace(TRACE_DEVERROR(LPC214X_TRACEERR_ALLOCFAIL), 0);
@ -2693,7 +2693,7 @@ static FAR void *lpc214x_epallocbuffer(FAR struct usbdev_ep_s *ep, uint16_t nbyt
#else
usbtrace(TRACE_EPALLOCBUFFER, privep->epphy);
return kmalloc(bytes);
return kmm_malloc(bytes);
#endif
}

View file

@ -3690,7 +3690,7 @@ static int lpc31_epfree(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep)
* Some hardware supports special memory in which request and descriptor data
* 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 kmalloc.
* not support such "special" memory, this functions may simply map to kmm_malloc.
*
* This interface was optimized under a particular assumption. It was
* assumed that the driver maintains a pool of small, pre-allocated buffers
@ -3723,7 +3723,7 @@ static int lpc31_alloc(FAR struct usbhost_driver_s *drvr,
/* There is no special requirements for transfer/descriptor buffers. */
*buffer = (FAR uint8_t *)kmalloc(CONFIG_LPC31_EHCI_BUFSIZE);
*buffer = (FAR uint8_t *)kmm_malloc(CONFIG_LPC31_EHCI_BUFSIZE);
if (*buffer)
{
*maxlen = CONFIG_LPC31_EHCI_BUFSIZE;

View file

@ -1950,7 +1950,7 @@ static FAR struct usbdev_req_s *lpc31_epallocreq(FAR struct usbdev_ep_s *ep)
#endif
usbtrace(TRACE_EPALLOCREQ, ((FAR struct lpc31_ep_s *)ep)->epphy);
privreq = (FAR struct lpc31_req_s *)kmalloc(sizeof(struct lpc31_req_s));
privreq = (FAR struct lpc31_req_s *)kmm_malloc(sizeof(struct lpc31_req_s));
if (!privreq)
{
usbtrace(TRACE_DEVERROR(LPC31_TRACEERR_ALLOCFAIL), 0);
@ -2001,7 +2001,7 @@ static void *lpc31_epallocbuffer(FAR struct usbdev_ep_s *ep, unsigned bytes)
#ifdef CONFIG_USBDEV_DMAMEMORY
return usbdev_dma_alloc(bytes);
#else
return kmalloc(bytes);
return kmm_malloc(bytes);
#endif
}
#endif

View file

@ -1193,7 +1193,7 @@ FAR struct mtd_dev_s *lpc43_spifi_initialize(void)
/* Allocate a buffer for the erase block cache */
priv->cache = (FAR uint8_t *)kmalloc(SPIFI_BLKSIZE);
priv->cache = (FAR uint8_t *)kmm_malloc(SPIFI_BLKSIZE);
if (!priv->cache)
{
/* Allocation failed! Discard all of that work we just did and return NULL */

View file

@ -1950,7 +1950,7 @@ static FAR struct usbdev_req_s *lpc43_epallocreq(FAR struct usbdev_ep_s *ep)
#endif
usbtrace(TRACE_EPALLOCREQ, ((FAR struct lpc43_ep_s *)ep)->epphy);
privreq = (FAR struct lpc43_req_s *)kmalloc(sizeof(struct lpc43_req_s));
privreq = (FAR struct lpc43_req_s *)kmm_malloc(sizeof(struct lpc43_req_s));
if (!privreq)
{
usbtrace(TRACE_DEVERROR(LPC43_TRACEERR_ALLOCFAIL), 0);
@ -2001,7 +2001,7 @@ static void *lpc43_epallocbuffer(FAR struct usbdev_ep_s *ep, unsigned bytes)
#ifdef CONFIG_USBDEV_DMAMEMORY
return usbdev_dma_alloc(bytes);
#else
return kmalloc(bytes);
return kmm_malloc(bytes);
#endif
}
#endif

View file

@ -2987,7 +2987,7 @@ static struct usbdev_req_s *sam_ep_allocreq(struct usbdev_ep_s *ep)
#endif
usbtrace(TRACE_EPALLOCREQ, USB_EPNO(ep->eplog));
privreq = (struct sam_req_s *)kmalloc(sizeof(struct sam_req_s));
privreq = (struct sam_req_s *)kmm_malloc(sizeof(struct sam_req_s));
if (!privreq)
{
usbtrace(TRACE_DEVERROR(SAM_TRACEERR_ALLOCFAIL), 0);

View file

@ -2598,7 +2598,7 @@ config SAMA5_UDPHS_PREALLOCATE
---help---
If this option is selected then DMA transfer descriptors will be
pre-allocated in .bss. Otherwise, the descriptors will be allocated
at start-up time with kmalloc(). This might be important if a larger
at start-up time with kmm_malloc(). This might be important if a larger
memory pool is available after startup.
config SAMA5_UDPHS_REGDEBUG

View file

@ -3530,7 +3530,7 @@ static int sam_epfree(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep)
* Some hardware supports special memory in which request and descriptor data
* 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 kmalloc.
* not support such "special" memory, this functions may simply map to kmm_malloc.
*
* This interface was optimized under a particular assumption. It was
* assumed that the driver maintains a pool of small, pre-allocated buffers
@ -3563,7 +3563,7 @@ static int sam_alloc(FAR struct usbhost_driver_s *drvr,
/* There is no special requirements for transfer/descriptor buffers. */
*buffer = (FAR uint8_t *)kmalloc(CONFIG_SAMA5_EHCI_BUFSIZE);
*buffer = (FAR uint8_t *)kmm_malloc(CONFIG_SAMA5_EHCI_BUFSIZE);
if (*buffer)
{
*maxlen = CONFIG_SAMA5_EHCI_BUFSIZE;

View file

@ -2589,7 +2589,7 @@ static int sam_epfree(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep)
* Some hardware supports special memory in which request and descriptor data 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 kmalloc.
* such "special" memory, this functions may simply map to kmm_malloc.
*
* This interface was optimized under a particular assumption. It was assumed
* that the driver maintains a pool of small, pre-allocated buffers for descriptor

View file

@ -3476,7 +3476,7 @@ static struct usbdev_req_s *sam_ep_allocreq(struct usbdev_ep_s *ep)
#endif
usbtrace(TRACE_EPALLOCREQ, USB_EPNO(ep->eplog));
privreq = (struct sam_req_s *)kmalloc(sizeof(struct sam_req_s));
privreq = (struct sam_req_s *)kmm_malloc(sizeof(struct sam_req_s));
if (!privreq)
{
usbtrace(TRACE_DEVERROR(SAM_TRACEERR_ALLOCFAIL), 0);

View file

@ -1922,7 +1922,7 @@ FAR struct i2c_dev_s *up_i2cinitialize(int port)
/* Allocate instance */
if (!(inst = kmalloc(sizeof(struct stm32_i2c_inst_s))))
if (!(inst = kmm_malloc(sizeof(struct stm32_i2c_inst_s))))
{
return NULL;
}

View file

@ -2450,7 +2450,7 @@ FAR struct i2c_dev_s *up_i2cinitialize(int port)
/* Allocate instance */
if (!(inst = kmalloc(sizeof(struct stm32_i2c_inst_s))))
if (!(inst = kmm_malloc(sizeof(struct stm32_i2c_inst_s))))
{
return NULL;
}

View file

@ -4237,7 +4237,7 @@ static FAR struct usbdev_req_s *stm32_ep_allocreq(FAR struct usbdev_ep_s *ep)
usbtrace(TRACE_EPALLOCREQ, ((FAR struct stm32_ep_s *)ep)->epphy);
privreq = (FAR struct stm32_req_s *)kmalloc(sizeof(struct stm32_req_s));
privreq = (FAR struct stm32_req_s *)kmm_malloc(sizeof(struct stm32_req_s));
if (!privreq)
{
usbtrace(TRACE_DEVERROR(STM32_TRACEERR_ALLOCFAIL), 0);
@ -4288,7 +4288,7 @@ static void *stm32_ep_allocbuffer(FAR struct usbdev_ep_s *ep, unsigned bytes)
#ifdef CONFIG_USBDEV_DMAMEMORY
return usbdev_dma_alloc(bytes);
#else
return kmalloc(bytes);
return kmm_malloc(bytes);
#endif
}
#endif

View file

@ -3480,7 +3480,7 @@ static int stm32_epfree(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep)
* Some hardware supports special memory in which request and descriptor data 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 kmalloc.
* such "special" memory, this functions may simply map to kmm_malloc.
*
* This interface was optimized under a particular assumption. It was assumed
* that the driver maintains a pool of small, pre-allocated buffers for descriptor
@ -3514,7 +3514,7 @@ static int stm32_alloc(FAR struct usbhost_driver_s *drvr,
/* There is no special memory requirement for the STM32. */
alloc = (FAR uint8_t *)kmalloc(CONFIG_STM32_OTGFS_DESCSIZE);
alloc = (FAR uint8_t *)kmm_malloc(CONFIG_STM32_OTGFS_DESCSIZE);
if (!alloc)
{
return -ENOMEM;
@ -3566,7 +3566,7 @@ static int stm32_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 kmalloc.
* such "special" memory, this functions may simply map to kmm_malloc.
*
* This interface differs from DRVR_ALLOC in that the buffers are variable-sized.
*
@ -3595,7 +3595,7 @@ static int stm32_ioalloc(FAR struct usbhost_driver_s *drvr,
/* There is no special memory requirement */
alloc = (FAR uint8_t *)kmalloc(buflen);
alloc = (FAR uint8_t *)kmm_malloc(buflen);
if (!alloc)
{
return -ENOMEM;

View file

@ -2977,7 +2977,7 @@ static struct usbdev_req_s *stm32_epallocreq(struct usbdev_ep_s *ep)
#endif
usbtrace(TRACE_EPALLOCREQ, USB_EPNO(ep->eplog));
privreq = (struct stm32_req_s *)kmalloc(sizeof(struct stm32_req_s));
privreq = (struct stm32_req_s *)kmm_malloc(sizeof(struct stm32_req_s));
if (!privreq)
{
usbtrace(TRACE_DEVERROR(STM32_TRACEERR_ALLOCFAIL), 0);

View file

@ -2013,7 +2013,7 @@ FAR struct i2c_dev_s *up_i2cinitialize(int port)
/* Allocate instance */
if (!(inst = kmalloc( sizeof(struct stm32_i2c_inst_s))))
if (!(inst = kmm_malloc( sizeof(struct stm32_i2c_inst_s))))
{
return NULL;
}

View file

@ -2287,7 +2287,7 @@ static FAR struct usbdev_req_s *avr_epallocreq(FAR struct usbdev_ep_s *ep)
#endif
usbtrace(TRACE_EPALLOCREQ, ((FAR struct avr_ep_s *)ep)->ep.eplog);
privreq = (FAR struct avr_req_s *)kmalloc(sizeof(struct avr_req_s));
privreq = (FAR struct avr_req_s *)kmm_malloc(sizeof(struct avr_req_s));
if (!privreq)
{
usbtrace(TRACE_DEVERROR(AVR_TRACEERR_ALLOCFAIL), 0);
@ -2339,7 +2339,7 @@ static void *avr_epallocbuffer(FAR struct usbdev_ep_s *ep, unsigned bytes)
#ifdef CONFIG_USBDEV_DMAMEMORY
return usbdev_dma_alloc(bytes);
#else
return kmalloc(bytes);
return kmm_malloc(bytes);
#endif
}
#endif

View file

@ -132,7 +132,7 @@ 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 *)kzalloc(stack_size);
#else
tcb->stack_alloc_ptr = (uint32_t *)kmalloc(stack_size);
tcb->stack_alloc_ptr = (uint32_t *)kmm_malloc(stack_size);
#endif
}
else

View file

@ -129,7 +129,7 @@ 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 *)kzalloc(stack_size);
#else
tcb->stack_alloc_ptr = (uint32_t *)kmalloc(stack_size);
tcb->stack_alloc_ptr = (uint32_t *)kmm_malloc(stack_size);
#endif
}
else

View file

@ -150,7 +150,7 @@ 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 *)kzalloc(stack_size);
#else
tcb->stack_alloc_ptr = (uint32_t *)kmalloc(stack_size);
tcb->stack_alloc_ptr = (uint32_t *)kmm_malloc(stack_size);
#endif
}
else

View file

@ -3324,7 +3324,7 @@ static struct usbdev_req_s *pic32mx_epallocreq(struct usbdev_ep_s *ep)
#endif
usbtrace(TRACE_EPALLOCREQ, USB_EPNO(ep->eplog));
privreq = (struct pic32mx_req_s *)kmalloc(sizeof(struct pic32mx_req_s));
privreq = (struct pic32mx_req_s *)kmm_malloc(sizeof(struct pic32mx_req_s));
if (!privreq)
{
usbtrace(TRACE_DEVERROR(PIC32MX_TRACEERR_ALLOCFAIL), 0);

View file

@ -102,7 +102,7 @@ int rtos_bridge_init(struct rgmp_bridge *b)
struct bridge *bridge;
char path[30] = {'/', 'd', 'e', 'v', '/'};
if ((bridge = kmalloc(sizeof(*bridge))) == NULL)
if ((bridge = kmm_malloc(sizeof(*bridge))) == NULL)
goto err0;
bridge->b = b;

View file

@ -130,7 +130,7 @@ int up_create_stack(struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
/* Use the kernel allocator if this is a kernel thread */
if (ttype == TCB_FLAG_TTYPE_KERNEL) {
stack_alloc_ptr = (uint32_t *)kmalloc(stack_size);
stack_alloc_ptr = (uint32_t *)kmm_malloc(stack_size);
} else
#endif
{

View file

@ -80,7 +80,7 @@ void rtos_free_page(void *page)
void *rtos_kmalloc(int size)
{
return kmalloc(size);
return kmm_malloc(size);
}
void rtos_kfree(void *addr)
@ -130,7 +130,7 @@ void rtos_timer_isr(void *data)
*/
int rtos_sem_init(struct semaphore *sem, int val)
{
if ((sem->sem = kmalloc(sizeof(sem_t))) == NULL)
if ((sem->sem = kmm_malloc(sizeof(sem_t))) == NULL)
return -1;
return sem_init(sem->sem, 0, val);
}

View file

@ -129,7 +129,7 @@ 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 *)kzalloc(stack_size);
#else
tcb->stack_alloc_ptr = (uint32_t *)kmalloc(stack_size);
tcb->stack_alloc_ptr = (uint32_t *)kmm_malloc(stack_size);
#endif
}
else

View file

@ -131,7 +131,7 @@ 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 *)kzalloc(stack_size);
#else
tcb->stack_alloc_ptr = (uint32_t *)kmalloc(stack_size);
tcb->stack_alloc_ptr = (uint32_t *)kmm_malloc(stack_size);
#endif
}
else

View file

@ -129,7 +129,7 @@ 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 *)kzalloc(stack_size);
#else
tcb->stack_alloc_ptr = (uint32_t *)kmalloc(stack_size);
tcb->stack_alloc_ptr = (uint32_t *)kmm_malloc(stack_size);
#endif
}
else

View file

@ -920,7 +920,7 @@ FAR struct i2c_dev_s *up_i2cinitialize(int port)
/* Now, allocate an I2C instance for this caller */
i2c = (FAR struct ez80_i2cdev_s *)kmalloc(sizeof(FAR struct ez80_i2cdev_s));
i2c = (FAR struct ez80_i2cdev_s *)kmm_malloc(sizeof(FAR struct ez80_i2cdev_s));
if (i2c)
{
/* Initialize the allocated instance */

View file

@ -593,7 +593,7 @@ FAR struct i2c_dev_s *up_i2cinitialize(int port)
/* Now, allocate an I2C instance for this caller */
i2c = (FAR struct z8_i2cdev_s *)kmalloc(sizeof(FAR struct z8_i2cdev_s));
i2c = (FAR struct z8_i2cdev_s *)kmm_malloc(sizeof(FAR struct z8_i2cdev_s));
if (i2c)
{
/* Initialize the allocated instance */

View file

@ -124,7 +124,7 @@ EXEPATH_HANDLE exepath_init(void)
/* Allocate a container for the PATH variable contents */
exepath = (FAR struct exepath_s *)kmalloc(SIZEOF_EXEPATH_S(strlen(path) + 1));
exepath = (FAR struct exepath_s *)kmm_malloc(SIZEOF_EXEPATH_S(strlen(path) + 1));
if (!exepath)
{
/* Ooops.. we are out of memory */
@ -230,7 +230,7 @@ FAR char *exepath_next(EXEPATH_HANDLE handle, FAR const char *relpath)
}
pathlen = strlen(path) + strlen(relpath) + 2;
fullpath = (FAR char *)kmalloc(pathlen);
fullpath = (FAR char *)kmm_malloc(pathlen);
if (!fullpath)
{
/* Failed to allocate memory */

View file

@ -73,7 +73,7 @@ FAR struct binary_s *g_unloadhead;
*
* Description:
* If CONFIG_SCHED_HAVE_PARENT is defined then schedul_unload() will
* manage instances of struct binary_s allocated with kmalloc. It
* manage instances of struct binary_s allocated with kmm_malloc. It
* will keep the binary data in a link list and when SIGCHLD is received
* (meaning that the task has exit'ed, schedul_unload() will find the
* data, unload the module, and free the structure.
@ -82,7 +82,7 @@ FAR struct binary_s *g_unloadhead;
*
* Input Parameter:
* pid - The task ID of the child task
* bin - This structure must have been allocated with kmalloc() and must
* bin - This structure must have been allocated with kmm_malloc() and must
* persist until the task unloads
*
@ -116,7 +116,7 @@ static void unload_list_add(pid_t pid, FAR struct binary_s *bin)
*
* Description:
* If CONFIG_SCHED_HAVE_PARENT is defined then schedul_unload() will
* manage instances of struct binary_s allocated with kmalloc. It
* manage instances of struct binary_s allocated with kmm_malloc. It
* will keep the binary data in a link list and when SIGCHLD is received
* (meaning that the task has exit'ed, schedul_unload() will find the
* data, unload the module, and free the structure.
@ -187,7 +187,7 @@ static FAR struct binary_s *unload_list_remove(pid_t pid)
* Description:
* If CONFIG_SCHED_HAVE_PARENT is defined, this function may be called to
* automatically unload the module when task exits. It assumes that
* bin was allocated with kmalloc() or friends and will also automatically
* bin was allocated with kmm_malloc() or friends and will also automatically
* free the structure with kmm_free() when the task exists.
*
* Input Parameter:
@ -245,13 +245,13 @@ static void unload_callback(int signo, siginfo_t *info, void *ucontext)
* If CONFIG_SCHED_HAVE_PARENT is defined, this function may be called by
* the parent of the newly created task to automatically unload the
* module when the task exits. This assumes that (1) the caller is the
* parent of the created task, (2) that bin was allocated with kmalloc()
* parent of the created task, (2) that bin was allocated with kmm_malloc()
* or friends. It will also automatically free the structure with kmm_free()
* after unloading the module.
*
* Input Parameter:
* pid - The task ID of the child task
* bin - This structure must have been allocated with kmalloc() and must
* bin - This structure must have been allocated with kmm_malloc() and must
* persist until the task unloads
*
* Returned Value:

View file

@ -84,7 +84,7 @@ int elf_allocbuffer(FAR struct elf_loadinfo_s *loadinfo)
{
/* No.. allocate one now */
loadinfo->iobuffer = (FAR uint8_t *)kmalloc(CONFIG_ELF_BUFFERSIZE);
loadinfo->iobuffer = (FAR uint8_t *)kmm_malloc(CONFIG_ELF_BUFFERSIZE);
if (!loadinfo->iobuffer)
{
bdbg("Failed to allocate an I/O buffer\n");

View file

@ -211,7 +211,7 @@ int elf_loadshdrs(FAR struct elf_loadinfo_s *loadinfo)
/* Allocate memory to hold a working copy of the sector header table */
loadinfo->shdr = (FAR Elf32_Shdr*)kmalloc(shdrsize);
loadinfo->shdr = (FAR Elf32_Shdr*)kmm_malloc(shdrsize);
if (!loadinfo->shdr)
{
bdbg("Failed to allocate the section header table. Size: %ld\n", (long)shdrsize);

View file

@ -95,7 +95,7 @@ int nxflat_addrenv_alloc(FAR struct nxflat_loadinfo_s *loadinfo, size_t envsize)
/* Allocate the struct dspace_s container for the D-Space allocation */
dspace = (FAR struct dspace_s *)kmalloc(sizeof(struct dspace_s));
dspace = (FAR struct dspace_s *)kmm_malloc(sizeof(struct dspace_s));
if (dspace == 0)
{
bdbg("ERROR: Failed to allocate DSpace\n");

View file

@ -89,7 +89,7 @@ int usbmsc_archinitialize(void)
uint8_t *pbuffer;
int ret;
pbuffer = (uint8_t *)kmalloc(BUFFER_SIZE);
pbuffer = (uint8_t *)kmm_malloc(BUFFER_SIZE);
if (!pbuffer)
{
lowsyslog("usbmsc_archinitialize: Failed to allocate ramdisk of size %d\n",

View file

@ -89,7 +89,7 @@ int usbmsc_archinitialize(void)
uint8_t *pbuffer;
int ret;
pbuffer = (uint8_t *)kmalloc(BUFFER_SIZE);
pbuffer = (uint8_t *)kmm_malloc(BUFFER_SIZE);
if (!pbuffer)
{
lowsyslog("usbmsc_archinitialize: Failed to allocate ramdisk of size %d\n",

View file

@ -291,7 +291,7 @@ int nsh_archinitialize(void)
#if defined(CONFIG_RAMMTD) && defined(CONFIG_MIKROE_RAMMTD)
{
uint8_t *start = (uint8_t *) kmalloc(CONFIG_MIKROE_RAMMTD_SIZE * 1024);
uint8_t *start = (uint8_t *) kmm_malloc(CONFIG_MIKROE_RAMMTD_SIZE * 1024);
mtd = rammtd_initialize(start, CONFIG_MIKROE_RAMMTD_SIZE * 1024);
mtd->ioctl(mtd, MTDIOC_BULKERASE, 0);

View file

@ -1529,10 +1529,10 @@ int arch_tcinitialize(int minor)
#ifndef CONFIG_TOUCHSCREEN_MULTIPLE
priv = &g_touchscreen;
#else
priv = (FAR struct tc_dev_s *)kmalloc(sizeof(struct tc_dev_s));
priv = (FAR struct tc_dev_s *)kmm_malloc(sizeof(struct tc_dev_s));
if (!priv)
{
idbg("kmalloc(%d) failed\n", sizeof(struct tc_dev_s));
idbg("kmm_malloc(%d) failed\n", sizeof(struct tc_dev_s));
return -ENOMEM;
}
#endif

View file

@ -1386,10 +1386,10 @@ int arch_tcinitialize(int minor)
#ifndef CONFIG_TOUCHSCREEN_MULTIPLE
priv = &g_touchscreen;
#else
priv = (FAR struct tc_dev_s *)kmalloc(sizeof(struct tc_dev_s));
priv = (FAR struct tc_dev_s *)kmm_malloc(sizeof(struct tc_dev_s));
if (!priv)
{
idbg("kmalloc(%d) failed\n", sizeof(struct tc_dev_s));
idbg("kmm_malloc(%d) failed\n", sizeof(struct tc_dev_s));
return -ENOMEM;
}
#endif

View file

@ -293,7 +293,7 @@ int nsh_archinitialize(void)
#if defined(CONFIG_RAMMTD) && defined(CONFIG_STM32F429I_DISCO_RAMMTD)
{
uint8_t *start = (uint8_t *) kmalloc(CONFIG_STM32F429I_DISCO_RAMMTD_SIZE * 1024);
uint8_t *start = (uint8_t *) kmm_malloc(CONFIG_STM32F429I_DISCO_RAMMTD_SIZE * 1024);
mtd = rammtd_initialize(start, CONFIG_STM32F429I_DISCO_RAMMTD_SIZE * 1024);
mtd->ioctl(mtd, MTDIOC_BULKERASE, 0);

View file

@ -1825,7 +1825,7 @@ struct audio_lowerhalf_s *vs1053_initialize(FAR struct spi_dev_s *spi,
/* Allocate a VS1053 device structure */
dev = (struct vs1053_struct_s *)kmalloc(sizeof(struct vs1053_struct_s));
dev = (struct vs1053_struct_s *)kmm_malloc(sizeof(struct vs1053_struct_s));
if (dev)
{
/* Initialize the VS1053 device structure */

View file

@ -142,7 +142,7 @@ int bchlib_setup(const char *blkdev, bool readonly, FAR void **handle)
/* Allocate the sector I/O buffer */
bch->buffer = (FAR uint8_t *)kmalloc(bch->sectsize);
bch->buffer = (FAR uint8_t *)kmm_malloc(bch->sectsize);
if (!bch->buffer)
{
fdbg("Failed to allocate sector buffer\n");

View file

@ -1212,10 +1212,10 @@ int ads7843e_register(FAR struct spi_dev_s *spi,
#ifndef CONFIG_ADS7843E_MULTIPLE
priv = &g_ads7843e;
#else
priv = (FAR struct ads7843e_dev_s *)kmalloc(sizeof(struct ads7843e_dev_s));
priv = (FAR struct ads7843e_dev_s *)kmm_malloc(sizeof(struct ads7843e_dev_s));
if (!priv)
{
idbg("kmalloc(%d) failed\n", sizeof(struct ads7843e_dev_s));
idbg("kmm_malloc(%d) failed\n", sizeof(struct ads7843e_dev_s));
return -ENOMEM;
}
#endif

View file

@ -1193,10 +1193,10 @@ int max11802_register(FAR struct spi_dev_s *spi,
#ifndef CONFIG_MAX11802_MULTIPLE
priv = &g_max11802;
#else
priv = (FAR struct max11802_dev_s *)kmalloc(sizeof(struct max11802_dev_s));
priv = (FAR struct max11802_dev_s *)kmm_malloc(sizeof(struct max11802_dev_s));
if (!priv)
{
idbg("kmalloc(%d) failed\n", sizeof(struct max11802_dev_s));
idbg("kmm_malloc(%d) failed\n", sizeof(struct max11802_dev_s));
return -ENOMEM;
}
#endif

View file

@ -1234,10 +1234,10 @@ int tsc2007_register(FAR struct i2c_dev_s *dev,
#ifndef CONFIG_TSC2007_MULTIPLE
priv = &g_tsc2007;
#else
priv = (FAR struct tsc2007_dev_s *)kmalloc(sizeof(struct tsc2007_dev_s));
priv = (FAR struct tsc2007_dev_s *)kmm_malloc(sizeof(struct tsc2007_dev_s));
if (!priv)
{
idbg("kmalloc(%d) failed\n", sizeof(struct tsc2007_dev_s));
idbg("kmm_malloc(%d) failed\n", sizeof(struct tsc2007_dev_s));
return -ENOMEM;
}
#endif

View file

@ -3231,7 +3231,7 @@ int mmcsd_slotinitialize(int minor, FAR struct sdio_dev_s *dev)
/* Allocate a MMC/SD state structure */
priv = (FAR struct mmcsd_state_s *)kmalloc(sizeof(struct mmcsd_state_s));
priv = (FAR struct mmcsd_state_s *)kmm_malloc(sizeof(struct mmcsd_state_s));
if (priv)
{
/* Initialize the MMC/SD state structure */

View file

@ -523,7 +523,7 @@ int ftl_initialize(int minor, FAR struct mtd_dev_s *mtd)
/* Allocate a FTL device structure */
dev = (struct ftl_struct_s *)kmalloc(sizeof(struct ftl_struct_s));
dev = (struct ftl_struct_s *)kmm_malloc(sizeof(struct ftl_struct_s));
if (dev)
{
/* Initialize the FTL device structure */
@ -546,7 +546,7 @@ int ftl_initialize(int minor, FAR struct mtd_dev_s *mtd)
/* Allocate one, in-memory erase block buffer */
#ifdef CONFIG_FS_WRITABLE
dev->eblock = (FAR uint8_t *)kmalloc(dev->geo.erasesize);
dev->eblock = (FAR uint8_t *)kmm_malloc(dev->geo.erasesize);
if (!dev->eblock)
{
fdbg("Failed to allocate an erase block buffer\n");

View file

@ -561,7 +561,7 @@ static off_t mtdconfig_ramconsolidate(FAR struct mtdconfig_struct_s *dev)
/* Allocate a consolidation buffer */
pBuf = (uint8_t *)kmalloc(dev->erasesize);
pBuf = (uint8_t *)kmm_malloc(dev->erasesize);
if (pBuf == NULL)
{
/* Unable to allocate buffer, can't consolidate! */
@ -730,7 +730,7 @@ static off_t mtdconfig_consolidate(FAR struct mtdconfig_struct_s *dev)
/* Allocate a small buffer for moving data */
pBuf = (uint8_t *)kmalloc(dev->blocksize);
pBuf = (uint8_t *)kmm_malloc(dev->blocksize);
if (pBuf == NULL)
{
return 0;
@ -1036,7 +1036,7 @@ static int mtdconfig_setconfig(FAR struct mtdconfig_struct_s *dev,
/* Allocate a temp block buffer */
dev->buffer = (FAR uint8_t *) kmalloc(dev->blocksize);
dev->buffer = (FAR uint8_t *) kmm_malloc(dev->blocksize);
/* Read and vaidate the signature bytes */
@ -1220,7 +1220,7 @@ static int mtdconfig_getconfig(FAR struct mtdconfig_struct_s *dev,
/* Allocate a temp block buffer */
dev->buffer = (FAR uint8_t *)kmalloc(dev->blocksize);
dev->buffer = (FAR uint8_t *)kmm_malloc(dev->blocksize);
if (dev->buffer == NULL)
{
return -ENOMEM;
@ -1339,7 +1339,7 @@ int mtdconfig_register(FAR struct mtd_dev_s *mtd)
struct mtdconfig_struct_s *dev;
struct mtd_geometry_s geo; /* Device geometry */
dev = (struct mtdconfig_struct_s *)kmalloc(sizeof(struct mtdconfig_struct_s));
dev = (struct mtdconfig_struct_s *)kmm_malloc(sizeof(struct mtdconfig_struct_s));
if (dev)
{
/* Initialize the mtdconfig device structure */

View file

@ -624,7 +624,7 @@ FAR struct mtd_dev_s *s512_initialize(FAR struct mtd_dev_s *mtd)
/* Allocate a buffer for the erase block cache */
priv->eblock = (FAR uint8_t *)kmalloc(priv->eblocksize);
priv->eblock = (FAR uint8_t *)kmm_malloc(priv->eblocksize);
if (!priv->eblock)
{
/* Allocation failed! Discard all of that work we just did and return NULL */

View file

@ -517,7 +517,7 @@ static int smart_setsectorsize(struct smart_struct_s *dev, uint16_t size)
totalsectors = dev->neraseblocks * dev->sectorsPerBlk;
dev->totalsectors = (uint16_t) totalsectors;
dev->sMap = (uint16_t *) kmalloc(totalsectors * sizeof(uint16_t) +
dev->sMap = (uint16_t *) kmm_malloc(totalsectors * sizeof(uint16_t) +
(dev->neraseblocks << 1));
if (!dev->sMap)
{
@ -531,7 +531,7 @@ static int smart_setsectorsize(struct smart_struct_s *dev, uint16_t size)
/* Allocate a read/write buffer */
dev->rwbuffer = (char *) kmalloc(size);
dev->rwbuffer = (char *) kmm_malloc(size);
if (!dev->rwbuffer)
{
fdbg("Error allocating SMART read/write buffer\n");
@ -823,7 +823,7 @@ static int smart_scan(struct smart_struct_s *dev)
* the SMART device structure and the root directory number.
*/
rootdirdev = (struct smart_multiroot_device_s*) kmalloc(sizeof(*rootdirdev));
rootdirdev = (struct smart_multiroot_device_s*) kmm_malloc(sizeof(*rootdirdev));
if (rootdirdev == NULL)
{
fdbg("Memory alloc failed\n");
@ -2113,7 +2113,7 @@ int smart_initialize(int minor, FAR struct mtd_dev_s *mtd, const char *partname)
/* Allocate a SMART device structure */
dev = (struct smart_struct_s *)kmalloc(sizeof(struct smart_struct_s));
dev = (struct smart_struct_s *)kmm_malloc(sizeof(struct smart_struct_s));
if (dev)
{
/* Initialize the SMART device structure */
@ -2192,7 +2192,7 @@ int smart_initialize(int minor, FAR struct mtd_dev_s *mtd, const char *partname)
* the SMART device structure and the root directory number.
*/
rootdirdev = (struct smart_multiroot_device_s*) kmalloc(sizeof(*rootdirdev));
rootdirdev = (struct smart_multiroot_device_s*) kmm_malloc(sizeof(*rootdirdev));
if (rootdirdev == NULL)
{
fdbg("register_blockdriver failed: %d\n", -ret);

View file

@ -1243,7 +1243,7 @@ FAR struct mtd_dev_s *sst25_initialize(FAR struct spi_dev_s *dev)
#ifdef CONFIG_SST25_SECTOR512 /* Simulate a 512 byte sector */
/* Allocate a buffer for the erase block cache */
priv->sector = (FAR uint8_t *)kmalloc(1 << priv->sectorshift);
priv->sector = (FAR uint8_t *)kmm_malloc(1 << priv->sectorshift);
if (!priv->sector)
{
/* Allocation failed! Discard all of that work we just did and return NULL */

View file

@ -1175,7 +1175,7 @@ FAR struct mtd_dev_s *w25_initialize(FAR struct spi_dev_s *spi)
#ifdef CONFIG_W25_SECTOR512 /* Simulate a 512 byte sector */
/* Allocate a buffer for the erase block cache */
priv->sector = (FAR uint8_t *)kmalloc(W25_SECTOR_SIZE);
priv->sector = (FAR uint8_t *)kmm_malloc(W25_SECTOR_SIZE);
if (!priv->sector)
{
/* Allocation failed! Discard all of that work we just did and return NULL */

View file

@ -186,7 +186,7 @@ struct slip_driver_s
****************************************************************************/
/* We really should get rid of CONFIG_SLIP_NINTERFACES and, instead,
* kmalloc() new interface instances as needed.
* kmm_malloc() new interface instances as needed.
*/
static struct slip_driver_s g_slip[CONFIG_SLIP_NINTERFACES];

View file

@ -151,7 +151,7 @@ FAR struct pipe_dev_s *pipecommon_allocdev(void)
/* Allocate a private structure to manage the pipe */
dev = (struct pipe_dev_s *)kmalloc(sizeof(struct pipe_dev_s));
dev = (struct pipe_dev_s *)kmm_malloc(sizeof(struct pipe_dev_s));
if (dev)
{
/* Initialize the private structure */
@ -212,7 +212,7 @@ int pipecommon_open(FAR struct file *filep)
if (dev->d_refs == 0)
{
dev->d_buffer = (uint8_t*)kmalloc(CONFIG_DEV_PIPE_SIZE);
dev->d_buffer = (uint8_t*)kmm_malloc(CONFIG_DEV_PIPE_SIZE);
if (!dev->d_buffer)
{
(void)sem_post(&dev->d_bfsem);

View file

@ -313,7 +313,7 @@ int romdisk_register(int minor, uint8_t *buffer, uint32_t nsectors,
/* Allocate a ramdisk device structure */
dev = (struct rd_struct_s *)kmalloc(sizeof(struct rd_struct_s));
dev = (struct rd_struct_s *)kmm_malloc(sizeof(struct rd_struct_s));
if (dev)
{
/* Initialize the ramdisk device structure */

View file

@ -654,10 +654,10 @@ int rwb_initialize(FAR struct rwbuffer_s *rwb)
if (rwb->wrmaxblocks > 0)
{
allocsize = rwb->wrmaxblocks * rwb->blocksize;
rwb->wrbuffer = kmalloc(allocsize);
rwb->wrbuffer = kmm_malloc(allocsize);
if (!rwb->wrbuffer)
{
fdbg("Write buffer kmalloc(%d) failed\n", allocsize);
fdbg("Write buffer kmm_malloc(%d) failed\n", allocsize);
return -ENOMEM;
}
}
@ -685,10 +685,10 @@ int rwb_initialize(FAR struct rwbuffer_s *rwb)
if (rwb->rhmaxblocks > 0)
{
allocsize = rwb->rhmaxblocks * rwb->blocksize;
rwb->rhbuffer = kmalloc(allocsize);
rwb->rhbuffer = kmm_malloc(allocsize);
if (!rwb->rhbuffer)
{
fdbg("Read-ahead buffer kmalloc(%d) failed\n", allocsize);
fdbg("Read-ahead buffer kmm_malloc(%d) failed\n", allocsize);
return -ENOMEM;
}
}

View file

@ -223,7 +223,7 @@ FAR struct lis331dl_dev_s *lis331dl_init(FAR struct i2c_dev_s *i2c,
ASSERT(i2c);
ASSERT(address);
dev = kmalloc(sizeof(struct lis331dl_dev_s));
dev = kmm_malloc(sizeof(struct lis331dl_dev_s));
if (dev == NULL)
{
errno = ENOMEM;

View file

@ -514,7 +514,7 @@ int lm75_register(FAR const char *devpath, FAR struct i2c_dev_s *i2c, uint8_t ad
/* Initialize the LM-75 device structure */
priv = (FAR struct lm75_dev_s *)kmalloc(sizeof(struct lm75_dev_s));
priv = (FAR struct lm75_dev_s *)kmm_malloc(sizeof(struct lm75_dev_s));
if (!priv)
{
lm75dbg("Failed to allocate instance\n");

View file

@ -968,9 +968,9 @@ static int cdcacm_bind(FAR struct usbdevclass_driver_s *driver,
/* Pre-allocate all endpoints... the endpoints will not be functional
* until the SET CONFIGURATION request is processed in cdcacm_setconfig.
* This is done here because there may be calls to kmalloc and the SET
* This is done here because there may be calls to kmm_malloc and the SET
* CONFIGURATION processing probably occurrs within interrupt handling
* logic where kmalloc calls will fail.
* logic where kmm_malloc calls will fail.
*/
/* Pre-allocate the IN interrupt endpoint */
@ -2231,7 +2231,7 @@ int cdcacm_classobject(int minor, FAR struct usbdevclass_driver_s **classdev)
/* Allocate the structures needed */
alloc = (FAR struct cdcacm_alloc_s*)kmalloc(sizeof(struct cdcacm_alloc_s));
alloc = (FAR struct cdcacm_alloc_s*)kmm_malloc(sizeof(struct cdcacm_alloc_s));
if (!alloc)
{
usbtrace(TRACE_CLSERROR(USBSER_TRACEERR_ALLOCDEVSTRUCT), 0);

View file

@ -797,7 +797,7 @@ FAR void *composite_initialize(void)
/* Allocate the structures needed */
alloc = (FAR struct composite_alloc_s*)kmalloc(sizeof(struct composite_alloc_s));
alloc = (FAR struct composite_alloc_s*)kmm_malloc(sizeof(struct composite_alloc_s));
if (!alloc)
{
usbtrace(TRACE_CLSERROR(USBCOMPOSITE_TRACEERR_ALLOCDEVSTRUCT), 0);

View file

@ -1348,9 +1348,9 @@ static int usbclass_bind(FAR struct usbdevclass_driver_s *driver,
/* Pre-allocate all endpoints... the endpoints will not be functional
* until the SET CONFIGURATION request is processed in usbclass_setconfig.
* This is done here because there may be calls to kmalloc and the SET
* This is done here because there may be calls to kmm_malloc and the SET
* CONFIGURATION processing probably occurrs within interrupt handling
* logic where kmalloc calls will fail.
* logic where kmm_malloc calls will fail.
*/
/* Pre-allocate the IN interrupt endpoint */
@ -2284,7 +2284,7 @@ int usbdev_serialinitialize(int minor)
/* Allocate the structures needed */
alloc = (FAR struct pl2303_alloc_s*)kmalloc(sizeof(struct pl2303_alloc_s));
alloc = (FAR struct pl2303_alloc_s*)kmm_malloc(sizeof(struct pl2303_alloc_s));
if (!alloc)
{
usbtrace(TRACE_CLSERROR(USBSER_TRACEERR_ALLOCDEVSTRUCT), 0);

View file

@ -298,9 +298,9 @@ static int usbmsc_bind(FAR struct usbdevclass_driver_s *driver,
/* Pre-allocate all endpoints... the endpoints will not be functional
* until the SET CONFIGURATION request is processed in usbmsc_setconfig.
* This is done here because there may be calls to kmalloc and the SET
* This is done here because there may be calls to kmm_malloc and the SET
* CONFIGURATION processing probably occurrs within interrupt handling
* logic where kmalloc calls will fail.
* logic where kmm_malloc calls will fail.
*/
/* Pre-allocate the IN bulk endpoint */
@ -1326,7 +1326,7 @@ int usbmsc_configure(unsigned int nluns, void **handle)
/* Allocate the structures needed */
alloc = (FAR struct usbmsc_alloc_s*)kmalloc(sizeof(struct usbmsc_alloc_s));
alloc = (FAR struct usbmsc_alloc_s*)kmm_malloc(sizeof(struct usbmsc_alloc_s));
if (!alloc)
{
usbtrace(TRACE_CLSERROR(USBMSC_TRACEERR_ALLOCDEVSTRUCT), 0);
@ -1347,7 +1347,7 @@ int usbmsc_configure(unsigned int nluns, void **handle)
/* Allocate the LUN table */
priv->luntab = (struct usbmsc_lun_s*)kmalloc(priv->nluns*sizeof(struct usbmsc_lun_s));
priv->luntab = (struct usbmsc_lun_s*)kmm_malloc(priv->nluns*sizeof(struct usbmsc_lun_s));
if (!priv->luntab)
{
ret = -ENOMEM;
@ -1489,7 +1489,7 @@ int usbmsc_bindlun(FAR void *handle, FAR const char *drvrpath,
if (!priv->iobuffer)
{
priv->iobuffer = (uint8_t*)kmalloc(geo.geo_sectorsize);
priv->iobuffer = (uint8_t*)kmm_malloc(geo.geo_sectorsize);
if (!priv->iobuffer)
{
usbtrace(TRACE_CLSERROR(USBMSC_TRACEERR_ALLOCIOBUFFER), geo.geo_sectorsize);

View file

@ -196,7 +196,7 @@ int usbhost_devaddr_create(FAR struct usbhost_devaddr_s *hcd,
/* Allocate a hash table entry */
hentry = (FAR struct usbhost_devhash_s *)kmalloc(sizeof(struct usbhost_devhash_s));
hentry = (FAR struct usbhost_devhash_s *)kmm_malloc(sizeof(struct usbhost_devhash_s));
if (!hentry)
{
udbg("ERROR: Failed to allocate a hash table entry\n");

View file

@ -664,7 +664,7 @@ static inline FAR struct usbhost_state_s *usbhost_allocclass(void)
FAR struct usbhost_state_s *priv;
DEBUGASSERT(!up_interrupt_context());
priv = (FAR struct usbhost_state_s *)kmalloc(sizeof(struct usbhost_state_s));
priv = (FAR struct usbhost_state_s *)kmm_malloc(sizeof(struct usbhost_state_s));
uvdbg("Allocated: %p\n", priv);;
return priv;
}

View file

@ -519,7 +519,7 @@ static inline FAR struct usbhost_state_s *usbhost_allocclass(void)
FAR struct usbhost_state_s *priv;
DEBUGASSERT(!up_interrupt_context());
priv = (FAR struct usbhost_state_s *)kmalloc(sizeof(struct usbhost_state_s));
priv = (FAR struct usbhost_state_s *)kmm_malloc(sizeof(struct usbhost_state_s));
uvdbg("Allocated: %p\n", priv);;
return priv;
}

View file

@ -253,7 +253,7 @@ static inline FAR struct usbhost_state_s *usbhost_allocclass(void)
FAR struct usbhost_state_s *priv;
DEBUGASSERT(!up_interrupt_context());
priv = (FAR struct usbhost_state_s *)kmalloc(sizeof(struct usbhost_state_s));
priv = (FAR struct usbhost_state_s *)kmm_malloc(sizeof(struct usbhost_state_s));
uvdbg("Allocated: %p\n", priv);;
return priv;
}

View file

@ -74,7 +74,7 @@
#endif
/* If the create() method is called by the USB host device driver from an
* interrupt handler, then it will be unable to call kmalloc() in order to
* interrupt handler, then it will be unable to call kmm_malloc() in order to
* allocate a new class instance. If the create() method is called from the
* interrupt level, then class instances must be pre-allocated.
*/
@ -388,11 +388,11 @@ static inline FAR struct usbhost_state_s *usbhost_allocclass(void)
FAR struct usbhost_state_s *priv;
/* We are not executing from an interrupt handler so we can just call
* kmalloc() to get memory for the class instance.
* kmm_malloc() to get memory for the class instance.
*/
DEBUGASSERT(!up_interrupt_context());
priv = (FAR struct usbhost_state_s *)kmalloc(sizeof(struct usbhost_state_s));
priv = (FAR struct usbhost_state_s *)kmm_malloc(sizeof(struct usbhost_state_s));
uvdbg("Allocated: %p\n", priv);;
return priv;
}

View file

@ -502,7 +502,7 @@ struct cc1101_dev_s * cc1101_init(struct spi_dev_s * spi, uint8_t isrpin,
ASSERT(spi);
if ((dev = kmalloc(sizeof(struct cc1101_dev_s))) == NULL)
if ((dev = kmm_malloc(sizeof(struct cc1101_dev_s))) == NULL)
{
errno = ENOMEM;
return NULL;

View file

@ -894,7 +894,7 @@ static int cc3000_open(FAR struct file *filep)
/* Do late allocation with hopes of realloc not fragmenting */
priv->rx_buffer.pbuffer = kmalloc(priv->rx_buffer_max_len);
priv->rx_buffer.pbuffer = kmm_malloc(priv->rx_buffer_max_len);
DEBUGASSERT(priv->rx_buffer.pbuffer);
if (!priv->rx_buffer.pbuffer)
{
@ -1501,10 +1501,10 @@ int cc3000_register(FAR struct spi_dev_s *spi,
#ifndef CONFIG_CC3000_MULTIPLE
priv = &g_cc3000;
#else
priv = (FAR struct cc3000_dev_s *)kmalloc(sizeof(struct cc3000_dev_s));
priv = (FAR struct cc3000_dev_s *)kmm_malloc(sizeof(struct cc3000_dev_s));
if (!priv)
{
ndbg("kmalloc(%d) failed\n", sizeof(struct cc3000_dev_s));
ndbg("kmm_malloc(%d) failed\n", sizeof(struct cc3000_dev_s));
return -ENOMEM;
}
#endif

View file

@ -1220,7 +1220,7 @@ int nrf24l01_register(FAR struct spi_dev_s *spi, FAR struct nrf24l01_config_s *c
ASSERT((spi != NULL) & (cfg != NULL));
if ((dev = kmalloc(sizeof(struct nrf24l01_dev_s))) == NULL)
if ((dev = kmm_malloc(sizeof(struct nrf24l01_dev_s))) == NULL)
{
return -ENOMEM;
}
@ -1242,7 +1242,7 @@ int nrf24l01_register(FAR struct spi_dev_s *spi, FAR struct nrf24l01_config_s *c
sem_init(&(dev->sem_tx), 0, 0);
#ifdef CONFIG_WL_NRF24L01_RXSUPPORT
if ((rx_fifo = kmalloc(CONFIG_WL_NRF24L01_RXFIFO_LEN)) == NULL)
if ((rx_fifo = kmm_malloc(CONFIG_WL_NRF24L01_RXFIFO_LEN)) == NULL)
{
kmm_free(dev);
return -ENOMEM;

View file

@ -1350,7 +1350,7 @@ static int fat_dup(FAR const struct file *oldp, FAR struct file *newp)
* dup'ed file.
*/
newff = (struct fat_file_s *)kmalloc(sizeof(struct fat_file_s));
newff = (struct fat_file_s *)kmm_malloc(sizeof(struct fat_file_s));
if (!newff)
{
ret = -ENOMEM;

View file

@ -298,7 +298,7 @@ int mkfatfs(FAR const char *pathname, FAR struct fat_format_s *fmt)
/* Allocate a buffer that will be working sector memory */
var.fv_sect = (uint8_t*)kmalloc(var.fv_sectorsize);
var.fv_sect = (uint8_t*)kmm_malloc(var.fv_sectorsize);
if (!var.fv_sect)
{
fdbg("ERROR: Failed to allocate working buffers\n");

View file

@ -188,7 +188,7 @@ int foreach_inode(foreach_inode_t handler, FAR void *arg)
/* Allocate the mountpoint info structure */
info = (FAR struct inode_path_s *)kmalloc(sizeof(struct inode_path_s));
info = (FAR struct inode_path_s *)kmm_malloc(sizeof(struct inode_path_s));
if (!info)
{
return -ENOMEM;

View file

@ -439,7 +439,7 @@ int nxffs_dump(FAR struct mtd_dev_s *mtd, bool verbose)
/* Allocate a buffer to hold one block */
blkinfo.buffer = (FAR uint8_t *)kmalloc(blkinfo.geo.blocksize);
blkinfo.buffer = (FAR uint8_t *)kmm_malloc(blkinfo.geo.blocksize);
if (!blkinfo.buffer)
{
fdbg("ERROR: Failed to allocate block cache\n");

View file

@ -203,7 +203,7 @@ int nxffs_initialize(FAR struct mtd_dev_s *mtd)
/* Allocate one I/O block buffer to general files system access */
volume->cache = (FAR uint8_t *)kmalloc(volume->geo.blocksize);
volume->cache = (FAR uint8_t *)kmm_malloc(volume->geo.blocksize);
if (!volume->cache)
{
fdbg("ERROR: Failed to allocate an erase block buffer\n");
@ -216,7 +216,7 @@ int nxffs_initialize(FAR struct mtd_dev_s *mtd)
* often, but is best to have pre-allocated and in-place.
*/
volume->pack = (FAR uint8_t *)kmalloc(volume->geo.erasesize);
volume->pack = (FAR uint8_t *)kmm_malloc(volume->geo.erasesize);
if (!volume->pack)
{
fdbg("ERROR: Failed to allocate an I/O block buffer\n");

View file

@ -134,7 +134,7 @@ static int nxffs_rdentry(FAR struct nxffs_volume_s *volume, off_t offset,
/* Allocate memory to hold the variable-length file name */
namlen = inode.namlen;
entry->name = (FAR char *)kmalloc(namlen + 1);
entry->name = (FAR char *)kmm_malloc(namlen + 1);
if (!entry->name)
{
fdbg("ERROR: Failed to allocate name, namlen: %d\n", namlen);

View file

@ -301,7 +301,7 @@ static int cpuload_dup(FAR const struct file *oldp, FAR struct file *newp)
/* Allocate a new container to hold the task and attribute selection */
newattr = (FAR struct cpuload_file_s *)kmalloc(sizeof(struct cpuload_file_s));
newattr = (FAR struct cpuload_file_s *)kmm_malloc(sizeof(struct cpuload_file_s));
if (!newattr)
{
fdbg("ERROR: Failed to allocate file attributes\n");

View file

@ -1115,7 +1115,7 @@ static int proc_dup(FAR const struct file *oldp, FAR struct file *newp)
/* Allocate a new container to hold the task and node selection */
newfile = (FAR struct proc_file_s *)kmalloc(sizeof(struct proc_file_s));
newfile = (FAR struct proc_file_s *)kmm_malloc(sizeof(struct proc_file_s));
if (!newfile)
{
fdbg("ERROR: Failed to allocate file container\n");

View file

@ -327,7 +327,7 @@ static int uptime_dup(FAR const struct file *oldp, FAR struct file *newp)
/* Allocate a new container to hold the task and attribute selection */
newattr = (FAR struct uptime_file_s *)kmalloc(sizeof(struct uptime_file_s));
newattr = (FAR struct uptime_file_s *)kmm_malloc(sizeof(struct uptime_file_s));
if (!newattr)
{
fdbg("ERROR: Failed to allocate file attributes\n");

View file

@ -637,7 +637,7 @@ static int romfs_dup(FAR const struct file *oldp, FAR struct file *newp)
* dup'ed file.
*/
newrf = (FAR struct romfs_file_s *)kmalloc(sizeof(struct romfs_file_s));
newrf = (FAR struct romfs_file_s *)kmm_malloc(sizeof(struct romfs_file_s));
if (!newrf)
{
fdbg("Failed to allocate private data\n", ret);

View file

@ -560,7 +560,7 @@ int romfs_hwconfigure(struct romfs_mountpt_s *rm)
/* Allocate the device cache buffer for normal sector accesses */
rm->rm_buffer = (uint8_t*)kmalloc(rm->rm_hwsectorsize);
rm->rm_buffer = (uint8_t*)kmm_malloc(rm->rm_hwsectorsize);
if (!rm->rm_buffer)
{
return -ENOMEM;
@ -648,7 +648,7 @@ int romfs_fileconfigure(struct romfs_mountpt_s *rm, struct romfs_file_s *rf)
/* Create a file buffer to support partial sector accesses */
rf->rf_buffer = (uint8_t*)kmalloc(rm->rm_hwsectorsize);
rf->rf_buffer = (uint8_t*)kmm_malloc(rm->rm_hwsectorsize);
if (!rf->rf_buffer)
{
return -ENOMEM;

View file

@ -189,7 +189,7 @@ static int smartfs_open(FAR struct file *filep, const char *relpath,
/* Locate the directory entry for this path */
sf = (struct smartfs_ofile_s *) kmalloc(sizeof *sf);
sf = (struct smartfs_ofile_s *) kmm_malloc(sizeof *sf);
if (sf == NULL)
{
ret = -ENOMEM;

View file

@ -210,8 +210,8 @@ int smartfs_mount(struct smartfs_mountpt_s *fs, bool writeable)
if (nextfs == NULL)
{
fs->fs_rwbuffer = (char *) kmalloc(fs->fs_llformat.availbytes);
fs->fs_workbuffer = (char *) kmalloc(256);
fs->fs_rwbuffer = (char *) kmm_malloc(fs->fs_llformat.availbytes);
fs->fs_workbuffer = (char *) kmm_malloc(256);
}
/* Now add ourselves to the linked list of SMART mounts */
@ -227,8 +227,8 @@ int smartfs_mount(struct smartfs_mountpt_s *fs, bool writeable)
fs->fs_rootsector = SMARTFS_ROOT_DIR_SECTOR + fs->fs_llformat.rootdirnum;
#else
fs->fs_rwbuffer = (char *) kmalloc(fs->fs_llformat.availbytes);
fs->fs_workbuffer = (char *) kmalloc(256);
fs->fs_rwbuffer = (char *) kmm_malloc(fs->fs_llformat.availbytes);
fs->fs_workbuffer = (char *) kmm_malloc(256);
fs->fs_rootsector = SMARTFS_ROOT_DIR_SECTOR;
#endif
@ -574,7 +574,7 @@ int smartfs_finddirentry(struct smartfs_mountpt_s *fs,
direntry->dfirst = dirstack[depth];
if (direntry->name == NULL)
{
direntry->name = (char *) kmalloc(fs->fs_llformat.namesize+1);
direntry->name = (char *) kmm_malloc(fs->fs_llformat.namesize+1);
}
memset(direntry->name, 0, fs->fs_llformat.namesize + 1);
@ -914,7 +914,7 @@ int smartfs_createentry(struct smartfs_mountpt_s *fs,
direntry->datlen = 0;
if (direntry->name == NULL)
{
direntry->name = (FAR char *) kmalloc(fs->fs_llformat.namesize+1);
direntry->name = (FAR char *) kmm_malloc(fs->fs_llformat.namesize+1);
}
memset(direntry->name, 0, fs->fs_llformat.namesize+1);

View file

@ -102,7 +102,7 @@ int nxbe_colormap(FAR NX_DRIVERTYPE *dev)
*/
size = 3 * CONFIG_NX_NCOLORS * sizeof(uint8_t);
alloc = (uint8_t*)kmalloc(size);
alloc = (uint8_t*)kmm_malloc(size);
if (alloc == NULL)
{
return -ENOMEM;

View file

@ -244,7 +244,7 @@ nxcon_renderglyph(FAR struct nxcon_state_s *priv,
/* Allocate memory to hold the glyph with its offsets */
bmsize = glyph->stride * glyph->height;
glyph->bitmap = (FAR uint8_t *)kmalloc(bmsize);
glyph->bitmap = (FAR uint8_t *)kmm_malloc(bmsize);
if (glyph->bitmap)
{

View file

@ -96,7 +96,7 @@ void nxmu_kbdin(FAR struct nxfe_state_s *fe, uint8_t nch, FAR uint8_t *ch)
*/
size = sizeof(struct nxclimsg_kbdin_s) + nch - 1;
outmsg = (FAR struct nxclimsg_kbdin_s *)kmalloc(size);
outmsg = (FAR struct nxclimsg_kbdin_s *)kmm_malloc(size);
if (outmsg)
{
/* Give the keypad input only to the top child */

View file

@ -83,7 +83,7 @@ struct symtab_s;
struct binary_s
{
/* If CONFIG_SCHED_HAVE_PARENT is defined then schedul_unload() will
* manage instances of struct binary_s allocated with kmalloc. It
* manage instances of struct binary_s allocated with kmm_malloc. It
* will keep the binary data in a link list and when SIGCHLD is received
* (meaning that the task has exit'ed, schedul_unload() will find the
* data, unload the module, and free the structure.
@ -261,13 +261,13 @@ int exec_module(FAR const struct binary_s *bin);
* If CONFIG_SCHED_HAVE_PARENT is defined, this function may be called by
* the parent of the newly created task to automatically unload the
* module when the task exits. This assumes that (1) the caller is the
* parent of the created task, (2) that bin was allocated with kmalloc()
* parent of the created task, (2) that bin was allocated with kmm_malloc()
* or friends. It will also automatically free the structure with kmm_free()
* after unloading the module.
*
* Input Parameter:
* pid - The task ID of the child task
* bin - This structure must have been allocated with kmalloc() and must
* bin - This structure must have been allocated with kmm_malloc() and must
* persist until the task unloads
*
* Returned Value:

View file

@ -95,7 +95,7 @@ struct elf_loadinfo_s
/* elfalloc is the base address of the memory that is allocated to hold the
* ELF program image.
*
* If CONFIG_ARCH_ADDRENV=n, elfalloc will be allocated using kmalloc() (or
* If CONFIG_ARCH_ADDRENV=n, elfalloc will be allocated using kmm_malloc() (or
* kzalloc()). If CONFIG_ARCH_ADDRENV-y, then elfalloc will be allocated using
* up_addrenv_create(). In either case, there will be a unique instance
* of elfalloc (and stack) for each instance of a process.

View file

@ -77,7 +77,7 @@ struct nxflat_loadinfo_s
/* Data Space (DSpace): This region contains all information that is
* referenced as data (other than the stack which is separately allocated).
*
* If CONFIG_ARCH_ADDRENV=n, DSpace will be allocated using kmalloc() (or
* If CONFIG_ARCH_ADDRENV=n, DSpace will be allocated using kmm_malloc() (or
* kzalloc()). If CONFIG_ARCH_ADDRENV-y, then DSpace will be allocated using
* up_addrenv_create(). In either case, there will be a unique instance
* of DSpace (and stack) for each instance of a process.

View file

@ -126,8 +126,8 @@ extern "C"
# define kmm_trysemaphore() umm_trysemaphore()
# define kmm_givesemaphore() umm_givesemaphore()
# define kmalloc(s) malloc(s)
# define kzalloc(s) zalloc(s)
# define kmm_malloc(s) malloc(s)
# define kmm_zalloc(s) zalloc(s)
# define kmm_realloc(p,s) realloc(p,s)
# define kmm_memalign(a,s) memalign(a,s)
# define kmm_free(p) free(p)
@ -143,8 +143,8 @@ extern "C"
# define kmm_trysemaphore() umm_trysemaphore()
# define kmm_givesemaphore() umm_givesemaphore()
# define kmalloc(s) umm_malloc(s)
# define kzalloc(s) umm_zalloc(s)
# define kmm_malloc(s) umm_malloc(s)
# define kmm_zalloc(s) umm_zalloc(s)
# define kmm_realloc(p,s) umm_realloc(p,s)
# define kmm_memalign(a,s) umm_memalign(a,s)
# define kmm_free(p) umm_free(p)
@ -154,8 +154,6 @@ extern "C"
* and we can call them directly.
*/
FAR void *kmalloc(size_t size);
FAR void *kzalloc(size_t size);
#endif
/* Functions defined in sched/sched_kfree.c **********************************/

View file

@ -315,6 +315,12 @@ void kmm_givesemaphore(void);
FAR void *mm_malloc(FAR struct mm_heap_s *heap, size_t size);
/* Functions contained in kmm_malloc.c **************************************/
#ifdef CONFIG_MM_KERNEL_HEAP
FAR void *kmm_malloc(size_t size);
#endif
/* Functions contained in mm_free.c *****************************************/
void mm_free(FAR struct mm_heap_s *heap, FAR void *mem);
@ -350,6 +356,12 @@ FAR void *kmm_calloc(size_t n, size_t elem_size);
FAR void *mm_zalloc(FAR struct mm_heap_s *heap, size_t size);
/* Functions contained in kmm_zalloc.c **************************************/
#ifdef CONFIG_MM_KERNEL_HEAP
FAR void *kmm_zalloc(size_t size);
#endif
/* Functions contained in mm_memalign.c *************************************/
FAR void *mm_memalign(FAR struct mm_heap_s *heap, size_t alignment,

View file

@ -483,7 +483,7 @@ extern "C"
* inheritance: The caller's window structure may include extensions that
* are not visible to NX.
*
* NOTE: wnd must have been allocated using kmalloc() (or related allocators)
* NOTE: wnd must have been allocated using kmm_malloc() (or related allocators)
* Once provided to nxfe_constructwindow() that memory is owned and managed
* by NX. On certain error conditions or when the window is closed, NX will
* free the window.

View file

@ -259,7 +259,7 @@ struct dspace_s
uint16_t crefs;
/* This is the allocated D-Space memory region. This may be a physical
* address allocated with kmalloc(), or it may be virtual address associated
* address allocated with kmm_malloc(), or it may be virtual address associated
* with an address environment (if CONFIG_ARCH_ADDRENV=y).
*/

View file

@ -318,7 +318,7 @@
* Some hardware supports special memory in which request and descriptor data 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 kmalloc.
* such "special" memory, this functions may simply map to kmm_malloc.
*
* This interface was optimized under a particular assumption. It was assumed
* that the driver maintains a pool of small, pre-allocated buffers for descriptor
@ -376,7 +376,7 @@
* 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 kmalloc.
* such "special" memory, this functions may simply map to kmm_malloc.
*
* This interface differs from DRVR_ALLOC in that the buffers are variable-sized.
*
@ -676,7 +676,7 @@ struct usbhost_driver_s
* be accessed more efficiently. The following methods provide a mechanism
* to allocate and free the transfer descriptor memory. If the underlying
* hardware does not support such "special" memory, these functions may
* simply map to kmalloc and kmm_free.
* simply map to kmm_malloc and kmm_free.
*
* This interface was optimized under a particular assumption. It was assumed
* that the driver maintains a pool of small, pre-allocated buffers for descriptor
@ -691,7 +691,7 @@ struct usbhost_driver_s
/* 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 kmalloc.
* such "special" memory, this functions may simply map to kmm_malloc.
*
* This interface differs from DRVR_ALLOC in that the buffers are variable-sized.
*/

View file

@ -68,7 +68,7 @@
****************************************************************************/
/************************************************************************
* Name: kmalloc
* Name: kmm_malloc
*
* Description:
* Allocate memory from the kernel heap.
@ -81,7 +81,7 @@
*
************************************************************************/
FAR void *kmalloc(size_t size)
FAR void *kmm_malloc(size_t size)
{
return mm_malloc(&g_kmmheap, size);
}

Some files were not shown because too many files have changed in this diff Show more