Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 0 additions & 27 deletions binfmt/binfmt_exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ static int exec_internal(FAR const char *filename,
FAR const posix_spawnattr_t *attr, bool spawn)
{
FAR struct binary_s *bin;
irqstate_t flags;
int pid;
int ret;
#ifndef CONFIG_BINFMT_LOADABLE
Expand Down Expand Up @@ -133,14 +132,6 @@ static int exec_internal(FAR const char *filename,
#endif
}

/* Disable pre-emption so that the executed module does
* not return until we get a chance to connect the on_exit
* handler.
*/

flags = enter_critical_section();
sched_lock();

/* Then start the module */

pid = exec_module(bin, filename, argv, envp, actions, attr, spawn);
Expand All @@ -152,27 +143,9 @@ static int exec_internal(FAR const char *filename,
goto errout_with_lock;
}

#ifdef CONFIG_BINFMT_LOADABLE
/* Set up to unload the module (and free the binary_s structure)
* when the task exists.
*/

ret = group_exitinfo(pid, bin);
if (ret < 0)
{
berr("ERROR: Failed to schedule unload '%s': %d\n", filename, ret);
goto errout_with_lock;
}

#endif

sched_unlock();
leave_critical_section(flags);
return pid;

errout_with_lock:
sched_unlock();
leave_critical_section(flags);
unload_module(bin);
errout_with_bin:
#ifdef CONFIG_BINFMT_LOADABLE
Expand Down
4 changes: 4 additions & 0 deletions binfmt/binfmt_execmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,10 @@ int exec_module(FAR struct binary_s *binp,
}
}

#ifdef CONFIG_BINFMT_LOADABLE
tcb->group->tg_bininfo = binp;
#endif

/* Then activate the task at the provided priority */

nxtask_activate(tcb);
Expand Down
25 changes: 0 additions & 25 deletions include/nuttx/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -1168,31 +1168,6 @@ void nxtask_abort_fork(FAR struct tcb_s *child, int errcode);

size_t nxtask_argvstr(FAR struct tcb_s *tcb, FAR char *args, size_t size);

/****************************************************************************
* Name: group_exitinfo
*
* Description:
* This function may be called to when a task is loaded into memory. It
* will setup the to automatically unload the module when the task exits.
*
* Input Parameters:
* pid - The task ID of the newly loaded task
* bininfo - This structure allocated with kmm_malloc(). This memory
* persists until the task exits and will be used unloads
* the module from memory.
*
* Returned Value:
* This is a NuttX internal function so it follows the convention that
* 0 (OK) is returned on success and a negated errno is returned on
* failure.
*
****************************************************************************/

#ifdef CONFIG_BINFMT_LOADABLE
struct binary_s; /* Forward reference */
int group_exitinfo(pid_t pid, FAR struct binary_s *bininfo);
#endif

/****************************************************************************
* Name: nxsched_get_param
*
Expand Down
4 changes: 0 additions & 4 deletions sched/group/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@ if(CONFIG_SIG_SIGSTOP_ACTION)
list(APPEND SRCS group_suspendchildren.c group_continue.c)
endif()

if(CONFIG_BINFMT_LOADABLE)
list(APPEND SRCS group_exitinfo.c)
endif()

if(CONFIG_MM_KERNEL_HEAP)
list(APPEND SRCS group_malloc.c group_realloc.c group_zalloc.c group_free.c)
endif()
Expand Down
4 changes: 0 additions & 4 deletions sched/group/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ ifeq ($(CONFIG_SIG_SIGSTOP_ACTION),y)
CSRCS += group_suspendchildren.c group_continue.c
endif

ifeq ($(CONFIG_BINFMT_LOADABLE),y)
CSRCS += group_exitinfo.c
endif

ifeq ($(CONFIG_MM_KERNEL_HEAP),y)
CSRCS += group_malloc.c group_realloc.c group_zalloc.c group_free.c
endif
Expand Down
97 changes: 0 additions & 97 deletions sched/group/group_exitinfo.c

This file was deleted.

Loading