From ce376ed9e145fe7b9c0215e93bfebf0893ecf7b3 Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 7 Mar 2013 01:52:30 +0000 Subject: More LPC1788 changes from Rommel Marcelo + a few kernel build fixes git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5715 42af7a65-404d-4744-a932-0658087f49c3 --- apps/nshlib/nsh.h | 9 +++++++++ apps/nshlib/nsh_mntcmds.c | 8 +++++++- apps/nshlib/nsh_parse.c | 4 ++++ 3 files changed, 20 insertions(+), 1 deletion(-) (limited to 'apps/nshlib') diff --git a/apps/nshlib/nsh.h b/apps/nshlib/nsh.h index 23209dba5..3afbce8f9 100644 --- a/apps/nshlib/nsh.h +++ b/apps/nshlib/nsh.h @@ -403,6 +403,15 @@ # define IOBUFFERSIZE (PATH_MAX + 1) #endif +/* Certain commands are not availalbe in a kernel build because they depend + * on interfaces that are not exported by the kernel. + */ + +#ifdef CONFIG_NUTTX_KERNEL +# undef CONFIG_NSH_DISABLE_DF +# define CONFIG_NSH_DISABLE_DF 1 +#endif + /**************************************************************************** * Public Types ****************************************************************************/ diff --git a/apps/nshlib/nsh_mntcmds.c b/apps/nshlib/nsh_mntcmds.c index f8e3a142a..8e62229fa 100644 --- a/apps/nshlib/nsh_mntcmds.c +++ b/apps/nshlib/nsh_mntcmds.c @@ -1,7 +1,7 @@ /**************************************************************************** * apps/nshlib/nsh_mntcmds.c * - * Copyright (C) 2007-2009, 2011-2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011-2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -107,6 +107,7 @@ static int df_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 static int mount_handler(FAR const char *mountpoint, FAR struct statfs *statbuf, FAR void *arg) { @@ -158,6 +159,7 @@ static int mount_handler(FAR const char *mountpoint, return OK; } #endif +#endif /**************************************************************************** * Name: mount_show @@ -165,11 +167,13 @@ 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 static inline int mount_show(FAR struct nsh_vtbl_s *vtbl, FAR const char *progname) { return foreach_mountpoint(mount_handler, (FAR void *)vtbl); } #endif +#endif /**************************************************************************** * Public Functions @@ -209,10 +213,12 @@ 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 (argc < 2) { return mount_show(vtbl, argv[0]); } +#endif /* Get the mount options. NOTE: getopt() is not thread safe nor re-entrant. * To keep its state proper for the next usage, it is necessary to parse to diff --git a/apps/nshlib/nsh_parse.c b/apps/nshlib/nsh_parse.c index 4ee86b4cc..d5ffd81ee 100644 --- a/apps/nshlib/nsh_parse.c +++ b/apps/nshlib/nsh_parse.c @@ -302,7 +302,11 @@ 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 + { "mount", cmd_mount, 5, 5, "-t [] " }, +# else { "mount", cmd_mount, 1, 5, "[-t [] ]" }, +# endif # endif #endif -- cgit v1.2.3