summaryrefslogtreecommitdiff
path: root/nuttx/binfmt
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-09-10 08:41:01 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-09-10 08:41:01 -0600
commit964637c55aa7e3205590c3e509eb7058f4d0869c (patch)
treeb55791e804f4c0115c3ac945da6a141ef55b6db3 /nuttx/binfmt
parent56bb85dc4173fec7d91379bd475c0310749d243c (diff)
downloadnuttx-964637c55aa7e3205590c3e509eb7058f4d0869c.tar.gz
nuttx-964637c55aa7e3205590c3e509eb7058f4d0869c.tar.bz2
nuttx-964637c55aa7e3205590c3e509eb7058f4d0869c.zip
Add configuration to use the fixed DRAM mapping for the page pool (if available) instead of remapping dynamically to access L2 page tables and page data. Also, add logic in address environment creation to initialize the shared data at the beginning of the .bss/.data process memory region.
Diffstat (limited to 'nuttx/binfmt')
-rw-r--r--nuttx/binfmt/binfmt_execmodule.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/nuttx/binfmt/binfmt_execmodule.c b/nuttx/binfmt/binfmt_execmodule.c
index 9b8024dde..1afb4e8b3 100644
--- a/nuttx/binfmt/binfmt_execmodule.c
+++ b/nuttx/binfmt/binfmt_execmodule.c
@@ -179,10 +179,10 @@ int exec_module(FAR const struct binary_s *binp)
/* Allocate the stack for the new task (always from the user heap) */
stack = (FAR uint32_t*)kumm_malloc(binp->stacksize);
- if (!tcb)
+ if (!stack)
{
err = ENOMEM;
- goto errout_with_tcb;
+ goto errout_with_addrenv;
}
/* Restore the address environment */
@@ -196,6 +196,7 @@ int exec_module(FAR const struct binary_s *binp)
goto errout_with_stack;
}
#endif
+
/* Initialize the task */
ret = task_init((FAR struct tcb_s *)tcb, binp->filename, binp->priority,
@@ -269,6 +270,10 @@ errout_with_stack:
kumm_free(stack);
goto errout;
+errout_with_addrenv:
+#ifdef CONFIG_ARCH_ADDRENV
+ (void)up_addrenv_restore(&oldenv);
+#endif
errout_with_tcb:
kmm_free(tcb);
errout: