summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nuttx/arch/arm/src/armv7-a/arm_pgalloc.c4
-rw-r--r--nuttx/include/sched.h2
-rw-r--r--nuttx/include/spawn.h4
-rw-r--r--nuttx/include/sys/syscall.h6
-rw-r--r--nuttx/libc/spawn/Make.defs2
-rw-r--r--nuttx/libc/spawn/lib_psa_getstacksize.c4
-rw-r--r--nuttx/libc/spawn/lib_psa_setstacksize.c4
-rwxr-xr-xnuttx/mm/kmm_sbrk.c5
-rw-r--r--nuttx/mm/mm_sbrk.c5
-rw-r--r--nuttx/mm/umm_malloc.c4
-rw-r--r--nuttx/mm/umm_sbrk.c17
-rw-r--r--nuttx/sched/task/Make.defs13
-rw-r--r--nuttx/sched/task/task_create.c3
-rw-r--r--nuttx/sched/task/task_spawn.c4
-rw-r--r--nuttx/syscall/syscall.csv4
-rw-r--r--nuttx/syscall/syscall_lookup.h4
16 files changed, 37 insertions, 48 deletions
diff --git a/nuttx/arch/arm/src/armv7-a/arm_pgalloc.c b/nuttx/arch/arm/src/armv7-a/arm_pgalloc.c
index 673af5834..da4623792 100644
--- a/nuttx/arch/arm/src/armv7-a/arm_pgalloc.c
+++ b/nuttx/arch/arm/src/armv7-a/arm_pgalloc.c
@@ -51,7 +51,7 @@
#include "mmu.h"
#include "pgalloc.h"
-#if defined(CONFIG_MM_PGALLOC) && defined(CONFIG_ARCH_USE_MMU)
+#ifdef CONFIG_BUILD_KERNEL
/****************************************************************************
* Pre-processor Definitions
@@ -317,4 +317,4 @@ uintptr_t pgalloc(uintptr_t brkaddr, unsigned int npages)
return brkaddr;
}
-#endif /* CONFIG_MM_PGALLOC && CONFIG_ARCH_USE_MMU */
+#endif /* CONFIG_BUILD_KERNEL */
diff --git a/nuttx/include/sched.h b/nuttx/include/sched.h
index 64d6a6b82..a0f296e14 100644
--- a/nuttx/include/sched.h
+++ b/nuttx/include/sched.h
@@ -99,7 +99,7 @@ int task_init(FAR struct tcb_s *tcb, const char *name, int priority,
FAR char * const argv[]);
int task_activate(FAR struct tcb_s *tcb);
-#ifndef CONFIG_ARCH_ADDRENV
+#ifndef CONFIG_BUILD_KERNEL
int task_create(FAR const char *name, int priority, int stack_size,
main_t entry, FAR char * const argv[]);
#endif
diff --git a/nuttx/include/spawn.h b/nuttx/include/spawn.h
index f994ac51f..e47bf47b2 100644
--- a/nuttx/include/spawn.h
+++ b/nuttx/include/spawn.h
@@ -89,7 +89,7 @@ struct posix_spawnattr_s
sigset_t sigmask; /* Signals to be masked */
#endif
-#ifndef CONFIG_ARCH_ADDRENV
+#ifndef CONFIG_BUILD_KERNEL
/* Used only by task_spawn (non-standard) */
size_t stacksize; /* Task stack size */
@@ -141,7 +141,7 @@ int posix_spawn(FAR pid_t *pid, FAR const char *path,
posix_spawn(pid,path,file_actions,attr,argv,envp)
#endif
-#ifndef CONFIG_ARCH_ADDRENV
+#ifndef CONFIG_BUILD_KERNEL
/* Non-standard task_spawn interface. This function uses the same
* semantics to execute a file in memory at 'entry', giving it the name
* 'name'.
diff --git a/nuttx/include/sys/syscall.h b/nuttx/include/sys/syscall.h
index 3ec10b3cd..10e6fb2c8 100644
--- a/nuttx/include/sys/syscall.h
+++ b/nuttx/include/sys/syscall.h
@@ -94,7 +94,7 @@
* address environments.
*/
-#ifndef CONFIG_ARCH_ADDRENV
+#ifndef CONFIG_BUILD_KERNEL
# define SYS_task_create (CONFIG_SYS_RESERVED+22)
# define __SYS_task_delete (CONFIG_SYS_RESERVED+23)
@@ -102,11 +102,9 @@
* allocator selected. MMU support from the CPU is also required.
*/
-#elif defined(CONFIG_MM_PGALLOC) && defined(CONFIG_ARCH_USE_MMU)
+#else
# define SYS_pgalloc (CONFIG_SYS_RESERVED+22)
# define __SYS_task_delete (CONFIG_SYS_RESERVED+23)
-#else
-# define __SYS_task_delete (CONFIG_SYS_RESERVED+22)
#endif
# define SYS_task_delete __SYS_task_delete
diff --git a/nuttx/libc/spawn/Make.defs b/nuttx/libc/spawn/Make.defs
index d186de38e..7b4fdba4c 100644
--- a/nuttx/libc/spawn/Make.defs
+++ b/nuttx/libc/spawn/Make.defs
@@ -50,7 +50,7 @@ ifneq ($(CONFIG_DISABLE_SIGNALS),y)
CSRCS += lib_psa_getsigmask.c lib_psa_setsigmask.c
endif
-ifneq ($(CONFIG_ARCH_ADDRENV),y)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
CSRCS += lib_psa_getstacksize.c lib_psa_setstacksize.c
endif
diff --git a/nuttx/libc/spawn/lib_psa_getstacksize.c b/nuttx/libc/spawn/lib_psa_getstacksize.c
index d6fd8978e..4c50ee526 100644
--- a/nuttx/libc/spawn/lib_psa_getstacksize.c
+++ b/nuttx/libc/spawn/lib_psa_getstacksize.c
@@ -43,7 +43,7 @@
#include <spawn.h>
#include <assert.h>
-#ifndef CONFIG_ARCH_ADDRENV
+#ifndef CONFIG_BUILD_KERNEL
/****************************************************************************
* Public Functions
@@ -75,4 +75,4 @@ int task_spawnattr_getstacksize(FAR const posix_spawnattr_t *attr,
return OK;
}
-#endif /* !CONFIG_ARCH_ADDRENV */
+#endif /* !CONFIG_BUILD_KERNEL */
diff --git a/nuttx/libc/spawn/lib_psa_setstacksize.c b/nuttx/libc/spawn/lib_psa_setstacksize.c
index bad7627a1..54d48173b 100644
--- a/nuttx/libc/spawn/lib_psa_setstacksize.c
+++ b/nuttx/libc/spawn/lib_psa_setstacksize.c
@@ -43,7 +43,7 @@
#include <spawn.h>
#include <assert.h>
-#ifndef CONFIG_ARCH_ADDRENV
+#ifndef CONFIG_BUILD_KERNEL
/****************************************************************************
* Public Functions
@@ -74,4 +74,4 @@ int task_spawnattr_setstacksize(FAR posix_spawnattr_t *attr, size_t stacksize)
return OK;
}
-#endif /* !CONFIG_ARCH_ADDRENV */
+#endif /* !CONFIG_BUILD_KERNEL */
diff --git a/nuttx/mm/kmm_sbrk.c b/nuttx/mm/kmm_sbrk.c
index 547dba047..90c9b6627 100755
--- a/nuttx/mm/kmm_sbrk.c
+++ b/nuttx/mm/kmm_sbrk.c
@@ -41,8 +41,7 @@
#include <nuttx/mm.h>
-#if defined(CONFIG_MM_KERNEL_HEAP) && defined(CONFIG_ARCH_ADDRENV) && \
- defined(CONFIG_MM_PGALLOC) && defined(CONFIG_ARCH_USE_MMU)
+#if defined(CONFIG_BUILD_KERNEL) && defined(__KERNEL__)
/****************************************************************************
* Pre-processor Definitions
@@ -89,4 +88,4 @@ FAR void *kmm_sbrk(intptr_t incr)
return mm_sbrk(&g_kmmheap, incr, UINTPTR_MAX);
}
-#endif /* CONFIG_MM_KERNEL_HEAP && CONFIG_ARCH_ADDRENV && ... */
+#endif /* CONFIG_BUILD_KERNEL && __KERNEL__ */
diff --git a/nuttx/mm/mm_sbrk.c b/nuttx/mm/mm_sbrk.c
index 5d81250fa..dc4c0318e 100644
--- a/nuttx/mm/mm_sbrk.c
+++ b/nuttx/mm/mm_sbrk.c
@@ -47,8 +47,7 @@
#include <nuttx/mm.h>
#include <nuttx/pgalloc.h>
-#if defined(CONFIG_ARCH_ADDRENV) && defined(CONFIG_MM_PGALLOC) && \
- defined(CONFIG_ARCH_USE_MMU)
+#ifdef CONFIG_BUILD_KERNEL
/****************************************************************************
* Pre-processor Definitions
@@ -166,4 +165,4 @@ errout:
set_errno(err);
return (FAR void *)-1;
}
-#endif /* CONFIG_ARCH_ADDRENV && CONFIG_MM_PGALLOC && CONFIG_ARCH_USE_MMU */
+#endif /* CONFIG_BUILD_KERNEL */
diff --git a/nuttx/mm/umm_malloc.c b/nuttx/mm/umm_malloc.c
index 31511b82f..972b214de 100644
--- a/nuttx/mm/umm_malloc.c
+++ b/nuttx/mm/umm_malloc.c
@@ -50,7 +50,7 @@
* Pre-processor Definitions
****************************************************************************/
-#if defined(CONFIG_ARCH_ADDRENV) && defined(CONFIG_BUILD_KERNEL)
+#ifdef CONFIG_BUILD_KERNEL
/* In the kernel build, there a multiple user heaps; one for each task
* group. In this build configuration, the user heap structure lies
* in a reserved region at the beginning of the .bss/.data address
@@ -103,7 +103,7 @@
FAR void *malloc(size_t size)
{
-#ifdef CONFIG_ARCH_ADDRENV
+#ifdef CONFIG_BUILD_KERNEL
FAR void *brkaddr;
FAR void *mem;
diff --git a/nuttx/mm/umm_sbrk.c b/nuttx/mm/umm_sbrk.c
index bb74385ee..1e6eaf5c3 100644
--- a/nuttx/mm/umm_sbrk.c
+++ b/nuttx/mm/umm_sbrk.c
@@ -42,17 +42,15 @@
#include <unistd.h>
#include <nuttx/mm.h>
+#include <nuttx/addrenv.h>
#include <nuttx/pgalloc.h>
-#if defined(CONFIG_ARCH_ADDRENV) && defined(CONFIG_MM_PGALLOC) && \
- defined(CONFIG_ARCH_USE_MMU) && (!defined(CONFIG_BUILD_PROTECTED) || \
- !defined(__KERNEL__))
+#if defined(CONFIG_BUILD_KERNEL) && !defined(__KERNEL__)
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
-#if defined(CONFIG_ARCH_ADDRENV) && defined(CONFIG_BUILD_KERNEL)
/* In the kernel build, there a multiple user heaps; one for each task
* group. In this build configuration, the user heap structure lies
* in a reserved region at the beginning of the .bss/.data address
@@ -60,14 +58,7 @@
* ARCH_DATA_RESERVE_SIZE
*/
-# include <nuttx/addrenv.h>
-# define USR_HEAP (&ARCH_DATA_RESERVE->ar_usrheap)
-
-#else
-/* Otherwise, the user heap data structures are in common .bss */
-
-# define USR_HEAP &g_mmheap
-#endif
+#define USR_HEAP (&ARCH_DATA_RESERVE->ar_usrheap)
/****************************************************************************
* Public Functions
@@ -110,4 +101,4 @@ FAR void *sbrk(intptr_t incr)
return mm_sbrk(USR_HEAP, incr, CONFIG_ARCH_HEAP_NPAGES << MM_PGSHIFT);
}
-#endif /* CONFIG_ARCH_ADDRENV && CONFIG_MM_PGALLOC && ... */
+#endif /* CONFIG_BUILD_KERNEL && !__KERNEL__ */
diff --git a/nuttx/sched/task/Make.defs b/nuttx/sched/task/Make.defs
index 5d0b093da..81410d71f 100644
--- a/nuttx/sched/task/Make.defs
+++ b/nuttx/sched/task/Make.defs
@@ -33,11 +33,10 @@
#
############################################################################
-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_recover.c task_restart.c task_spawnparms.c
-TSK_SRCS += task_terminate.c task_getgroup.c task_prctl.c task_getpid.c
-TSK_SRCS += exit.c
+TSK_SRCS = task_init.c task_setup.c task_activate.c task_start.c
+TSK_SRCS += task_delete.c task_exit.c task_exithook.c task_recover.c
+TSK_SRCS += task_restart.c task_spawnparms.c task_terminate.c
+TSK_SRCS += task_getgroup.c task_prctl.c task_getpid.c exit.c
ifeq ($(CONFIG_ARCH_HAVE_VFORK),y)
ifeq ($(CONFIG_SCHED_WAITPID),y)
@@ -45,8 +44,8 @@ TSK_SRCS += task_vfork.c
endif
endif
-ifneq ($(CONFIG_ARCH_ADDRENV),y)
-TSK_SRCS += task_spawn.c
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+TSK_SRCS += task_create.c task_spawn.c
endif
ifneq ($(CONFIG_BINFMT_DISABLE),y)
diff --git a/nuttx/sched/task/task_create.c b/nuttx/sched/task/task_create.c
index f2078b592..358306c13 100644
--- a/nuttx/sched/task/task_create.c
+++ b/nuttx/sched/task/task_create.c
@@ -52,6 +52,8 @@
#include "group/group.h"
#include "task/task.h"
+#ifndef CONFIG_BUILD_KERNEL
+
/****************************************************************************
* Definitions
****************************************************************************/
@@ -270,3 +272,4 @@ int kernel_thread(FAR const char *name, int priority,
return thread_create(name, TCB_FLAG_TTYPE_KERNEL, priority, stack_size, entry, argv);
}
+#endif /* CONFIG_BUILD_KERNEL */
diff --git a/nuttx/sched/task/task_spawn.c b/nuttx/sched/task/task_spawn.c
index eb2983bf0..985350782 100644
--- a/nuttx/sched/task/task_spawn.c
+++ b/nuttx/sched/task/task_spawn.c
@@ -49,7 +49,7 @@
#include "task/spawn.h"
#include "task/task.h"
-#ifndef CONFIG_ARCH_ADDRENV
+#ifndef CONFIG_BUILD_KERNEL
/****************************************************************************
* Pre-processor Definitions
@@ -455,4 +455,4 @@ errout_with_lock:
return ret;
}
-#endif /* CONFIG_ARCH_ADDRENV */
+#endif /* CONFIG_BUILD_KERNEL */
diff --git a/nuttx/syscall/syscall.csv b/nuttx/syscall/syscall.csv
index 073f9d1d9..254464f8e 100644
--- a/nuttx/syscall/syscall.csv
+++ b/nuttx/syscall/syscall.csv
@@ -42,7 +42,7 @@
"nanosleep","time.h","!defined(CONFIG_DISABLE_SIGNALS)","int","FAR const struct timespec *", "FAR struct timespec*"
"open","fcntl.h","CONFIG_NFILE_DESCRIPTORS > 0","int","const char*","int","..."
"opendir","dirent.h","CONFIG_NFILE_DESCRIPTORS > 0","FAR DIR*","FAR const char*"
-"pgalloc", "nuttx/arch.h", "defined(CONFIG_ARCH_ADDRENV) && defined(CONFIG_MM_PGALLOC) && defined(CONFIG_ARCH_USE_MMU)", "uintptr_t", "uintptr_t", "unsigned int"
+"pgalloc", "nuttx/arch.h", "defined(CONFIG_BUILD_KERNEL)", "uintptr_t", "uintptr_t", "unsigned int"
"pipe","unistd.h","CONFIG_NFILE_DESCRIPTORS > 0","int","int [2]|int*"
"poll","poll.h","!defined(CONFIG_DISABLE_POLL) && (CONFIG_NSOCKET_DESCRIPTORS > 0 || CONFIG_NFILE_DESCRIPTORS > 0)","int","FAR struct pollfd*","nfds_t","int"
"prctl","sys/prctl.h", "CONFIG_TASK_NAME_SIZE > 0","int","int","..."
@@ -124,7 +124,7 @@
"stat","sys/stat.h","CONFIG_NFILE_DESCRIPTORS > 0","int","const char*","FAR struct stat*"
#"statfs","stdio.h","","int","FAR const char*","FAR struct statfs*"
"statfs","sys/statfs.h","CONFIG_NFILE_DESCRIPTORS > 0","int","const char*","struct statfs*"
-"task_create","sched.h","!defined(CONFIG_ARCH_ADDRENV)","int","FAR const char*","int","int","main_t","FAR char * const []|FAR char * const *"
+"task_create","sched.h","!defined(CONFIG_BUILD_KERNEL)", "int","FAR const char*","int","int","main_t","FAR char * const []|FAR char * const *"
#"task_create","sched.h","","int","const char*","int","main_t","FAR char * const []|FAR char * const *"
"task_delete","sched.h","","int","pid_t"
"task_restart","sched.h","","int","pid_t"
diff --git a/nuttx/syscall/syscall_lookup.h b/nuttx/syscall/syscall_lookup.h
index f4779fe2a..ac4fd20f2 100644
--- a/nuttx/syscall/syscall_lookup.h
+++ b/nuttx/syscall/syscall_lookup.h
@@ -65,9 +65,9 @@ SYSCALL_LOOKUP(sem_trywait, 1, STUB_sem_trywait)
SYSCALL_LOOKUP(sem_unlink, 1, STUB_sem_unlink)
SYSCALL_LOOKUP(sem_wait, 1, STUB_sem_wait)
SYSCALL_LOOKUP(set_errno, 1, STUB_set_errno)
-#ifndef CONFIG_ARCH_ADDRENV
+#ifndef CONFIG_BUILD_KERNEL
SYSCALL_LOOKUP(task_create, 5, STUB_task_create)
-#elif defined(CONFIG_MM_PGALLOC) && defined(CONFIG_ARCH_USE_MMU)
+#else
SYSCALL_LOOKUP(pgalloc, 2, STUB_pgalloc)
#endif
SYSCALL_LOOKUP(task_delete, 1, STUB_task_delete)