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
This commit is contained in:
patacongo 2013-03-07 01:52:30 +00:00
parent 52441236b8
commit dd90abae95
3 changed files with 20 additions and 1 deletions

View File

@ -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
****************************************************************************/

View File

@ -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 <gnutt@nuttx.org>
*
* 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

View File

@ -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 <fstype> [<block-device>] <mount-point>" },
# else
{ "mount", cmd_mount, 1, 5, "[-t <fstype> [<block-device>] <mount-point>]" },
# endif
# endif
#endif