You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by gn...@apache.org on 2020/05/02 15:56:34 UTC

[incubator-nuttx] branch master updated: syscall: nx_task_spawn should exist in the flat build just like the protected build

This is an automated email from the ASF dual-hosted git repository.

gnutt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 31c60c3  syscall: nx_task_spawn should exist in the flat build just like the protected build
31c60c3 is described below

commit 31c60c3b0e10d37394cdba11adc3cbb5f8bb2b91
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Sat May 2 18:36:48 2020 +0800

    syscall: nx_task_spawn should exist in the flat build just like the protected build
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 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 6b4c0d1..96f580a 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 42bd628..84686af 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 c15e945..003529f 100644
--- a/libs/libc/spawn/lib_task_spawn.c
+++ b/libs/libc/spawn/lib_task_spawn.c
@@ -42,7 +42,7 @@
 #include <spawn.h>
 #include <nuttx/spawn.h>
 
-#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 533447f..2837dfe 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 ab24d4e..b539e72 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 0e85d59..954e8cd 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