1041100948
In the FLAT build if CONFIG_LIB_SYSCALL=y, then the function task_spawn() will be duplicated.: One version in libs/libc/spawn and one version in sched/task. The version of task_spawn in lib/libc/spawn exists only if CONFIG_LIB_SYSCALL is selected. In that case, the one in sched/task/task_spawn.c should be static, at least in the FLAT build. The version of task_spawn.c in libs/libc/spawn simply marshals the parameters into a structure and calls nx_task_spawn(). If CONFIG_LIB_SYSCALL is defined then nx_task_spawn() will un-marshal the data can call the real task spawn. This nonsense is only necessary because task_spawn has 8 parameters and the maximum number of parameters in a system call is only 6. Without syscalls: Application should call directly in task_spawn() in sched/task/task_spawn.c and, hence, it must not be static With syscalls: Application should call the marshalling task_spawn() in libs/libc/spawn/lib_task_spawn.c -> That will call the autogenerated nx_task_spawn() proxy -> And generate a system call -> The system call will the unmarshalling nx_task_spawn() in sched/task/task_spawn.c -> Which will, finally, call the real task_spawn(). The side-effect of making task_spawn() static is that it then cannot be used within the OS. But as far as I can tell, nothing in the OS itself currently uses task_spawn() so I think it is safe to make it conditionally static. But that only protects from duplicate symbols in the useless case mentioned above. |
||
---|---|---|
.. | ||
exit.c | ||
Make.defs | ||
spawn.h | ||
task_activate.c | ||
task_atexit.c | ||
task_cancelpt.c | ||
task_create.c | ||
task_delete.c | ||
task_execv.c | ||
task_exit.c | ||
task_exithook.c | ||
task_getgroup.c | ||
task_getpid.c | ||
task_init.c | ||
task_onexit.c | ||
task_posixspawn.c | ||
task_prctl.c | ||
task_recover.c | ||
task_reparent.c | ||
task_restart.c | ||
task_setcancelstate.c | ||
task_setcanceltype.c | ||
task_setup.c | ||
task_spawn.c | ||
task_spawnparms.c | ||
task_start.c | ||
task_starthook.c | ||
task_terminate.c | ||
task_testcancel.c | ||
task_vfork.c | ||
task.h |