nuttx/sched/task
Gregory Nutt 1041100948 sched/task/task_spawn.c: Fix duplicate task_spawn()
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.
2020-06-01 16:40:06 +01:00
..
exit.c sched/: Run nxstyle on all .c/.h files modified by PR. 2020-05-16 13:39:03 -03:00
Make.defs Add task_testcancel() 2016-12-10 16:34:14 -06:00
spawn.h Check return from nxsem_wait_initialize() 2020-03-29 20:11:10 +01:00
task_activate.c Make task_init() and task_activate() internal OS functions. 2020-05-25 23:54:45 +01:00
task_atexit.c task_atexit.c:Fix style errors. 2020-03-08 07:28:04 -06:00
task_cancelpt.c task_cancelpt.c:Fix style errors. 2020-03-08 07:28:04 -06:00
task_create.c sched/task/task_create.c: Correct logic in error handling 2020-05-27 17:53:46 +01:00
task_delete.c include/nuttx/sched.h: Make naming of all internal names consistent: 2020-05-09 14:19:08 -03:00
task_execv.c task_execv.c:Fix style errors. 2020-03-08 07:28:04 -06:00
task_exit.c sched/: Run nxstyle on all .c/.h files modified by PR. 2020-05-16 13:39:03 -03:00
task_exithook.c sched/: Make more naming consistent 2020-05-16 13:39:03 -03:00
task_getgroup.c include/nuttx/sched.h: Make naming of all internal names consistent: 2020-05-09 14:19:08 -03:00
task_getpid.c Some cosmetic updates, mostly to spacing and comments. 2018-12-30 11:58:19 -06:00
task_init.c fs/vfs/fs_fstat: Correct fstat() for proxied block and MTD drivers. 2020-05-28 17:34:09 +01:00
task_onexit.c task_onexit.c:Fix style errors. 2020-03-08 07:28:04 -06:00
task_posixspawn.c include/nuttx/sched.h: Make naming of all internal names consistent: 2020-05-09 14:19:08 -03:00
task_prctl.c include/nuttx/sched.h: Make naming of all internal names consistent: 2020-05-09 14:19:08 -03:00
task_recover.c sched/sched/sched.h: Make naming of all internal names consistent: 2020-05-09 16:58:42 -03:00
task_reparent.c sched/: Make more naming consistent 2020-05-16 13:39:03 -03:00
task_restart.c Make task_init() and task_activate() internal OS functions. 2020-05-25 23:54:45 +01:00
task_setcancelstate.c task_setcancelstate.c:Fix style errors. 2020-03-08 07:28:04 -06:00
task_setcanceltype.c Run codespell -w with the latest dictonary again 2020-02-23 22:27:46 +01:00
task_setup.c Make task_init() and task_activate() internal OS functions. 2020-05-25 23:54:45 +01:00
task_spawn.c sched/task/task_spawn.c: Fix duplicate task_spawn() 2020-06-01 16:40:06 +01:00
task_spawnparms.c include/nuttx/sched.h: Make naming of all internal names consistent: 2020-05-09 14:19:08 -03:00
task_start.c Refine __KERNEL__ and CONFIG_BUILD_xxx usage in the code base 2020-05-01 10:43:47 -03:00
task_starthook.c task_starthook.c:Fix style errors. 2020-03-08 07:28:04 -06:00
task_terminate.c sched/sched/sched.h: Make naming of all internal names consistent: 2020-05-09 16:58:42 -03:00
task_testcancel.c Run codespell -w with the latest dictonary again 2020-02-23 22:27:46 +01:00
task_vfork.c Make task_init() and task_activate() internal OS functions. 2020-05-25 23:54:45 +01:00
task.h sched/: Make more naming consistent 2020-05-16 13:39:03 -03:00