diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-08-31 17:26:36 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-08-31 17:26:36 -0600 |
commit | 39c90ce1ce01a0b45451df19c1635240d47aaf29 (patch) | |
tree | 3814c0a5ce1961e161e268801e0529a926100ffb | |
parent | e4f3869daedaf22dd224285cc7f0373e0a5025d2 (diff) | |
download | px4-nuttx-39c90ce1ce01a0b45451df19c1635240d47aaf29.tar.gz px4-nuttx-39c90ce1ce01a0b45451df19c1635240d47aaf29.tar.bz2 px4-nuttx-39c90ce1ce01a0b45451df19c1635240d47aaf29.zip |
Rename kmalloc to kmm_malloc for consistency
111 files changed, 197 insertions, 187 deletions
diff --git a/nuttx/arch/arm/src/common/up_createstack.c b/nuttx/arch/arm/src/common/up_createstack.c index a34612753..2748f52b9 100644 --- a/nuttx/arch/arm/src/common/up_createstack.c +++ b/nuttx/arch/arm/src/common/up_createstack.c @@ -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 diff --git a/nuttx/arch/arm/src/dm320/dm320_framebuffer.c b/nuttx/arch/arm/src/dm320/dm320_framebuffer.c index 5f8597969..3fb6a6271 100644 --- a/nuttx/arch/arm/src/dm320/dm320_framebuffer.c +++ b/nuttx/arch/arm/src/dm320/dm320_framebuffer.c @@ -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; diff --git a/nuttx/arch/arm/src/dm320/dm320_usbdev.c b/nuttx/arch/arm/src/dm320/dm320_usbdev.c index b04b732e0..0749a1392 100644 --- a/nuttx/arch/arm/src/dm320/dm320_usbdev.c +++ b/nuttx/arch/arm/src/dm320/dm320_usbdev.c @@ -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 diff --git a/nuttx/arch/arm/src/lpc17xx/lpc17_usbdev.c b/nuttx/arch/arm/src/lpc17xx/lpc17_usbdev.c index 218b58021..2e527f670 100644 --- a/nuttx/arch/arm/src/lpc17xx/lpc17_usbdev.c +++ b/nuttx/arch/arm/src/lpc17xx/lpc17_usbdev.c @@ -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 } diff --git a/nuttx/arch/arm/src/lpc17xx/lpc17_usbhost.c b/nuttx/arch/arm/src/lpc17xx/lpc17_usbhost.c index 56ca38b6c..230821af8 100644 --- a/nuttx/arch/arm/src/lpc17xx/lpc17_usbhost.c +++ b/nuttx/arch/arm/src/lpc17xx/lpc17_usbhost.c @@ -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. * diff --git a/nuttx/arch/arm/src/lpc214x/lpc214x_usbdev.c b/nuttx/arch/arm/src/lpc214x/lpc214x_usbdev.c index c01813e1a..f2d1658d8 100644 --- a/nuttx/arch/arm/src/lpc214x/lpc214x_usbdev.c +++ b/nuttx/arch/arm/src/lpc214x/lpc214x_usbdev.c @@ -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 } diff --git a/nuttx/arch/arm/src/lpc31xx/lpc31_ehci.c b/nuttx/arch/arm/src/lpc31xx/lpc31_ehci.c index e460241e5..54e4f0e6a 100755 --- a/nuttx/arch/arm/src/lpc31xx/lpc31_ehci.c +++ b/nuttx/arch/arm/src/lpc31xx/lpc31_ehci.c @@ -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; diff --git a/nuttx/arch/arm/src/lpc31xx/lpc31_usbdev.c b/nuttx/arch/arm/src/lpc31xx/lpc31_usbdev.c index 748430dbe..0cffe9252 100644 --- a/nuttx/arch/arm/src/lpc31xx/lpc31_usbdev.c +++ b/nuttx/arch/arm/src/lpc31xx/lpc31_usbdev.c @@ -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 diff --git a/nuttx/arch/arm/src/lpc43xx/lpc43_spifi.c b/nuttx/arch/arm/src/lpc43xx/lpc43_spifi.c index fcaae5ea8..a529bc673 100644 --- a/nuttx/arch/arm/src/lpc43xx/lpc43_spifi.c +++ b/nuttx/arch/arm/src/lpc43xx/lpc43_spifi.c @@ -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 */ diff --git a/nuttx/arch/arm/src/lpc43xx/lpc43_usb0dev.c b/nuttx/arch/arm/src/lpc43xx/lpc43_usb0dev.c index eeba3b443..c77c01465 100644 --- a/nuttx/arch/arm/src/lpc43xx/lpc43_usb0dev.c +++ b/nuttx/arch/arm/src/lpc43xx/lpc43_usb0dev.c @@ -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 diff --git a/nuttx/arch/arm/src/sam34/sam_udp.c b/nuttx/arch/arm/src/sam34/sam_udp.c index a1cc83bdd..5d4cfad7e 100644 --- a/nuttx/arch/arm/src/sam34/sam_udp.c +++ b/nuttx/arch/arm/src/sam34/sam_udp.c @@ -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); diff --git a/nuttx/arch/arm/src/sama5/Kconfig b/nuttx/arch/arm/src/sama5/Kconfig index f3baca2f0..b169179d7 100644 --- a/nuttx/arch/arm/src/sama5/Kconfig +++ b/nuttx/arch/arm/src/sama5/Kconfig @@ -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 diff --git a/nuttx/arch/arm/src/sama5/sam_ehci.c b/nuttx/arch/arm/src/sama5/sam_ehci.c index f0706a8c9..e0c17f2ff 100755 --- a/nuttx/arch/arm/src/sama5/sam_ehci.c +++ b/nuttx/arch/arm/src/sama5/sam_ehci.c @@ -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; diff --git a/nuttx/arch/arm/src/sama5/sam_ohci.c b/nuttx/arch/arm/src/sama5/sam_ohci.c index 16c1c264d..dd8229eda 100644 --- a/nuttx/arch/arm/src/sama5/sam_ohci.c +++ b/nuttx/arch/arm/src/sama5/sam_ohci.c @@ -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 diff --git a/nuttx/arch/arm/src/sama5/sam_udphs.c b/nuttx/arch/arm/src/sama5/sam_udphs.c index 5d2f1b24a..feee254c3 100644 --- a/nuttx/arch/arm/src/sama5/sam_udphs.c +++ b/nuttx/arch/arm/src/sama5/sam_udphs.c @@ -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); diff --git a/nuttx/arch/arm/src/stm32/stm32_i2c.c b/nuttx/arch/arm/src/stm32/stm32_i2c.c index b08dafd7a..f10460b35 100644 --- a/nuttx/arch/arm/src/stm32/stm32_i2c.c +++ b/nuttx/arch/arm/src/stm32/stm32_i2c.c @@ -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; } diff --git a/nuttx/arch/arm/src/stm32/stm32_i2c_alt.c b/nuttx/arch/arm/src/stm32/stm32_i2c_alt.c index 809d6d34a..63c329691 100755 --- a/nuttx/arch/arm/src/stm32/stm32_i2c_alt.c +++ b/nuttx/arch/arm/src/stm32/stm32_i2c_alt.c @@ -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; } diff --git a/nuttx/arch/arm/src/stm32/stm32_otgfsdev.c b/nuttx/arch/arm/src/stm32/stm32_otgfsdev.c index b5fe45e22..3acd5ced4 100644 --- a/nuttx/arch/arm/src/stm32/stm32_otgfsdev.c +++ b/nuttx/arch/arm/src/stm32/stm32_otgfsdev.c @@ -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 diff --git a/nuttx/arch/arm/src/stm32/stm32_otgfshost.c b/nuttx/arch/arm/src/stm32/stm32_otgfshost.c index a60564780..86934beab 100644 --- a/nuttx/arch/arm/src/stm32/stm32_otgfshost.c +++ b/nuttx/arch/arm/src/stm32/stm32_otgfshost.c @@ -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; diff --git a/nuttx/arch/arm/src/stm32/stm32_usbdev.c b/nuttx/arch/arm/src/stm32/stm32_usbdev.c index fbc83c5b9..8651c69f5 100644 --- a/nuttx/arch/arm/src/stm32/stm32_usbdev.c +++ b/nuttx/arch/arm/src/stm32/stm32_usbdev.c @@ -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); diff --git a/nuttx/arch/arm/src/stm32/stm32f30xxx_i2c.c b/nuttx/arch/arm/src/stm32/stm32f30xxx_i2c.c index 1a1f5b41b..f816bad30 100644 --- a/nuttx/arch/arm/src/stm32/stm32f30xxx_i2c.c +++ b/nuttx/arch/arm/src/stm32/stm32f30xxx_i2c.c @@ -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; } diff --git a/nuttx/arch/avr/src/at90usb/at90usb_usbdev.c b/nuttx/arch/avr/src/at90usb/at90usb_usbdev.c index 7e9e37555..29cb0f980 100644 --- a/nuttx/arch/avr/src/at90usb/at90usb_usbdev.c +++ b/nuttx/arch/avr/src/at90usb/at90usb_usbdev.c @@ -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 diff --git a/nuttx/arch/avr/src/avr32/up_createstack.c b/nuttx/arch/avr/src/avr32/up_createstack.c index 10895e98f..a8e2bfeb7 100644 --- a/nuttx/arch/avr/src/avr32/up_createstack.c +++ b/nuttx/arch/avr/src/avr32/up_createstack.c @@ -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 diff --git a/nuttx/arch/hc/src/common/up_createstack.c b/nuttx/arch/hc/src/common/up_createstack.c index 339ea3c77..4646b8ad6 100644 --- a/nuttx/arch/hc/src/common/up_createstack.c +++ b/nuttx/arch/hc/src/common/up_createstack.c @@ -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 diff --git a/nuttx/arch/mips/src/common/up_createstack.c b/nuttx/arch/mips/src/common/up_createstack.c index 940071d18..676b1e6a4 100644 --- a/nuttx/arch/mips/src/common/up_createstack.c +++ b/nuttx/arch/mips/src/common/up_createstack.c @@ -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 diff --git a/nuttx/arch/mips/src/pic32mx/pic32mx-usbdev.c b/nuttx/arch/mips/src/pic32mx/pic32mx-usbdev.c index 7e9017901..f73a73a1e 100644 --- a/nuttx/arch/mips/src/pic32mx/pic32mx-usbdev.c +++ b/nuttx/arch/mips/src/pic32mx/pic32mx-usbdev.c @@ -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); diff --git a/nuttx/arch/rgmp/src/bridge.c b/nuttx/arch/rgmp/src/bridge.c index 86992f143..5762e0fea 100644 --- a/nuttx/arch/rgmp/src/bridge.c +++ b/nuttx/arch/rgmp/src/bridge.c @@ -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; diff --git a/nuttx/arch/rgmp/src/nuttx.c b/nuttx/arch/rgmp/src/nuttx.c index 234bb6dad..3f9323bb7 100644 --- a/nuttx/arch/rgmp/src/nuttx.c +++ b/nuttx/arch/rgmp/src/nuttx.c @@ -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 { diff --git a/nuttx/arch/rgmp/src/rgmp.c b/nuttx/arch/rgmp/src/rgmp.c index abe6c48ae..32289f55d 100644 --- a/nuttx/arch/rgmp/src/rgmp.c +++ b/nuttx/arch/rgmp/src/rgmp.c @@ -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); } diff --git a/nuttx/arch/sh/src/common/up_createstack.c b/nuttx/arch/sh/src/common/up_createstack.c index 04a0a44ec..a56824627 100644 --- a/nuttx/arch/sh/src/common/up_createstack.c +++ b/nuttx/arch/sh/src/common/up_createstack.c @@ -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 diff --git a/nuttx/arch/x86/src/i486/up_createstack.c b/nuttx/arch/x86/src/i486/up_createstack.c index 4c915e618..0e70c905f 100644 --- a/nuttx/arch/x86/src/i486/up_createstack.c +++ b/nuttx/arch/x86/src/i486/up_createstack.c @@ -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 diff --git a/nuttx/arch/z80/src/common/up_createstack.c b/nuttx/arch/z80/src/common/up_createstack.c index 05d42b325..8c43a5049 100644 --- a/nuttx/arch/z80/src/common/up_createstack.c +++ b/nuttx/arch/z80/src/common/up_createstack.c @@ -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 diff --git a/nuttx/arch/z80/src/ez80/ez80_i2c.c b/nuttx/arch/z80/src/ez80/ez80_i2c.c index 329892d16..9432c6e42 100644 --- a/nuttx/arch/z80/src/ez80/ez80_i2c.c +++ b/nuttx/arch/z80/src/ez80/ez80_i2c.c @@ -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 */ diff --git a/nuttx/arch/z80/src/z8/z8_i2c.c b/nuttx/arch/z80/src/z8/z8_i2c.c index 6239ad25b..5e3912253 100644 --- a/nuttx/arch/z80/src/z8/z8_i2c.c +++ b/nuttx/arch/z80/src/z8/z8_i2c.c @@ -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 */ diff --git a/nuttx/binfmt/binfmt_exepath.c b/nuttx/binfmt/binfmt_exepath.c index af69499d1..1e05d55f3 100644 --- a/nuttx/binfmt/binfmt_exepath.c +++ b/nuttx/binfmt/binfmt_exepath.c @@ -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 */ diff --git a/nuttx/binfmt/binfmt_schedunload.c b/nuttx/binfmt/binfmt_schedunload.c index cedd940c6..cc9c84805 100644 --- a/nuttx/binfmt/binfmt_schedunload.c +++ b/nuttx/binfmt/binfmt_schedunload.c @@ -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: diff --git a/nuttx/binfmt/libelf/libelf_iobuffer.c b/nuttx/binfmt/libelf/libelf_iobuffer.c index 3e27c73e3..6e97781a3 100644 --- a/nuttx/binfmt/libelf/libelf_iobuffer.c +++ b/nuttx/binfmt/libelf/libelf_iobuffer.c @@ -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"); diff --git a/nuttx/binfmt/libelf/libelf_sections.c b/nuttx/binfmt/libelf/libelf_sections.c index 1b749ba8b..23f7cc031 100644 --- a/nuttx/binfmt/libelf/libelf_sections.c +++ b/nuttx/binfmt/libelf/libelf_sections.c @@ -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); diff --git a/nuttx/binfmt/libnxflat/libnxflat_addrenv.c b/nuttx/binfmt/libnxflat/libnxflat_addrenv.c index 7378c2438..7ee0376d2 100644 --- a/nuttx/binfmt/libnxflat/libnxflat_addrenv.c +++ b/nuttx/binfmt/libnxflat/libnxflat_addrenv.c @@ -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"); diff --git a/nuttx/configs/ea3131/src/up_usbmsc.c b/nuttx/configs/ea3131/src/up_usbmsc.c index 9a7e74427..aee022490 100644 --- a/nuttx/configs/ea3131/src/up_usbmsc.c +++ b/nuttx/configs/ea3131/src/up_usbmsc.c @@ -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", diff --git a/nuttx/configs/ea3152/src/up_usbmsc.c b/nuttx/configs/ea3152/src/up_usbmsc.c index 44d11089d..55bd3440c 100644 --- a/nuttx/configs/ea3152/src/up_usbmsc.c +++ b/nuttx/configs/ea3152/src/up_usbmsc.c @@ -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", diff --git a/nuttx/configs/mikroe-stm32f4/src/up_nsh.c b/nuttx/configs/mikroe-stm32f4/src/up_nsh.c index 844389e93..80331fe40 100644 --- a/nuttx/configs/mikroe-stm32f4/src/up_nsh.c +++ b/nuttx/configs/mikroe-stm32f4/src/up_nsh.c @@ -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); diff --git a/nuttx/configs/mikroe-stm32f4/src/up_touchscreen.c b/nuttx/configs/mikroe-stm32f4/src/up_touchscreen.c index ab18f05d5..3466e60b0 100644 --- a/nuttx/configs/mikroe-stm32f4/src/up_touchscreen.c +++ b/nuttx/configs/mikroe-stm32f4/src/up_touchscreen.c @@ -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 diff --git a/nuttx/configs/pic32mx7mmb/src/up_touchscreen.c b/nuttx/configs/pic32mx7mmb/src/up_touchscreen.c index fd048d613..532e612cb 100644 --- a/nuttx/configs/pic32mx7mmb/src/up_touchscreen.c +++ b/nuttx/configs/pic32mx7mmb/src/up_touchscreen.c @@ -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 diff --git a/nuttx/configs/stm32f429i-disco/src/stm32_nsh.c b/nuttx/configs/stm32f429i-disco/src/stm32_nsh.c index 3504ed05d..58e49d5f4 100644 --- a/nuttx/configs/stm32f429i-disco/src/stm32_nsh.c +++ b/nuttx/configs/stm32f429i-disco/src/stm32_nsh.c @@ -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); diff --git a/nuttx/drivers/audio/vs1053.c b/nuttx/drivers/audio/vs1053.c index c1853be43..b1780918c 100644 --- a/nuttx/drivers/audio/vs1053.c +++ b/nuttx/drivers/audio/vs1053.c @@ -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 */ diff --git a/nuttx/drivers/bch/bchlib_setup.c b/nuttx/drivers/bch/bchlib_setup.c index 7b2155158..5e3446610 100644 --- a/nuttx/drivers/bch/bchlib_setup.c +++ b/nuttx/drivers/bch/bchlib_setup.c @@ -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"); diff --git a/nuttx/drivers/input/ads7843e.c b/nuttx/drivers/input/ads7843e.c index ee2f6122d..ecc788108 100644 --- a/nuttx/drivers/input/ads7843e.c +++ b/nuttx/drivers/input/ads7843e.c @@ -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 diff --git a/nuttx/drivers/input/max11802.c b/nuttx/drivers/input/max11802.c index ff889e1a1..9c6aad9b9 100644 --- a/nuttx/drivers/input/max11802.c +++ b/nuttx/drivers/input/max11802.c @@ -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 diff --git a/nuttx/drivers/input/tsc2007.c b/nuttx/drivers/input/tsc2007.c index 9385e28e0..c4ad24594 100644 --- a/nuttx/drivers/input/tsc2007.c +++ b/nuttx/drivers/input/tsc2007.c @@ -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 diff --git a/nuttx/drivers/mmcsd/mmcsd_sdio.c b/nuttx/drivers/mmcsd/mmcsd_sdio.c index 113ba7101..e208a8aca 100644 --- a/nuttx/drivers/mmcsd/mmcsd_sdio.c +++ b/nuttx/drivers/mmcsd/mmcsd_sdio.c @@ -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 */ diff --git a/nuttx/drivers/mtd/ftl.c b/nuttx/drivers/mtd/ftl.c index 457967d1b..4e0204972 100644 --- a/nuttx/drivers/mtd/ftl.c +++ b/nuttx/drivers/mtd/ftl.c @@ -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"); diff --git a/nuttx/drivers/mtd/mtd_config.c b/nuttx/drivers/mtd/mtd_config.c index 3e71f2a0a..fcf168b0d 100644 --- a/nuttx/drivers/mtd/mtd_config.c +++ b/nuttx/drivers/mtd/mtd_config.c @@ -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 */ diff --git a/nuttx/drivers/mtd/sector512.c b/nuttx/drivers/mtd/sector512.c index 7438700c8..f1da6df05 100644 --- a/nuttx/drivers/mtd/sector512.c +++ b/nuttx/drivers/mtd/sector512.c @@ -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 */ diff --git a/nuttx/drivers/mtd/smart.c b/nuttx/drivers/mtd/smart.c index 860708f5b..156bbae1f 100644 --- a/nuttx/drivers/mtd/smart.c +++ b/nuttx/drivers/mtd/smart.c @@ -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); diff --git a/nuttx/drivers/mtd/sst25.c b/nuttx/drivers/mtd/sst25.c index 25622c5ef..72d4c14e3 100644 --- a/nuttx/drivers/mtd/sst25.c +++ b/nuttx/drivers/mtd/sst25.c @@ -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 */ diff --git a/nuttx/drivers/mtd/w25.c b/nuttx/drivers/mtd/w25.c index f56632e6e..49433d60c 100644 --- a/nuttx/drivers/mtd/w25.c +++ b/nuttx/drivers/mtd/w25.c @@ -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 */ diff --git a/nuttx/drivers/net/slip.c b/nuttx/drivers/net/slip.c index 66e84961e..b09a79753 100644 --- a/nuttx/drivers/net/slip.c +++ b/nuttx/drivers/net/slip.c @@ -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]; diff --git a/nuttx/drivers/pipes/pipe_common.c b/nuttx/drivers/pipes/pipe_common.c index aad49eff0..2acaeab97 100644 --- a/nuttx/drivers/pipes/pipe_common.c +++ b/nuttx/drivers/pipes/pipe_common.c @@ -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); diff --git a/nuttx/drivers/ramdisk.c b/nuttx/drivers/ramdisk.c index 0ada5c0cf..ee45aaf05 100644 --- a/nuttx/drivers/ramdisk.c +++ b/nuttx/drivers/ramdisk.c @@ -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 */ diff --git a/nuttx/drivers/rwbuffer.c b/nuttx/drivers/rwbuffer.c index e02dcf6f8..f5f5ebc75 100644 --- a/nuttx/drivers/rwbuffer.c +++ b/nuttx/drivers/rwbuffer.c @@ -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; } } diff --git a/nuttx/drivers/sensors/lis331dl.c b/nuttx/drivers/sensors/lis331dl.c index 12ff46f6c..ec44a7286 100644 --- a/nuttx/drivers/sensors/lis331dl.c +++ b/nuttx/drivers/sensors/lis331dl.c @@ -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; diff --git a/nuttx/drivers/sensors/lm75.c b/nuttx/drivers/sensors/lm75.c index 89f8b0885..8d60337c9 100644 --- a/nuttx/drivers/sensors/lm75.c +++ b/nuttx/drivers/sensors/lm75.c @@ -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"); diff --git a/nuttx/drivers/usbdev/cdcacm.c b/nuttx/drivers/usbdev/cdcacm.c index 2de32b3cf..797af20e4 100644 --- a/nuttx/drivers/usbdev/cdcacm.c +++ b/nuttx/drivers/usbdev/cdcacm.c @@ -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); diff --git a/nuttx/drivers/usbdev/composite.c b/nuttx/drivers/usbdev/composite.c index 9c7ca5208..5671b3607 100644 --- a/nuttx/drivers/usbdev/composite.c +++ b/nuttx/drivers/usbdev/composite.c @@ -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); diff --git a/nuttx/drivers/usbdev/pl2303.c b/nuttx/drivers/usbdev/pl2303.c index 45c92880c..5adb02b21 100644 --- a/nuttx/drivers/usbdev/pl2303.c +++ b/nuttx/drivers/usbdev/pl2303.c @@ -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); diff --git a/nuttx/drivers/usbdev/usbmsc.c b/nuttx/drivers/usbdev/usbmsc.c index 6332f5de7..6bcd33fcd 100644 --- a/nuttx/drivers/usbdev/usbmsc.c +++ b/nuttx/drivers/usbdev/usbmsc.c @@ -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); diff --git a/nuttx/drivers/usbhost/usbhost_devaddr.c b/nuttx/drivers/usbhost/usbhost_devaddr.c index e4bd67922..24eb63556 100755 --- a/nuttx/drivers/usbhost/usbhost_devaddr.c +++ b/nuttx/drivers/usbhost/usbhost_devaddr.c @@ -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"); diff --git a/nuttx/drivers/usbhost/usbhost_hidkbd.c b/nuttx/drivers/usbhost/usbhost_hidkbd.c index b18399e38..763c3151c 100644 --- a/nuttx/drivers/usbhost/usbhost_hidkbd.c +++ b/nuttx/drivers/usbhost/usbhost_hidkbd.c @@ -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; } diff --git a/nuttx/drivers/usbhost/usbhost_hidmouse.c b/nuttx/drivers/usbhost/usbhost_hidmouse.c index 3d5752941..5fdf181fa 100644 --- a/nuttx/drivers/usbhost/usbhost_hidmouse.c +++ b/nuttx/drivers/usbhost/usbhost_hidmouse.c @@ -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; } diff --git a/nuttx/drivers/usbhost/usbhost_skeleton.c b/nuttx/drivers/usbhost/usbhost_skeleton.c index 028441b72..b1af20f11 100644 --- a/nuttx/drivers/usbhost/usbhost_skeleton.c +++ b/nuttx/drivers/usbhost/usbhost_skeleton.c @@ -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; } diff --git a/nuttx/drivers/usbhost/usbhost_storage.c b/nuttx/drivers/usbhost/usbhost_storage.c index a3ff5ed4f..0b8072467 100644 --- a/nuttx/drivers/usbhost/usbhost_storage.c +++ b/nuttx/drivers/usbhost/usbhost_storage.c @@ -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; } diff --git a/nuttx/drivers/wireless/cc1101.c b/nuttx/drivers/wireless/cc1101.c index 69d88de2b..beb8f34d5 100644 --- a/nuttx/drivers/wireless/cc1101.c +++ b/nuttx/drivers/wireless/cc1101.c @@ -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; diff --git a/nuttx/drivers/wireless/cc3000/cc3000.c b/nuttx/drivers/wireless/cc3000/cc3000.c index 5f415c1f6..6cbde77ac 100644 --- a/nuttx/drivers/wireless/cc3000/cc3000.c +++ b/nuttx/drivers/wireless/cc3000/cc3000.c @@ -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 diff --git a/nuttx/drivers/wireless/nrf24l01.c b/nuttx/drivers/wireless/nrf24l01.c index f7a51fde7..dc9fa1363 100644 --- a/nuttx/drivers/wireless/nrf24l01.c +++ b/nuttx/drivers/wireless/nrf24l01.c @@ -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; diff --git a/nuttx/fs/fat/fs_fat32.c b/nuttx/fs/fat/fs_fat32.c index 677924057..1302b6395 100644 --- a/nuttx/fs/fat/fs_fat32.c +++ b/nuttx/fs/fat/fs_fat32.c @@ -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; diff --git a/nuttx/fs/fat/fs_mkfatfs.c b/nuttx/fs/fat/fs_mkfatfs.c index 4445c5a4c..10976abc1 100644 --- a/nuttx/fs/fat/fs_mkfatfs.c +++ b/nuttx/fs/fat/fs_mkfatfs.c @@ -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"); diff --git a/nuttx/fs/fs_foreachinode.c b/nuttx/fs/fs_foreachinode.c index b1b6439d7..8066aabe6 100644 --- a/nuttx/fs/fs_foreachinode.c +++ b/nuttx/fs/fs_foreachinode.c @@ -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; diff --git a/nuttx/fs/nxffs/nxffs_dump.c b/nuttx/fs/nxffs/nxffs_dump.c index 2cc50b1e0..f3208f5ff 100644 --- a/nuttx/fs/nxffs/nxffs_dump.c +++ b/nuttx/fs/nxffs/nxffs_dump.c @@ -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"); diff --git a/nuttx/fs/nxffs/nxffs_initialize.c b/nuttx/fs/nxffs/nxffs_initialize.c index 34ac847ad..2aace3a7b 100644 --- a/nuttx/fs/nxffs/nxffs_initialize.c +++ b/nuttx/fs/nxffs/nxffs_initialize.c @@ -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"); diff --git a/nuttx/fs/nxffs/nxffs_inode.c b/nuttx/fs/nxffs/nxffs_inode.c index 4af7cfe41..fb1847893 100644 --- a/nuttx/fs/nxffs/nxffs_inode.c +++ b/nuttx/fs/nxffs/nxffs_inode.c @@ -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); diff --git a/nuttx/fs/procfs/fs_procfscpuload.c b/nuttx/fs/procfs/fs_procfscpuload.c index e6bc1b398..9d01bcad3 100644 --- a/nuttx/fs/procfs/fs_procfscpuload.c +++ b/nuttx/fs/procfs/fs_procfscpuload.c @@ -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"); diff --git a/nuttx/fs/procfs/fs_procfsproc.c b/nuttx/fs/procfs/fs_procfsproc.c index 50cec9ed2..15625c22a 100644 --- a/nuttx/fs/procfs/fs_procfsproc.c +++ b/nuttx/fs/procfs/fs_procfsproc.c @@ -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"); diff --git a/nuttx/fs/procfs/fs_procfsuptime.c b/nuttx/fs/procfs/fs_procfsuptime.c index acbeb5595..2d1d02a25 100644 --- a/nuttx/fs/procfs/fs_procfsuptime.c +++ b/nuttx/fs/procfs/fs_procfsuptime.c @@ -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"); diff --git a/nuttx/fs/romfs/fs_romfs.c b/nuttx/fs/romfs/fs_romfs.c index 1197270ef..cbc0cbe81 100644 --- a/nuttx/fs/romfs/fs_romfs.c +++ b/nuttx/fs/romfs/fs_romfs.c @@ -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); diff --git a/nuttx/fs/romfs/fs_romfsutil.c b/nuttx/fs/romfs/fs_romfsutil.c index 36de75ed5..ce945a669 100644 --- a/nuttx/fs/romfs/fs_romfsutil.c +++ b/nuttx/fs/romfs/fs_romfsutil.c @@ -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; diff --git a/nuttx/fs/smartfs/smartfs_smart.c b/nuttx/fs/smartfs/smartfs_smart.c index fe398fa68..5b967bb4a 100644 --- a/nuttx/fs/smartfs/smartfs_smart.c +++ b/nuttx/fs/smartfs/smartfs_smart.c @@ -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; diff --git a/nuttx/fs/smartfs/smartfs_utils.c b/nuttx/fs/smartfs/smartfs_utils.c index 86b43cb09..d14f9d9fa 100644 --- a/nuttx/fs/smartfs/smartfs_utils.c +++ b/nuttx/fs/smartfs/smartfs_utils.c @@ -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); diff --git a/nuttx/graphics/nxbe/nxbe_colormap.c b/nuttx/graphics/nxbe/nxbe_colormap.c index 3a9a2506a..307ae4d99 100644 --- a/nuttx/graphics/nxbe/nxbe_colormap.c +++ b/nuttx/graphics/nxbe/nxbe_colormap.c @@ -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; diff --git a/nuttx/graphics/nxconsole/nxcon_font.c b/nuttx/graphics/nxconsole/nxcon_font.c index 056a96637..a9afa0c14 100644 --- a/nuttx/graphics/nxconsole/nxcon_font.c +++ b/nuttx/graphics/nxconsole/nxcon_font.c @@ -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) { diff --git a/nuttx/graphics/nxmu/nxmu_kbdin.c b/nuttx/graphics/nxmu/nxmu_kbdin.c index eb3fc0717..4f05b05fb 100644 --- a/nuttx/graphics/nxmu/nxmu_kbdin.c +++ b/nuttx/graphics/nxmu/nxmu_kbdin.c @@ -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 */ diff --git a/nuttx/include/nuttx/binfmt/binfmt.h b/nuttx/include/nuttx/binfmt/binfmt.h index f53b3a2ae..fbc50b3c7 100644 --- a/nuttx/include/nuttx/binfmt/binfmt.h +++ b/nuttx/include/nuttx/binfmt/binfmt.h @@ -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: diff --git a/nuttx/include/nuttx/binfmt/elf.h b/nuttx/include/nuttx/binfmt/elf.h index eb3f100c2..cacb80de5 100644 --- a/nuttx/include/nuttx/binfmt/elf.h +++ b/nuttx/include/nuttx/binfmt/elf.h @@ -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. diff --git a/nuttx/include/nuttx/binfmt/nxflat.h b/nuttx/include/nuttx/binfmt/nxflat.h index 69a7d8332..2777785e3 100644 --- a/nuttx/include/nuttx/binfmt/nxflat.h +++ b/nuttx/include/nuttx/binfmt/nxflat.h @@ -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. diff --git a/nuttx/include/nuttx/kmalloc.h b/nuttx/include/nuttx/kmalloc.h index 13d8b7155..ffe0340dc 100644 --- a/nuttx/include/nuttx/kmalloc.h +++ b/nuttx/include/nuttx/kmalloc.h @@ -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 **********************************/ diff --git a/nuttx/include/nuttx/mm.h b/nuttx/include/nuttx/mm.h index 4de3d5912..41095b98a 100644 --- a/nuttx/include/nuttx/mm.h +++ b/nuttx/include/nuttx/mm.h @@ -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, diff --git a/nuttx/include/nuttx/nx/nxmu.h b/nuttx/include/nuttx/nx/nxmu.h index 711365f74..b8e1e60e4 100644 --- a/nuttx/include/nuttx/nx/nxmu.h +++ b/nuttx/include/nuttx/nx/nxmu.h @@ -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. diff --git a/nuttx/include/nuttx/sched.h b/nuttx/include/nuttx/sched.h index 1952bea77..279abea95 100644 --- a/nuttx/include/nuttx/sched.h +++ b/nuttx/include/nuttx/sched.h @@ -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). */ diff --git a/nuttx/include/nuttx/usb/usbhost.h b/nuttx/include/nuttx/usb/usbhost.h index 5c8d23df1..e6deed85f 100644 --- a/nuttx/include/nuttx/usb/usbhost.h +++ b/nuttx/include/nuttx/usb/usbhost.h @@ -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. */ diff --git a/nuttx/mm/kmm_malloc.c b/nuttx/mm/kmm_malloc.c index 3646d3bae..65d1a5f4e 100644 --- a/nuttx/mm/kmm_malloc.c +++ b/nuttx/mm/kmm_malloc.c @@ -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); } diff --git a/nuttx/net/igmp/igmp_group.c b/nuttx/net/igmp/igmp_group.c index fba472757..632c29fc4 100644 --- a/nuttx/net/igmp/igmp_group.c +++ b/nuttx/net/igmp/igmp_group.c @@ -116,7 +116,7 @@ * Private Data ****************************************************************************/ -/* kmalloc() cannot be called from an interrupt handler. To work around this, +/* kmm_malloc() cannot be called from an interrupt handler. To work around this, * a small number of IGMP groups are preallocated just for use in interrupt * handling logic. */ @@ -141,7 +141,7 @@ static FAR sq_queue_t g_freelist; * Allocate a new group from heap memory. * * Assumptions: - * Calls kmalloc and so cannot be called from an interrupt handler. + * Calls kmm_malloc and so cannot be called from an interrupt handler. * ****************************************************************************/ diff --git a/nuttx/net/socket/net_poll.c b/nuttx/net/socket/net_poll.c index f60df2366..37f990bd2 100644 --- a/nuttx/net/socket/net_poll.c +++ b/nuttx/net/socket/net_poll.c @@ -200,7 +200,7 @@ static inline int net_pollsetup(FAR struct socket *psock, /* Allocate a container to hold the poll information */ - info = (FAR struct net_poll_s *)kmalloc(sizeof(struct net_poll_s)); + info = (FAR struct net_poll_s *)kmm_malloc(sizeof(struct net_poll_s)); if (!info) { return -ENOMEM; diff --git a/nuttx/sched/group/group_create.c b/nuttx/sched/group/group_create.c index 352862eac..5635cdc0b 100644 --- a/nuttx/sched/group/group_create.c +++ b/nuttx/sched/group/group_create.c @@ -278,7 +278,7 @@ int group_initialize(FAR struct task_tcb_s *tcb) #ifdef HAVE_GROUP_MEMBERS /* Allocate space to hold GROUP_INITIAL_MEMBERS members of the group */ - group->tg_members = (FAR pid_t *)kmalloc(GROUP_INITIAL_MEMBERS*sizeof(pid_t)); + group->tg_members = (FAR pid_t *)kmm_malloc(GROUP_INITIAL_MEMBERS*sizeof(pid_t)); if (!group->tg_members) { kmm_free(group); diff --git a/nuttx/sched/mqueue/mq_initialize.c b/nuttx/sched/mqueue/mq_initialize.c index 0c6fd025a..99e4d5c0a 100644 --- a/nuttx/sched/mqueue/mq_initialize.c +++ b/nuttx/sched/mqueue/mq_initialize.c @@ -133,7 +133,7 @@ static mqmsg_t *mq_msgblockalloc(sq_queue_t *queue, uint16_t nmsgs, * configured number of messages. */ - mqmsgblock = (mqmsg_t*)kmalloc(sizeof(mqmsg_t) * nmsgs); + mqmsgblock = (mqmsg_t*)kmm_malloc(sizeof(mqmsg_t) * nmsgs); if (mqmsgblock) { mqmsg_t *mqmsg = mqmsgblock; @@ -221,7 +221,7 @@ void mq_desblockalloc(void) /* Allocate a block of message descriptors */ - mqdesblock = (FAR struct mq_des_block_s *)kmalloc(sizeof(struct mq_des_block_s)); + mqdesblock = (FAR struct mq_des_block_s *)kmm_malloc(sizeof(struct mq_des_block_s)); if (mqdesblock) { int i; diff --git a/nuttx/sched/mqueue/mq_sndinternal.c b/nuttx/sched/mqueue/mq_sndinternal.c index 033b2095c..c499ff1f8 100644 --- a/nuttx/sched/mqueue/mq_sndinternal.c +++ b/nuttx/sched/mqueue/mq_sndinternal.c @@ -199,7 +199,7 @@ FAR mqmsg_t *mq_msgalloc(void) if (!mqmsg) { - mqmsg = (FAR mqmsg_t *)kmalloc((sizeof (mqmsg_t))); + mqmsg = (FAR mqmsg_t *)kmm_malloc((sizeof (mqmsg_t))); /* Check if we got an allocated message */ diff --git a/nuttx/sched/semaphore/sem_open.c b/nuttx/sched/semaphore/sem_open.c index 8308ffb86..1d5225db1 100644 --- a/nuttx/sched/semaphore/sem_open.c +++ b/nuttx/sched/semaphore/sem_open.c @@ -173,7 +173,7 @@ FAR sem_t *sem_open (FAR const char *name, int oflag, ...) { /* Allocate memory for the new semaphore */ - psem = (FAR nsem_t*)kmalloc((sizeof(nsem_t) + namelen + 1)); + psem = (FAR nsem_t*)kmm_malloc((sizeof(nsem_t) + namelen + 1)); if (psem) { /* Initialize the named semaphore */ diff --git a/nuttx/sched/signal/sig_allocatependingsigaction.c b/nuttx/sched/signal/sig_allocatependingsigaction.c index 3e784bf1f..201a4939c 100644 --- a/nuttx/sched/signal/sig_allocatependingsigaction.c +++ b/nuttx/sched/signal/sig_allocatependingsigaction.c @@ -119,7 +119,7 @@ FAR sigq_t *sig_allocatependingsigaction(void) if (!sigq) { - sigq = (FAR sigq_t *)kmalloc((sizeof (sigq_t))); + sigq = (FAR sigq_t *)kmm_malloc((sizeof (sigq_t))); } /* Check if we got an allocated message */ diff --git a/nuttx/sched/signal/sig_dispatch.c b/nuttx/sched/signal/sig_dispatch.c index 1cffefb36..48e35e21e 100644 --- a/nuttx/sched/signal/sig_dispatch.c +++ b/nuttx/sched/signal/sig_dispatch.c @@ -183,7 +183,7 @@ static FAR sigpendq_t *sig_allocatependingsignal(void) if (!sigpend) { - sigpend = (FAR sigpendq_t *)kmalloc((sizeof (sigpendq_t))); + sigpend = (FAR sigpendq_t *)kmm_malloc((sizeof (sigpendq_t))); } /* Check if we got an allocated message */ diff --git a/nuttx/sched/signal/sig_initialize.c b/nuttx/sched/signal/sig_initialize.c index aba6d37de..a9091a3c8 100644 --- a/nuttx/sched/signal/sig_initialize.c +++ b/nuttx/sched/signal/sig_initialize.c @@ -153,7 +153,7 @@ static sigq_t *sig_allocateblock(sq_queue_t *siglist, uint16_t nsigs, /* Allocate a block of pending signal actions */ - sigqalloc = (sigq_t*)kmalloc((sizeof(sigq_t)) * nsigs); + sigqalloc = (sigq_t*)kmm_malloc((sizeof(sigq_t)) * nsigs); sigq = sigqalloc; for (i = 0; i < nsigs; i++) @@ -184,7 +184,7 @@ static sigpendq_t *sig_allocatependingsignalblock(sq_queue_t *siglist, /* Allocate a block of pending signal structures */ sigpendalloc = - (sigpendq_t*)kmalloc((sizeof(sigpendq_t)) * nsigs); + (sigpendq_t*)kmm_malloc((sizeof(sigpendq_t)) * nsigs); sigpend = sigpendalloc; for (i = 0; i < nsigs; i++) @@ -260,7 +260,7 @@ void sig_allocateactionblock(void) /* Allocate a block of signal actions */ g_sigactionalloc = - (sigactq_t*)kmalloc((sizeof(sigactq_t)) * NUM_SIGNAL_ACTIONS); + (sigactq_t*)kmm_malloc((sizeof(sigactq_t)) * NUM_SIGNAL_ACTIONS); sigact = g_sigactionalloc; for (i = 0; i < NUM_SIGNAL_ACTIONS; i++) diff --git a/nuttx/sched/timer/timer_create.c b/nuttx/sched/timer/timer_create.c index 3c1a4c1d3..ce488186d 100644 --- a/nuttx/sched/timer/timer_create.c +++ b/nuttx/sched/timer/timer_create.c @@ -100,7 +100,7 @@ static struct posix_timer_s *timer_allocate(void) { /* Allocate a new timer from the heap */ - ret = (struct posix_timer_s*)kmalloc(sizeof(struct posix_timer_s)); + ret = (struct posix_timer_s*)kmm_malloc(sizeof(struct posix_timer_s)); pt_flags = 0; } diff --git a/nuttx/sched/wdog/wd_create.c b/nuttx/sched/wdog/wd_create.c index ce1ca56ed..459f0a68a 100644 --- a/nuttx/sched/wdog/wd_create.c +++ b/nuttx/sched/wdog/wd_create.c @@ -139,7 +139,7 @@ WDOG_ID wd_create (void) /* We do not require that interrupts be disabled to do this. */ irqrestore(state); - wdog = (FAR struct wdog_s *)kmalloc(sizeof(struct wdog_s)); + wdog = (FAR struct wdog_s *)kmm_malloc(sizeof(struct wdog_s)); /* Did we get one? */ |