diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2010-08-29 14:27:58 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2010-08-29 14:27:58 +0000 |
commit | 3701c8c5e72d862fcec6c3ee4419215622418237 (patch) | |
tree | 57283df037129ab49ab6c4155ae6d6383ec2fccb /nuttx/configs/ea3131 | |
parent | b31aeb387646c04061abf1e0544d39c92744f1f1 (diff) | |
download | px4-nuttx-3701c8c5e72d862fcec6c3ee4419215622418237.tar.gz px4-nuttx-3701c8c5e72d862fcec6c3ee4419215622418237.tar.bz2 px4-nuttx-3701c8c5e72d862fcec6c3ee4419215622418237.zip |
Two pass build for on-demand paging now works
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2896 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/configs/ea3131')
-rwxr-xr-x | nuttx/configs/ea3131/locked/Makefile | 28 | ||||
-rw-r--r-- | nuttx/configs/ea3131/locked/ld-locked.script | 7 | ||||
-rwxr-xr-x | nuttx/configs/ea3131/pgnsh/defconfig | 4 | ||||
-rwxr-xr-x | nuttx/configs/ea3131/pgnsh/ld.script | 10 |
4 files changed, 36 insertions, 13 deletions
diff --git a/nuttx/configs/ea3131/locked/Makefile b/nuttx/configs/ea3131/locked/Makefile index b4566ae40..26a62a683 100755 --- a/nuttx/configs/ea3131/locked/Makefile +++ b/nuttx/configs/ea3131/locked/Makefile @@ -36,10 +36,18 @@ -include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -# Remove the application library (libapp) from the list of libraries. +# Board-specific directory, board library, and application library +PASS1_SRCDIR = arch/$(CONFIG_ARCH)/src +PASS1_BOARDDIR = $(PASS1_SRCDIR)/board +PASS1_LIBBOARD = $(PASS1_BOARDDIR)/libboard$(LIBEXT) PASS1_LIBAPP = $(CONFIG_APP_DIR)/libapp$(LIBEXT) + +# Remove the application library (libapp) from the list of libraries. Add +# the boad library (liboard) + PASS1_LINKLIBS = $(filter-out $(PASS1_LIBAPP),$(LINKLIBS)) +PASS1_LINKLIBS += $(PASS1_LIBBOARD) # Get the paths to the libraries and the links script path in format that # is appropriate for the host OS @@ -58,8 +66,12 @@ PASS1_LDFLAGS = -r $(PASS1_LDSCRIPT) PASS1_LDLIBS = $(patsubst lib%,-l%,$(basename $(notdir $(PASS1_LINKLIBS)))) PASS1_LIBGCC = "${shell $(CC) -print-libgcc-file-name}" +# Targets: + all: locked.r +.PHONY: depend clean distclean + # Create include-able linker script that specifies all of the symbols to be # resolved in the locked.r file. @@ -67,18 +79,26 @@ ld-locked.inc: mklocked.sh $(TOPDIR)/.config @echo "MK: ld-locked.inc" @./mklocked.sh "$(TOPDIR)" +# Make the board library. This is normally done in arch/arm/src/Makefile. +# However, we need it earlier here when doing a two-pass build so that libboard.a +# is available to link against. + +$(PASS1_LIBBOARD): + @$(MAKE) -C $(TOPDIR)/configs/ea3131/src TOPDIR="$(TOPDIR)" libboard$(LIBEXT) + # Create the locked.r file containing all of the code (except the start-up code) # that needs to lie in the locked text region. -locked.r: ld-locked.inc +locked.r: ld-locked.inc $(PASS1_LIBBOARD) @echo "LD: locked.r" @$(LD) -o $@ $(PASS1_LDFLAGS) $(PASS1_LIBPATHS) --start-group $(PASS1_LDLIBS) --end-group $(PASS1_LIBGCC) - @echo "NM: locked.map" @$(NM) $@ > locked.map @fgrep " U " locked.map | grep -v os_start - @echo "SZ:" @$(CROSSDEV)size $@ +$(PASS1_SRCDIR)/locked.r: locked.r + @cp -a locked.r $(TOPDIR)/$(PASS1_SRCDIR)/locked.r + .depend: depend: .depend diff --git a/nuttx/configs/ea3131/locked/ld-locked.script b/nuttx/configs/ea3131/locked/ld-locked.script index f89d8549f..5b5feeb1a 100644 --- a/nuttx/configs/ea3131/locked/ld-locked.script +++ b/nuttx/configs/ea3131/locked/ld-locked.script @@ -37,8 +37,7 @@ INCLUDE ld-locked.inc OUTPUT_ARCH(arm) SECTIONS { - .locked : { - *(.vectors) - *(.text .text.*) - } + .text.locked : { *(.text .text.*) } + .data : { *(.data) } + .bss : { *(.bss) *(COMMON) } }
\ No newline at end of file diff --git a/nuttx/configs/ea3131/pgnsh/defconfig b/nuttx/configs/ea3131/pgnsh/defconfig index db542a647..58480f875 100755 --- a/nuttx/configs/ea3131/pgnsh/defconfig +++ b/nuttx/configs/ea3131/pgnsh/defconfig @@ -202,8 +202,8 @@ CONFIG_HAVE_LIBM=n # Setup for a two-pass build # CONFIG_BUILD_2PASS=y -CONFIG_PASS1_DIR=configs/ea3131/locked -CONFIG_PASS1_LIB=locked.r +CONFIG_PASS1_BUILDIR=configs/ea3131/locked +CONFIG_PASS1_OBJECT=locked.r # # General OS setup diff --git a/nuttx/configs/ea3131/pgnsh/ld.script b/nuttx/configs/ea3131/pgnsh/ld.script index 0dc768257..131ee62f9 100755 --- a/nuttx/configs/ea3131/pgnsh/ld.script +++ b/nuttx/configs/ea3131/pgnsh/ld.script @@ -32,7 +32,7 @@ * POSSIBILITY OF SUCH DAMAGE. * ****************************************************************************/ - + /* The LPC3131 has 192Kb of ISRAM beginning at virtual address 0x1102:8000. * LPC313x boot ROM expects the boot image be compiled with entry point at * 0x1102:9000. A 128b header will appear at this address (applied by @@ -45,6 +45,10 @@ * locked - Pages locked in memory. Start: 0x1102 8000 Size: 36Kb * paged - Pages in nonvolatile store. Start: 0x1103 1000 Size: 384Kb * data - .data/.bss/heap. Start: 0x1109 1000 Size: 44Kb + * + * These region sizes must match the size in pages specified for each region + * in the NuttX configuration file: CONFIG_PAGING_NLOCKED, CONFIG_PAGING_NVPAGED, + * and CONFIG_PAGING_NDATA. */ MEMORY @@ -61,10 +65,10 @@ SECTIONS .locked : { _slocked = ABSOLUTE(.); *(.vectors) - *(.locked) + locked.r (.text) _elocked = ABSOLUTE(.); } >locked - _eronly = ABSOLUTE(.); /* See below */ + _eronly = ABSOLUTE(.); .paged : { _spaged = ABSOLUTE(.); |