From 869c3fa50b71594fb504470131191e306711f839 Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 24 Dec 2012 17:49:58 +0000 Subject: [PATCH] Fixes for l3s, USB composite, nfsmount, apps context build problems git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5458 42af7a65-404d-4744-a932-0658087f49c3 --- configs/ekk-lm3s9b96/nsh/setenv.sh | 12 ++++++++---- configs/ekk-lm3s9b96/ostest/setenv.sh | 12 ++++++++---- configs/lm3s8962-ek/nsh/appconfig | 2 +- configs/lm3s8962-ek/nsh/setenv.sh | 26 +++++++++++++++++++++----- configs/lm3s8962-ek/nx/setenv.sh | 26 +++++++++++++++++++++----- configs/lm3s8962-ek/ostest/setenv.sh | 26 +++++++++++++++++++++----- configs/stm3210e-eval/RIDE/defconfig | 2 +- drivers/usbdev/composite.c | 4 ++-- include/nuttx/clock.h | 2 +- sched/sig_timedwait.c | 5 +++-- 10 files changed, 87 insertions(+), 30 deletions(-) diff --git a/configs/ekk-lm3s9b96/nsh/setenv.sh b/configs/ekk-lm3s9b96/nsh/setenv.sh index 6e591e0dd7..bba7595de3 100755 --- a/configs/ekk-lm3s9b96/nsh/setenv.sh +++ b/configs/ekk-lm3s9b96/nsh/setenv.sh @@ -48,12 +48,16 @@ if [ -z "${PATH_ORIG}" ]; then export PATH_ORIG="${PATH}" fi -# TOOLCHAIN_BIN must be defined to the full path to the location where you -# have installed the toolchain of your choice. Modify the following: +# This is the Cygwin path to the location where I installed the CodeSourcery +# toolchain under windows. You will also have to edit this if you install +# the CodeSourcery toolchain in any other location +# export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery G++ Lite/bin" +# This is the Cygwin path to the location where I build the buildroot +# toolchain. export TOOLCHAIN_BIN="${WD}/../misc/buildroot/build_arm_nofpu/staging_dir/bin" -# Andd add the toolchain path to the PATH variable - +# Add the path to the toolchain to the PATH varialble export PATH="${TOOLCHAIN_BIN}:/sbin:/usr/sbin:${PATH_ORIG}" + echo "PATH : ${PATH}" diff --git a/configs/ekk-lm3s9b96/ostest/setenv.sh b/configs/ekk-lm3s9b96/ostest/setenv.sh index d98c6cc40c..60dfa3c71d 100755 --- a/configs/ekk-lm3s9b96/ostest/setenv.sh +++ b/configs/ekk-lm3s9b96/ostest/setenv.sh @@ -48,12 +48,16 @@ if [ -z "${PATH_ORIG}" ]; then export PATH_ORIG="${PATH}" fi -# TOOLCHAIN_BIN must be defined to the full path to the location where you -# have installed the toolchain of your choice. Modify the following: +# This is the Cygwin path to the location where I installed the CodeSourcery +# toolchain under windows. You will also have to edit this if you install +# the CodeSourcery toolchain in any other location +# export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery G++ Lite/bin" +# This is the Cygwin path to the location where I build the buildroot +# toolchain. export TOOLCHAIN_BIN="${WD}/../misc/buildroot/build_arm_nofpu/staging_dir/bin" -# Andd add the toolchain path to the PATH variable - +# Add the path to the toolchain to the PATH varialble export PATH="${TOOLCHAIN_BIN}:/sbin:/usr/sbin:${PATH_ORIG}" + echo "PATH : ${PATH}" diff --git a/configs/lm3s8962-ek/nsh/appconfig b/configs/lm3s8962-ek/nsh/appconfig index 5eeb566076..2e2421b675 100644 --- a/configs/lm3s8962-ek/nsh/appconfig +++ b/configs/lm3s8962-ek/nsh/appconfig @@ -40,7 +40,7 @@ CONFIGURED_APPS += examples/nsh # NSH library CONFIGURED_APPS += system/readline -CONFIGURED_APPS += nshlibO +CONFIGURED_APPS += nshlib # Networking support diff --git a/configs/lm3s8962-ek/nsh/setenv.sh b/configs/lm3s8962-ek/nsh/setenv.sh index 511552d94b..1db7f8ee26 100755 --- a/configs/lm3s8962-ek/nsh/setenv.sh +++ b/configs/lm3s8962-ek/nsh/setenv.sh @@ -32,15 +32,31 @@ # POSSIBILITY OF SUCH DAMAGE. # -if [ "$(basename $0)" = "setenv.sh" ] ; then +if [ "$_" = "$0" ] ; then echo "You must source this script, not run it!" 1>&2 exit 1 fi -if [ -z "${PATH_ORIG}" ]; then export PATH_ORIG="${PATH}"; fi - WD=`pwd` -export BUILDROOT_BIN="${WD}/../misc/buildroot/build_arm_nofpu/staging_dir/bin" -export PATH="${BUILDROOT_BIN}:/sbin:/usr/sbin:${PATH_ORIG}" +if [ ! -x "setenv.sh" ]; then + echo "This script must be executed from the top-level NuttX build directory" + exit 1 +fi + +if [ -z "${PATH_ORIG}" ]; then + export PATH_ORIG="${PATH}" +fi + +# This is the Cygwin path to the location where I installed the CodeSourcery +# toolchain under windows. You will also have to edit this if you install +# the CodeSourcery toolchain in any other location +# export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery G++ Lite/bin" + +# This is the Cygwin path to the location where I build the buildroot +# toolchain. +export TOOLCHAIN_BIN="${WD}/../misc/buildroot/build_arm_nofpu/staging_dir/bin" + +# Add the path to the toolchain to the PATH varialble +export PATH="${TOOLCHAIN_BIN}:/sbin:/usr/sbin:${PATH_ORIG}" echo "PATH : ${PATH}" diff --git a/configs/lm3s8962-ek/nx/setenv.sh b/configs/lm3s8962-ek/nx/setenv.sh index a367250836..c716ddf5ef 100755 --- a/configs/lm3s8962-ek/nx/setenv.sh +++ b/configs/lm3s8962-ek/nx/setenv.sh @@ -32,15 +32,31 @@ # POSSIBILITY OF SUCH DAMAGE. # -if [ "$(basename $0)" = "setenv.sh" ] ; then +if [ "$_" = "$0" ] ; then echo "You must source this script, not run it!" 1>&2 exit 1 fi -if [ -z "${PATH_ORIG}" ]; then export PATH_ORIG="${PATH}"; fi - WD=`pwd` -export BUILDROOT_BIN="${WD}/../misc/buildroot/build_arm_nofpu/staging_dir/bin" -export PATH="${BUILDROOT_BIN}:/sbin:/usr/sbin:${PATH_ORIG}" +if [ ! -x "setenv.sh" ]; then + echo "This script must be executed from the top-level NuttX build directory" + exit 1 +fi + +if [ -z "${PATH_ORIG}" ]; then + export PATH_ORIG="${PATH}" +fi + +# This is the Cygwin path to the location where I installed the CodeSourcery +# toolchain under windows. You will also have to edit this if you install +# the CodeSourcery toolchain in any other location +# export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery G++ Lite/bin" + +# This is the Cygwin path to the location where I build the buildroot +# toolchain. +export TOOLCHAIN_BIN="${WD}/../misc/buildroot/build_arm_nofpu/staging_dir/bin" + +# Add the path to the toolchain to the PATH varialble +export PATH="${TOOLCHAIN_BIN}:/sbin:/usr/sbin:${PATH_ORIG}" echo "PATH : ${PATH}" diff --git a/configs/lm3s8962-ek/ostest/setenv.sh b/configs/lm3s8962-ek/ostest/setenv.sh index 6bd49b6fa0..91bf1095b9 100755 --- a/configs/lm3s8962-ek/ostest/setenv.sh +++ b/configs/lm3s8962-ek/ostest/setenv.sh @@ -32,15 +32,31 @@ # POSSIBILITY OF SUCH DAMAGE. # -if [ "$(basename $0)" = "setenv.sh" ] ; then +if [ "$_" = "$0" ] ; then echo "You must source this script, not run it!" 1>&2 exit 1 fi -if [ -z "${PATH_ORIG}" ]; then export PATH_ORIG="${PATH}"; fi - WD=`pwd` -export BUILDROOT_BIN="${WD}/../misc/buildroot/build_arm_nofpu/staging_dir/bin" -export PATH="${BUILDROOT_BIN}:/sbin:/usr/sbin:${PATH_ORIG}" +if [ ! -x "setenv.sh" ]; then + echo "This script must be executed from the top-level NuttX build directory" + exit 1 +fi + +if [ -z "${PATH_ORIG}" ]; then + export PATH_ORIG="${PATH}" +fi + +# This is the Cygwin path to the location where I installed the CodeSourcery +# toolchain under windows. You will also have to edit this if you install +# the CodeSourcery toolchain in any other location +# export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery G++ Lite/bin" + +# This is the Cygwin path to the location where I build the buildroot +# toolchain. +export TOOLCHAIN_BIN="${WD}/../misc/buildroot/build_arm_nofpu/staging_dir/bin" + +# Add the path to the toolchain to the PATH varialble +export PATH="${TOOLCHAIN_BIN}:/sbin:/usr/sbin:${PATH_ORIG}" echo "PATH : ${PATH}" diff --git a/configs/stm3210e-eval/RIDE/defconfig b/configs/stm3210e-eval/RIDE/defconfig index 64665f47e7..e71540c24c 100755 --- a/configs/stm3210e-eval/RIDE/defconfig +++ b/configs/stm3210e-eval/RIDE/defconfig @@ -169,7 +169,7 @@ CONFIG_RAW_BINARY=n # # General OS setup # -#CONFIG_USER_ENTRYPOINT= +CONFIG_USER_ENTRYPOINT="null_main" CONFIG_DEBUG=n CONFIG_DEBUG_VERBOSE=n CONFIG_DEBUG_SYMBOLS=n diff --git a/drivers/usbdev/composite.c b/drivers/usbdev/composite.c index 4cad8af864..530d644169 100644 --- a/drivers/usbdev/composite.c +++ b/drivers/usbdev/composite.c @@ -523,12 +523,12 @@ static int composite_setup(FAR struct usbdevclass_driver_s *driver, { /* Save the configuration and inform the constituent classes */ - ret = CLASS_SETUP(priv->dev1, dev, ctrl); + ret = CLASS_SETUP(priv->dev1, dev, ctrl, dataout, outlen); dispatched = true; if (ret >= 0) { - ret = CLASS_SETUP(priv->dev2, dev, ctrl); + ret = CLASS_SETUP(priv->dev2, dev, ctrl, dataout, outlen); if (ret >= 0) { priv->config = value; diff --git a/include/nuttx/clock.h b/include/nuttx/clock.h index 952e0e5efc..e640ecd2e5 100644 --- a/include/nuttx/clock.h +++ b/include/nuttx/clock.h @@ -113,7 +113,7 @@ #define USEC2TICK(usec) (((usec)+(USEC_PER_TICK/2))/USEC_PER_TICK) /* Rounds */ #define MSEC2TICK(msec) (((msec)+(MSEC_PER_TICK/2))/MSEC_PER_TICK) /* Rounds */ #define DSEC2TICK(dsec) MSEC2TICK((dsec)*MSEC_PER_DSEC) -#define SEC2TICK(sec) MSEC2TICK((sec)*MSEC_PER_SEC) +#define SEC2TICK(sec) MSEC2TICK((sec)*MSEC_PER_SEC) /* Exact */ #define TICK2NSEC(tick) ((tick)*NSEC_PER_TICK) /* Exact */ #define TICK2USEC(tick) ((tick)*USEC_PER_TICK) /* Exact */ diff --git a/sched/sig_timedwait.c b/sched/sig_timedwait.c index d03611610d..d7610cd491 100644 --- a/sched/sig_timedwait.c +++ b/sched/sig_timedwait.c @@ -38,6 +38,7 @@ ****************************************************************************/ #include +#include #include #include @@ -244,8 +245,8 @@ int sigtimedwait(FAR const sigset_t *set, FAR struct siginfo *info, */ #ifdef CONFIG_HAVE_LONG_LONG - uint64_t waitticks64 = (timeout->tv_sec * NSEC_PER_SEC + - timeout->tv_nsec + NSEC_PER_TICK - 1) / + uint64_t waitticks64 = ((uint64_t)timeout->tv_sec * NSEC_PER_SEC + + (uint64_t)timeout->tv_nsec + NSEC_PER_TICK - 1) / NSEC_PER_TICK; DEBUGASSERT(waitticks64 <= UINT32_MAX); waitticks = (uint32_t)waitticks64;