summaryrefslogtreecommitdiff
path: root/apps/nshlib
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 /apps/nshlib
parentc48af0eb9c61462f59a7ba63ca7a73e8df146f49 (diff)
downloadnuttx-64892e44f2ce2612c77b1b20497fb007adafafb8.tar.gz
nuttx-64892e44f2ce2612c77b1b20497fb007adafafb8.tar.bz2
nuttx-64892e44f2ce2612c77b1b20497fb007adafafb8.zip
Rename CONFIG_NUTTX_KERNEL to CONFIG_BUILD_PROTECTED; Partially integrate new CONFIG_BUILD_KERNEL
Diffstat (limited to 'apps/nshlib')
-rw-r--r--apps/nshlib/Kconfig2
-rw-r--r--apps/nshlib/nsh.h4
-rw-r--r--apps/nshlib/nsh_command.c2
-rw-r--r--apps/nshlib/nsh_mntcmds.c12
-rw-r--r--apps/nshlib/nsh_routecmds.c9
5 files changed, 16 insertions, 13 deletions
diff --git a/apps/nshlib/Kconfig b/apps/nshlib/Kconfig
index b51b2931e..0add860d6 100644
--- a/apps/nshlib/Kconfig
+++ b/apps/nshlib/Kconfig
@@ -301,7 +301,7 @@ config NSH_DISABLE_NSFMOUNT
config NSH_DISABLE_PS
bool "Disable ps"
default n
- depends on !NUTTX_KERNEL
+ depends on !BUILD_PROTECTED && !BUILD_KERNEL
config NSH_DISABLE_PING
bool "Disable ping"
diff --git a/apps/nshlib/nsh.h b/apps/nshlib/nsh.h
index 23b030072..a17b0a901 100644
--- a/apps/nshlib/nsh.h
+++ b/apps/nshlib/nsh.h
@@ -546,11 +546,11 @@
# define IOBUFFERSIZE (PATH_MAX + 1)
#endif
-/* Certain commands are not availalbe in a kernel build because they depend
+/* Certain commands are not available in a kernel builds because they depend
* on interfaces that are not exported by the kernel.
*/
-#ifdef CONFIG_NUTTX_KERNEL
+#if defined(CONFIG_BUILD_PROTECTED) || defined(CONFIG_BUILD_KERNEL)
# undef CONFIG_NSH_DISABLE_DF
# define CONFIG_NSH_DISABLE_DF 1
#endif
diff --git a/apps/nshlib/nsh_command.c b/apps/nshlib/nsh_command.c
index ef141b80a..3950b3379 100644
--- a/apps/nshlib/nsh_command.c
+++ b/apps/nshlib/nsh_command.c
@@ -292,7 +292,7 @@ static const struct cmdmap_s g_cmdmap[] =
#if !defined(CONFIG_DISABLE_MOUNTPOINT) && CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_FS_READABLE)
# ifndef CONFIG_NSH_DISABLE_MOUNT
-# ifdef CONFIG_NUTTX_KERNEL
+#if defined(CONFIG_BUILD_PROTECTED) || defined(CONFIG_BUILD_KERNEL)
{ "mount", cmd_mount, 5, 5, "-t <fstype> [<block-device>] <mount-point>" },
# else
{ "mount", cmd_mount, 1, 5, "[-t <fstype> [<block-device>] <mount-point>]" },
diff --git a/apps/nshlib/nsh_mntcmds.c b/apps/nshlib/nsh_mntcmds.c
index 584c1258a..55d9df9b6 100644
--- a/apps/nshlib/nsh_mntcmds.c
+++ b/apps/nshlib/nsh_mntcmds.c
@@ -88,7 +88,7 @@
#if CONFIG_NFILE_DESCRIPTORS > 0 && !defined(CONFIG_DISABLE_MOUNTPOINT) && \
defined(CONFIG_FS_READABLE) && !defined(CONFIG_NSH_DISABLE_MOUNT)
-#ifndef CONFIG_NUTTX_KERNEL
+#if !defined(CONFIG_BUILD_PROTECTED) && !defined(CONFIG_BUILD_KERNEL)
static const char* get_fstype(FAR struct statfs *statbuf)
{
FAR const char *fstype;
@@ -227,7 +227,7 @@ static int df_man_readable_handler(FAR const char *mountpoint,
usedlabel = labels[which];
-#ifndef CONFIG_NUTTX_KERNEL
+#if !defined(CONFIG_BUILD_PROTECTED) && !defined(CONFIG_BUILD_KERNEL)
nsh_output(vtbl, "%-10s %6ld%c %8ld%c %8ld%c %s\n", get_fstype(statbuf),
size, sizelabel, used, usedlabel, free, freelabel,
mountpoint);
@@ -249,7 +249,7 @@ static int df_man_readable_handler(FAR const char *mountpoint,
#if CONFIG_NFILE_DESCRIPTORS > 0 && !defined(CONFIG_DISABLE_MOUNTPOINT) && \
defined(CONFIG_FS_READABLE) && !defined(CONFIG_NSH_DISABLE_MOUNT)
-#ifndef CONFIG_NUTTX_KERNEL
+#if !defined(CONFIG_BUILD_PROTECTED) && !defined(CONFIG_BUILD_KERNEL)
static int mount_handler(FAR const char *mountpoint,
FAR struct statfs *statbuf, FAR void *arg)
{
@@ -274,7 +274,7 @@ static int mount_handler(FAR const char *mountpoint,
#if CONFIG_NFILE_DESCRIPTORS > 0 && !defined(CONFIG_DISABLE_MOUNTPOINT) && \
defined(CONFIG_FS_READABLE) && !defined(CONFIG_NSH_DISABLE_MOUNT)
-#ifndef CONFIG_NUTTX_KERNEL
+#if !defined(CONFIG_BUILD_PROTECTED) && !defined(CONFIG_BUILD_KERNEL)
static inline int mount_show(FAR struct nsh_vtbl_s *vtbl, FAR const char *progname)
{
return foreach_mountpoint(mount_handler, (FAR void *)vtbl);
@@ -297,7 +297,7 @@ int cmd_df(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
#ifdef CONFIG_NSH_CMDOPT_DF_H
if (argc > 1 && strcmp(argv[1], "-h") == 0)
{
-#ifndef CONFIG_NUTTX_KERNEL
+#if !defined(CONFIG_BUILD_PROTECTED) && !defined(CONFIG_BUILD_KERNEL)
nsh_output(vtbl, "Filesystem Size Used Available Mounted on\n");
#else
nsh_output(vtbl, "Size Used Available Mounted on\n");
@@ -333,7 +333,7 @@ int cmd_mount(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
/* The mount command behaves differently if no parameters are provided */
-#ifndef CONFIG_NUTTX_KERNEL
+#if !defined(CONFIG_BUILD_PROTECTED) && !defined(CONFIG_BUILD_KERNEL)
if (argc < 2)
{
return mount_show(vtbl, argv[0]);
diff --git a/apps/nshlib/nsh_routecmds.c b/apps/nshlib/nsh_routecmds.c
index b8a6c4784..30489332a 100644
--- a/apps/nshlib/nsh_routecmds.c
+++ b/apps/nshlib/nsh_routecmds.c
@@ -321,11 +321,14 @@ errout:
*
****************************************************************************/
-#if !defined(CONFIG_NSH_DISABLE_DELROUTE) && !defined(CONFIG_NUTTX_KERNEL)
+#if !defined(CONFIG_NSH_DISABLE_DELROUTE) && \
+ !defined(CONFIG_BUILD_PROTECTED) && \
+ !defined(CONFIG_BUILD_KERNEL)
+
/* Perhaps... someday. This would current depend on using the internal
- * OS interface net_foreachroute and internal OS data structrues defined
+ * OS interface net_foreachroute and internal OS data structures defined
* in nuttx/net/net_route.h
*/
-#endif /* !CONFIG_NSH_DISABLE_DELROUTE && !CONFIG_NUTTX_KERNEL */
+#endif /* !CONFIG_NSH_DISABLE_DELROUTE && !CONFIG_BUILD_PROTECTED && !CONFIG_BUILD_KERNEL */
#endif /* CONFIG_NET && CONFIG_NET_ROUTE */