mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 16:50:55 +08:00
sched/spawn: Support task_spawnattr_[set|get]stackaddr
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
committed by
Masayuki Ishikawa
parent
b9b032af72
commit
64e7833cbc
@@ -120,6 +120,7 @@ int exec_module(FAR const struct binary_s *binp,
|
||||
save_addrenv_t oldenv;
|
||||
FAR void *vheap;
|
||||
#endif
|
||||
FAR void *stackaddr = NULL;
|
||||
pid_t pid;
|
||||
int ret;
|
||||
|
||||
@@ -189,14 +190,18 @@ int exec_module(FAR const struct binary_s *binp,
|
||||
|
||||
/* Initialize the task */
|
||||
|
||||
#ifndef CONFIG_BUILD_KERNEL
|
||||
stackaddr = binp->stackaddr;
|
||||
#endif
|
||||
|
||||
if (argv && argv[0])
|
||||
{
|
||||
ret = nxtask_init(tcb, argv[0], binp->priority, NULL,
|
||||
ret = nxtask_init(tcb, argv[0], binp->priority, stackaddr,
|
||||
binp->stacksize, binp->entrypt, &argv[1], envp);
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = nxtask_init(tcb, filename, binp->priority, NULL,
|
||||
ret = nxtask_init(tcb, filename, binp->priority, stackaddr,
|
||||
binp->stacksize, binp->entrypt, argv, envp);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user