From f06a61ad2416526b0f9afddc0b42fb5c928b7093 Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 16 Jan 2013 14:14:14 +0000 Subject: 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 --- nuttx/binfmt/binfmt_execmodule.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'nuttx/binfmt/binfmt_execmodule.c') 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 * * Redistribution and use in source and binary forms, with or without @@ -47,6 +47,7 @@ #include #include +#include #include #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); -- cgit v1.2.3