diff --git a/binfmt/binfmt_exec.c b/binfmt/binfmt_exec.c index 222a7de72b..dd51d7e53a 100644 --- a/binfmt/binfmt_exec.c +++ b/binfmt/binfmt_exec.c @@ -106,12 +106,10 @@ int exec_spawn(FAR const char *filename, FAR char * const *argv, bin->priority = attr->priority; } -#ifndef CONFIG_BUILD_KERNEL if (attr->stacksize > 0) { bin->stacksize = attr->stacksize; } -#endif } /* Disable pre-emption so that the executed module does diff --git a/include/spawn.h b/include/spawn.h index 6c12e29633..0a8ae8d0c0 100644 --- a/include/spawn.h +++ b/include/spawn.h @@ -87,12 +87,10 @@ struct posix_spawnattr_s #endif sigset_t sigmask; /* Signals to be masked */ + size_t stacksize; /* Task stack size (non-standard) */ #ifndef CONFIG_BUILD_KERNEL - /* Used only by task_spawn (non-standard) */ - - FAR void *stackaddr; /* Task stack address */ - size_t stacksize; /* Task stack size */ + FAR void *stackaddr; /* Task stack address (non-standard) */ #endif #ifdef CONFIG_SCHED_SPORADIC @@ -203,25 +201,21 @@ int posix_spawnattr_setschedpolicy(FAR posix_spawnattr_t *attr, int policy); int posix_spawnattr_setsigmask(FAR posix_spawnattr_t *attr, FAR const sigset_t *sigmask); -/* Non-standard get/set spawn attributes interfaces for use only with - * task_spawn() - */ +/* Non-standard get/set spawn attributes interfaces */ + +int task_spawnattr_getstacksize(FAR const posix_spawnattr_t *attr, + FAR size_t *stacksize); +int task_spawnattr_setstacksize(FAR posix_spawnattr_t *attr, + size_t stacksize); #ifndef CONFIG_BUILD_KERNEL int task_spawnattr_getstackaddr(FAR const posix_spawnattr_t *attr, FAR void **stackaddr); int task_spawnattr_setstackaddr(FAR posix_spawnattr_t *attr, FAR void *stackaddr); - -int task_spawnattr_getstacksize(FAR const posix_spawnattr_t *attr, - FAR size_t *stacksize); -int task_spawnattr_setstacksize(FAR posix_spawnattr_t *attr, - size_t stacksize); #else # define task_spawnattr_getstackaddr(attr, addr) (*(addr) = NULL, 0) # define task_spawnattr_setstackaddr(attr, addr) (0) -# define task_spawnattr_getstacksize(attr, size) (*(size) = 0, 0) -# define task_spawnattr_setstacksize(attr, size) (0) #endif /* Non standard debug functions */ diff --git a/libs/libc/spawn/Make.defs b/libs/libc/spawn/Make.defs index 42a2df84de..55538890d7 100644 --- a/libs/libc/spawn/Make.defs +++ b/libs/libc/spawn/Make.defs @@ -23,21 +23,17 @@ CSRCS += lib_psfa_addaction.c lib_psfa_addclose.c lib_psfa_adddup2.c CSRCS += lib_psfa_addopen.c lib_psfa_destroy.c lib_psfa_init.c -ifeq ($(CONFIG_DEBUG_FEATURES),y) -CSRCS += lib_psfa_dump.c -endif - CSRCS += lib_psa_getflags.c lib_psa_getschedparam.c lib_psa_getschedpolicy.c CSRCS += lib_psa_init.c lib_psa_setflags.c lib_psa_setschedparam.c CSRCS += lib_psa_setschedpolicy.c lib_psa_getsigmask.c lib_psa_setsigmask.c +CSRCS += lib_psa_getstackaddr.c lib_psa_setstackaddr.c ifneq ($(CONFIG_BUILD_KERNEL),y) -CSRCS += lib_psa_getstackaddr.c lib_psa_setstackaddr.c CSRCS += lib_psa_getstacksize.c lib_psa_setstacksize.c endif ifeq ($(CONFIG_DEBUG_FEATURES),y) -CSRCS += lib_psa_dump.c +CSRCS += lib_psfa_dump.c lib_psa_dump.c endif # Add the spawn directory to the build diff --git a/libs/libc/spawn/lib_psa_getstacksize.c b/libs/libc/spawn/lib_psa_getstacksize.c index 748fb52fa2..83f5550bc8 100644 --- a/libs/libc/spawn/lib_psa_getstacksize.c +++ b/libs/libc/spawn/lib_psa_getstacksize.c @@ -28,8 +28,6 @@ #include #include -#ifndef CONFIG_BUILD_KERNEL - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -59,5 +57,3 @@ int task_spawnattr_getstacksize(FAR const posix_spawnattr_t *attr, *stacksize = attr->stacksize; return OK; } - -#endif /* !CONFIG_BUILD_KERNEL */ diff --git a/libs/libc/spawn/lib_psa_init.c b/libs/libc/spawn/lib_psa_init.c index 5bb112fbb2..c9fb53a5ce 100644 --- a/libs/libc/spawn/lib_psa_init.c +++ b/libs/libc/spawn/lib_psa_init.c @@ -98,11 +98,9 @@ int posix_spawnattr_init(posix_spawnattr_t *attr) attr->budget.tv_nsec = param.sched_ss_init_budget.tv_nsec; #endif -#ifndef CONFIG_ARCH_ADDRENV /* Default stack size */ attr->stacksize = CONFIG_TASK_SPAWN_DEFAULT_STACKSIZE; -#endif return OK; } diff --git a/libs/libc/spawn/lib_psa_setstacksize.c b/libs/libc/spawn/lib_psa_setstacksize.c index 6db71c6582..a6712a6871 100644 --- a/libs/libc/spawn/lib_psa_setstacksize.c +++ b/libs/libc/spawn/lib_psa_setstacksize.c @@ -28,8 +28,6 @@ #include #include -#ifndef CONFIG_BUILD_KERNEL - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -59,5 +57,3 @@ int task_spawnattr_setstacksize(FAR posix_spawnattr_t *attr, attr->stacksize = stacksize; return OK; } - -#endif /* !CONFIG_BUILD_KERNEL */