From 671044fd302045c5aa27eaf7c814f484f1f9603b Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 24 Dec 2012 20:22:14 +0000 Subject: [PATCH] Fix several build issues noted by Mike Smith git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5459 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog | 3 ++ arch/arm/src/arm/up_head.S | 51 +++++++++++++++++++-------- configs/ntosd-dm320/nettest/setenv.sh | 26 +++++++++++--- configs/ntosd-dm320/nsh/setenv.sh | 26 +++++++++++--- configs/ntosd-dm320/ostest/setenv.sh | 26 +++++++++++--- configs/ntosd-dm320/poll/setenv.sh | 26 +++++++++++--- configs/ntosd-dm320/thttpd/setenv.sh | 26 +++++++++++--- configs/ntosd-dm320/udp/setenv.sh | 26 +++++++++++--- configs/ntosd-dm320/uip/setenv.sh | 26 +++++++++++--- 9 files changed, 187 insertions(+), 49 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6c6fd7843c..c5cc9b54a8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3815,4 +3815,7 @@ * sched/sig_timedwait.c: Should always move the time up to the next largest number of system ticks. The logic was rounding. Noted by Petteri Aimonen. + * arch/arm/src/up_head.S: Fix backward conditional compilation. NOTE + there is a issue of ARM9 systems with low vectors and large memories + that will have to be addressed in the future. diff --git a/arch/arm/src/arm/up_head.S b/arch/arm/src/arm/up_head.S index 91d67fd15b..46efd87725 100644 --- a/arch/arm/src/arm/up_head.S +++ b/arch/arm/src/arm/up_head.S @@ -1,5 +1,5 @@ /**************************************************************************** - * arch/arm/src/arm/up_head.S + * arch/arm/src/arm/up_pghead.S * * Copyright (C) 2007, 2009-2010 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -78,6 +78,10 @@ * beginning of FLASH. */ +# if !defined(CONFIG_FLASH_START) || !defined(CONFIG_FLASH_VSTART) +# error "CONFIG_FLASH_START or CONFIG_FLASH_VSTART is not defined" +# endif + # if CONFIG_FLASH_START == CONFIG_FLASH_VSTART # define CONFIG_IDENTITY_TEXTMAP 1 # endif @@ -102,6 +106,10 @@ * beginning of FLASH. */ +# if !defined(CONFIG_FLASH_START) || !defined(CONFIG_FLASH_VSTART) +# error "CONFIG_FLASH_START or CONFIG_FLASH_VSTART is not defined" +# endif + # if CONFIG_FLASH_START == CONFIG_FLASH_VSTART # define CONFIG_IDENTITY_TEXTMAP 1 # endif @@ -120,6 +128,10 @@ * beginning of RAM. */ +# if !defined(CONFIG_DRAM_START) || !defined(CONFIG_DRAM_VSTART) +# error "CONFIG_DRAM_START or CONFIG_DRAM_VSTART is not defined" +# endif + # if CONFIG_DRAM_START == CONFIG_DRAM_VSTART # define CONFIG_IDENTITY_TEXTMAP 1 # endif @@ -162,26 +174,37 @@ * Assembly Macros ****************************************************************************/ -/* The ARM9 L1 page table can be placed at the beginning or at the end of the - * RAM space. This decision is based on the placement of the vector area: - * If the vectors are place in low memory at address 0x0000 0000, then the - * page table is placed in high memory; if the vectors are placed in high - * memory at address 0xfff0 0000, then the page table is locating at the - * beginning of RAM. +/* The ARM9 L1 page table can be placed at the beginning or at the end of + * the RAM space. This decision is based on the placement of the vector + * area: If the vectors are place in low memory at address 0x0000 0000, then + * the page table is placed in high memory; if the vectors are placed in + * high memory at address 0xfff0 0000, then the page table is locating at + * the beginning of RAM. * - * For the special case where (1) the program executes out of RAM, and (2) the - * page is located at the beginning of RAM, then the following macro can - * easily find the physical address of the section that includes the first - * part of the text region: Since the page table is closely related to the - * NuttX base address in this case, we can convert the page table base address - * to the base address of the section containing both. + * For the special case where (1) the program executes out of RAM, and (2) + * the page is located at the beginning of RAM (i.e., the high vector case), + * then the following macro can easily find the physical address of the + * section that includes the first part of the text region: Since the page + * table is closely related to the NuttX base address in this case, we can + * convert the page table base address to the base address of the section + * containing both. + */ + +/* REVISIT: This works now of the low vector case only because the RAM + * sizes that we have been dealing with are less then 1MB so that both the + * page table and the vector table are in the same 1MB RAM block. But + * this will certainly break later. Hence, the annoying warning. */ #ifdef CONFIG_ARCH_LOWVECTORS +# warning "REVISIT" +#endif + +//#ifndef CONFIG_ARCH_LOWVECTORS .macro mksection, section, pgtable bic \section, \pgtable, #0x000ff000 .endm -#endif +//#endif /* This macro will modify r0, r1, r2 and r14 */ diff --git a/configs/ntosd-dm320/nettest/setenv.sh b/configs/ntosd-dm320/nettest/setenv.sh index 6090d4cea3..cfb438ce72 100755 --- a/configs/ntosd-dm320/nettest/setenv.sh +++ b/configs/ntosd-dm320/nettest/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/ntosd-dm320/nsh/setenv.sh b/configs/ntosd-dm320/nsh/setenv.sh index a84e68884b..005aa81530 100755 --- a/configs/ntosd-dm320/nsh/setenv.sh +++ b/configs/ntosd-dm320/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/ntosd-dm320/ostest/setenv.sh b/configs/ntosd-dm320/ostest/setenv.sh index a65be2677d..75d6f0cd0d 100755 --- a/configs/ntosd-dm320/ostest/setenv.sh +++ b/configs/ntosd-dm320/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/ntosd-dm320/poll/setenv.sh b/configs/ntosd-dm320/poll/setenv.sh index de3b64ea90..427ffe26ab 100755 --- a/configs/ntosd-dm320/poll/setenv.sh +++ b/configs/ntosd-dm320/poll/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/ntosd-dm320/thttpd/setenv.sh b/configs/ntosd-dm320/thttpd/setenv.sh index 92ff91700e..ea38c09a51 100755 --- a/configs/ntosd-dm320/thttpd/setenv.sh +++ b/configs/ntosd-dm320/thttpd/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/ntosd-dm320/udp/setenv.sh b/configs/ntosd-dm320/udp/setenv.sh index 052413b089..92995bee56 100755 --- a/configs/ntosd-dm320/udp/setenv.sh +++ b/configs/ntosd-dm320/udp/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/ntosd-dm320/uip/setenv.sh b/configs/ntosd-dm320/uip/setenv.sh index 988e0a1269..33c252e1ec 100755 --- a/configs/ntosd-dm320/uip/setenv.sh +++ b/configs/ntosd-dm320/uip/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}"