summaryrefslogtreecommitdiff
path: root/nuttx/libc
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-08-29 14:47:22 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-08-29 14:47:22 -0600
commit64892e44f2ce2612c77b1b20497fb007adafafb8 (patch)
tree2c917f29727a017b85193ac85959663d504b26e5 /nuttx/libc
parentc48af0eb9c61462f59a7ba63ca7a73e8df146f49 (diff)
downloadpx4-nuttx-64892e44f2ce2612c77b1b20497fb007adafafb8.tar.gz
px4-nuttx-64892e44f2ce2612c77b1b20497fb007adafafb8.tar.bz2
px4-nuttx-64892e44f2ce2612c77b1b20497fb007adafafb8.zip
Rename CONFIG_NUTTX_KERNEL to CONFIG_BUILD_PROTECTED; Partially integrate new CONFIG_BUILD_KERNEL
Diffstat (limited to 'nuttx/libc')
-rw-r--r--nuttx/libc/Kconfig4
-rw-r--r--nuttx/libc/Makefile12
-rw-r--r--nuttx/libc/README.txt7
-rw-r--r--nuttx/libc/lib_internal.h3
-rw-r--r--nuttx/libc/misc/lib_init.c5
-rw-r--r--nuttx/libc/pthread/Make.defs2
-rw-r--r--nuttx/libc/pthread/pthread_attrinit.c3
-rw-r--r--nuttx/libc/pthread/pthread_startup.c5
-rw-r--r--nuttx/libc/sched/Make.defs2
-rw-r--r--nuttx/libc/sched/task_startup.c4
-rw-r--r--nuttx/libc/stdio/lib_lowsyslog.c2
-rw-r--r--nuttx/libc/stdio/lib_syslog.c2
-rw-r--r--nuttx/libc/wqueue/Make.defs2
-rw-r--r--nuttx/libc/wqueue/work_thread.c6
-rw-r--r--nuttx/libc/wqueue/work_usrstart.c4
15 files changed, 39 insertions, 24 deletions
diff --git a/nuttx/libc/Kconfig b/nuttx/libc/Kconfig
index 6ed38bc6d..79b7cbc0f 100644
--- a/nuttx/libc/Kconfig
+++ b/nuttx/libc/Kconfig
@@ -460,7 +460,7 @@ config SCHED_LPWORKSTACKSIZE
endif # SCHED_LPWORK
endif # SCHED_HPWORK
-if NUTTX_KERNEL
+if BUILD_PROTECTED
config SCHED_USRWORK
bool "User mode worker thread"
@@ -490,7 +490,7 @@ config SCHED_LPWORKSTACKSIZE
The stack size allocated for the lower priority worker thread. Default: 2K.
endif # SCHED_USRWORK
-endif # NUTTX_KERNEL
+endif # BUILD_PROTECTED
endif # SCHED_WORKQUEUE
config LIB_KBDCODEC
diff --git a/nuttx/libc/Makefile b/nuttx/libc/Makefile
index 4556b66a4..7404b9c5e 100644
--- a/nuttx/libc/Makefile
+++ b/nuttx/libc/Makefile
@@ -37,12 +37,20 @@
# CFLAGS
-ifeq ($(CONFIG_NUTTX_KERNEL),y)
+ifeq ($(CONFIG_BUILD_PROTECTED),y)
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
KDEFINE = ${shell $(TOPDIR)\tools\define.bat "$(CC)" __KERNEL__}
else
KDEFINE = ${shell $(TOPDIR)/tools/define.sh "$(CC)" __KERNEL__}
endif
+else
+ifeq ($(CONFIG_BUILD_KERNEL),y)
+ifeq ($(CONFIG_WINDOWS_NATIVE),y)
+ KDEFINE = ${shell $(TOPDIR)\tools\define.bat "$(CC)" __KERNEL__}
+else
+ KDEFINE = ${shell $(TOPDIR)/tools/define.sh "$(CC)" __KERNEL__}
+endif
+endif
endif
# Sources and paths
@@ -122,7 +130,7 @@ endif
# Dependencies
.depend: Makefile $(SRCS)
-ifeq ($(CONFIG_NUTTX_KERNEL),y)
+ifeq ($(CONFIG_BUILD_PROTECTED),y)
$(Q) $(MKDEP) --obj-path ubin --obj-suffix $(OBJEXT) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make_ubin.dep
$(Q) $(MKDEP) --obj-path kbin --obj-suffix $(OBJEXT) $(DEPPATH) "$(CC)" -- $(CFLAGS) $(KDEFINE) -- $(SRCS) >Make_kbin.dep
else
diff --git a/nuttx/libc/README.txt b/nuttx/libc/README.txt
index b165bd74b..8e8fa9f73 100644
--- a/nuttx/libc/README.txt
+++ b/nuttx/libc/README.txt
@@ -11,13 +11,16 @@ mode. In that model, there is no real architectural distinction between
what is a kernel-mode program and what is a user-mode program; the system is
more like on multi-threaded program that all runs in kernel-mode.
-But if the CONFIG_NUTTX_KERNEL option is selected, NuttX will be built into
-distinct user-mode and kernel-mode sections. In that case, most of the
+But if the CONFIG_BUILD_PROTECTED option is selected, NuttX will be built
+into distinct user-mode and kernel-mode sections. In that case, most of the
code in the nuttx/ directory will run in kernel-mode with with exceptions
of (1) the user-mode "proxies" found in syscall/proxies, and (2) the
standard C library functions found in this directory. In this build model,
it is critical to separate the user-mode OS interfaces in this way.
+If CONFIG_BUILD_KERNEL is selected, then only a NuttX kernel will be built
+with no applications.
+
Sub-Directories
===============
diff --git a/nuttx/libc/lib_internal.h b/nuttx/libc/lib_internal.h
index c65cab5b2..6b9404680 100644
--- a/nuttx/libc/lib_internal.h
+++ b/nuttx/libc/lib_internal.h
@@ -80,7 +80,8 @@
* mode is supported.
*/
-#if defined(CONFIG_NUTTX_KERNEL) && defined(__KERNEL__)
+#if (defined(CONFIG_BUILD_PROTECTED) && defined(__KERNEL__)) || \
+ defined(CONFIG_BUILD_KERNEL)
# include <nuttx/kmalloc.h>
/* Domain-specific allocations */
diff --git a/nuttx/libc/misc/lib_init.c b/nuttx/libc/misc/lib_init.c
index 586699a4a..f4f4e5b6e 100644
--- a/nuttx/libc/misc/lib_init.c
+++ b/nuttx/libc/misc/lib_init.c
@@ -49,7 +49,8 @@
#include "lib_internal.h"
-#if !defined(CONFIG_NUTTX_KERNEL) || defined(__KERNEL__)
+#if !defined(CONFIG_BUILD_PROTECTED) || defined(__KERNEL__) || \
+ defined(CONFIG_BUILD_KERNEL)
/************************************************************
* Pre-processor Definitions
@@ -150,5 +151,5 @@ void lib_releaselist(FAR struct streamlist *list)
#endif
}
-#endif /* !CONFIG_NUTTX_KERNEL || __KERNEL__ */
+#endif /* !CONFIG_BUILD_PROTECTED || __KERNEL__ || CONFIG_BUILD_KERNEL */
#endif /* CONFIG_NFILE_STREAMS */
diff --git a/nuttx/libc/pthread/Make.defs b/nuttx/libc/pthread/Make.defs
index c4ccbf635..a443a6996 100644
--- a/nuttx/libc/pthread/Make.defs
+++ b/nuttx/libc/pthread/Make.defs
@@ -50,7 +50,7 @@ ifeq ($(CONFIG_MUTEX_TYPES),y)
CSRCS += pthread_mutexattrsettype.c pthread_mutexattrgettype.c
endif
-ifeq ($(CONFIG_NUTTX_KERNEL),y)
+ifeq ($(CONFIG_BUILD_PROTECTED),y)
CSRCS += pthread_startup.c
endif
diff --git a/nuttx/libc/pthread/pthread_attrinit.c b/nuttx/libc/pthread/pthread_attrinit.c
index a2d6bf938..d4a3e0f93 100644
--- a/nuttx/libc/pthread/pthread_attrinit.c
+++ b/nuttx/libc/pthread/pthread_attrinit.c
@@ -64,7 +64,8 @@
* the user address space.
*/
-#if defined(CONFIG_NUTTX_KERNEL) && !defined(__KERNEL__)
+#if (defined(CONFIG_BUILD_PROTECTED) && !defined(__KERNEL__)) && \
+ !defined(CONFIG_BUILD_KERNEL)
pthread_attr_t g_default_pthread_attr = PTHREAD_ATTR_INITIALIZER;
#endif
diff --git a/nuttx/libc/pthread/pthread_startup.c b/nuttx/libc/pthread/pthread_startup.c
index 50aa263e4..6dea37c4e 100644
--- a/nuttx/libc/pthread/pthread_startup.c
+++ b/nuttx/libc/pthread/pthread_startup.c
@@ -44,7 +44,8 @@
#include <nuttx/userspace.h>
-#if defined(CONFIG_NUTTX_KERNEL) && !defined(__KERNEL__)
+#if (defined(CONFIG_BUILD_PROTECTED) && !defined(__KERNEL__)) || \
+ !defined(CONFIG_BUILD_KERNEL)
/****************************************************************************
* Pre-processor Definitions
@@ -105,4 +106,4 @@ void pthread_startup(pthread_startroutine_t entrypt, pthread_addr_t arg)
pthread_exit(exit_status);
}
-#endif /* CONFIG_NUTTX_KERNEL && !__KERNEL__ */
+#endif /* (CONFIG_BUILD_PROTECTED && !__KERNEL__) && !CONFIG_BUILD_KERNEL */
diff --git a/nuttx/libc/sched/Make.defs b/nuttx/libc/sched/Make.defs
index 310a6259b..f1e69aff8 100644
--- a/nuttx/libc/sched/Make.defs
+++ b/nuttx/libc/sched/Make.defs
@@ -37,7 +37,7 @@
CSRCS += sched_getprioritymax.c sched_getprioritymin.c
-ifeq ($(CONFIG_NUTTX_KERNEL),y)
+ifeq ($(CONFIG_BUILD_PROTECTED),y)
CSRCS += task_startup.c
endif
diff --git a/nuttx/libc/sched/task_startup.c b/nuttx/libc/sched/task_startup.c
index 72cffbaaa..8c81c0b50 100644
--- a/nuttx/libc/sched/task_startup.c
+++ b/nuttx/libc/sched/task_startup.c
@@ -44,7 +44,7 @@
#include <nuttx/userspace.h>
-#if defined(CONFIG_NUTTX_KERNEL) && !defined(__KERNEL__)
+#if defined(CONFIG_BUILD_PROTECTED) && !defined(__KERNEL__)
/****************************************************************************
* Pre-processor Definitions
@@ -101,4 +101,4 @@ void task_startup(main_t entrypt, int argc, FAR char *argv[])
exit(entrypt(argc, argv));
}
-#endif /* CONFIG_NUTTX_KERNEL && !__KERNEL__ */
+#endif /* CONFIG_BUILD_PROTECTED && !__KERNEL__ */
diff --git a/nuttx/libc/stdio/lib_lowsyslog.c b/nuttx/libc/stdio/lib_lowsyslog.c
index 364a41831..3ada77bf5 100644
--- a/nuttx/libc/stdio/lib_lowsyslog.c
+++ b/nuttx/libc/stdio/lib_lowsyslog.c
@@ -46,7 +46,7 @@
/* This interface can only be used from within the kernel */
-#if !defined(CONFIG_NUTTX_KERNEL) || defined(__KERNEL__)
+#if !defined(CONFIG_BUILD_PROTECTED) || defined(__KERNEL__)
/****************************************************************************
* Definitions
diff --git a/nuttx/libc/stdio/lib_syslog.c b/nuttx/libc/stdio/lib_syslog.c
index 4e5afcebb..5f0958262 100644
--- a/nuttx/libc/stdio/lib_syslog.c
+++ b/nuttx/libc/stdio/lib_syslog.c
@@ -50,7 +50,7 @@
/* Some output destinations are only available from within the kernel */
-#if defined(CONFIG_NUTTX_KERNEL) && !defined(__KERNEL__)
+#if defined(CONFIG_BUILD_PROTECTED) && !defined(__KERNEL__)
# undef CONFIG_SYSLOG
# undef CONFIG_ARCH_LOWPUTC
#endif
diff --git a/nuttx/libc/wqueue/Make.defs b/nuttx/libc/wqueue/Make.defs
index fca63a8a6..3f1303d7a 100644
--- a/nuttx/libc/wqueue/Make.defs
+++ b/nuttx/libc/wqueue/Make.defs
@@ -39,7 +39,7 @@ ifeq ($(CONFIG_SCHED_WORKQUEUE),y)
CSRCS += work_thread.c work_queue.c work_cancel.c work_signal.c
-ifeq ($(CONFIG_NUTTX_KERNEL),y)
+ifeq ($(CONFIG_BUILD_PROTECTED),y)
CSRCS += work_usrstart.c
endif
diff --git a/nuttx/libc/wqueue/work_thread.c b/nuttx/libc/wqueue/work_thread.c
index ed26ca3ff..657fe9d10 100644
--- a/nuttx/libc/wqueue/work_thread.c
+++ b/nuttx/libc/wqueue/work_thread.c
@@ -67,7 +67,7 @@
/* The state of each work queue. */
-#ifdef CONFIG_NUTTX_KERNEL
+#ifdef CONFIG_BUILD_PROTECTED
/* Play some games in the kernel mode build to assure that different
* naming is used for the global work queue data structures. This may
@@ -83,11 +83,11 @@ struct wqueue_s g_kernelwork[NWORKERS];
struct wqueue_s g_usrwork[NWORKERS];
# endif
-#else /* CONFIG_NUTTX_KERNEL */
+#else /* CONFIG_BUILD_PROTECTED */
struct wqueue_s g_work[NWORKERS];
-#endif /* CONFIG_NUTTX_KERNEL */
+#endif /* CONFIG_BUILD_PROTECTED */
/****************************************************************************
* Private Variables
diff --git a/nuttx/libc/wqueue/work_usrstart.c b/nuttx/libc/wqueue/work_usrstart.c
index 2b3ee3c67..068c016d1 100644
--- a/nuttx/libc/wqueue/work_usrstart.c
+++ b/nuttx/libc/wqueue/work_usrstart.c
@@ -46,7 +46,7 @@
#include <nuttx/wqueue.h>
-#if defined(CONFIG_NUTTX_KERNEL) && !defined(__KERNEL__) && \
+#if defined(CONFIG_BUILD_PROTECTED) && !defined(__KERNEL__) && \
defined(CONFIG_SCHED_WORKQUEUE) && defined(CONFIG_SCHED_USRWORK)
/****************************************************************************
@@ -112,4 +112,4 @@ int work_usrstart(void)
return g_usrwork[USRWORK].pid;
}
-#endif /* CONFIG_NUTTX_KERNEL && !__KERNEL__ CONFIG_SCHED_WORKQUEUE && CONFIG_SCHED_USRWORK */
+#endif /* CONFIG_BUILD_PROTECTED && !__KERNEL__ CONFIG_SCHED_WORKQUEUE && CONFIG_SCHED_USRWORK */