diff --git a/include/nuttx/spawn.h b/include/nuttx/spawn.h index 609b91db1a..6b4c0d1725 100644 --- a/include/nuttx/spawn.h +++ b/include/nuttx/spawn.h @@ -135,7 +135,7 @@ extern "C" void add_file_action(FAR posix_spawn_file_actions_t *file_action, FAR struct spawn_general_file_action_s *entry); -#ifdef CONFIG_LIB_SYSCALL +#ifdef CONFIG_BUILD_PROTECTED int nx_task_spawn(FAR const struct spawn_syscall_parms_s *parms); #endif diff --git a/include/sys/syscall.h b/include/sys/syscall.h index 8917d29b08..765ec45e3d 100644 --- a/include/sys/syscall.h +++ b/include/sys/syscall.h @@ -128,8 +128,12 @@ #ifndef CONFIG_BUILD_KERNEL # define SYS_task_create __SYS_task_create +#ifdef CONFIG_BUILD_PROTECTED # define SYS_nx_task_spawn (__SYS_task_create + 1) # define __SYS_task_delete (__SYS_task_create + 2) +#else +# define __SYS_task_delete (__SYS_task_create + 1) +#endif /* pgalloc() is only available with address environments with the page * allocator selected. MMU support from the CPU is also required. diff --git a/libs/libc/spawn/lib_task_spawn.c b/libs/libc/spawn/lib_task_spawn.c index aebf5eb301..c15e9455e9 100644 --- a/libs/libc/spawn/lib_task_spawn.c +++ b/libs/libc/spawn/lib_task_spawn.c @@ -42,7 +42,7 @@ #include #include -#if defined(CONFIG_BUILD_PROTECTED) && defined(CONFIG_LIB_SYSCALL) +#ifdef CONFIG_BUILD_PROTECTED /**************************************************************************** * Public Functions @@ -91,4 +91,4 @@ int task_spawn(FAR pid_t *pid, FAR const char *name, main_t entry, return nx_task_spawn(&parms); } -#endif /* CONFIG_BUILD_PROTECTED && CONFIG_LIB_SYSCALL */ +#endif /* CONFIG_BUILD_PROTECTED */ diff --git a/sched/task/task_spawn.c b/sched/task/task_spawn.c index 3c7bc9e682..48ce61866e 100644 --- a/sched/task/task_spawn.c +++ b/sched/task/task_spawn.c @@ -458,7 +458,7 @@ errout_with_lock: * ****************************************************************************/ -#if defined(CONFIG_BUILD_PROTECTED) && defined(CONFIG_LIB_SYSCALL) +#ifdef CONFIG_BUILD_PROTECTED int nx_task_spawn(FAR const struct spawn_syscall_parms_s *parms) { DEBUGASSERT(parms != NULL); diff --git a/syscall/syscall.csv b/syscall/syscall.csv index 199e98682b..f5363abb5e 100644 --- a/syscall/syscall.csv +++ b/syscall/syscall.csv @@ -63,7 +63,7 @@ "mq_timedreceive","mqueue.h","!defined(CONFIG_DISABLE_MQUEUE)","ssize_t","mqd_t","char*","size_t","FAR unsigned int*","const struct timespec*" "mq_timedsend","mqueue.h","!defined(CONFIG_DISABLE_MQUEUE)","int","mqd_t","const char*","size_t","unsigned int","const struct timespec*" "mq_unlink","mqueue.h","!defined(CONFIG_DISABLE_MQUEUE)","int","const char*" -"nx_task_spawn","nuttx/spawn.h","!defined(CONFIG_BUILD_KERNEL) && defined(CONFIG_LIB_SYSCALL)","int","FAR const struct spawn_syscall_parms_s *" +"nx_task_spawn","nuttx/spawn.h","defined(CONFIG_BUILD_PROTECTED)","int","FAR const struct spawn_syscall_parms_s *" "nx_vsyslog","nuttx/syslog/syslog.h","","int","int","FAR const IPTR char*","FAR va_list*" "on_exit","stdlib.h","defined(CONFIG_SCHED_ONEXIT)","int","CODE void (*)(int, FAR void *)","FAR void *" "open","fcntl.h","","int","const char*","int","..." diff --git a/syscall/syscall_lookup.h b/syscall/syscall_lookup.h index 9e86ff5e79..cde497442d 100644 --- a/syscall/syscall_lookup.h +++ b/syscall/syscall_lookup.h @@ -90,7 +90,9 @@ SYSCALL_LOOKUP(sem_unlink, 1, STUB_sem_unlink) #ifndef CONFIG_BUILD_KERNEL SYSCALL_LOOKUP(task_create, 5, STUB_task_create) +#ifdef CONFIG_BUILD_PROTECTED SYSCALL_LOOKUP(nx_task_spawn, 1, STUB_nx_task_spawn) +#endif #else SYSCALL_LOOKUP(pgalloc, 2, STUB_pgalloc) #endif