summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/netutils/thttpd/cgi-src/Makefile46
-rw-r--r--apps/nshlib/nsh_parse.c2
-rw-r--r--nuttx/TODO23
-rwxr-xr-xnuttx/configs/lpcxpresso-lpc1768/README.txt76
-rwxr-xr-xnuttx/configs/lpcxpresso-lpc1768/thttpd/Make.defs4
-rwxr-xr-xnuttx/configs/lpcxpresso-lpc1768/thttpd/setenv.sh6
-rwxr-xr-xnuttx/configs/lpcxpresso-lpc1768/tools/dfu_util.sh88
-rw-r--r--nuttx/include/sys/syscall.h16
-rw-r--r--nuttx/lib/time/lib_time.c49
-rw-r--r--nuttx/syscall/stub_lookup.c1
-rw-r--r--nuttx/syscall/stub_lookup.h3
-rw-r--r--nuttx/syscall/syscall.csv1
-rwxr-xr-xnuttx/tools/incdir.sh8
13 files changed, 159 insertions, 164 deletions
diff --git a/apps/netutils/thttpd/cgi-src/Makefile b/apps/netutils/thttpd/cgi-src/Makefile
index 3f025dec3..46b41fd62 100644
--- a/apps/netutils/thttpd/cgi-src/Makefile
+++ b/apps/netutils/thttpd/cgi-src/Makefile
@@ -36,40 +36,44 @@
-include $(TOPDIR)/.config
-include $(TOPDIR)/Make.defs
-CFLAGS += -I$(APPDIR)/netutils/thttpd -I$(APPDIR)/netutils/thttpd/cgi-src
+ifeq ($(WINTOOL),y)
+INCDIROPT = -w
+endif
+
+CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" "$(APPDIR)/netutils/thttpd" "$(APPDIR)/netutils/thttpd/cgi-src"}
CGIBINDIR = $(APPDIR)/netutils/thttpd/cgi-bin
CLEANFILES = *.o redirect ssi phf
-BIN1 = phf
-BIN2 = redirect
-BIN3 = ssi
-BIN = $(BIN1) $(BIN2) $(BIN3)
+BIN1 = phf
+BIN2 = redirect
+BIN3 = ssi
+BIN = $(BIN1) $(BIN2) $(BIN3)
-R1SRCS1 = $(BIN1).c
-R1OBJS1 = $(R1SRCS1:.c=.o)
-R2SRC1 = $(BIN1)-thunk.S
-R2OBJ1 = $(R2SRC1:.S=.o)
+R1SRCS1 = $(BIN1).c
+R1OBJS1 = $(R1SRCS1:.c=.o)
+R2SRC1 = $(BIN1)-thunk.S
+R2OBJ1 = $(R2SRC1:.S=.o)
-R1SRCS2 = $(BIN2).c
-R1OBJS2 = $(R1SRCS2:.c=.o)
-R2SRC2 = $(BIN2)-thunk.S
-R2OBJ2 = $(R2SRC2:.S=.o)
+R1SRCS2 = $(BIN2).c
+R1OBJS2 = $(R1SRCS2:.c=.o)
+R2SRC2 = $(BIN2)-thunk.S
+R2OBJ2 = $(R2SRC2:.S=.o)
-R1SRCS3 = $(BIN3).c
-R1OBJS3 = $(R1SRCS3:.c=.o)
-R2SRC3 = $(BIN3)-thunk.S
-R2OBJ3 = $(R2SRC3:.S=.o)
+R1SRCS3 = $(BIN3).c
+R1OBJS3 = $(R1SRCS3:.c=.o)
+R2SRC3 = $(BIN3)-thunk.S
+R2OBJ3 = $(R2SRC3:.S=.o)
-DERIVED = $(R2SRC1) $(R2SRC2) $(R2SRC3)
+DERIVED = $(R2SRC1) $(R2SRC2) $(R2SRC3)
-R1COBJS = $(R1OBJS1) $(R1OBJS2) $(R1OBJS3)
-R2AOBJS = $(R2OBJ1) $(R2OBJ2) $(R2OBJ3)
+R1COBJS = $(R1OBJS1) $(R1OBJS2) $(R1OBJS3)
+R2AOBJS = $(R2OBJ1) $(R2OBJ2) $(R2OBJ3)
all: $(BIN1) $(BIN2) $(BIN3)
$(R1COBJS): %.o: %.c
@echo "CC: $<"
- @$(CC) -c $(CPICFLAGS) $< -o $@
+ $(CC) -c $(CPICFLAGS) $< -o $@
$(R2AOBJS): %.o: %.S
@echo "AS: $<"
diff --git a/apps/nshlib/nsh_parse.c b/apps/nshlib/nsh_parse.c
index a4c3c893d..650ef5732 100644
--- a/apps/nshlib/nsh_parse.c
+++ b/apps/nshlib/nsh_parse.c
@@ -348,7 +348,7 @@ static const struct cmdmap_s g_cmdmap[] =
*/
#if CONFIG_VERSION_MAJOR != 0 || CONFIG_VERSION_MINOR != 0
-const char g_nshgreeting[] = "\nNuttShell (NSH) NuttX-" CONFIG_VERSION_STRING "\n
+const char g_nshgreeting[] = "\nNuttShell (NSH) NuttX-" CONFIG_VERSION_STRING "\n";
#else
const char g_nshgreeting[] = "\nNuttShell (NSH)\n";
#endif
diff --git a/nuttx/TODO b/nuttx/TODO
index d40421663..15852c314 100644
--- a/nuttx/TODO
+++ b/nuttx/TODO
@@ -182,6 +182,29 @@ o Binary loaders (binfmt/)
Status: Open
Priority: Low
+ Description: Windows build issue. Almost all configurations that use NXFLAT have
+ the linker script specified like this:
+
+ NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+
+
+ That will not work for windows-based tools because they require Windows
+ style paths. The solution is to do something like this:
+
+ if ($(WINTOOL)y)
+ NXFLATLDSCRIPT=${cygpath -w $(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld}
+ else
+ NXFLATLDSCRIPT=$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld
+ endif
+
+ Then use
+
+ NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T"$(NXFLATLDSCRIPT)" -no-check-sections
+
+ Status: Open
+ Priority: There are too many references like the above. They will have
+ to get fixed as needed for Windows native tool builds.
+
o Network (net/, drivers/net)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/nuttx/configs/lpcxpresso-lpc1768/README.txt b/nuttx/configs/lpcxpresso-lpc1768/README.txt
index abf659211..acff1d74b 100755
--- a/nuttx/configs/lpcxpresso-lpc1768/README.txt
+++ b/nuttx/configs/lpcxpresso-lpc1768/README.txt
@@ -151,27 +151,31 @@ GNU Toolchain Options
The NuttX make system has been modified to support the following different
toolchain options.
- 1. The CodeSourcery GNU toolchain,
- 2. The devkitARM GNU toolchain,
- 3. The NuttX buildroot Toolchain (see below).
+ 1. The Code Red GNU toolchain
+ 2. The CodeSourcery GNU toolchain,
+ 3. The devkitARM GNU toolchain,
+ 4. The NuttX buildroot Toolchain (see below).
- All testing has been conducted using the NuttX buildroot toolchain. However,
- the make system is setup to default to use the devkitARM toolchain. To use
- the CodeSourcery or devkitARM toolchain, you simply need add one of the
- following configuration options to your .config (or defconfig) file:
+ All testing has been conducted using the Code Red toolchain and the
+ make system is setup to default to use the Code Red Linux toolchain. To use
+ the other toolchain, you simply need add one of the following configuration
+ options to your .config (or defconfig) file:
CONFIG_LPC17_CODESOURCERYW=y : CodeSourcery under Windows
CONFIG_LPC17_CODESOURCERYL=y : CodeSourcery under Linux
CONFIG_LPC17_DEVKITARM=y : devkitARM under Windows
CONFIG_LPC17_BUILDROOT=y : NuttX buildroot under Linux or Cygwin (default)
+ CONFIG_LPC17_CODEREDW=n : Code Red toolchain under Windows
+ CONFIG_LPC17_CODEREDL=y : Code Red toolchain under Linux
- If you are not using CONFIG_LPC17_BUILDROOT, then you may also have to modify
- the PATH in the setenv.h file if your make cannot find the tools.
+ You may also have to modify the PATH in the setenv.h file if your make cannot
+ find the tools.
- NOTE: the CodeSourcery (for Windows)and devkitARM are Windows native toolchains.
- The CodeSourcey (for Linux) and NuttX buildroot toolchains are Cygwin and/or
- Linux native toolchains. There are several limitations to using a Windows based
- toolchain in a Cygwin environment. The three biggest are:
+ NOTE: the CodeSourcery (for Windows), devkitARM, and Code Red (for Windoes)
+ are Windows native toolchains. The CodeSourcey (for Linux), Code Red (for Linux)
+ and NuttX buildroot toolchains are Cygwin and/or Linux native toolchains. There
+ are several limitations to using a Windows based toolchain in a Cygwin
+ environment. The three biggest are:
1. The Windows toolchain cannot follow Cygwin paths. Path conversions are
performed automatically in the Cygwin makefiles using the 'cygpath' utility
@@ -220,7 +224,7 @@ Code Red IDE
Makefile Build
--------------
- Under Eclipse, it is pretty easy to set up an "empty makefile project" and
+ Under Linux Eclipse, it is pretty easy to set up an "empty makefile project" and
simply use the NuttX makefile to build the system. That is almost for free
under Linux. Under Windows, you will need to set up the "Cygwin GCC" empty
makefile project in order to work with Windows (Google for "Eclipse Cygwin" -
@@ -309,6 +313,12 @@ Code Red IDE
crt_emu_lpc11_13_nxp -wire=hid -pLPC1343 -flash-load=binary.bin -load-base=0x1000
+ tools/flash.sh
+ --------------
+
+ All of the above steps are automated in the bash script flash.sh that can
+ be found in the configs/lpcxpresso/tools directory.
+
NuttX buildroot Toolchain
^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -317,7 +327,7 @@ NuttX buildroot Toolchain
different from the default in your PATH variable).
If you have no Cortex-M3 toolchain, one can be downloaded from the NuttX
- SourceForge download site (https://sourceforge.net/project/showfiles.php?group_id=189573).
+ SourceForge download site (https://sourceforge.net/projects/nuttx/files/).
This GNU toolchain builds and executes in the Linux or Cygwin environment.
1. You must have already configured Nuttx in <some-dir>/nuttx.
@@ -348,6 +358,39 @@ NuttX buildroot Toolchain
NOTE: This is an OABI toolchain.
+NXFLAT Toolchain
+^^^^^^^^^^^^^^^^
+
+ If you are *not* using the NuttX buildroot toolchain and you want to use
+ the NXFLAT tools, then you will still have to build a portion of the buildroot
+ tools -- just the NXFLAT tools. The buildroot with the NXFLAT tools can
+ be downloaded from the NuttX SourceForge download site
+ (https://sourceforge.net/projects/nuttx/files/).
+
+ This GNU toolchain builds and executes in the Linux or Cygwin environment.
+
+ 1. You must have already configured Nuttx in <some-dir>/nuttx.
+
+ cd tools
+ ./configure.sh lpcxpresso-lpc1768/<sub-dir>
+
+ 2. Download the latest buildroot package into <some-dir>
+
+ 3. unpack the buildroot tarball. The resulting directory may
+ have versioning information on it like buildroot-x.y.z. If so,
+ rename <some-dir>/buildroot-x.y.z to <some-dir>/buildroot.
+
+ 4. cd <some-dir>/buildroot
+
+ 5. cp configs/cortexm3-defconfig-nxflat .config
+
+ 6. make oldconfig
+
+ 7. make
+
+ 8. Edit setenv.h, if necessary, so that the PATH variable includes
+ the path to the newly builtNXFLAT binaries.
+
LEDs
^^^^
@@ -604,6 +647,9 @@ Where <subdir> is one of the following:
This builds the THTTPD web server example using the THTTPD and
the apps/examples/thttpd application.
+ NOTE: You will need to build the NXFLAT toolchain as described
+ above in order to use this example.
+
usbstorage:
This configuration directory exercises the USB mass storage
class driver at apps/examples/usbstorage. See apps/examples/README.txt
diff --git a/nuttx/configs/lpcxpresso-lpc1768/thttpd/Make.defs b/nuttx/configs/lpcxpresso-lpc1768/thttpd/Make.defs
index a1cf32edf..7e3bd6771 100755
--- a/nuttx/configs/lpcxpresso-lpc1768/thttpd/Make.defs
+++ b/nuttx/configs/lpcxpresso-lpc1768/thttpd/Make.defs
@@ -83,12 +83,14 @@ ifeq ($(WINTOOL),y)
ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}"
ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/thttpd/ld.script}"
MAXOPTIMIZATION = -O2
+ NXFLATLDSCRIPT = -T "${shell cygpath -w $(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld}"
else
# Linux/Cygwin-native toolchain
MKDEP = $(TOPDIR)/tools/mkdeps.sh
ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/thttpd/ld.script
+ NXFLATLDSCRIPT = -T"$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld"
endif
CC = $(CROSSDEV)gcc
@@ -127,7 +129,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) $(NXFLATLDSCRIPT) -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o
diff --git a/nuttx/configs/lpcxpresso-lpc1768/thttpd/setenv.sh b/nuttx/configs/lpcxpresso-lpc1768/thttpd/setenv.sh
index 39c4bb55c..932b23065 100755
--- a/nuttx/configs/lpcxpresso-lpc1768/thttpd/setenv.sh
+++ b/nuttx/configs/lpcxpresso-lpc1768/thttpd/setenv.sh
@@ -42,7 +42,9 @@ if [ -z "${PATH_ORIG}" ]; then export PATH_ORIG="${PATH}"; fi
WD=`pwd`
# This is where the buildroot might reside on a Linux or Cygwin system
-# export TOOLCHAIN_BIN="${WD}/../buildroot/build_arm_nofpu/staging_dir/bin"
+# A minimal buildroot version with the NXFLAT tools is always required
+# for this configuration in order to buildthe THTTPD CGI programs
+export BUILDROOT_BIN="${WD}/../buildroot/build_arm_nofpu/staging_dir/bin"
# This is the default install location for Code Red on Linux
export TOOLCHAIN_BIN="/usr/local/LPCXpresso/tools/bin"
@@ -54,6 +56,6 @@ export TOOLCHAIN_BIN="/usr/local/LPCXpresso/tools/bin"
export LPCTOOL_DIR="${WD}/configs/lpcxpresso-lpc1768/tools"
# Add the path to the toolchain to the PATH varialble
-export PATH="${TOOLCHAIN_BIN}:${LPCTOOL_DIR}:/sbin:/usr/sbin:${PATH_ORIG}"
+export PATH="${TOOLCHAIN_BIN}:${LPCTOOL_DIR}:${BUILDROOT_BIN}:/sbin:/usr/sbin:${PATH_ORIG}"
echo "PATH : ${PATH}"
diff --git a/nuttx/configs/lpcxpresso-lpc1768/tools/dfu_util.sh b/nuttx/configs/lpcxpresso-lpc1768/tools/dfu_util.sh
deleted file mode 100755
index 19186c96e..000000000
--- a/nuttx/configs/lpcxpresso-lpc1768/tools/dfu_util.sh
+++ /dev/null
@@ -1,88 +0,0 @@
-#!/bin/bash
-####################################################################################
-# dfu_util.sh
-#
-# Copyright (C) 2011 Gregory Nutt. All rights reserved.
-# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in
-# the documentation and/or other materials provided with the
-# distribution.
-# 3. Neither the name NuttX nor the names of its contributors may be
-# used to endorse or promote products derived from this software
-# without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
-# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
-# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-#
-####################################################################################
-# On Linux, the program dfu_utils is included in the Code Red installation:
-#
-# dfu-util - (C) 2007-2008 by OpenMoko Inc.
-# This program is Free Software and has ABSOLUTELY NO WARRANTY
-#
-# You need to specify one of -D or -U
-# Usage: dfu-util [options] ...
-# -h --help Print this help message
-# -V --version Print the version number
-# -l --list List the currently attached DFU capable USB devices
-# -d --device vendor:product Specify Vendor/Product ID of DFU device
-# -p --path bus-port. ... .port Specify path to DFU device
-# -c --cfg config_nr Specify the Configuration of DFU device
-# -i --intf intf_nr Specify the DFU Interface number
-# -a --alt alt Specify the Altsetting of the DFU Interface
-# by name or by number
-# -t --transfer-size Specify the number of bytes per USB Transfer
-# -U --upload file Read firmware from device into <file>
-# -D --download file Write firmware from <file> into device
-# -R --reset Issue USB Reset signalling once we're finished
-#
-# Example:
-#
-# /usr/local/LPCXpresso/bin/Flash$ dfu-util -l
-# dfu-util - (C) 2007-2008 by OpenMoko Inc.
-# This program is Free Software and has ABSOLUTELY NO WARRANTY
-#
-# Found Runtime: [0x0471:0xdf55] devnum=3, cfg=0, intf=0, alt=0, name="UNDEFINED"
-#
-# dmesg:
-# [ 1.472016] usb 1-3: new high speed USB device using ehci_hcd and address 3
-# [ 1.604784] usb 1-3: configuration #1 chosen from 1 choice
-#
-####################################################################################
-# In the windows installation, a program called DFUAPP.exe is provided.
-#
-# DFUAPP.exe /s gui : Will only the DFU app in GUI mode
-####################################################################################
-
-# This is the default install location for dfu_util on Linux
-DFU_UTIL=/usr/local/LPCXpresso/bin/dfu-util
-
-# This is the default install location for DFUAPP.exe on Windows (note that this
-# path could change with the Code Red version number
-DFUAPP=/cygdrive/c/nxp/lpcxpresso_3.6/bin/DFUAPP.exe
-
-# The binary to download:
-NUTTX=/home/patacongo/projects/nuttx/nuttx/trunk/nuttx/nuttx
-
-#${DFU_UTIL} -d nxp:lpc1768 -p 1-3 -c 0 -i 0 -a 0 -D ${NUTTX} -R
-${DFU_UTIL} -d nxp:lpc1768 -D ${NUTTX} -R
-
-
diff --git a/nuttx/include/sys/syscall.h b/nuttx/include/sys/syscall.h
index 5c1570c53..616c39546 100644
--- a/nuttx/include/sys/syscall.h
+++ b/nuttx/include/sys/syscall.h
@@ -135,17 +135,11 @@
#ifndef CONFIG_DISABLE_CLOCK
# define SYS_clock_systimer (__SYS_clock+0)
-# define SYS_clock_uptime (__SYS_clock+1)
-# define SYS_clock_getres (__SYS_clock+2)
-# define SYS_clock_gettime (__SYS_clock+3)
-# define SYS_clock_settime (__SYS_clock+4)
-# define SYS_gettimeofday (__SYS_clock+5)
-# ifdef CONFIG_UPTIME
-# define SYS_clock_uptime (__SYS_clock+6)
-# define __SYS_timers (__SYS_clock+7)
-# else
-# define __SYS_timers (__SYS_clock+6)
-#endif
+# define SYS_clock_getres (__SYS_clock+1)
+# define SYS_clock_gettime (__SYS_clock+2)
+# define SYS_clock_settime (__SYS_clock+3)
+# define SYS_gettimeofday (__SYS_clock+4)
+# define __SYS_timers (__SYS_clock+5)
#else
# define __SYS_timers __SYS_clock
#endif
diff --git a/nuttx/lib/time/lib_time.c b/nuttx/lib/time/lib_time.c
index 95352f133..6900791a7 100644
--- a/nuttx/lib/time/lib_time.c
+++ b/nuttx/lib/time/lib_time.c
@@ -39,11 +39,10 @@
#include <nuttx/config.h>
+#include <sys/time.h>
#include <time.h>
-#include <nuttx/clock.h>
-
-#if !defined(CONFIG_DISABLE_CLOCK) && defined(CONFIG_UPTIME)
+#ifndef CONFIG_DISABLE_CLOCK
/****************************************************************************
* Pre-processor Definitions
@@ -61,30 +60,50 @@
* Function: time
*
* Description:
- * Return the current system up-time.
+ * Get the current calendar time as a time_t object. The function returns
+ * this value, and if the argument is not a null pointer, the value is also
+ * set to the object pointed by tloc.
+ *
+ * Note that this function is just a thin wrapper around gettimeofday()
+ * and is provided for compatibility. gettimeofday() is the preffered way
+ * to obtain system time.
*
* Parameters:
- * The tloc argument points to an area where the return value is
- * also stored. If tloc is a null pointer, no value is stored.
+ * Pointer to an object of type time_t, where the time value is stored.
+ * Alternativelly, this parameter can be a null pointer, in which case the
+ * parameter is not used, but a time_t object is still returned by the
+ * function.
*
* Return Value:
- * The current system up time
+ * The current calendar time as a time_t object. If the argument is not
+ * a null pointer, the return value is the same as the one stored in the
+ * location pointed by the argument.
+ *
+ * If the function could not retrieve the calendar time, it returns a -1
+ * value.
*
****************************************************************************/
time_t time(time_t *tloc)
{
- /* Get the current uptime from the system */
+ struct timeval tp;
+ int ret;
- time_t uptime = clock_uptime();
-
- /* Return the uptime */
+ /* Get the current uptime from the system */
- if (tloc)
+ ret = gettimeofday(&tp, NULL);
+ if (ret == OK)
{
- *tloc = uptime;
+ /* Return the seconds since the epoch */
+
+ if (tloc)
+ {
+ *tloc = tp.tv_sec;
+ }
+ return tp.tv_sec;
}
- return uptime;
+
+ return (time_t)ERROR;
}
-#endif /* !CONFIG_DISABLE_CLOCK && CONFIG_UPTIME */
+#endif /* !CONFIG_DISABLE_CLOCK */
diff --git a/nuttx/syscall/stub_lookup.c b/nuttx/syscall/stub_lookup.c
index d56364bfe..0c4f4451c 100644
--- a/nuttx/syscall/stub_lookup.c
+++ b/nuttx/syscall/stub_lookup.c
@@ -112,7 +112,6 @@ extern uintptr_t STUB_clock_getres(uintptr_t parm1, uintptr_t parm2);
extern uintptr_t STUB_clock_gettime(uintptr_t parm1, uintptr_t parm2);
extern uintptr_t STUB_clock_settime(uintptr_t parm1, uintptr_t parm2);
extern uintptr_t STUB_gettimeofday(uintptr_t parm1, uintptr_t parm2);
-extern uintptr_t STUB_clock_uptime(void);
/* The following are defined only if POSIX timers are supported */
diff --git a/nuttx/syscall/stub_lookup.h b/nuttx/syscall/stub_lookup.h
index 16792aefc..f9b33938b 100644
--- a/nuttx/syscall/stub_lookup.h
+++ b/nuttx/syscall/stub_lookup.h
@@ -107,9 +107,6 @@ STUB_LOOKUP(3, STUB_up_assert_code) /* SYS_up_assert_code */
STUB_LOOKUP(2, STUB_clock_gettime) /* SYS_clock_gettime */
STUB_LOOKUP(2, STUB_clock_settime) /* SYS_clock_settime */
STUB_LOOKUP(2, STUB_gettimeofday) /* SYS_gettimeofday */
-# ifdef CONFIG_UPTIME
- STUB_LOOKUP(0, STUB_clock_uptime) /* SYS_clock_uptime */
-# endif
#endif
/* The following are defined only if POSIX timers are supported */
diff --git a/nuttx/syscall/syscall.csv b/nuttx/syscall/syscall.csv
index 6998e89b0..2499cd4ab 100644
--- a/nuttx/syscall/syscall.csv
+++ b/nuttx/syscall/syscall.csv
@@ -6,7 +6,6 @@
"clock_getres","time.h","!defined(CONFIG_DISABLE_CLOCK)","int","clockid_t","struct timespec*"
"clock_gettime","time.h","!defined(CONFIG_DISABLE_CLOCK)","int","clockid_t","struct timespec*"
"clock_settime","time.h","!defined(CONFIG_DISABLE_CLOCK)","int","clockid_t","const struct timespec*"
-"clock_uptime","nuttx/clock.h","!defined(CONFIG_DISABLE_CLOCK) && defined(CONFIG_UPTIME)","time_t"
"close","unistd.h","CONFIG_NSOCKET_DESCRIPTORS > 0 || CONFIG_NFILE_DESCRIPTORS > 0","int","int"
"closedir","dirent.h","CONFIG_NFILE_DESCRIPTORS > 0","int","FAR DIR*"
"connect","sys/socket.h","CONFIG_NSOCKET_DESCRIPTORS > 0 && defined(CONFIG_NET)","int","int","FAR const struct sockaddr*","socklen_t"
diff --git a/nuttx/tools/incdir.sh b/nuttx/tools/incdir.sh
index 32f383324..76f767e83 100755
--- a/nuttx/tools/incdir.sh
+++ b/nuttx/tools/incdir.sh
@@ -36,7 +36,7 @@
progname=$0
wintool=n
-usage="USAGE: $progname [-w] [-d] [-l] [-h] <compiler-path> <dir1> [<dir2> [<dir3> ...]]"
+usage="USAGE: $progname [-w] [-d] [-h] <compiler-path> <dir1> [<dir2> [<dir3> ...]]"
advice="Try '$progname -h' for more information"
while [ ! -z "$1" ]; do
@@ -193,17 +193,15 @@ for dir in $dirlist; do
# Treat the first directory differently
if [ -z "$response" ]; then
- response=-I$path
+ response=-I\"$path\"
else
- response=$response" -I$path"
+ response=$response" -I\"$path\""
fi
fi
done
if [ "X$fmt" = "Xuserinc" ]; then
response=$response"'"
-else
- response=\"$response\"
fi
echo $response