nuttx/sched
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
..
clock Rename clock_systime[r|spec] to clock_systime_[ticks|timespec] 2020-05-10 14:35:50 -06:00
environ global change: repace sched_xfree() to kxmm_free() 2020-04-09 10:29:28 -06:00
group fs/vfs/fd_open.c: fs_fdopen() must not set errno 2020-05-23 15:22:09 +08:00
init sched/: Run nxstyle on all .c/.h files modified by PR. 2020-05-16 13:39:03 -03:00
irq Rename clock_systime[r|spec] to clock_systime_[ticks|timespec] 2020-05-10 14:35:50 -06:00
module modsym: Fix a printf format for berr 2020-04-13 16:20:09 +01:00
mqueue include/nuttx/sched.h: Make naming of all internal names consistent: 2020-05-09 14:19:08 -03:00
paging Rename clock_systime[r|spec] to clock_systime_[ticks|timespec] 2020-05-10 14:35:50 -06:00
pthread Make task_init() and task_activate() internal OS functions. 2020-05-25 23:54:45 +01:00
sched sched/sched/sched_releasetcb.c: Handle custom stack allocations. 2020-05-27 20:00:14 +01:00
semaphore sched/: Make more naming consistent 2020-05-17 14:01:00 -03:00
signal sched/: Make more naming consistent 2020-05-16 13:39:03 -03:00
task sched/task/task_spawn.c: Fix duplicate task_spawn() 2020-06-01 16:40:06 +01:00
timer Update timer_gettime.c 2020-04-24 19:49:29 +08:00
wdog Rename clock_systime[r|spec] to clock_systime_[ticks|timespec] 2020-05-10 14:35:50 -06:00
wqueue sched/: Make more naming consistent 2020-05-16 13:39:03 -03:00
Kconfig sched/: Make more naming consistent 2020-05-17 14:01:00 -03:00
Makefile build: Replace -I with INCDIR 2020-05-24 20:20:12 +01:00