Reanem kzalloc to kmm_zalloc for consistency
This commit is contained in:
parent
ff2442a02e
commit
205260d5e2
76 changed files with 116 additions and 116 deletions
|
|
@ -163,7 +163,7 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
|||
if (ttype == TCB_FLAG_TTYPE_KERNEL)
|
||||
{
|
||||
#if defined(CONFIG_DEBUG) && !defined(CONFIG_DEBUG_STACK)
|
||||
tcb->stack_alloc_ptr = (uint32_t *)kzalloc(stack_size);
|
||||
tcb->stack_alloc_ptr = (uint32_t *)kmm_zalloc(stack_size);
|
||||
#else
|
||||
tcb->stack_alloc_ptr = (uint32_t *)kmm_malloc(stack_size);
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -3617,7 +3617,7 @@ static int lpc31_epalloc(FAR struct usbhost_driver_s *drvr,
|
|||
|
||||
/* Allocate a endpoint information structure */
|
||||
|
||||
epinfo = (struct lpc31_epinfo_s *)kzalloc(sizeof(struct lpc31_epinfo_s));
|
||||
epinfo = (struct lpc31_epinfo_s *)kmm_zalloc(sizeof(struct lpc31_epinfo_s));
|
||||
if (!epinfo)
|
||||
{
|
||||
usbhost_trace1(EHCI_TRACE1_EPALLOC_FAILED, 0);
|
||||
|
|
|
|||
|
|
@ -3457,7 +3457,7 @@ static int sam_epalloc(FAR struct usbhost_driver_s *drvr,
|
|||
|
||||
/* Allocate a endpoint information structure */
|
||||
|
||||
epinfo = (struct sam_epinfo_s *)kzalloc(sizeof(struct sam_epinfo_s));
|
||||
epinfo = (struct sam_epinfo_s *)kmm_zalloc(sizeof(struct sam_epinfo_s));
|
||||
if (!epinfo)
|
||||
{
|
||||
usbhost_trace1(EHCI_TRACE1_EPALLOC_FAILED, 0);
|
||||
|
|
|
|||
|
|
@ -2359,7 +2359,7 @@ static int sam_epalloc(FAR struct usbhost_driver_s *drvr,
|
|||
|
||||
/* Allocate a container for the endpoint data */
|
||||
|
||||
eplist = (struct sam_eplist_s *)kzalloc(sizeof(struct sam_eplist_s));
|
||||
eplist = (struct sam_eplist_s *)kmm_zalloc(sizeof(struct sam_eplist_s));
|
||||
if (!eplist)
|
||||
{
|
||||
usbhost_trace1(OHCI_TRACE1_EPLISTALLOC_FAILED, 0);
|
||||
|
|
|
|||
|
|
@ -165,7 +165,7 @@ static int ccm_open(FAR struct file *filep, FAR const char *relpath,
|
|||
|
||||
/* Allocate a container to hold the task and attribute selection */
|
||||
|
||||
priv = (FAR struct ccm_file_s *)kzalloc(sizeof(struct ccm_file_s));
|
||||
priv = (FAR struct ccm_file_s *)kmm_zalloc(sizeof(struct ccm_file_s));
|
||||
if (!priv)
|
||||
{
|
||||
fdbg("ERROR: Failed to allocate file attributes\n");
|
||||
|
|
@ -282,7 +282,7 @@ static int ccm_dup(FAR const struct file *oldp, FAR struct file *newp)
|
|||
|
||||
/* Allocate a new container to hold the task and attribute selection */
|
||||
|
||||
newpriv = (FAR struct ccm_file_s *)kzalloc(sizeof(struct ccm_file_s));
|
||||
newpriv = (FAR struct ccm_file_s *)kmm_zalloc(sizeof(struct ccm_file_s));
|
||||
if (!newpriv)
|
||||
{
|
||||
fdbg("ERROR: Failed to allocate file attributes\n");
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
|||
if (ttype == TCB_FLAG_TTYPE_KERNEL)
|
||||
{
|
||||
#if defined(CONFIG_DEBUG) && !defined(CONFIG_DEBUG_STACK)
|
||||
tcb->stack_alloc_ptr = (uint32_t *)kzalloc(stack_size);
|
||||
tcb->stack_alloc_ptr = (uint32_t *)kmm_zalloc(stack_size);
|
||||
#else
|
||||
tcb->stack_alloc_ptr = (uint32_t *)kmm_malloc(stack_size);
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
|||
if (ttype == TCB_FLAG_TTYPE_KERNEL)
|
||||
{
|
||||
#if defined(CONFIG_DEBUG) && !defined(CONFIG_DEBUG_STACK)
|
||||
tcb->stack_alloc_ptr = (uint32_t *)kzalloc(stack_size);
|
||||
tcb->stack_alloc_ptr = (uint32_t *)kmm_zalloc(stack_size);
|
||||
#else
|
||||
tcb->stack_alloc_ptr = (uint32_t *)kmm_malloc(stack_size);
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
|||
if (ttype == TCB_FLAG_TTYPE_KERNEL)
|
||||
{
|
||||
#if defined(CONFIG_DEBUG) && !defined(CONFIG_DEBUG_STACK)
|
||||
tcb->stack_alloc_ptr = (uint32_t *)kzalloc(stack_size);
|
||||
tcb->stack_alloc_ptr = (uint32_t *)kmm_zalloc(stack_size);
|
||||
#else
|
||||
tcb->stack_alloc_ptr = (uint32_t *)kmm_malloc(stack_size);
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -174,11 +174,11 @@ static uart_dev_t *up_alloc_com(unsigned int base, int irq)
|
|||
uart_dev_t *dev;
|
||||
struct up_dev_s *priv;
|
||||
|
||||
priv = kzalloc(sizeof(struct up_dev_s));
|
||||
priv = kmm_zalloc(sizeof(struct up_dev_s));
|
||||
if (priv == NULL)
|
||||
goto err0;
|
||||
|
||||
dev = kzalloc(sizeof(uart_dev_t));
|
||||
dev = kmm_zalloc(sizeof(uart_dev_t));
|
||||
if (dev == NULL)
|
||||
goto err1;
|
||||
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
|||
if (ttype == TCB_FLAG_TTYPE_KERNEL)
|
||||
{
|
||||
#if defined(CONFIG_DEBUG) && !defined(CONFIG_DEBUG_STACK)
|
||||
tcb->stack_alloc_ptr = (uint32_t *)kzalloc(stack_size);
|
||||
tcb->stack_alloc_ptr = (uint32_t *)kmm_zalloc(stack_size);
|
||||
#else
|
||||
tcb->stack_alloc_ptr = (uint32_t *)kmm_malloc(stack_size);
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
|||
if (ttype == TCB_FLAG_TTYPE_KERNEL)
|
||||
{
|
||||
#if defined(CONFIG_DEBUG) && !defined(CONFIG_DEBUG_STACK)
|
||||
tcb->stack_alloc_ptr = (uint32_t *)kzalloc(stack_size);
|
||||
tcb->stack_alloc_ptr = (uint32_t *)kmm_zalloc(stack_size);
|
||||
#else
|
||||
tcb->stack_alloc_ptr = (uint32_t *)kmm_malloc(stack_size);
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
|||
if (ttype == TCB_FLAG_TTYPE_KERNEL)
|
||||
{
|
||||
#if defined(CONFIG_DEBUG) && !defined(CONFIG_DEBUG_STACK)
|
||||
tcb->stack_alloc_ptr = (uint32_t *)kzalloc(stack_size);
|
||||
tcb->stack_alloc_ptr = (uint32_t *)kmm_zalloc(stack_size);
|
||||
#else
|
||||
tcb->stack_alloc_ptr = (uint32_t *)kmm_malloc(stack_size);
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -882,14 +882,14 @@ int audio_register(FAR const char *name, FAR struct audio_lowerhalf_s *dev)
|
|||
|
||||
/* Allocate the upper-half data structure */
|
||||
|
||||
upper = (FAR struct audio_upperhalf_s *)kzalloc(sizeof(struct audio_upperhalf_s));
|
||||
upper = (FAR struct audio_upperhalf_s *)kmm_zalloc(sizeof(struct audio_upperhalf_s));
|
||||
if (!upper)
|
||||
{
|
||||
auddbg("Allocation failed\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
/* Initialize the Audio device structure (it was already zeroed by kzalloc()) */
|
||||
/* Initialize the Audio device structure (it was already zeroed by kmm_zalloc()) */
|
||||
|
||||
sem_init(&upper->exclsem, 0, 1);
|
||||
upper->dev = dev;
|
||||
|
|
|
|||
|
|
@ -1375,14 +1375,14 @@ FAR struct audio_lowerhalf_s *
|
|||
|
||||
/* Allocate an instance of our private data structure */
|
||||
|
||||
priv = (FAR struct pcm_decode_s *)kzalloc(sizeof(struct pcm_decode_s));
|
||||
priv = (FAR struct pcm_decode_s *)kmm_zalloc(sizeof(struct pcm_decode_s));
|
||||
if (!priv)
|
||||
{
|
||||
auddbg("ERROR: Failed to allocate driver structure\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Initialize our private data structure. Since kzalloc() was used for
|
||||
/* Initialize our private data structure. Since kmm_zalloc() was used for
|
||||
* the allocation, we need to initialize only non-zero, non-NULL, non-
|
||||
* false fields.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ int exec(FAR const char *filename, FAR char * const *argv,
|
|||
|
||||
/* Allocate the load information */
|
||||
|
||||
bin = (FAR struct binary_s *)kzalloc(sizeof(struct binary_s));
|
||||
bin = (FAR struct binary_s *)kmm_zalloc(sizeof(struct binary_s));
|
||||
if (!bin)
|
||||
{
|
||||
set_errno(ENOMEM);
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ int exec_module(FAR const struct binary_s *binp)
|
|||
|
||||
/* Allocate a TCB for the new task. */
|
||||
|
||||
tcb = (FAR struct task_tcb_s*)kzalloc(sizeof(struct task_tcb_s));
|
||||
tcb = (FAR struct task_tcb_s*)kmm_zalloc(sizeof(struct task_tcb_s));
|
||||
if (!tcb)
|
||||
{
|
||||
err = ENOMEM;
|
||||
|
|
|
|||
|
|
@ -265,7 +265,7 @@ int elf_loaddtors(FAR struct elf_loadinfo_s *loadinfo);
|
|||
*
|
||||
* Description:
|
||||
* Allocate memory for the ELF image (textalloc and dataalloc). If
|
||||
* CONFIG_ARCH_ADDRENV=n, textalloc will be allocated using kzalloc() and
|
||||
* CONFIG_ARCH_ADDRENV=n, textalloc will be allocated using kmm_zalloc() and
|
||||
* dataalloc will be a offset from textalloc. If CONFIG_ARCH_ADDRENV-y, then
|
||||
* textalloc and dataalloc will be allocated using up_addrenv_create(). In
|
||||
* either case, there will be a unique instance of textalloc and dataalloc
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@
|
|||
*
|
||||
* Description:
|
||||
* Allocate memory for the ELF image (textalloc and dataalloc). If
|
||||
* CONFIG_ARCH_ADDRENV=n, textalloc will be allocated using kzalloc() and
|
||||
* CONFIG_ARCH_ADDRENV=n, textalloc will be allocated using kmm_zalloc() and
|
||||
* dataalloc will be a offset from textalloc. If CONFIG_ARCH_ADDRENV-y, then
|
||||
* textalloc and dataalloc will be allocated using up_addrenv_create(). In
|
||||
* either case, there will be a unique instance of textalloc and dataalloc
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@
|
|||
*
|
||||
* Description:
|
||||
* Allocate data memory for the NXFLAT image. If CONFIG_ARCH_ADDRENV=n,
|
||||
* memory will be allocated using kzalloc(). If CONFIG_ARCH_ADDRENV-y,
|
||||
* memory will be allocated using kmm_zalloc(). If CONFIG_ARCH_ADDRENV-y,
|
||||
* then memory will be allocated using up_addrenv_create().
|
||||
*
|
||||
* Input Parameters:
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@
|
|||
*
|
||||
* Description:
|
||||
* Allocate data memory for the NXFLAT image. If CONFIG_ARCH_ADDRENV=n,
|
||||
* memory will be allocated using kzalloc(). If CONFIG_ARCH_ADDRENV-y,
|
||||
* memory will be allocated using kmm_zalloc(). If CONFIG_ARCH_ADDRENV-y,
|
||||
* then memory will be allocated using up_addrenv_create().
|
||||
*
|
||||
* Input Parameters:
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@
|
|||
|
||||
static int do_test_aes(FAR struct cipher_testvec* test, int mode, int encrypt)
|
||||
{
|
||||
FAR void *out = kzalloc(test->rlen);
|
||||
FAR void *out = kmm_zalloc(test->rlen);
|
||||
int res = aes_cypher(out, test->input, test->ilen, test->iv, test->key,
|
||||
test->klen, mode, encrypt);
|
||||
if (res == OK)
|
||||
|
|
|
|||
|
|
@ -831,10 +831,10 @@ FAR struct audio_lowerhalf_s *audio_null_initialize(void)
|
|||
|
||||
/* Allocate the null audio device structure */
|
||||
|
||||
priv = (FAR struct null_dev_s *)kzalloc(sizeof(struct null_dev_s));
|
||||
priv = (FAR struct null_dev_s *)kmm_zalloc(sizeof(struct null_dev_s));
|
||||
if (priv)
|
||||
{
|
||||
/* Initialize the null audio device structure. Since we used kzalloc,
|
||||
/* Initialize the null audio device structure. Since we used kmm_zalloc,
|
||||
* only the non-zero elements of the structure need to be initialized.
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -413,7 +413,7 @@ int i2schar_register(FAR struct i2s_dev_s *i2s, int minor)
|
|||
|
||||
/* Allocate a I2S character device structure */
|
||||
|
||||
priv = (FAR struct i2schar_dev_s *)kzalloc(sizeof(struct i2schar_dev_s));
|
||||
priv = (FAR struct i2schar_dev_s *)kmm_zalloc(sizeof(struct i2schar_dev_s));
|
||||
if (priv)
|
||||
{
|
||||
/* Initialize the I2S character device structure */
|
||||
|
|
|
|||
|
|
@ -2470,10 +2470,10 @@ FAR struct audio_lowerhalf_s *
|
|||
|
||||
/* Allocate a WM8904 device structure */
|
||||
|
||||
priv = (FAR struct wm8904_dev_s *)kzalloc(sizeof(struct wm8904_dev_s));
|
||||
priv = (FAR struct wm8904_dev_s *)kmm_zalloc(sizeof(struct wm8904_dev_s));
|
||||
if (priv)
|
||||
{
|
||||
/* Initialize the WM8904 device structure. Since we used kzalloc,
|
||||
/* Initialize the WM8904 device structure. Since we used kmm_zalloc,
|
||||
* only the non-zero elements of the structure need to be initialized.
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ int bchlib_setup(const char *blkdev, bool readonly, FAR void **handle)
|
|||
|
||||
/* Allocate the BCH state structure */
|
||||
|
||||
bch = (FAR struct bchlib_s*)kzalloc(sizeof(struct bchlib_s));
|
||||
bch = (FAR struct bchlib_s*)kmm_zalloc(sizeof(struct bchlib_s));
|
||||
if (!bch)
|
||||
{
|
||||
fdbg("Failed to allocate BCH structure\n");
|
||||
|
|
|
|||
|
|
@ -1745,7 +1745,7 @@ static int mxt_hwinitialize(FAR struct mxt_dev_s *priv)
|
|||
|
||||
/* Allocate memory for the object table */
|
||||
|
||||
priv->objtab = kzalloc(info->nobjects * sizeof(struct mxt_object_s));
|
||||
priv->objtab = kmm_zalloc(info->nobjects * sizeof(struct mxt_object_s));
|
||||
if (priv->objtab == NULL)
|
||||
{
|
||||
idbg("ERROR: Failed to allocate object table\n");
|
||||
|
|
@ -1807,7 +1807,7 @@ static int mxt_hwinitialize(FAR struct mxt_dev_s *priv)
|
|||
/* Allocate a place to hold sample data for each slot */
|
||||
|
||||
priv->sample = (FAR struct mxt_sample_s *)
|
||||
kzalloc(nslots * sizeof(struct mxt_sample_s));
|
||||
kmm_zalloc(nslots * sizeof(struct mxt_sample_s));
|
||||
if (priv->sample == NULL)
|
||||
{
|
||||
idbg("ERROR: Failed to allocate object table\n");
|
||||
|
|
@ -1863,7 +1863,7 @@ int mxt_register(FAR struct i2c_dev_s *i2c,
|
|||
|
||||
/* Create and initialize a maXTouch device driver instance */
|
||||
|
||||
priv = (FAR struct mxt_dev_s *)kzalloc(sizeof(struct mxt_dev_s));
|
||||
priv = (FAR struct mxt_dev_s *)kmm_zalloc(sizeof(struct mxt_dev_s));
|
||||
if (priv == NULL)
|
||||
{
|
||||
idbg("ERROR: Failed allocate device structure\n");
|
||||
|
|
|
|||
|
|
@ -297,7 +297,7 @@ STMPE811_HANDLE stmpe811_instantiate(FAR struct i2c_dev_s *dev,
|
|||
/* Allocate the device state structure */
|
||||
|
||||
#ifdef CONFIG_STMPE811_MULTIPLE
|
||||
priv = (FAR struct stmpe811_dev_s *)kzalloc(sizeof(struct stmpe811_dev_s));
|
||||
priv = (FAR struct stmpe811_dev_s *)kmm_zalloc(sizeof(struct stmpe811_dev_s));
|
||||
if (!priv)
|
||||
{
|
||||
return NULL;
|
||||
|
|
|
|||
|
|
@ -381,7 +381,7 @@ int losetup(const char *devname, const char *filename, uint16_t sectsize,
|
|||
|
||||
/* Allocate a loop device structure */
|
||||
|
||||
dev = (FAR struct loop_struct_s *)kzalloc(sizeof(struct loop_struct_s));
|
||||
dev = (FAR struct loop_struct_s *)kmm_zalloc(sizeof(struct loop_struct_s));
|
||||
if (!dev)
|
||||
{
|
||||
return -ENOMEM;
|
||||
|
|
|
|||
|
|
@ -674,11 +674,11 @@ FAR struct mtd_dev_s *at25_initialize(FAR struct spi_dev_s *dev)
|
|||
* to be extended to handle multiple FLASH parts on the same SPI bus.
|
||||
*/
|
||||
|
||||
priv = (FAR struct at25_dev_s *)kzalloc(sizeof(struct at25_dev_s));
|
||||
priv = (FAR struct at25_dev_s *)kmm_zalloc(sizeof(struct at25_dev_s));
|
||||
if (priv)
|
||||
{
|
||||
/* Initialize the allocated structure (unsupported methods were
|
||||
* nullified by kzalloc).
|
||||
* nullified by kmm_zalloc).
|
||||
*/
|
||||
|
||||
priv->mtd.erase = at25_erase;
|
||||
|
|
|
|||
|
|
@ -827,11 +827,11 @@ FAR struct mtd_dev_s *at45db_initialize(FAR struct spi_dev_s *spi)
|
|||
* to be extended to handle multiple FLASH parts on the same SPI bus.
|
||||
*/
|
||||
|
||||
priv = (FAR struct at45db_dev_s *)kzalloc(sizeof(struct at45db_dev_s));
|
||||
priv = (FAR struct at45db_dev_s *)kmm_zalloc(sizeof(struct at45db_dev_s));
|
||||
if (priv)
|
||||
{
|
||||
/* Initialize the allocated structure. (unsupported methods were
|
||||
* nullified by kzalloc).
|
||||
* nullified by kmm_zalloc).
|
||||
*/
|
||||
|
||||
priv->mtd.erase = at45db_erase;
|
||||
|
|
|
|||
|
|
@ -998,11 +998,11 @@ FAR struct mtd_dev_s *m25p_initialize(FAR struct spi_dev_s *dev)
|
|||
* to be extended to handle multiple FLASH parts on the same SPI bus.
|
||||
*/
|
||||
|
||||
priv = (FAR struct m25p_dev_s *)kzalloc(sizeof(struct m25p_dev_s));
|
||||
priv = (FAR struct m25p_dev_s *)kmm_zalloc(sizeof(struct m25p_dev_s));
|
||||
if (priv)
|
||||
{
|
||||
/* Initialize the allocated structure. (unsupported methods were
|
||||
* nullified by kzalloc).
|
||||
* nullified by kmm_zalloc).
|
||||
*/
|
||||
|
||||
priv->mtd.erase = m25p_erase;
|
||||
|
|
|
|||
|
|
@ -952,7 +952,7 @@ FAR struct mtd_dev_s *nand_initialize(FAR struct nand_raw_s *raw)
|
|||
|
||||
/* Allocate an NAND MTD device structure */
|
||||
|
||||
nand = (FAR struct nand_dev_s *)kzalloc(sizeof(struct nand_dev_s));
|
||||
nand = (FAR struct nand_dev_s *)kmm_zalloc(sizeof(struct nand_dev_s));
|
||||
if (!nand)
|
||||
{
|
||||
fdbg("ERROR: Failed to allocate the NAND MTD device structure\n");
|
||||
|
|
|
|||
|
|
@ -495,7 +495,7 @@ static int part_procfs_open(FAR struct file *filep, FAR const char *relpath,
|
|||
|
||||
/* Allocate a container to hold the task and attribute selection */
|
||||
|
||||
attr = (FAR struct part_procfs_file_s *)kzalloc(sizeof(struct part_procfs_file_s));
|
||||
attr = (FAR struct part_procfs_file_s *)kmm_zalloc(sizeof(struct part_procfs_file_s));
|
||||
if (!attr)
|
||||
{
|
||||
fdbg("ERROR: Failed to allocate file attributes\n");
|
||||
|
|
@ -711,7 +711,7 @@ static int part_procfs_dup(FAR const struct file *oldp, FAR struct file *newp)
|
|||
|
||||
/* Allocate a new container to hold the task and attribute selection */
|
||||
|
||||
newattr = (FAR struct part_procfs_file_s *)kzalloc(sizeof(struct part_procfs_file_s));
|
||||
newattr = (FAR struct part_procfs_file_s *)kmm_zalloc(sizeof(struct part_procfs_file_s));
|
||||
if (!newattr)
|
||||
{
|
||||
fdbg("ERROR: Failed to allocate file attributes\n");
|
||||
|
|
@ -833,7 +833,7 @@ FAR struct mtd_dev_s *mtd_partition(FAR struct mtd_dev_s *mtd, off_t firstblock,
|
|||
|
||||
/* Allocate a partition device structure */
|
||||
|
||||
part = (FAR struct mtd_partition_s *)kzalloc(sizeof(struct mtd_partition_s));
|
||||
part = (FAR struct mtd_partition_s *)kmm_zalloc(sizeof(struct mtd_partition_s));
|
||||
if (!part)
|
||||
{
|
||||
fdbg("ERROR: Failed to allocate memory for the partition device\n");
|
||||
|
|
@ -841,7 +841,7 @@ FAR struct mtd_dev_s *mtd_partition(FAR struct mtd_dev_s *mtd, off_t firstblock,
|
|||
}
|
||||
|
||||
/* Initialize the partition device structure. (unsupported methods were
|
||||
* nullified by kzalloc).
|
||||
* nullified by kmm_zalloc).
|
||||
*/
|
||||
|
||||
part->child.erase = part_erase;
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ static int mtd_open(FAR struct file *filep, FAR const char *relpath,
|
|||
|
||||
/* Allocate a context structure */
|
||||
|
||||
attr = (FAR struct mtd_file_s *)kzalloc(sizeof(struct mtd_file_s));
|
||||
attr = (FAR struct mtd_file_s *)kmm_zalloc(sizeof(struct mtd_file_s));
|
||||
if (!attr)
|
||||
{
|
||||
fdbg("ERROR: Failed to allocate file attributes\n");
|
||||
|
|
@ -276,7 +276,7 @@ static int mtd_dup(FAR const struct file *oldp, FAR struct file *newp)
|
|||
|
||||
/* Allocate a new container to hold the task and attribute selection */
|
||||
|
||||
newattr = (FAR struct mtd_file_s *)kzalloc(sizeof(struct mtd_file_s));
|
||||
newattr = (FAR struct mtd_file_s *)kmm_zalloc(sizeof(struct mtd_file_s));
|
||||
if (!newattr)
|
||||
{
|
||||
fdbg("ERROR: Failed to allocate file attributes\n");
|
||||
|
|
|
|||
|
|
@ -356,11 +356,11 @@ FAR struct mtd_dev_s *mtd_rwb_initialize(FAR struct mtd_dev_s *mtd)
|
|||
* to be extended to handle multiple FLASH parts on the same SPI bus.
|
||||
*/
|
||||
|
||||
priv = (FAR struct mtd_rwbuffer_s *)kzalloc(sizeof(struct mtd_rwbuffer_s));
|
||||
priv = (FAR struct mtd_rwbuffer_s *)kmm_zalloc(sizeof(struct mtd_rwbuffer_s));
|
||||
if (priv)
|
||||
{
|
||||
/* Initialize the allocated structure. (unsupported methods/fields
|
||||
* were already nullified by kzalloc).
|
||||
* were already nullified by kmm_zalloc).
|
||||
*/
|
||||
|
||||
priv->mtd.erase = mtd_erase; /* Our MTD erase method */
|
||||
|
|
|
|||
|
|
@ -443,7 +443,7 @@ FAR struct mtd_dev_s *rammtd_initialize(FAR uint8_t *start, size_t size)
|
|||
|
||||
/* Create an instance of the RAM MTD device state structure */
|
||||
|
||||
priv = (FAR struct ram_dev_s *)kzalloc(sizeof(struct ram_dev_s));
|
||||
priv = (FAR struct ram_dev_s *)kmm_zalloc(sizeof(struct ram_dev_s));
|
||||
if (!priv)
|
||||
{
|
||||
fdbg("Failed to allocate the RAM MTD state structure\n");
|
||||
|
|
@ -460,7 +460,7 @@ FAR struct mtd_dev_s *rammtd_initialize(FAR uint8_t *start, size_t size)
|
|||
}
|
||||
|
||||
/* Perform initialization as necessary. (unsupported methods were
|
||||
* nullified by kzalloc).
|
||||
* nullified by kmm_zalloc).
|
||||
*/
|
||||
|
||||
priv->mtd.erase = ram_erase;
|
||||
|
|
|
|||
|
|
@ -689,11 +689,11 @@ FAR struct mtd_dev_s *ramtron_initialize(FAR struct spi_dev_s *dev)
|
|||
* to be extended to handle multiple FLASH parts on the same SPI bus.
|
||||
*/
|
||||
|
||||
priv = (FAR struct ramtron_dev_s *)kzalloc(sizeof(struct ramtron_dev_s));
|
||||
priv = (FAR struct ramtron_dev_s *)kmm_zalloc(sizeof(struct ramtron_dev_s));
|
||||
if (priv)
|
||||
{
|
||||
/* Initialize the allocated structure. (unsupported methods were
|
||||
* nullified by kzalloc).
|
||||
* nullified by kmm_zalloc).
|
||||
*/
|
||||
|
||||
priv->mtd.erase = ramtron_erase;
|
||||
|
|
|
|||
|
|
@ -603,11 +603,11 @@ FAR struct mtd_dev_s *s512_initialize(FAR struct mtd_dev_s *mtd)
|
|||
* to be extended to handle multiple FLASH parts on the same SPI bus.
|
||||
*/
|
||||
|
||||
priv = (FAR struct s512_dev_s *)kzalloc(sizeof(struct s512_dev_s));
|
||||
priv = (FAR struct s512_dev_s *)kmm_zalloc(sizeof(struct s512_dev_s));
|
||||
if (priv)
|
||||
{
|
||||
/* Initialize the allocated structure. (unsupported methods/fields
|
||||
* were already nullified by kzalloc).
|
||||
* were already nullified by kmm_zalloc).
|
||||
*/
|
||||
|
||||
priv->mtd.erase = s512_erase;
|
||||
|
|
|
|||
|
|
@ -1203,11 +1203,11 @@ FAR struct mtd_dev_s *sst25_initialize(FAR struct spi_dev_s *dev)
|
|||
* to be extended to handle multiple FLASH parts on the same SPI bus.
|
||||
*/
|
||||
|
||||
priv = (FAR struct sst25_dev_s *)kzalloc(sizeof(struct sst25_dev_s));
|
||||
priv = (FAR struct sst25_dev_s *)kmm_zalloc(sizeof(struct sst25_dev_s));
|
||||
if (priv)
|
||||
{
|
||||
/* Initialize the allocated structure. (unsupported methods were
|
||||
* nullified by kzalloc).
|
||||
* nullified by kmm_zalloc).
|
||||
*/
|
||||
|
||||
priv->mtd.erase = sst25_erase;
|
||||
|
|
|
|||
|
|
@ -952,11 +952,11 @@ FAR struct mtd_dev_s *sst25xx_initialize(FAR struct spi_dev_s *dev)
|
|||
* to be extended to handle multiple FLASH parts on the same SPI bus.
|
||||
*/
|
||||
|
||||
priv = (FAR struct sst25xx_dev_s *)kzalloc(sizeof(struct sst25xx_dev_s));
|
||||
priv = (FAR struct sst25xx_dev_s *)kmm_zalloc(sizeof(struct sst25xx_dev_s));
|
||||
if (priv)
|
||||
{
|
||||
/* Initialize the allocated structure. (unsupported methods were
|
||||
* nullified by kzalloc).
|
||||
* nullified by kmm_zalloc).
|
||||
*/
|
||||
|
||||
priv->mtd.erase = sst25xx_erase;
|
||||
|
|
|
|||
|
|
@ -1135,11 +1135,11 @@ FAR struct mtd_dev_s *w25_initialize(FAR struct spi_dev_s *spi)
|
|||
* to be extended to handle multiple FLASH parts on the same SPI bus.
|
||||
*/
|
||||
|
||||
priv = (FAR struct w25_dev_s *)kzalloc(sizeof(struct w25_dev_s));
|
||||
priv = (FAR struct w25_dev_s *)kmm_zalloc(sizeof(struct w25_dev_s));
|
||||
if (priv)
|
||||
{
|
||||
/* Initialize the allocated structure (unsupported methods were
|
||||
* nullified by kzalloc).
|
||||
* nullified by kmm_zalloc).
|
||||
*/
|
||||
|
||||
priv->mtd.erase = w25_erase;
|
||||
|
|
|
|||
|
|
@ -982,7 +982,7 @@ static int e1000_probe(uint16_t addr, pci_id_t id)
|
|||
|
||||
/* alloc e1000_dev memory */
|
||||
|
||||
if ((dev = kzalloc(sizeof(struct e1000_dev))) == NULL)
|
||||
if ((dev = kmm_zalloc(sizeof(struct e1000_dev))) == NULL)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -531,7 +531,7 @@ FAR struct battery_dev_s *max1704x_initialize(FAR struct i2c_dev_s *i2c,
|
|||
|
||||
/* Initialize the MAX1704x device structure */
|
||||
|
||||
priv = (FAR struct max1704x_dev_s *)kzalloc(sizeof(struct max1704x_dev_s));
|
||||
priv = (FAR struct max1704x_dev_s *)kmm_zalloc(sizeof(struct max1704x_dev_s));
|
||||
if (priv)
|
||||
{
|
||||
/* Initialize the MAX1704x device structure */
|
||||
|
|
|
|||
|
|
@ -588,14 +588,14 @@ int pwm_register(FAR const char *path, FAR struct pwm_lowerhalf_s *dev)
|
|||
|
||||
/* Allocate the upper-half data structure */
|
||||
|
||||
upper = (FAR struct pwm_upperhalf_s *)kzalloc(sizeof(struct pwm_upperhalf_s));
|
||||
upper = (FAR struct pwm_upperhalf_s *)kmm_zalloc(sizeof(struct pwm_upperhalf_s));
|
||||
if (!upper)
|
||||
{
|
||||
pwmdbg("Allocation failed\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
/* Initialize the PWM device structure (it was already zeroed by kzalloc()) */
|
||||
/* Initialize the PWM device structure (it was already zeroed by kmm_zalloc()) */
|
||||
|
||||
sem_init(&upper->exclsem, 0, 1);
|
||||
#ifdef CONFIG_PWM_PULSECOUNT
|
||||
|
|
|
|||
|
|
@ -382,14 +382,14 @@ int qe_register(FAR const char *devpath, FAR struct qe_lowerhalf_s *lower)
|
|||
|
||||
/* Allocate the upper-half data structure */
|
||||
|
||||
upper = (FAR struct qe_upperhalf_s *)kzalloc(sizeof(struct qe_upperhalf_s));
|
||||
upper = (FAR struct qe_upperhalf_s *)kmm_zalloc(sizeof(struct qe_upperhalf_s));
|
||||
if (!upper)
|
||||
{
|
||||
qedbg("Allocation failed\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
/* Initialize the PWM device structure (it was already zeroed by kzalloc()) */
|
||||
/* Initialize the PWM device structure (it was already zeroed by kmm_zalloc()) */
|
||||
|
||||
sem_init(&upper->exclsem, 0, 1);
|
||||
upper->lower = lower;
|
||||
|
|
|
|||
|
|
@ -654,7 +654,7 @@ int ramlog_register(FAR const char *devpath, FAR char *buffer, size_t buflen)
|
|||
|
||||
/* Allocate a RAM logging device structure */
|
||||
|
||||
priv = (struct ramlog_dev_s *)kzalloc(sizeof(struct ramlog_dev_s));
|
||||
priv = (struct ramlog_dev_s *)kmm_zalloc(sizeof(struct ramlog_dev_s));
|
||||
if (priv)
|
||||
{
|
||||
/* Initialize the non-zero values in the RAM logging device structure */
|
||||
|
|
|
|||
|
|
@ -481,7 +481,7 @@ FAR void *timer_register(FAR const char *path,
|
|||
/* Allocate the upper-half data structure */
|
||||
|
||||
upper = (FAR struct timer_upperhalf_s *)
|
||||
kzalloc(sizeof(struct timer_upperhalf_s));
|
||||
kmm_zalloc(sizeof(struct timer_upperhalf_s));
|
||||
if (!upper)
|
||||
{
|
||||
tmrdbg("Upper half allocation failed\n");
|
||||
|
|
@ -489,7 +489,7 @@ FAR void *timer_register(FAR const char *path,
|
|||
}
|
||||
|
||||
/* Initialize the timer device structure (it was already zeroed
|
||||
* by kzalloc()).
|
||||
* by kmm_zalloc()).
|
||||
*/
|
||||
|
||||
//sem_init(&upper->exclsem, 0, 1);
|
||||
|
|
|
|||
|
|
@ -483,7 +483,7 @@ FAR void *watchdog_register(FAR const char *path,
|
|||
/* Allocate the upper-half data structure */
|
||||
|
||||
upper = (FAR struct watchdog_upperhalf_s *)
|
||||
kzalloc(sizeof(struct watchdog_upperhalf_s));
|
||||
kmm_zalloc(sizeof(struct watchdog_upperhalf_s));
|
||||
if (!upper)
|
||||
{
|
||||
wddbg("Upper half allocation failed\n");
|
||||
|
|
@ -491,7 +491,7 @@ FAR void *watchdog_register(FAR const char *path,
|
|||
}
|
||||
|
||||
/* Initialize the watchdog timer device structure (it was already zeroed
|
||||
* by kzalloc()).
|
||||
* by kmm_zalloc()).
|
||||
*/
|
||||
|
||||
sem_init(&upper->exclsem, 0, 1);
|
||||
|
|
|
|||
|
|
@ -306,7 +306,7 @@ static int fat_open(FAR struct file *filep, const char *relpath,
|
|||
* file.
|
||||
*/
|
||||
|
||||
ff = (struct fat_file_s *)kzalloc(sizeof(struct fat_file_s));
|
||||
ff = (struct fat_file_s *)kmm_zalloc(sizeof(struct fat_file_s));
|
||||
if (!ff)
|
||||
{
|
||||
ret = -ENOMEM;
|
||||
|
|
@ -1756,7 +1756,7 @@ static int fat_bind(FAR struct inode *blkdriver, const void *data,
|
|||
|
||||
/* Create an instance of the mountpt state structure */
|
||||
|
||||
fs = (struct fat_mountpt_s *)kzalloc(sizeof(struct fat_mountpt_s));
|
||||
fs = (struct fat_mountpt_s *)kmm_zalloc(sizeof(struct fat_mountpt_s));
|
||||
if (!fs)
|
||||
{
|
||||
return -ENOMEM;
|
||||
|
|
|
|||
|
|
@ -546,7 +546,7 @@ FAR void *automount_initialize(FAR const struct automount_lower_s *lower)
|
|||
/* Allocate an auto-mounter state structure */
|
||||
|
||||
priv = (FAR struct automounter_state_s *)
|
||||
kzalloc(sizeof(struct automounter_state_s));
|
||||
kmm_zalloc(sizeof(struct automounter_state_s));
|
||||
|
||||
if (!priv)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ static void inode_namecpy(char *dest, const char *src)
|
|||
static FAR struct inode *inode_alloc(FAR const char *name)
|
||||
{
|
||||
int namelen = inode_namelen(name);
|
||||
FAR struct inode *node = (FAR struct inode*)kzalloc(FSNODE_SIZE(namelen));
|
||||
FAR struct inode *node = (FAR struct inode*)kmm_zalloc(FSNODE_SIZE(namelen));
|
||||
if (node)
|
||||
{
|
||||
inode_namecpy(node->i_name, name);
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ int select(int nfds, FAR fd_set *readfds, FAR fd_set *writefds,
|
|||
|
||||
/* Allocate the descriptor list for poll() */
|
||||
|
||||
pollset = (struct pollfd *)kzalloc(npfds * sizeof(struct pollfd));
|
||||
pollset = (struct pollfd *)kmm_zalloc(npfds * sizeof(struct pollfd));
|
||||
if (!pollset)
|
||||
{
|
||||
set_errno(ENOMEM);
|
||||
|
|
|
|||
|
|
@ -570,7 +570,7 @@ static int nfs_open(FAR struct file *filep, FAR const char *relpath,
|
|||
|
||||
/* Pre-allocate the file private data to describe the opened file. */
|
||||
|
||||
np = (struct nfsnode *)kzalloc(sizeof(struct nfsnode));
|
||||
np = (struct nfsnode *)kmm_zalloc(sizeof(struct nfsnode));
|
||||
if (!np)
|
||||
{
|
||||
fdbg("ERROR: Failed to allocate private data\n");
|
||||
|
|
@ -1722,7 +1722,7 @@ static int nfs_bind(FAR struct inode *blkdriver, FAR const void *data,
|
|||
|
||||
/* Create an instance of the mountpt state structure */
|
||||
|
||||
nmp = (FAR struct nfsmount *)kzalloc(SIZEOF_nfsmount(buflen));
|
||||
nmp = (FAR struct nfsmount *)kmm_zalloc(SIZEOF_nfsmount(buflen));
|
||||
if (!nmp)
|
||||
{
|
||||
fdbg("ERROR: Failed to allocate mountpoint structure\n");
|
||||
|
|
@ -1772,7 +1772,7 @@ static int nfs_bind(FAR struct inode *blkdriver, FAR const void *data,
|
|||
|
||||
/* Create an instance of the rpc state structure */
|
||||
|
||||
rpc = (struct rpcclnt *)kzalloc(sizeof(struct rpcclnt));
|
||||
rpc = (struct rpcclnt *)kmm_zalloc(sizeof(struct rpcclnt));
|
||||
if (!rpc)
|
||||
{
|
||||
fdbg("ERROR: Failed to allocate rpc structure\n");
|
||||
|
|
|
|||
|
|
@ -396,7 +396,7 @@ int rpcclnt_connect(struct rpcclnt *rpc)
|
|||
|
||||
/* Create an instance of the socket state structure */
|
||||
|
||||
so = (struct socket *)kzalloc(sizeof(struct socket));
|
||||
so = (struct socket *)kmm_zalloc(sizeof(struct socket));
|
||||
if (!so)
|
||||
{
|
||||
fdbg("ERROR: Failed to allocate socket structure\n");
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@ int nxffs_initialize(FAR struct mtd_dev_s *mtd)
|
|||
|
||||
/* Allocate a NXFFS volume structure */
|
||||
|
||||
volume = (FAR struct nxffs_volume_s *)kzalloc(sizeof(struct nxffs_volume_s));
|
||||
volume = (FAR struct nxffs_volume_s *)kmm_zalloc(sizeof(struct nxffs_volume_s));
|
||||
if (!volume)
|
||||
{
|
||||
return -ENOMEM;
|
||||
|
|
|
|||
|
|
@ -514,7 +514,7 @@ static inline int nxffs_wropen(FAR struct nxffs_volume_s *volume,
|
|||
wrfile = &g_wrfile;
|
||||
memset(wrfile, 0, sizeof(struct nxffs_wrfile_s));
|
||||
#else
|
||||
wrfile = (FAR struct nxffs_wrfile_s *)kzalloc(sizeof(struct nxffs_wrfile_s));
|
||||
wrfile = (FAR struct nxffs_wrfile_s *)kmm_zalloc(sizeof(struct nxffs_wrfile_s));
|
||||
if (!wrfile)
|
||||
{
|
||||
ret = -ENOMEM;
|
||||
|
|
@ -750,7 +750,7 @@ static inline int nxffs_rdopen(FAR struct nxffs_volume_s *volume,
|
|||
{
|
||||
/* Not already open.. create a new open structure */
|
||||
|
||||
ofile = (FAR struct nxffs_ofile_s *)kzalloc(sizeof(struct nxffs_ofile_s));
|
||||
ofile = (FAR struct nxffs_ofile_s *)kmm_zalloc(sizeof(struct nxffs_ofile_s));
|
||||
if (!ofile)
|
||||
{
|
||||
fdbg("ERROR: ofile allocation failed\n");
|
||||
|
|
|
|||
|
|
@ -435,7 +435,7 @@ static int procfs_opendir(FAR struct inode *mountpt, FAR const char *relpath,
|
|||
*/
|
||||
|
||||
level0 = (FAR struct procfs_level0_s *)
|
||||
kzalloc(sizeof(struct procfs_level0_s));
|
||||
kmm_zalloc(sizeof(struct procfs_level0_s));
|
||||
|
||||
if (!level0)
|
||||
{
|
||||
|
|
@ -514,7 +514,7 @@ static int procfs_opendir(FAR struct inode *mountpt, FAR const char *relpath,
|
|||
*/
|
||||
|
||||
level1 = (FAR struct procfs_level1_s *)
|
||||
kzalloc(sizeof(struct procfs_level1_s));
|
||||
kmm_zalloc(sizeof(struct procfs_level1_s));
|
||||
|
||||
if (!level1)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ static int cpuload_open(FAR struct file *filep, FAR const char *relpath,
|
|||
|
||||
/* Allocate a container to hold the file attributes */
|
||||
|
||||
attr = (FAR struct cpuload_file_s *)kzalloc(sizeof(struct cpuload_file_s));
|
||||
attr = (FAR struct cpuload_file_s *)kmm_zalloc(sizeof(struct cpuload_file_s));
|
||||
if (!attr)
|
||||
{
|
||||
fdbg("ERROR: Failed to allocate file attributes\n");
|
||||
|
|
|
|||
|
|
@ -978,7 +978,7 @@ static int proc_open(FAR struct file *filep, FAR const char *relpath,
|
|||
|
||||
/* Allocate a container to hold the task and node selection */
|
||||
|
||||
procfile = (FAR struct proc_file_s *)kzalloc(sizeof(struct proc_file_s));
|
||||
procfile = (FAR struct proc_file_s *)kmm_zalloc(sizeof(struct proc_file_s));
|
||||
if (!procfile)
|
||||
{
|
||||
fdbg("ERROR: Failed to allocate file container\n");
|
||||
|
|
@ -1197,11 +1197,11 @@ static int proc_opendir(FAR const char *relpath, FAR struct fs_dirent_s *dir)
|
|||
}
|
||||
|
||||
/* Allocate the directory structure. Note that the index and procentry
|
||||
* pointer are implicitly nullified by kzalloc(). Only the remaining,
|
||||
* pointer are implicitly nullified by kmm_zalloc(). Only the remaining,
|
||||
* non-zero entries will need be initialized.
|
||||
*/
|
||||
|
||||
procdir = (FAR struct proc_dir_s *)kzalloc(sizeof(struct proc_dir_s));
|
||||
procdir = (FAR struct proc_dir_s *)kmm_zalloc(sizeof(struct proc_dir_s));
|
||||
if (!procdir)
|
||||
{
|
||||
fdbg("ERROR: Failed to allocate the directory structure\n");
|
||||
|
|
|
|||
|
|
@ -168,7 +168,7 @@ static int uptime_open(FAR struct file *filep, FAR const char *relpath,
|
|||
|
||||
/* Allocate a container to hold the file attributes */
|
||||
|
||||
attr = (FAR struct uptime_file_s *)kzalloc(sizeof(struct uptime_file_s));
|
||||
attr = (FAR struct uptime_file_s *)kmm_zalloc(sizeof(struct uptime_file_s));
|
||||
if (!attr)
|
||||
{
|
||||
fdbg("ERROR: Failed to allocate file attributes\n");
|
||||
|
|
|
|||
|
|
@ -179,7 +179,7 @@ static int skel_open(FAR struct file *filep, FAR const char *relpath,
|
|||
|
||||
/* Allocate a container to hold the task and attribute selection */
|
||||
|
||||
priv = (FAR struct skel_file_s *)kzalloc(sizeof(struct skel_file_s));
|
||||
priv = (FAR struct skel_file_s *)kmm_zalloc(sizeof(struct skel_file_s));
|
||||
if (!priv)
|
||||
{
|
||||
fdbg("ERROR: Failed to allocate file attributes\n");
|
||||
|
|
@ -268,7 +268,7 @@ static int skel_dup(FAR const struct file *oldp, FAR struct file *newp)
|
|||
|
||||
/* Allocate a new container to hold the task and attribute selection */
|
||||
|
||||
newpriv = (FAR struct skel_file_s *)kzalloc(sizeof(struct skel_file_s));
|
||||
newpriv = (FAR struct skel_file_s *)kmm_zalloc(sizeof(struct skel_file_s));
|
||||
if (!newpriv)
|
||||
{
|
||||
fdbg("ERROR: Failed to allocate file attributes\n");
|
||||
|
|
@ -305,7 +305,7 @@ static int skel_opendir(FAR const char *relpath, FAR struct fs_dirent_s *dir)
|
|||
*/
|
||||
|
||||
level1 = (FAR struct skel_level1_s *)
|
||||
kzalloc(sizeof(struct skel_level1_s));
|
||||
kmm_zalloc(sizeof(struct skel_level1_s));
|
||||
|
||||
if (!level1)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -226,7 +226,7 @@ static int romfs_open(FAR struct file *filep, FAR const char *relpath,
|
|||
* file.
|
||||
*/
|
||||
|
||||
rf = (FAR struct romfs_file_s *)kzalloc(sizeof(struct romfs_file_s));
|
||||
rf = (FAR struct romfs_file_s *)kmm_zalloc(sizeof(struct romfs_file_s));
|
||||
if (!rf)
|
||||
{
|
||||
fdbg("Failed to allocate private data\n", ret);
|
||||
|
|
@ -916,7 +916,7 @@ static int romfs_bind(FAR struct inode *blkdriver, FAR const void *data,
|
|||
|
||||
/* Create an instance of the mountpt state structure */
|
||||
|
||||
rm = (FAR struct romfs_mountpt_s *)kzalloc(sizeof(struct romfs_mountpt_s));
|
||||
rm = (FAR struct romfs_mountpt_s *)kmm_zalloc(sizeof(struct romfs_mountpt_s));
|
||||
if (!rm)
|
||||
{
|
||||
fdbg("Failed to allocate mountpoint structure\n");
|
||||
|
|
|
|||
|
|
@ -179,7 +179,7 @@ static int smartfs_open(FAR struct file *filep, FAR const char *relpath,
|
|||
|
||||
/* Allocate a container to hold the task and attribute selection */
|
||||
|
||||
priv = (FAR struct smartfs_file_s *)kzalloc(sizeof(struct smartfs_file_s));
|
||||
priv = (FAR struct smartfs_file_s *)kmm_zalloc(sizeof(struct smartfs_file_s));
|
||||
if (!priv)
|
||||
{
|
||||
fdbg("ERROR: Failed to allocate file attributes\n");
|
||||
|
|
@ -268,7 +268,7 @@ static int smartfs_dup(FAR const struct file *oldp, FAR struct file *newp)
|
|||
|
||||
/* Allocate a new container to hold the task and attribute selection */
|
||||
|
||||
newpriv = (FAR struct smartfs_file_s *)kzalloc(sizeof(struct smartfs_file_s));
|
||||
newpriv = (FAR struct smartfs_file_s *)kmm_zalloc(sizeof(struct smartfs_file_s));
|
||||
if (!newpriv)
|
||||
{
|
||||
fdbg("ERROR: Failed to allocate file attributes\n");
|
||||
|
|
@ -305,7 +305,7 @@ static int smartfs_opendir(FAR const char *relpath, FAR struct fs_dirent_s *dir)
|
|||
*/
|
||||
|
||||
level1 = (FAR struct smartfs_level1_s *)
|
||||
kzalloc(sizeof(struct smartfs_level1_s));
|
||||
kmm_zalloc(sizeof(struct smartfs_level1_s));
|
||||
|
||||
if (!level1)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1337,7 +1337,7 @@ static int smartfs_bind(FAR struct inode *blkdriver, const void *data,
|
|||
|
||||
/* Create an instance of the mountpt state structure */
|
||||
|
||||
fs = (struct smartfs_mountpt_s *)kzalloc(sizeof(struct smartfs_mountpt_s));
|
||||
fs = (struct smartfs_mountpt_s *)kmm_zalloc(sizeof(struct smartfs_mountpt_s));
|
||||
if (!fs)
|
||||
{
|
||||
return -ENOMEM;
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ FAR struct nxcon_state_s *
|
|||
|
||||
/* Allocate the driver structure */
|
||||
|
||||
priv = (FAR struct nxcon_state_s *)kzalloc(sizeof(struct nxcon_state_s));
|
||||
priv = (FAR struct nxcon_state_s *)kmm_zalloc(sizeof(struct nxcon_state_s));
|
||||
if (!priv)
|
||||
{
|
||||
gdbg("Failed to allocate the NX driver structure\n");
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ struct elf_loadinfo_s
|
|||
* ELF program image.
|
||||
*
|
||||
* 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
|
||||
* kmm_zalloc()). 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.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ struct nxflat_loadinfo_s
|
|||
* referenced as data (other than the stack which is separately allocated).
|
||||
*
|
||||
* 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
|
||||
* kmm_zalloc()). 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.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@
|
|||
****************************************************************************/
|
||||
|
||||
/************************************************************************
|
||||
* Name: kzalloc
|
||||
* Name: kmm_zalloc
|
||||
*
|
||||
* Description:
|
||||
* Allocate and zero memory from the kernel heap.
|
||||
|
|
@ -65,7 +65,7 @@
|
|||
*
|
||||
************************************************************************/
|
||||
|
||||
FAR void *kzalloc(size_t size)
|
||||
FAR void *kmm_zalloc(size_t size)
|
||||
{
|
||||
return mm_zalloc(&g_kmmheap, size);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@
|
|||
****************************************************************************/
|
||||
|
||||
/************************************************************************
|
||||
* Name: kzalloc
|
||||
* Name: zalloc
|
||||
*
|
||||
* Description:
|
||||
* Allocate and zero memory from the user heap.
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ static FAR sq_queue_t g_freelist;
|
|||
|
||||
static inline FAR struct igmp_group_s *igmp_grpheapalloc(void)
|
||||
{
|
||||
return (FAR struct igmp_group_s *)kzalloc(sizeof(struct igmp_group_s));
|
||||
return (FAR struct igmp_group_s *)kmm_zalloc(sizeof(struct igmp_group_s));
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ int tcp_backlogcreate(FAR struct tcp_conn_s *conn, int nblg)
|
|||
|
||||
/* Then allocate that much */
|
||||
|
||||
bls = (FAR struct tcp_backlog_s *)kzalloc(size);
|
||||
bls = (FAR struct tcp_backlog_s *)kmm_zalloc(size);
|
||||
if (!bls)
|
||||
{
|
||||
nlldbg("Failed to allocate backlog\n");
|
||||
|
|
|
|||
|
|
@ -184,7 +184,7 @@ int group_allocate(FAR struct task_tcb_s *tcb)
|
|||
|
||||
/* Allocate the group structure and assign it to the TCB */
|
||||
|
||||
group = (FAR struct task_group_s *)kzalloc(sizeof(struct task_group_s));
|
||||
group = (FAR struct task_group_s *)kmm_zalloc(sizeof(struct task_group_s));
|
||||
if (!group)
|
||||
{
|
||||
return -ENOMEM;
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ mqd_t mq_open(const char *mq_name, int oflags, ...)
|
|||
* of the message queue name+1.
|
||||
*/
|
||||
|
||||
msgq = (FAR msgq_t*)kzalloc(SIZEOF_MQ_HEADER + namelen + 1);
|
||||
msgq = (FAR msgq_t*)kmm_zalloc(SIZEOF_MQ_HEADER + namelen + 1);
|
||||
if (msgq)
|
||||
{
|
||||
/* Create a message queue descriptor for the TCB */
|
||||
|
|
|
|||
|
|
@ -247,7 +247,7 @@ int pthread_create(FAR pthread_t *thread, FAR pthread_attr_t *attr,
|
|||
|
||||
/* Allocate a TCB for the new task. */
|
||||
|
||||
ptcb = (FAR struct pthread_tcb_s *)kzalloc(sizeof(struct pthread_tcb_s));
|
||||
ptcb = (FAR struct pthread_tcb_s *)kmm_zalloc(sizeof(struct pthread_tcb_s));
|
||||
if (!ptcb)
|
||||
{
|
||||
sdbg("ERROR: Failed to allocate TCB\n");
|
||||
|
|
@ -281,7 +281,7 @@ int pthread_create(FAR pthread_t *thread, FAR pthread_attr_t *attr,
|
|||
|
||||
/* Allocate a detachable structure to support pthread_join logic */
|
||||
|
||||
pjoin = (FAR struct join_s*)kzalloc(sizeof(struct join_s));
|
||||
pjoin = (FAR struct join_s*)kmm_zalloc(sizeof(struct join_s));
|
||||
if (!pjoin)
|
||||
{
|
||||
sdbg("ERROR: Failed to allocate join\n");
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ static int thread_create(FAR const char *name, uint8_t ttype, int priority,
|
|||
|
||||
/* Allocate a TCB for the new task. */
|
||||
|
||||
tcb = (FAR struct task_tcb_s *)kzalloc(sizeof(struct task_tcb_s));
|
||||
tcb = (FAR struct task_tcb_s *)kmm_zalloc(sizeof(struct task_tcb_s));
|
||||
if (!tcb)
|
||||
{
|
||||
sdbg("ERROR: Failed to allocate TCB\n");
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ FAR struct task_tcb_s *task_vforksetup(start_t retaddr)
|
|||
|
||||
/* Allocate a TCB for the child task. */
|
||||
|
||||
child = (FAR struct task_tcb_s *)kzalloc(sizeof(struct task_tcb_s));
|
||||
child = (FAR struct task_tcb_s *)kmm_zalloc(sizeof(struct task_tcb_s));
|
||||
if (!child)
|
||||
{
|
||||
sdbg("ERROR: Failed to allocate TCB\n");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue