mirror of
https://github.com/apache/nuttx.git
synced 2026-05-30 21:36:28 +08:00
Rename kmalloc to kmm_malloc for consistency
This commit is contained in:
@@ -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)
|
#if defined(CONFIG_DEBUG) && !defined(CONFIG_DEBUG_STACK)
|
||||||
tcb->stack_alloc_ptr = (uint32_t *)kzalloc(stack_size);
|
tcb->stack_alloc_ptr = (uint32_t *)kzalloc(stack_size);
|
||||||
#else
|
#else
|
||||||
tcb->stack_alloc_ptr = (uint32_t *)kmalloc(stack_size);
|
tcb->stack_alloc_ptr = (uint32_t *)kmm_malloc(stack_size);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -675,10 +675,10 @@ static int dm320_allocvideomemory(void)
|
|||||||
{
|
{
|
||||||
#ifndef CONFIG_DM320_VID0_DISABLE
|
#ifndef CONFIG_DM320_VID0_DISABLE
|
||||||
#ifndef CONFIG_DM320_DISABLE_PINGPONG
|
#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;
|
g_vid0ppbase = (FAR char*)g_vid0base + DM320_VID0_FBLEN;
|
||||||
#else
|
#else
|
||||||
g_vid0base = (FAR void *)kmalloc(DM320_VID0_FBLEN);
|
g_vid0base = (FAR void *)kmm_malloc(DM320_VID0_FBLEN);
|
||||||
#endif
|
#endif
|
||||||
if (!g_vid0base)
|
if (!g_vid0base)
|
||||||
{
|
{
|
||||||
@@ -687,7 +687,7 @@ static int dm320_allocvideomemory(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef CONFIG_DM320_VID1_DISABLE
|
#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)
|
if (!g_vid1base)
|
||||||
{
|
{
|
||||||
goto errout;
|
goto errout;
|
||||||
@@ -695,7 +695,7 @@ static int dm320_allocvideomemory(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef CONFIG_DM320_OSD0_DISABLE
|
#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)
|
if (!g_osd0base)
|
||||||
{
|
{
|
||||||
goto errout;
|
goto errout;
|
||||||
@@ -703,7 +703,7 @@ static int dm320_allocvideomemory(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef CONFIG_DM320_OSD1_DISABLE
|
#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)
|
if (!g_osd1base)
|
||||||
{
|
{
|
||||||
goto errout;
|
goto errout;
|
||||||
|
|||||||
@@ -1937,7 +1937,7 @@ static FAR struct usbdev_req_s *dm320_epallocreq(FAR struct usbdev_ep_s *ep)
|
|||||||
#endif
|
#endif
|
||||||
usbtrace(TRACE_EPALLOCREQ, ((FAR struct dm320_ep_s *)ep)->epphy);
|
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)
|
if (!privreq)
|
||||||
{
|
{
|
||||||
usbtrace(TRACE_DEVERROR(DM320_TRACEERR_ALLOCFAIL), 0);
|
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
|
#ifdef CONFIG_USBDEV_DMAMEMORY
|
||||||
return usbdev_dma_alloc(bytes);
|
return usbdev_dma_alloc(bytes);
|
||||||
#else
|
#else
|
||||||
return kmalloc(bytes);
|
return kmm_malloc(bytes);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -2659,7 +2659,7 @@ static FAR struct usbdev_req_s *lpc17_epallocreq(FAR struct usbdev_ep_s *ep)
|
|||||||
#endif
|
#endif
|
||||||
usbtrace(TRACE_EPALLOCREQ, ((FAR struct lpc17_ep_s *)ep)->epphy);
|
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)
|
if (!privreq)
|
||||||
{
|
{
|
||||||
usbtrace(TRACE_DEVERROR(LPC17_TRACEERR_ALLOCFAIL), 0);
|
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
|
#else
|
||||||
|
|
||||||
usbtrace(TRACE_EPALLOCBUFFER, privep->epphy);
|
usbtrace(TRACE_EPALLOCBUFFER, privep->epphy);
|
||||||
return kmalloc(bytes);
|
return kmm_malloc(bytes);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
* Some hardware supports special memory in which request and descriptor data can
|
||||||
* be accessed more efficiently. This method provides a mechanism to allocate
|
* be accessed more efficiently. This method provides a mechanism to allocate
|
||||||
* the request/descriptor memory. If the underlying hardware does not support
|
* 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
|
* This interface was optimized under a particular assumption. It was assumed
|
||||||
* that the driver maintains a pool of small, pre-allocated buffers for descriptor
|
* 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
|
* Some hardware supports special memory in which larger IO buffers can
|
||||||
* be accessed more efficiently. This method provides a mechanism to allocate
|
* be accessed more efficiently. This method provides a mechanism to allocate
|
||||||
* the request/descriptor memory. If the underlying hardware does not support
|
* 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.
|
* This interface differs from DRVR_ALLOC in that the buffers are variable-sized.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -2623,7 +2623,7 @@ static FAR struct usbdev_req_s *lpc214x_epallocreq(FAR struct usbdev_ep_s *ep)
|
|||||||
#endif
|
#endif
|
||||||
usbtrace(TRACE_EPALLOCREQ, ((FAR struct lpc214x_ep_s *)ep)->epphy);
|
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)
|
if (!privreq)
|
||||||
{
|
{
|
||||||
usbtrace(TRACE_DEVERROR(LPC214X_TRACEERR_ALLOCFAIL), 0);
|
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
|
#else
|
||||||
|
|
||||||
usbtrace(TRACE_EPALLOCBUFFER, privep->epphy);
|
usbtrace(TRACE_EPALLOCBUFFER, privep->epphy);
|
||||||
return kmalloc(bytes);
|
return kmm_malloc(bytes);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
* Some hardware supports special memory in which request and descriptor data
|
||||||
* can be accessed more efficiently. This method provides a mechanism to
|
* can be accessed more efficiently. This method provides a mechanism to
|
||||||
* allocate the request/descriptor memory. If the underlying hardware does
|
* 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
|
* This interface was optimized under a particular assumption. It was
|
||||||
* assumed that the driver maintains a pool of small, pre-allocated buffers
|
* 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. */
|
/* 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)
|
if (*buffer)
|
||||||
{
|
{
|
||||||
*maxlen = CONFIG_LPC31_EHCI_BUFSIZE;
|
*maxlen = CONFIG_LPC31_EHCI_BUFSIZE;
|
||||||
|
|||||||
@@ -1950,7 +1950,7 @@ static FAR struct usbdev_req_s *lpc31_epallocreq(FAR struct usbdev_ep_s *ep)
|
|||||||
#endif
|
#endif
|
||||||
usbtrace(TRACE_EPALLOCREQ, ((FAR struct lpc31_ep_s *)ep)->epphy);
|
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)
|
if (!privreq)
|
||||||
{
|
{
|
||||||
usbtrace(TRACE_DEVERROR(LPC31_TRACEERR_ALLOCFAIL), 0);
|
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
|
#ifdef CONFIG_USBDEV_DMAMEMORY
|
||||||
return usbdev_dma_alloc(bytes);
|
return usbdev_dma_alloc(bytes);
|
||||||
#else
|
#else
|
||||||
return kmalloc(bytes);
|
return kmm_malloc(bytes);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1193,7 +1193,7 @@ FAR struct mtd_dev_s *lpc43_spifi_initialize(void)
|
|||||||
|
|
||||||
/* Allocate a buffer for the erase block cache */
|
/* 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)
|
if (!priv->cache)
|
||||||
{
|
{
|
||||||
/* Allocation failed! Discard all of that work we just did and return NULL */
|
/* Allocation failed! Discard all of that work we just did and return NULL */
|
||||||
|
|||||||
@@ -1950,7 +1950,7 @@ static FAR struct usbdev_req_s *lpc43_epallocreq(FAR struct usbdev_ep_s *ep)
|
|||||||
#endif
|
#endif
|
||||||
usbtrace(TRACE_EPALLOCREQ, ((FAR struct lpc43_ep_s *)ep)->epphy);
|
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)
|
if (!privreq)
|
||||||
{
|
{
|
||||||
usbtrace(TRACE_DEVERROR(LPC43_TRACEERR_ALLOCFAIL), 0);
|
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
|
#ifdef CONFIG_USBDEV_DMAMEMORY
|
||||||
return usbdev_dma_alloc(bytes);
|
return usbdev_dma_alloc(bytes);
|
||||||
#else
|
#else
|
||||||
return kmalloc(bytes);
|
return kmm_malloc(bytes);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -2987,7 +2987,7 @@ static struct usbdev_req_s *sam_ep_allocreq(struct usbdev_ep_s *ep)
|
|||||||
#endif
|
#endif
|
||||||
usbtrace(TRACE_EPALLOCREQ, USB_EPNO(ep->eplog));
|
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)
|
if (!privreq)
|
||||||
{
|
{
|
||||||
usbtrace(TRACE_DEVERROR(SAM_TRACEERR_ALLOCFAIL), 0);
|
usbtrace(TRACE_DEVERROR(SAM_TRACEERR_ALLOCFAIL), 0);
|
||||||
|
|||||||
@@ -2598,7 +2598,7 @@ config SAMA5_UDPHS_PREALLOCATE
|
|||||||
---help---
|
---help---
|
||||||
If this option is selected then DMA transfer descriptors will be
|
If this option is selected then DMA transfer descriptors will be
|
||||||
pre-allocated in .bss. Otherwise, the descriptors will be allocated
|
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.
|
memory pool is available after startup.
|
||||||
|
|
||||||
config SAMA5_UDPHS_REGDEBUG
|
config SAMA5_UDPHS_REGDEBUG
|
||||||
|
|||||||
@@ -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
|
* Some hardware supports special memory in which request and descriptor data
|
||||||
* can be accessed more efficiently. This method provides a mechanism to
|
* can be accessed more efficiently. This method provides a mechanism to
|
||||||
* allocate the request/descriptor memory. If the underlying hardware does
|
* 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
|
* This interface was optimized under a particular assumption. It was
|
||||||
* assumed that the driver maintains a pool of small, pre-allocated buffers
|
* 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. */
|
/* 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)
|
if (*buffer)
|
||||||
{
|
{
|
||||||
*maxlen = CONFIG_SAMA5_EHCI_BUFSIZE;
|
*maxlen = CONFIG_SAMA5_EHCI_BUFSIZE;
|
||||||
|
|||||||
@@ -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
|
* Some hardware supports special memory in which request and descriptor data can
|
||||||
* be accessed more efficiently. This method provides a mechanism to allocate
|
* be accessed more efficiently. This method provides a mechanism to allocate
|
||||||
* the request/descriptor memory. If the underlying hardware does not support
|
* 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
|
* This interface was optimized under a particular assumption. It was assumed
|
||||||
* that the driver maintains a pool of small, pre-allocated buffers for descriptor
|
* that the driver maintains a pool of small, pre-allocated buffers for descriptor
|
||||||
|
|||||||
@@ -3476,7 +3476,7 @@ static struct usbdev_req_s *sam_ep_allocreq(struct usbdev_ep_s *ep)
|
|||||||
#endif
|
#endif
|
||||||
usbtrace(TRACE_EPALLOCREQ, USB_EPNO(ep->eplog));
|
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)
|
if (!privreq)
|
||||||
{
|
{
|
||||||
usbtrace(TRACE_DEVERROR(SAM_TRACEERR_ALLOCFAIL), 0);
|
usbtrace(TRACE_DEVERROR(SAM_TRACEERR_ALLOCFAIL), 0);
|
||||||
|
|||||||
@@ -1922,7 +1922,7 @@ FAR struct i2c_dev_s *up_i2cinitialize(int port)
|
|||||||
|
|
||||||
/* Allocate instance */
|
/* Allocate instance */
|
||||||
|
|
||||||
if (!(inst = kmalloc(sizeof(struct stm32_i2c_inst_s))))
|
if (!(inst = kmm_malloc(sizeof(struct stm32_i2c_inst_s))))
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2450,7 +2450,7 @@ FAR struct i2c_dev_s *up_i2cinitialize(int port)
|
|||||||
|
|
||||||
/* Allocate instance */
|
/* Allocate instance */
|
||||||
|
|
||||||
if (!(inst = kmalloc(sizeof(struct stm32_i2c_inst_s))))
|
if (!(inst = kmm_malloc(sizeof(struct stm32_i2c_inst_s))))
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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);
|
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)
|
if (!privreq)
|
||||||
{
|
{
|
||||||
usbtrace(TRACE_DEVERROR(STM32_TRACEERR_ALLOCFAIL), 0);
|
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
|
#ifdef CONFIG_USBDEV_DMAMEMORY
|
||||||
return usbdev_dma_alloc(bytes);
|
return usbdev_dma_alloc(bytes);
|
||||||
#else
|
#else
|
||||||
return kmalloc(bytes);
|
return kmm_malloc(bytes);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -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
|
* Some hardware supports special memory in which request and descriptor data can
|
||||||
* be accessed more efficiently. This method provides a mechanism to allocate
|
* be accessed more efficiently. This method provides a mechanism to allocate
|
||||||
* the request/descriptor memory. If the underlying hardware does not support
|
* 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
|
* This interface was optimized under a particular assumption. It was assumed
|
||||||
* that the driver maintains a pool of small, pre-allocated buffers for descriptor
|
* 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. */
|
/* 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)
|
if (!alloc)
|
||||||
{
|
{
|
||||||
return -ENOMEM;
|
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
|
* Some hardware supports special memory in which larger IO buffers can
|
||||||
* be accessed more efficiently. This method provides a mechanism to allocate
|
* be accessed more efficiently. This method provides a mechanism to allocate
|
||||||
* the request/descriptor memory. If the underlying hardware does not support
|
* 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.
|
* 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 */
|
/* There is no special memory requirement */
|
||||||
|
|
||||||
alloc = (FAR uint8_t *)kmalloc(buflen);
|
alloc = (FAR uint8_t *)kmm_malloc(buflen);
|
||||||
if (!alloc)
|
if (!alloc)
|
||||||
{
|
{
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|||||||
@@ -2977,7 +2977,7 @@ static struct usbdev_req_s *stm32_epallocreq(struct usbdev_ep_s *ep)
|
|||||||
#endif
|
#endif
|
||||||
usbtrace(TRACE_EPALLOCREQ, USB_EPNO(ep->eplog));
|
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)
|
if (!privreq)
|
||||||
{
|
{
|
||||||
usbtrace(TRACE_DEVERROR(STM32_TRACEERR_ALLOCFAIL), 0);
|
usbtrace(TRACE_DEVERROR(STM32_TRACEERR_ALLOCFAIL), 0);
|
||||||
|
|||||||
@@ -2013,7 +2013,7 @@ FAR struct i2c_dev_s *up_i2cinitialize(int port)
|
|||||||
|
|
||||||
/* Allocate instance */
|
/* Allocate instance */
|
||||||
|
|
||||||
if (!(inst = kmalloc( sizeof(struct stm32_i2c_inst_s))))
|
if (!(inst = kmm_malloc( sizeof(struct stm32_i2c_inst_s))))
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2287,7 +2287,7 @@ static FAR struct usbdev_req_s *avr_epallocreq(FAR struct usbdev_ep_s *ep)
|
|||||||
#endif
|
#endif
|
||||||
usbtrace(TRACE_EPALLOCREQ, ((FAR struct avr_ep_s *)ep)->ep.eplog);
|
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)
|
if (!privreq)
|
||||||
{
|
{
|
||||||
usbtrace(TRACE_DEVERROR(AVR_TRACEERR_ALLOCFAIL), 0);
|
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
|
#ifdef CONFIG_USBDEV_DMAMEMORY
|
||||||
return usbdev_dma_alloc(bytes);
|
return usbdev_dma_alloc(bytes);
|
||||||
#else
|
#else
|
||||||
return kmalloc(bytes);
|
return kmm_malloc(bytes);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -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)
|
#if defined(CONFIG_DEBUG) && !defined(CONFIG_DEBUG_STACK)
|
||||||
tcb->stack_alloc_ptr = (uint32_t *)kzalloc(stack_size);
|
tcb->stack_alloc_ptr = (uint32_t *)kzalloc(stack_size);
|
||||||
#else
|
#else
|
||||||
tcb->stack_alloc_ptr = (uint32_t *)kmalloc(stack_size);
|
tcb->stack_alloc_ptr = (uint32_t *)kmm_malloc(stack_size);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -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)
|
#if defined(CONFIG_DEBUG) && !defined(CONFIG_DEBUG_STACK)
|
||||||
tcb->stack_alloc_ptr = (uint32_t *)kzalloc(stack_size);
|
tcb->stack_alloc_ptr = (uint32_t *)kzalloc(stack_size);
|
||||||
#else
|
#else
|
||||||
tcb->stack_alloc_ptr = (uint32_t *)kmalloc(stack_size);
|
tcb->stack_alloc_ptr = (uint32_t *)kmm_malloc(stack_size);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -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)
|
#if defined(CONFIG_DEBUG) && !defined(CONFIG_DEBUG_STACK)
|
||||||
tcb->stack_alloc_ptr = (uint32_t *)kzalloc(stack_size);
|
tcb->stack_alloc_ptr = (uint32_t *)kzalloc(stack_size);
|
||||||
#else
|
#else
|
||||||
tcb->stack_alloc_ptr = (uint32_t *)kmalloc(stack_size);
|
tcb->stack_alloc_ptr = (uint32_t *)kmm_malloc(stack_size);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -3324,7 +3324,7 @@ static struct usbdev_req_s *pic32mx_epallocreq(struct usbdev_ep_s *ep)
|
|||||||
#endif
|
#endif
|
||||||
usbtrace(TRACE_EPALLOCREQ, USB_EPNO(ep->eplog));
|
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)
|
if (!privreq)
|
||||||
{
|
{
|
||||||
usbtrace(TRACE_DEVERROR(PIC32MX_TRACEERR_ALLOCFAIL), 0);
|
usbtrace(TRACE_DEVERROR(PIC32MX_TRACEERR_ALLOCFAIL), 0);
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ int rtos_bridge_init(struct rgmp_bridge *b)
|
|||||||
struct bridge *bridge;
|
struct bridge *bridge;
|
||||||
char path[30] = {'/', 'd', 'e', 'v', '/'};
|
char path[30] = {'/', 'd', 'e', 'v', '/'};
|
||||||
|
|
||||||
if ((bridge = kmalloc(sizeof(*bridge))) == NULL)
|
if ((bridge = kmm_malloc(sizeof(*bridge))) == NULL)
|
||||||
goto err0;
|
goto err0;
|
||||||
|
|
||||||
bridge->b = b;
|
bridge->b = b;
|
||||||
|
|||||||
@@ -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 */
|
/* Use the kernel allocator if this is a kernel thread */
|
||||||
|
|
||||||
if (ttype == TCB_FLAG_TTYPE_KERNEL) {
|
if (ttype == TCB_FLAG_TTYPE_KERNEL) {
|
||||||
stack_alloc_ptr = (uint32_t *)kmalloc(stack_size);
|
stack_alloc_ptr = (uint32_t *)kmm_malloc(stack_size);
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ void rtos_free_page(void *page)
|
|||||||
|
|
||||||
void *rtos_kmalloc(int size)
|
void *rtos_kmalloc(int size)
|
||||||
{
|
{
|
||||||
return kmalloc(size);
|
return kmm_malloc(size);
|
||||||
}
|
}
|
||||||
|
|
||||||
void rtos_kfree(void *addr)
|
void rtos_kfree(void *addr)
|
||||||
@@ -130,7 +130,7 @@ void rtos_timer_isr(void *data)
|
|||||||
*/
|
*/
|
||||||
int rtos_sem_init(struct semaphore *sem, int val)
|
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 -1;
|
||||||
return sem_init(sem->sem, 0, val);
|
return sem_init(sem->sem, 0, val);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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)
|
#if defined(CONFIG_DEBUG) && !defined(CONFIG_DEBUG_STACK)
|
||||||
tcb->stack_alloc_ptr = (uint32_t *)kzalloc(stack_size);
|
tcb->stack_alloc_ptr = (uint32_t *)kzalloc(stack_size);
|
||||||
#else
|
#else
|
||||||
tcb->stack_alloc_ptr = (uint32_t *)kmalloc(stack_size);
|
tcb->stack_alloc_ptr = (uint32_t *)kmm_malloc(stack_size);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -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)
|
#if defined(CONFIG_DEBUG) && !defined(CONFIG_DEBUG_STACK)
|
||||||
tcb->stack_alloc_ptr = (uint32_t *)kzalloc(stack_size);
|
tcb->stack_alloc_ptr = (uint32_t *)kzalloc(stack_size);
|
||||||
#else
|
#else
|
||||||
tcb->stack_alloc_ptr = (uint32_t *)kmalloc(stack_size);
|
tcb->stack_alloc_ptr = (uint32_t *)kmm_malloc(stack_size);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -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)
|
#if defined(CONFIG_DEBUG) && !defined(CONFIG_DEBUG_STACK)
|
||||||
tcb->stack_alloc_ptr = (uint32_t *)kzalloc(stack_size);
|
tcb->stack_alloc_ptr = (uint32_t *)kzalloc(stack_size);
|
||||||
#else
|
#else
|
||||||
tcb->stack_alloc_ptr = (uint32_t *)kmalloc(stack_size);
|
tcb->stack_alloc_ptr = (uint32_t *)kmm_malloc(stack_size);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -920,7 +920,7 @@ FAR struct i2c_dev_s *up_i2cinitialize(int port)
|
|||||||
|
|
||||||
/* Now, allocate an I2C instance for this caller */
|
/* 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)
|
if (i2c)
|
||||||
{
|
{
|
||||||
/* Initialize the allocated instance */
|
/* Initialize the allocated instance */
|
||||||
|
|||||||
@@ -593,7 +593,7 @@ FAR struct i2c_dev_s *up_i2cinitialize(int port)
|
|||||||
|
|
||||||
/* Now, allocate an I2C instance for this caller */
|
/* 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)
|
if (i2c)
|
||||||
{
|
{
|
||||||
/* Initialize the allocated instance */
|
/* Initialize the allocated instance */
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ EXEPATH_HANDLE exepath_init(void)
|
|||||||
|
|
||||||
/* Allocate a container for the PATH variable contents */
|
/* 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)
|
if (!exepath)
|
||||||
{
|
{
|
||||||
/* Ooops.. we are out of memory */
|
/* 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;
|
pathlen = strlen(path) + strlen(relpath) + 2;
|
||||||
fullpath = (FAR char *)kmalloc(pathlen);
|
fullpath = (FAR char *)kmm_malloc(pathlen);
|
||||||
if (!fullpath)
|
if (!fullpath)
|
||||||
{
|
{
|
||||||
/* Failed to allocate memory */
|
/* Failed to allocate memory */
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ FAR struct binary_s *g_unloadhead;
|
|||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* If CONFIG_SCHED_HAVE_PARENT is defined then schedul_unload() will
|
* 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
|
* 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
|
* (meaning that the task has exit'ed, schedul_unload() will find the
|
||||||
* data, unload the module, and free the structure.
|
* data, unload the module, and free the structure.
|
||||||
@@ -82,7 +82,7 @@ FAR struct binary_s *g_unloadhead;
|
|||||||
*
|
*
|
||||||
* Input Parameter:
|
* Input Parameter:
|
||||||
* pid - The task ID of the child task
|
* 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
|
* persist until the task unloads
|
||||||
|
|
||||||
*
|
*
|
||||||
@@ -116,7 +116,7 @@ static void unload_list_add(pid_t pid, FAR struct binary_s *bin)
|
|||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* If CONFIG_SCHED_HAVE_PARENT is defined then schedul_unload() will
|
* 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
|
* 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
|
* (meaning that the task has exit'ed, schedul_unload() will find the
|
||||||
* data, unload the module, and free the structure.
|
* data, unload the module, and free the structure.
|
||||||
@@ -187,7 +187,7 @@ static FAR struct binary_s *unload_list_remove(pid_t pid)
|
|||||||
* Description:
|
* Description:
|
||||||
* If CONFIG_SCHED_HAVE_PARENT is defined, this function may be called to
|
* If CONFIG_SCHED_HAVE_PARENT is defined, this function may be called to
|
||||||
* automatically unload the module when task exits. It assumes that
|
* 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.
|
* free the structure with kmm_free() when the task exists.
|
||||||
*
|
*
|
||||||
* Input Parameter:
|
* 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
|
* If CONFIG_SCHED_HAVE_PARENT is defined, this function may be called by
|
||||||
* the parent of the newly created task to automatically unload the
|
* the parent of the newly created task to automatically unload the
|
||||||
* module when the task exits. This assumes that (1) the caller is 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()
|
* or friends. It will also automatically free the structure with kmm_free()
|
||||||
* after unloading the module.
|
* after unloading the module.
|
||||||
*
|
*
|
||||||
* Input Parameter:
|
* Input Parameter:
|
||||||
* pid - The task ID of the child task
|
* 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
|
* persist until the task unloads
|
||||||
*
|
*
|
||||||
* Returned Value:
|
* Returned Value:
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ int elf_allocbuffer(FAR struct elf_loadinfo_s *loadinfo)
|
|||||||
{
|
{
|
||||||
/* No.. allocate one now */
|
/* 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)
|
if (!loadinfo->iobuffer)
|
||||||
{
|
{
|
||||||
bdbg("Failed to allocate an I/O buffer\n");
|
bdbg("Failed to allocate an I/O buffer\n");
|
||||||
|
|||||||
@@ -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 */
|
/* 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)
|
if (!loadinfo->shdr)
|
||||||
{
|
{
|
||||||
bdbg("Failed to allocate the section header table. Size: %ld\n", (long)shdrsize);
|
bdbg("Failed to allocate the section header table. Size: %ld\n", (long)shdrsize);
|
||||||
|
|||||||
@@ -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 */
|
/* 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)
|
if (dspace == 0)
|
||||||
{
|
{
|
||||||
bdbg("ERROR: Failed to allocate DSpace\n");
|
bdbg("ERROR: Failed to allocate DSpace\n");
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ int usbmsc_archinitialize(void)
|
|||||||
uint8_t *pbuffer;
|
uint8_t *pbuffer;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
pbuffer = (uint8_t *)kmalloc(BUFFER_SIZE);
|
pbuffer = (uint8_t *)kmm_malloc(BUFFER_SIZE);
|
||||||
if (!pbuffer)
|
if (!pbuffer)
|
||||||
{
|
{
|
||||||
lowsyslog("usbmsc_archinitialize: Failed to allocate ramdisk of size %d\n",
|
lowsyslog("usbmsc_archinitialize: Failed to allocate ramdisk of size %d\n",
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ int usbmsc_archinitialize(void)
|
|||||||
uint8_t *pbuffer;
|
uint8_t *pbuffer;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
pbuffer = (uint8_t *)kmalloc(BUFFER_SIZE);
|
pbuffer = (uint8_t *)kmm_malloc(BUFFER_SIZE);
|
||||||
if (!pbuffer)
|
if (!pbuffer)
|
||||||
{
|
{
|
||||||
lowsyslog("usbmsc_archinitialize: Failed to allocate ramdisk of size %d\n",
|
lowsyslog("usbmsc_archinitialize: Failed to allocate ramdisk of size %d\n",
|
||||||
|
|||||||
@@ -291,7 +291,7 @@ int nsh_archinitialize(void)
|
|||||||
|
|
||||||
#if defined(CONFIG_RAMMTD) && defined(CONFIG_MIKROE_RAMMTD)
|
#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 = rammtd_initialize(start, CONFIG_MIKROE_RAMMTD_SIZE * 1024);
|
||||||
mtd->ioctl(mtd, MTDIOC_BULKERASE, 0);
|
mtd->ioctl(mtd, MTDIOC_BULKERASE, 0);
|
||||||
|
|
||||||
|
|||||||
@@ -1529,10 +1529,10 @@ int arch_tcinitialize(int minor)
|
|||||||
#ifndef CONFIG_TOUCHSCREEN_MULTIPLE
|
#ifndef CONFIG_TOUCHSCREEN_MULTIPLE
|
||||||
priv = &g_touchscreen;
|
priv = &g_touchscreen;
|
||||||
#else
|
#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)
|
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;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1386,10 +1386,10 @@ int arch_tcinitialize(int minor)
|
|||||||
#ifndef CONFIG_TOUCHSCREEN_MULTIPLE
|
#ifndef CONFIG_TOUCHSCREEN_MULTIPLE
|
||||||
priv = &g_touchscreen;
|
priv = &g_touchscreen;
|
||||||
#else
|
#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)
|
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;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -293,7 +293,7 @@ int nsh_archinitialize(void)
|
|||||||
|
|
||||||
#if defined(CONFIG_RAMMTD) && defined(CONFIG_STM32F429I_DISCO_RAMMTD)
|
#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 = rammtd_initialize(start, CONFIG_STM32F429I_DISCO_RAMMTD_SIZE * 1024);
|
||||||
mtd->ioctl(mtd, MTDIOC_BULKERASE, 0);
|
mtd->ioctl(mtd, MTDIOC_BULKERASE, 0);
|
||||||
|
|
||||||
|
|||||||
@@ -1825,7 +1825,7 @@ struct audio_lowerhalf_s *vs1053_initialize(FAR struct spi_dev_s *spi,
|
|||||||
|
|
||||||
/* Allocate a VS1053 device structure */
|
/* 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)
|
if (dev)
|
||||||
{
|
{
|
||||||
/* Initialize the VS1053 device structure */
|
/* Initialize the VS1053 device structure */
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ int bchlib_setup(const char *blkdev, bool readonly, FAR void **handle)
|
|||||||
|
|
||||||
/* Allocate the sector I/O buffer */
|
/* 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)
|
if (!bch->buffer)
|
||||||
{
|
{
|
||||||
fdbg("Failed to allocate sector buffer\n");
|
fdbg("Failed to allocate sector buffer\n");
|
||||||
|
|||||||
@@ -1212,10 +1212,10 @@ int ads7843e_register(FAR struct spi_dev_s *spi,
|
|||||||
#ifndef CONFIG_ADS7843E_MULTIPLE
|
#ifndef CONFIG_ADS7843E_MULTIPLE
|
||||||
priv = &g_ads7843e;
|
priv = &g_ads7843e;
|
||||||
#else
|
#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)
|
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;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1193,10 +1193,10 @@ int max11802_register(FAR struct spi_dev_s *spi,
|
|||||||
#ifndef CONFIG_MAX11802_MULTIPLE
|
#ifndef CONFIG_MAX11802_MULTIPLE
|
||||||
priv = &g_max11802;
|
priv = &g_max11802;
|
||||||
#else
|
#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)
|
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;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1234,10 +1234,10 @@ int tsc2007_register(FAR struct i2c_dev_s *dev,
|
|||||||
#ifndef CONFIG_TSC2007_MULTIPLE
|
#ifndef CONFIG_TSC2007_MULTIPLE
|
||||||
priv = &g_tsc2007;
|
priv = &g_tsc2007;
|
||||||
#else
|
#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)
|
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;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user