diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2013-03-07 01:52:30 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2013-03-07 01:52:30 +0000 |
commit | ce376ed9e145fe7b9c0215e93bfebf0893ecf7b3 (patch) | |
tree | 425cec7640f89663994f2a3646ca35e54db91df6 /nuttx/configs/sam3u-ek | |
parent | 5332fb0e659549272ed5527c26964b22d31da3bc (diff) | |
download | px4-nuttx-ce376ed9e145fe7b9c0215e93bfebf0893ecf7b3.tar.gz px4-nuttx-ce376ed9e145fe7b9c0215e93bfebf0893ecf7b3.tar.bz2 px4-nuttx-ce376ed9e145fe7b9c0215e93bfebf0893ecf7b3.zip |
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
Diffstat (limited to 'nuttx/configs/sam3u-ek')
-rw-r--r-- | nuttx/configs/sam3u-ek/kernel/Makefile | 85 | ||||
-rw-r--r-- | nuttx/configs/sam3u-ek/kernel/kernel.ld | 7 |
2 files changed, 46 insertions, 46 deletions
diff --git a/nuttx/configs/sam3u-ek/kernel/Makefile b/nuttx/configs/sam3u-ek/kernel/Makefile index e9a7ef7ff..8a2646094 100644 --- a/nuttx/configs/sam3u-ek/kernel/Makefile +++ b/nuttx/configs/sam3u-ek/kernel/Makefile @@ -39,28 +39,33 @@ BOARD_INCLUDE = $(TOPDIR)$(DELIM)configs$(DELIM)$(CONFIG_ARCH_BOARD)$(DELIM)include +# The entry point name (if none is provided in the .config file) + +CONFIG_USER_ENTRYPOINT ?= user_start +ENTRYPT = $(patsubst "%",%,$(CONFIG_USER_ENTRYPOINT)) + # Get the paths to the libraries and the links script path in format that # is appropriate for the host OS ifeq ($(WINTOOL),y) # Windows-native toolchains - USER_LIBPATHS = ${shell for path in $(USERLIBS); do dir=`dirname $(TOPDIR)$(DELIM)$$path`;echo "-L\"`cygpath -w $$dir`\"";done} - USER_LDSCRIPT = -T "${shell cygpath -w $(TOPDIR)$(DELIM)configs$(DELIM)$(CONFIG_ARCH_BOARD)$(DELIM)kernel$(DELIM)kernel.ld}" + USER_LIBPATHS = ${shell for path in $(USERLIBS); do dir=`dirname $(TOPDIR)$(DELIM)$$path`;echo "-L\"`cygpath -w $$dir`\"";done} + USER_LDSCRIPT = -T "${shell cygpath -w $(TOPDIR)$(DELIM)configs$(DELIM)$(CONFIG_ARCH_BOARD)$(DELIM)kernel$(DELIM)kernel.ld}" else # Linux/Cygwin-native toolchain - USER_LIBPATHS = $(addprefix -L$(TOPDIR)$(DELIM),$(dir $(USERLIBS))) - USER_LDSCRIPT = -T$(TOPDIR)$(DELIM)configs$(DELIM)$(CONFIG_ARCH_BOARD)$(DELIM)kernel$(DELIM)kernel.ld + USER_LIBPATHS = $(addprefix -L$(TOPDIR)$(DELIM),$(dir $(USERLIBS))) + USER_LDSCRIPT = -T$(TOPDIR)$(DELIM)configs$(DELIM)$(CONFIG_ARCH_BOARD)$(DELIM)kernel$(DELIM)kernel.ld endif -USER_LDFLAGS = $(USER_LDSCRIPT) -USER_LDLIBS = $(patsubst lib%,-l%,$(basename $(notdir $(USERLIBS)))) -USER_LIBGCC = "${shell $(CC) -print-libgcc-file-name}" +USER_LDFLAGS = --undefined=$(ENTRYPT) --entry=$(ENTRYPT) $(USER_LDSCRIPT) +USER_LDLIBS = $(patsubst lib%,-l%,$(basename $(notdir $(USERLIBS)))) +USER_LIBGCC = "${shell $(CC) -print-libgcc-file-name}" # Targets: all: $(TOPDIR)$(DELIM)nuttx_user.elf $(TOPDIR)$(DELIM)User.map $(BOARD_INCLUDE)$(DELIM)user_map.h -.PHONY: depend clean distclean +.PHONY: depend clean distclean # Create the nuttx_user.elf file containing all of the user-mode code @@ -90,38 +95,38 @@ $(TOPDIR)$(DELIM)User.map: nuttx_user.elf $(BOARD_INCLUDE)$(DELIM)user_map.h: $(TOPDIR)$(DELIM)User.map @echo "MK: user_map.h" - @echo "/* configs$(DELIM)$(CONFIG_ARCH_BOARD)$(DELIM)include$(DELIM)user_map.h" > $(BOARD_INCLUDE)$(DELIM)user_map.h - @echo " *" >> $(BOARD_INCLUDE)$(DELIM)user_map.h - @echo " * This is an auto-generated file.. Do not edit this file!" >> $(BOARD_INCLUDE)$(DELIM)user_map.h - @echo " */" >> $(BOARD_INCLUDE)$(DELIM)user_map.h - @echo "" >> $(BOARD_INCLUDE)$(DELIM)user_map.h - @echo "#ifndef __ARCH_BOARD_USER_MAP_H" >> $(BOARD_INCLUDE)$(DELIM)user_map.h - @echo "#define __ARCH_BOARD_USER_MAP_H" >> $(BOARD_INCLUDE)$(DELIM)user_map.h - @echo "" >> $(BOARD_INCLUDE)$(DELIM)user_map.h - @echo "/* General memory map */" >> $(BOARD_INCLUDE)$(DELIM)user_map.h - @echo "" >> $(BOARD_INCLUDE)$(DELIM)user_map.h - @echo "#define CONFIG_USER_ENTRYPOINT 0x`grep \" user_start$\" $(TOPDIR)$(DELIM)User.map | cut -d' ' -f1`" >> $(BOARD_INCLUDE)$(DELIM)user_map.h - @echo "#define CONFIG_USER_TEXTSTART 0x`grep \" _stext\" $(TOPDIR)$(DELIM)User.map | cut -d' ' -f1`" >> $(BOARD_INCLUDE)$(DELIM)user_map.h - @echo "#define CONFIG_USER_TEXTEND 0x`grep \" _etext$\" $(TOPDIR)$(DELIM)User.map | cut -d' ' -f1`" >> $(BOARD_INCLUDE)$(DELIM)user_map.h - @echo "#define CONFIG_USER_DATASOURCE 0x`grep \" _eronly$\" $(TOPDIR)$(DELIM)User.map | cut -d' ' -f1`" >> $(BOARD_INCLUDE)$(DELIM)user_map.h - @echo "#define CONFIG_USER_DATADESTSTART 0x`grep \" _sdata$\" $(TOPDIR)$(DELIM)User.map | cut -d' ' -f1`" >> $(BOARD_INCLUDE)$(DELIM)user_map.h - @echo "#define CONFIG_USER_DATADESTEND 0x`grep \" _edata$\" $(TOPDIR)$(DELIM)User.map | cut -d' ' -f1`" >> $(BOARD_INCLUDE)$(DELIM)user_map.h - @echo "#define CONFIG_USER_BSSSTART 0x`grep \" _sbss\" $(TOPDIR)$(DELIM)User.map | cut -d' ' -f1`" >> $(BOARD_INCLUDE)$(DELIM)user_map.h - @echo "#define CONFIG_USER_BSSEND 0x`grep \" _ebss$\" $(TOPDIR)$(DELIM)User.map | cut -d' ' -f1`" >> $(BOARD_INCLUDE)$(DELIM)user_map.h - @echo "" >> $(BOARD_INCLUDE)$(DELIM)user_map.h - @echo "/* Memory manager entry points */" >> $(BOARD_INCLUDE)$(DELIM)user_map.h - @echo "" >> $(BOARD_INCLUDE)$(DELIM)user_map.h - @echo "#define CONFIG_USER_MMINIT 0x`grep \" mm_initialize$\" $(TOPDIR)$(DELIM)User.map | cut -d' ' -f1`" >> $(BOARD_INCLUDE)$(DELIM)user_map.h - @echo "#define CONFIG_USER_MMADDREGION 0x`grep \" mm_addregion$\" $(TOPDIR)$(DELIM)User.map | cut -d' ' -f1`" >> $(BOARD_INCLUDE)$(DELIM)user_map.h - @echo "#define CONFIG_USER_MMTRYSEM 0x`grep \" mm_trysemaphore$\" $(TOPDIR)$(DELIM)User.map | cut -d' ' -f1`" >> $(BOARD_INCLUDE)$(DELIM)user_map.h - @echo "#define CONFIG_USER_MMGIVESEM 0x`grep \" mm_givesemaphore$\" $(TOPDIR)$(DELIM)User.map | cut -d' ' -f1`" >> $(BOARD_INCLUDE)$(DELIM)user_map.h - @echo "" >> $(BOARD_INCLUDE)$(DELIM)user_map.h - @echo "#define CONFIG_USER_MALLOC 0x`grep \" malloc$\" $(TOPDIR)$(DELIM)User.map | cut -d' ' -f1`" >> $(BOARD_INCLUDE)$(DELIM)user_map.h - @echo "#define CONFIG_USER_REALLOC 0x`grep \" realloc$\" $(TOPDIR)$(DELIM)User.map | cut -d' ' -f1`" >> $(BOARD_INCLUDE)$(DELIM)user_map.h - @echo "#define CONFIG_USER_ZALLOC 0x`grep \" zalloc$\" $(TOPDIR)$(DELIM)User.map | cut -d' ' -f1`" >> $(BOARD_INCLUDE)$(DELIM)user_map.h - @echo "#define CONFIG_USER_FREE 0x`grep \" free$\" $(TOPDIR)$(DELIM)User.map | cut -d' ' -f1`" >> $(BOARD_INCLUDE)$(DELIM)user_map.h - @echo "" >> $(BOARD_INCLUDE)$(DELIM)user_map.h - @echo "#endif /* __ARCH_BOARD_USER_MAP_H */" >> $(BOARD_INCLUDE)$(DELIM)user_map.h + $(Q) echo "/* configs$(DELIM)$(CONFIG_ARCH_BOARD)$(DELIM)include$(DELIM)user_map.h" > $(BOARD_INCLUDE)$(DELIM)user_map.h + $(Q) echo " *" >> $(BOARD_INCLUDE)$(DELIM)user_map.h + $(Q) echo " * This is an auto-generated file.. Do not edit this file!" >> $(BOARD_INCLUDE)$(DELIM)user_map.h + $(Q) echo " */" >> $(BOARD_INCLUDE)$(DELIM)user_map.h + $(Q) echo "" >> $(BOARD_INCLUDE)$(DELIM)user_map.h + $(Q) echo "#ifndef __ARCH_BOARD_USER_MAP_H" >> $(BOARD_INCLUDE)$(DELIM)user_map.h + $(Q) echo "#define __ARCH_BOARD_USER_MAP_H" >> $(BOARD_INCLUDE)$(DELIM)user_map.h + $(Q) echo "" >> $(BOARD_INCLUDE)$(DELIM)user_map.h + $(Q) echo "/* General memory map */" >> $(BOARD_INCLUDE)$(DELIM)user_map.h + $(Q) echo "" >> $(BOARD_INCLUDE)$(DELIM)user_map.h + $(Q) echo "#define CONFIG_USER_ENTRYPOINT 0x`grep \" $(ENTRYPT)\" $(TOPDIR)$(DELIM)User.map | cut -d' ' -f1`" >> $(BOARD_INCLUDE)$(DELIM)user_map.h + $(Q) echo "#define CONFIG_USER_TEXTSTART 0x`grep \" _stext\" $(TOPDIR)$(DELIM)User.map | cut -d' ' -f1`" >> $(BOARD_INCLUDE)$(DELIM)user_map.h + $(Q) echo "#define CONFIG_USER_TEXTEND 0x`grep \" _etext$\" $(TOPDIR)$(DELIM)User.map | cut -d' ' -f1`" >> $(BOARD_INCLUDE)$(DELIM)user_map.h + $(Q) echo "#define CONFIG_USER_DATASOURCE 0x`grep \" _eronly$\" $(TOPDIR)$(DELIM)User.map | cut -d' ' -f1`" >> $(BOARD_INCLUDE)$(DELIM)user_map.h + $(Q) echo "#define CONFIG_USER_DATADESTSTART 0x`grep \" _sdata$\" $(TOPDIR)$(DELIM)User.map | cut -d' ' -f1`" >> $(BOARD_INCLUDE)$(DELIM)user_map.h + $(Q) echo "#define CONFIG_USER_DATADESTEND 0x`grep \" _edata$\" $(TOPDIR)$(DELIM)User.map | cut -d' ' -f1`" >> $(BOARD_INCLUDE)$(DELIM)user_map.h + $(Q) echo "#define CONFIG_USER_BSSSTART 0x`grep \" _sbss\" $(TOPDIR)$(DELIM)User.map | cut -d' ' -f1`" >> $(BOARD_INCLUDE)$(DELIM)user_map.h + $(Q) echo "#define CONFIG_USER_BSSEND 0x`grep \" _ebss$\" $(TOPDIR)$(DELIM)User.map | cut -d' ' -f1`" >> $(BOARD_INCLUDE)$(DELIM)user_map.h + $(Q) echo "" >> $(BOARD_INCLUDE)$(DELIM)user_map.h + $(Q) echo "/* Memory manager entry points */" >> $(BOARD_INCLUDE)$(DELIM)user_map.h + $(Q) echo "" >> $(BOARD_INCLUDE)$(DELIM)user_map.h + $(Q) echo "#define CONFIG_USER_MMINIT 0x`grep \" mm_initialize$\" $(TOPDIR)$(DELIM)User.map | cut -d' ' -f1`" >> $(BOARD_INCLUDE)$(DELIM)user_map.h + $(Q) echo "#define CONFIG_USER_MMADDREGION 0x`grep \" mm_addregion$\" $(TOPDIR)$(DELIM)User.map | cut -d' ' -f1`" >> $(BOARD_INCLUDE)$(DELIM)user_map.h + $(Q) echo "#define CONFIG_USER_MMTRYSEM 0x`grep \" mm_trysemaphore$\" $(TOPDIR)$(DELIM)User.map | cut -d' ' -f1`" >> $(BOARD_INCLUDE)$(DELIM)user_map.h + $(Q) echo "#define CONFIG_USER_MMGIVESEM 0x`grep \" mm_givesemaphore$\" $(TOPDIR)$(DELIM)User.map | cut -d' ' -f1`" >> $(BOARD_INCLUDE)$(DELIM)user_map.h + $(Q) echo "" >> $(BOARD_INCLUDE)$(DELIM)user_map.h + $(Q) echo "#define CONFIG_USER_MALLOC 0x`grep \" malloc$\" $(TOPDIR)$(DELIM)User.map | cut -d' ' -f1`" >> $(BOARD_INCLUDE)$(DELIM)user_map.h + $(Q) echo "#define CONFIG_USER_REALLOC 0x`grep \" realloc$\" $(TOPDIR)$(DELIM)User.map | cut -d' ' -f1`" >> $(BOARD_INCLUDE)$(DELIM)user_map.h + $(Q) echo "#define CONFIG_USER_ZALLOC 0x`grep \" zalloc$\" $(TOPDIR)$(DELIM)User.map | cut -d' ' -f1`" >> $(BOARD_INCLUDE)$(DELIM)user_map.h + $(Q) echo "#define CONFIG_USER_FREE 0x`grep \" free$\" $(TOPDIR)$(DELIM)User.map | cut -d' ' -f1`" >> $(BOARD_INCLUDE)$(DELIM)user_map.h + $(Q) echo "" >> $(BOARD_INCLUDE)$(DELIM)user_map.h + $(Q) echo "#endif /* __ARCH_BOARD_USER_MAP_H */" >> $(BOARD_INCLUDE)$(DELIM)user_map.h .depend: diff --git a/nuttx/configs/sam3u-ek/kernel/kernel.ld b/nuttx/configs/sam3u-ek/kernel/kernel.ld index 93d16124a..c288ab047 100644 --- a/nuttx/configs/sam3u-ek/kernel/kernel.ld +++ b/nuttx/configs/sam3u-ek/kernel/kernel.ld @@ -1,7 +1,7 @@ /**************************************************************************** * configs/sam3u-ek/kernal/kernel.ld * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2011, 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -62,10 +62,6 @@ MEMORY sram2 (rwx) : ORIGIN = 0x20080000, LENGTH = 16K } -/* Force user_start into the link. This is the application entry point */ - -EXTERN(user_start) - /* Make sure that the critical memory management functions are in user-space. * Currently, the plan is that the memory manager will reside in user-space * but be usable both by kernel- and user-space code @@ -82,7 +78,6 @@ EXTERN(zalloc) EXTERN(free) OUTPUT_ARCH(arm) -ENTRY(user_start) SECTIONS { |