mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 08:36:24 +08:00
Rename kmalloc to kmm_malloc for consistency
This commit is contained in:
@@ -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 */
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 */
|
||||
|
||||
+2
-2
@@ -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");
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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 */
|
||||
|
||||
+5
-5
@@ -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);
|
||||
|
||||
+1
-1
@@ -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 */
|
||||
|
||||
+1
-1
@@ -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 */
|
||||
|
||||
+1
-1
@@ -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];
|
||||
|
||||
@@ -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);
|
||||
|
||||
+1
-1
@@ -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 */
|
||||
|
||||
+4
-4
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user