summaryrefslogtreecommitdiff
path: root/nuttx/configs/sam3u-ek/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/configs/sam3u-ek/kernel')
-rwxr-xr-xnuttx/configs/sam3u-ek/kernel/Makefile18
-rw-r--r--nuttx/configs/sam3u-ek/kernel/kernel.ld14
2 files changed, 26 insertions, 6 deletions
diff --git a/nuttx/configs/sam3u-ek/kernel/Makefile b/nuttx/configs/sam3u-ek/kernel/Makefile
index dd3e1892c..38abe2b0a 100755
--- a/nuttx/configs/sam3u-ek/kernel/Makefile
+++ b/nuttx/configs/sam3u-ek/kernel/Makefile
@@ -74,7 +74,7 @@ $(TOPDIR)/nuttx_user.elf: nuttx_user.elf
$(TOPDIR)/User.map: nuttx_user.elf
@$(NM) nuttx_user.elf >$(TOPDIR)/User.map
- @$(CROSSDEV)size $(TOPDIR)/User.map
+ @$(CROSSDEV)size nuttx_user.elf
$(BOARD_INCLUDE)/user_map.h: $(TOPDIR)/User.map
@echo "/* configs/$(CONFIG_ARCH_BOARD)/include/user_map.h" > $(BOARD_INCLUDE)/user_map.h
@@ -85,10 +85,18 @@ $(BOARD_INCLUDE)/user_map.h: $(TOPDIR)/User.map
@echo "#ifndef __ARCH_BOARD_USER_MAP_H" >> $(BOARD_INCLUDE)/user_map.h
@echo "#define __ARCH_BOARD_USER_MAP_H" >> $(BOARD_INCLUDE)/user_map.h
@echo "" >> $(BOARD_INCLUDE)/user_map.h
- @echo "#define CONFIG_USER_ENTRYPOINT `grep user_start $(TOPDIR)/User.map | cut -d' ' -f1`" >> $(BOARD_INCLUDE)/user_map.h
- @echo "#define CONFIG_USER_DATASOURCE `grep _eronly $(TOPDIR)/User.map | cut -d' ' -f1`" >> $(BOARD_INCLUDE)/user_map.h
- @echo "#define CONFIG_USER_DATADESTSTART `grep _sdata $(TOPDIR)/User.map | cut -d' ' -f1`" >> $(BOARD_INCLUDE)/user_map.h
- @echo "#define CONFIG_USER_DATADESTEND `grep _edata $(TOPDIR)/User.map | cut -d' ' -f1`" >> $(BOARD_INCLUDE)/user_map.h
+ @echo "/* General memory map */" >> $(BOARD_INCLUDE)/user_map.h
+ @echo "" >> $(BOARD_INCLUDE)/user_map.h
+ @echo "#define CONFIG_USER_ENTRYPOINT 0x`grep \" user_start$\" $(TOPDIR)/User.map | cut -d' ' -f1`" >> $(BOARD_INCLUDE)/user_map.h
+ @echo "#define CONFIG_USER_DATASOURCE 0x`grep \" _eronly$\" $(TOPDIR)/User.map | cut -d' ' -f1`" >> $(BOARD_INCLUDE)/user_map.h
+ @echo "#define CONFIG_USER_DATADESTSTART 0x`grep \" _sdata$\" $(TOPDIR)/User.map | cut -d' ' -f1`" >> $(BOARD_INCLUDE)/user_map.h
+ @echo "#define CONFIG_USER_DATADESTEND 0x`grep \" _edata$\" $(TOPDIR)/User.map | cut -d' ' -f1`" >> $(BOARD_INCLUDE)/user_map.h
+ @echo "" >> $(BOARD_INCLUDE)/user_map.h
+ @echo "/* Memory manager entry points */" >> $(BOARD_INCLUDE)/user_map.h
+ @echo "" >> $(BOARD_INCLUDE)/user_map.h
+ @echo "#define CONFIG_USER_MALLOC 0x`grep \" malloc$\" $(TOPDIR)/User.map | cut -d' ' -f1`" >> $(BOARD_INCLUDE)/user_map.h
+ @echo "#define CONFIG_USER_REALLOC 0x`grep \" realloc$\" $(TOPDIR)/User.map | cut -d' ' -f1`" >> $(BOARD_INCLUDE)/user_map.h
+ @echo "#define CONFIG_USER_FREE 0x`grep \" free$\" $(TOPDIR)/User.map | cut -d' ' -f1`" >> $(BOARD_INCLUDE)/user_map.h
@echo "" >> $(BOARD_INCLUDE)/user_map.h
@echo "#endif /* __ARCH_BOARD_USER_MAP_H */" >> $(BOARD_INCLUDE)/user_map.h
diff --git a/nuttx/configs/sam3u-ek/kernel/kernel.ld b/nuttx/configs/sam3u-ek/kernel/kernel.ld
index 72f79d9d7..267963978 100644
--- a/nuttx/configs/sam3u-ek/kernel/kernel.ld
+++ b/nuttx/configs/sam3u-ek/kernel/kernel.ld
@@ -62,9 +62,21 @@ 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
+
+EXTERN(malloc)
+EXTERN(realloc)
+EXTERN(free)
+
OUTPUT_ARCH(arm)
ENTRY(user_start)
-EXTERN(user_start)
+
SECTIONS
{
.text : {