summaryrefslogtreecommitdiff
path: root/nuttx/binfmt
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-01-16 14:14:14 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-01-16 14:14:14 +0000
commitf06a61ad2416526b0f9afddc0b42fb5c928b7093 (patch)
tree5c82c94b6cb8e68f1ffda9326d9cb2f108e5db86 /nuttx/binfmt
parent9cc7477faf3e49678aa827a6bc1ab99e2812c4d8 (diff)
downloadpx4-nuttx-f06a61ad2416526b0f9afddc0b42fb5c928b7093.tar.gz
px4-nuttx-f06a61ad2416526b0f9afddc0b42fb5c928b7093.tar.bz2
px4-nuttx-f06a61ad2416526b0f9afddc0b42fb5c928b7093.zip
BINFS now supports open, close, and FIOC_FILENAME ioctl
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5522 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/binfmt')
-rw-r--r--nuttx/binfmt/binfmt_execmodule.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/nuttx/binfmt/binfmt_execmodule.c b/nuttx/binfmt/binfmt_execmodule.c
index 400451c40..df8da5343 100644
--- a/nuttx/binfmt/binfmt_execmodule.c
+++ b/nuttx/binfmt/binfmt_execmodule.c
@@ -1,7 +1,7 @@
/****************************************************************************
* binfmt/binfmt_execmodule.c
*
- * Copyright (C) 2009 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2009, 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -47,6 +47,7 @@
#include <errno.h>
#include <nuttx/arch.h>
+#include <nuttx/kmalloc.h>
#include <nuttx/binfmt/binfmt.h>
#include "os_internal.h"
@@ -167,7 +168,7 @@ int exec_module(FAR const struct binary_s *binp, int priority)
/* Allocate a TCB for the new task. */
- tcb = (FAR _TCB*)zalloc(sizeof(_TCB));
+ tcb = (FAR _TCB*)kzalloc(sizeof(_TCB));
if (!tcb)
{
err = ENOMEM;
@@ -177,7 +178,7 @@ int exec_module(FAR const struct binary_s *binp, int priority)
/* Allocate the stack for the new task */
#ifndef CONFIG_CUSTOM_STACK
- stack = (FAR uint32_t*)malloc(binp->stacksize);
+ stack = (FAR uint32_t*)kmalloc(binp->stacksize);
if (!tcb)
{
err = ENOMEM;
@@ -201,6 +202,9 @@ int exec_module(FAR const struct binary_s *binp, int priority)
goto errout_with_stack;
}
+ /* Note that tcb->flags are not modified. 0=normal task */
+ /* tcb->flags |= TCB_FLAG_TTYPE_TASK; */
+
/* Add the D-Space address as the PIC base address. By convention, this
* must be the first allocated address space.
*/
@@ -257,14 +261,14 @@ errout_with_stack:
#ifndef CONFIG_CUSTOM_STACK
tcb->stack_alloc_ptr = NULL;
sched_releasetcb(tcb);
- free(stack);
+ kfree(stack);
#else
sched_releasetcb(tcb);
#endif
goto errout;
errout_with_tcb:
- free(tcb);
+ kfree(tcb);
errout:
errno = err;
bdbg("returning errno: %d\n", err);