sched/task: Simplify the syscall handling of task_spawn

It's better to save one argument by returning pid directly.
This change also follow the convention of task_create.
BTW, it is reasonable to adjust the function prototype a
little bit from both implementation and consistency since
task_spawn is NuttX specific API.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Id74f4dd1ef26dfd8f7c473684cf1a45fbeee13cf
This commit is contained in:
Xiang Xiao
2021-05-12 11:34:50 +08:00
parent 0301992760
commit c997bf0f52
8 changed files with 34 additions and 178 deletions
+1 -1
View File
@@ -66,7 +66,6 @@
"munmap","sys/mman.h","defined(CONFIG_FS_RAMMAP)","int","FAR void *","size_t"
"nx_mkfifo","nuttx/fs/fs.h","defined(CONFIG_PIPES) && CONFIG_DEV_FIFO_SIZE > 0","int","FAR const char *","mode_t","size_t"
"nx_pipe","nuttx/fs/fs.h","defined(CONFIG_PIPES) && CONFIG_DEV_PIPE_SIZE > 0","int","int [2]|FAR int *","size_t","int"
"nx_task_spawn","nuttx/spawn.h","defined(CONFIG_LIB_SYSCALL) && !defined(CONFIG_BUILD_KERNEL)","int","FAR const struct spawn_syscall_parms_s *"
"nx_vsyslog","nuttx/syslog/syslog.h","","int","int","FAR const IPTR char *","FAR va_list *"
"nxsched_get_stackinfo","nuttx/sched.h","","int","pid_t","FAR struct stackinfo_s *"
"nxsched_get_streams","nuttx/sched.h","defined(CONFIG_FILE_STREAM)","FAR struct streamlist *"
@@ -171,6 +170,7 @@
"task_restart","sched.h","","int","pid_t"
"task_setcancelstate","sched.h","","int","int","FAR int *"
"task_setcanceltype","sched.h","defined(CONFIG_CANCELLATION_POINTS)","int","int","FAR int *"
"task_spawn","nuttx/spawn.h","!defined(CONFIG_BUILD_KERNEL)","int","FAR const char *","main_t","FAR const posix_spawn_file_actions_t *","FAR const posix_spawnattr_t *","FAR char * const []|FAR char * const *","FAR char * const []|FAR char * const *"
"task_testcancel","pthread.h","defined(CONFIG_CANCELLATION_POINTS)","void"
"tcdrain","termios.h","defined(CONFIG_SERIAL_TERMIOS)","int","int"
"telldir","dirent.h","","off_t","FAR DIR *"
1 _exit unistd.h noreturn int
66 munmap sys/mman.h defined(CONFIG_FS_RAMMAP) int FAR void *
67 nx_mkfifo nuttx/fs/fs.h defined(CONFIG_PIPES) && CONFIG_DEV_FIFO_SIZE > 0 int FAR const char *
68 nx_pipe nuttx/fs/fs.h defined(CONFIG_PIPES) && CONFIG_DEV_PIPE_SIZE > 0 int int [2]|FAR int *
nx_task_spawn nuttx/spawn.h defined(CONFIG_LIB_SYSCALL) && !defined(CONFIG_BUILD_KERNEL) int FAR const struct spawn_syscall_parms_s *
69 nx_vsyslog nuttx/syslog/syslog.h int int
70 nxsched_get_stackinfo nuttx/sched.h int pid_t
71 nxsched_get_streams nuttx/sched.h defined(CONFIG_FILE_STREAM) FAR struct streamlist *
170 task_restart sched.h int pid_t
171 task_setcancelstate sched.h int int
172 task_setcanceltype sched.h defined(CONFIG_CANCELLATION_POINTS) int int
173 task_spawn nuttx/spawn.h !defined(CONFIG_BUILD_KERNEL) int FAR const char *
174 task_testcancel pthread.h defined(CONFIG_CANCELLATION_POINTS) void
175 tcdrain termios.h defined(CONFIG_SERIAL_TERMIOS) int int
176 telldir dirent.h off_t FAR DIR *