Don't build task_create() or task_spawn() interfaces if there is an addres environment
This commit is contained in:
parent
eae146d641
commit
e12213592b
10 changed files with 37 additions and 6 deletions
|
@ -98,8 +98,11 @@ int task_init(FAR struct tcb_s *tcb, const char *name, int priority,
|
||||||
FAR uint32_t *stack, uint32_t stack_size, main_t entry,
|
FAR uint32_t *stack, uint32_t stack_size, main_t entry,
|
||||||
FAR char * const argv[]);
|
FAR char * const argv[]);
|
||||||
int task_activate(FAR struct tcb_s *tcb);
|
int task_activate(FAR struct tcb_s *tcb);
|
||||||
|
|
||||||
|
#ifndef CONFIG_ARCH_ADDRENV
|
||||||
int task_create(FAR const char *name, int priority, int stack_size,
|
int task_create(FAR const char *name, int priority, int stack_size,
|
||||||
main_t entry, FAR char * const argv[]);
|
main_t entry, FAR char * const argv[]);
|
||||||
|
#endif
|
||||||
int task_delete(pid_t pid);
|
int task_delete(pid_t pid);
|
||||||
int task_restart(pid_t pid);
|
int task_restart(pid_t pid);
|
||||||
|
|
||||||
|
|
|
@ -89,9 +89,11 @@ struct posix_spawnattr_s
|
||||||
sigset_t sigmask; /* Signals to be masked */
|
sigset_t sigmask; /* Signals to be masked */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef CONFIG_ARCH_ADDRENV
|
||||||
/* Used only by task_spawn (non-standard) */
|
/* Used only by task_spawn (non-standard) */
|
||||||
|
|
||||||
size_t stacksize; /* Task stack size */
|
size_t stacksize; /* Task stack size */
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct posix_spawnattr_s posix_spawnattr_t;
|
typedef struct posix_spawnattr_s posix_spawnattr_t;
|
||||||
|
@ -139,6 +141,7 @@ int posix_spawn(FAR pid_t *pid, FAR const char *path,
|
||||||
posix_spawn(pid,path,file_actions,attr,argv,envp)
|
posix_spawn(pid,path,file_actions,attr,argv,envp)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef CONFIG_ARCH_ADDRENV
|
||||||
/* Non-standard task_spawn interface. This function uses the same
|
/* Non-standard task_spawn interface. This function uses the same
|
||||||
* semantics to execute a file in memory at 'entry', giving it the name
|
* semantics to execute a file in memory at 'entry', giving it the name
|
||||||
* 'name'.
|
* 'name'.
|
||||||
|
@ -148,6 +151,7 @@ int task_spawn(FAR pid_t *pid, FAR const char *name, main_t entry,
|
||||||
FAR const posix_spawn_file_actions_t *file_actions,
|
FAR const posix_spawn_file_actions_t *file_actions,
|
||||||
FAR const posix_spawnattr_t *attr,
|
FAR const posix_spawnattr_t *attr,
|
||||||
FAR char *const argv[], FAR char *const envp[]);
|
FAR char *const argv[], FAR char *const envp[]);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* File action interfaces ***************************************************/
|
/* File action interfaces ***************************************************/
|
||||||
/* File action initialization and destruction */
|
/* File action initialization and destruction */
|
||||||
|
|
|
@ -154,6 +154,7 @@ config POSIX_SPAWN_PROXY_STACKSIZE
|
||||||
config TASK_SPAWN_DEFAULT_STACKSIZE
|
config TASK_SPAWN_DEFAULT_STACKSIZE
|
||||||
int "Default task_spawn Stack Size"
|
int "Default task_spawn Stack Size"
|
||||||
default 2048
|
default 2048
|
||||||
|
depends on !ARCH_ADDRENV
|
||||||
---help---
|
---help---
|
||||||
The actual size to use for the child task's stack can be set with
|
The actual size to use for the child task's stack can be set with
|
||||||
task_spawnattr_setstacksize(). This value specifies the default
|
task_spawnattr_setstacksize(). This value specifies the default
|
||||||
|
|
|
@ -43,14 +43,17 @@ CSRCS += lib_psfa_dump.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
CSRCS += lib_psa_getflags.c lib_psa_getschedparam.c lib_psa_getschedpolicy.c
|
CSRCS += lib_psa_getflags.c lib_psa_getschedparam.c lib_psa_getschedpolicy.c
|
||||||
CSRCS += lib_psa_getstacksize.c lib_psa_init.c lib_psa_setflags.c
|
CSRCS += lib_psa_init.c lib_psa_setflags.c lib_psa_setschedparam.c
|
||||||
CSRCS += lib_psa_setschedparam.c lib_psa_setschedpolicy.c
|
CSRCS += lib_psa_setschedpolicy.c
|
||||||
CSRCS += lib_psa_setstacksize.c
|
|
||||||
|
|
||||||
ifneq ($(CONFIG_DISABLE_SIGNALS),y)
|
ifneq ($(CONFIG_DISABLE_SIGNALS),y)
|
||||||
CSRCS += lib_psa_getsigmask.c lib_psa_setsigmask.c
|
CSRCS += lib_psa_getsigmask.c lib_psa_setsigmask.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifneq ($(CONFIG_ARCH_ADDRENV),y)
|
||||||
|
CSRCS += lib_psa_getstacksize.c lib_psa_setstacksize.c
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_DEBUG),y)
|
ifeq ($(CONFIG_DEBUG),y)
|
||||||
CSRCS += lib_psa_dump.c
|
CSRCS += lib_psa_dump.c
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -43,8 +43,10 @@
|
||||||
#include <spawn.h>
|
#include <spawn.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
|
#ifndef CONFIG_ARCH_ADDRENV
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Global Functions
|
* Public Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
@ -72,3 +74,5 @@ int task_spawnattr_getstacksize(FAR const posix_spawnattr_t *attr,
|
||||||
*stacksize = attr->stacksize;
|
*stacksize = attr->stacksize;
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif /* CONFIG_ARCH_ADDRENV */
|
||||||
|
|
|
@ -100,8 +100,10 @@ int posix_spawnattr_init(posix_spawnattr_t *attr)
|
||||||
attr->sigmask = 0;
|
attr->sigmask = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef CONFIG_ARCH_ADDRENV
|
||||||
/* Default stack size */
|
/* Default stack size */
|
||||||
|
|
||||||
attr->stacksize = CONFIG_TASK_SPAWN_DEFAULT_STACKSIZE;
|
attr->stacksize = CONFIG_TASK_SPAWN_DEFAULT_STACKSIZE;
|
||||||
|
#endif
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,8 +43,10 @@
|
||||||
#include <spawn.h>
|
#include <spawn.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
|
#ifdef CONFIG_ARCH_ADDRENV
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Global Functions
|
* Public Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
@ -71,3 +73,5 @@ int task_spawnattr_setstacksize(FAR posix_spawnattr_t *attr, size_t stacksize)
|
||||||
attr->stacksize = stacksize;
|
attr->stacksize = stacksize;
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif /* CONFIG_ARCH_ADDRENV */
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
|
|
||||||
TSK_SRCS = task_create.c task_init.c task_setup.c task_activate.c
|
TSK_SRCS = task_create.c task_init.c task_setup.c task_activate.c
|
||||||
TSK_SRCS += task_start.c task_delete.c task_exit.c task_exithook.c
|
TSK_SRCS += task_start.c task_delete.c task_exit.c task_exithook.c
|
||||||
TSK_SRCS += task_recover.c task_restart.c task_spawn.c task_spawnparms.c
|
TSK_SRCS += task_recover.c task_restart.c task_spawnparms.c
|
||||||
TSK_SRCS += task_terminate.c task_getgroup.c task_prctl.c task_getpid.c
|
TSK_SRCS += task_terminate.c task_getgroup.c task_prctl.c task_getpid.c
|
||||||
TSK_SRCS += exit.c
|
TSK_SRCS += exit.c
|
||||||
|
|
||||||
|
@ -45,6 +45,10 @@ TSK_SRCS += task_vfork.c
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifneq ($(CONFIG_ARCH_ADDRENV),y)
|
||||||
|
TSK_SRCS += task_spawn.c
|
||||||
|
endif
|
||||||
|
|
||||||
ifneq ($(CONFIG_BINFMT_DISABLE),y)
|
ifneq ($(CONFIG_BINFMT_DISABLE),y)
|
||||||
ifeq ($(CONFIG_LIBC_EXECFUNCS),y)
|
ifeq ($(CONFIG_LIBC_EXECFUNCS),y)
|
||||||
TSK_SRCS += task_posixspawn.c
|
TSK_SRCS += task_posixspawn.c
|
||||||
|
|
|
@ -240,11 +240,13 @@ errout:
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef CONFIG_ARCH_ADDRENV
|
||||||
int task_create(FAR const char *name, int priority,
|
int task_create(FAR const char *name, int priority,
|
||||||
int stack_size, main_t entry, FAR char * const argv[])
|
int stack_size, main_t entry, FAR char * const argv[])
|
||||||
{
|
{
|
||||||
return thread_create(name, TCB_FLAG_TTYPE_TASK, priority, stack_size, entry, argv);
|
return thread_create(name, TCB_FLAG_TTYPE_TASK, priority, stack_size, entry, argv);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: kernel_thread
|
* Name: kernel_thread
|
||||||
|
|
|
@ -49,6 +49,8 @@
|
||||||
#include "task/spawn.h"
|
#include "task/spawn.h"
|
||||||
#include "task/task.h"
|
#include "task/task.h"
|
||||||
|
|
||||||
|
#ifndef CONFIG_ARCH_ADDRENV
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
@ -452,3 +454,5 @@ errout_with_lock:
|
||||||
spawn_semgive(&g_spawn_parmsem);
|
spawn_semgive(&g_spawn_parmsem);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif /* CONFIG_ARCH_ADDRENV */
|
||||||
|
|
Loading…
Reference in a new issue