From 31c60c3b0e10d37394cdba11adc3cbb5f8bb2b91 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Sat, 2 May 2020 18:36:48 +0800 Subject: [PATCH] syscall: nx_task_spawn should exist in the flat build just like the protected build Signed-off-by: Xiang Xiao --- include/nuttx/spawn.h | 2 +- libs/libc/spawn/Make.defs | 5 ++--- libs/libc/spawn/lib_task_spawn.c | 4 ++-- sched/task/task_spawn.c | 4 ++-- syscall/syscall.csv | 2 +- syscall/syscall_lookup.h | 2 +- 6 files changed, 9 insertions(+), 10 deletions(-) diff --git a/include/nuttx/spawn.h b/include/nuttx/spawn.h index 6b4c0d1725..96f580a977 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_BUILD_PROTECTED +#if defined(CONFIG_LIB_SYSCALL) && !defined(CONFIG_BUILD_KERNEL) int nx_task_spawn(FAR const struct spawn_syscall_parms_s *parms); #endif diff --git a/libs/libc/spawn/Make.defs b/libs/libc/spawn/Make.defs index 42bd628e80..84686af3fa 100644 --- a/libs/libc/spawn/Make.defs +++ b/libs/libc/spawn/Make.defs @@ -48,11 +48,10 @@ CSRCS += lib_psa_setschedpolicy.c lib_psa_getsigmask.c lib_psa_setsigmask.c ifneq ($(CONFIG_BUILD_KERNEL),y) CSRCS += lib_psa_getstacksize.c lib_psa_setstacksize.c -endif - -ifeq ($(CONFIG_BUILD_PROTECTED),y) +ifeq ($(CONFIG_LIB_SYSCALL),y) CSRCS += lib_task_spawn.c endif +endif ifeq ($(CONFIG_DEBUG_FEATURES),y) CSRCS += lib_psa_dump.c diff --git a/libs/libc/spawn/lib_task_spawn.c b/libs/libc/spawn/lib_task_spawn.c index c15e9455e9..003529f13f 100644 --- a/libs/libc/spawn/lib_task_spawn.c +++ b/libs/libc/spawn/lib_task_spawn.c @@ -42,7 +42,7 @@ #include #include -#ifdef CONFIG_BUILD_PROTECTED +#if defined(CONFIG_LIB_SYSCALL) && !defined(CONFIG_BUILD_KERNEL) /**************************************************************************** * 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 */ +#endif /* CONFIG_LIB_SYSCALL && !CONFIG_BUILD_KERNEL */ diff --git a/sched/task/task_spawn.c b/sched/task/task_spawn.c index 533447f65e..2837dfe070 100644 --- a/sched/task/task_spawn.c +++ b/sched/task/task_spawn.c @@ -99,7 +99,7 @@ static int nxtask_spawn_exec(FAR pid_t *pidp, FAR const char *name, sched_lock(); - /* Use the default task priority and stack size if no attributes are provided */ + /* Use the default priority and stack size if no attributes are provided */ if (attr) { @@ -459,7 +459,7 @@ errout_with_lock: * ****************************************************************************/ -#ifdef CONFIG_BUILD_PROTECTED +#ifdef CONFIG_LIB_SYSCALL 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 ab24d4ee11..b539e72b19 100644 --- a/syscall/syscall.csv +++ b/syscall/syscall.csv @@ -64,7 +64,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_PROTECTED)","int","FAR const struct spawn_syscall_parms_s *" +"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*" "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 0e85d59d76..954e8cde32 100644 --- a/syscall/syscall_lookup.h +++ b/syscall/syscall_lookup.h @@ -83,7 +83,7 @@ SYSCALL_LOOKUP(sem_unlink, 1, STUB_sem_unlink) #ifndef CONFIG_BUILD_KERNEL SYSCALL_LOOKUP(task_create, 5, STUB_task_create) -#ifdef CONFIG_BUILD_PROTECTED +#ifdef CONFIG_LIB_SYSCALL SYSCALL_LOOKUP(nx_task_spawn, 1, STUB_nx_task_spawn) #endif #else