1
0
Fork 0
forked from nuttx/nuttx-update

syscall/ and related: Fix an error found in build testing. Inconsistent conditional compilation led to link errors in certain configurations.

This commit is contained in:
Gregory Nutt 2019-08-27 16:41:07 -06:00
parent ac151e05e7
commit 5f02b0335f
6 changed files with 11 additions and 5 deletions

View file

@ -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

View file

@ -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.

View file

@ -42,7 +42,7 @@
#include <spawn.h>
#include <nuttx/spawn.h>
#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 */

View file

@ -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);

View file

@ -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","..."

Can't render this file because it has a wrong number of fields in line 2.

View file

@ -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