diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2013-03-14 14:42:52 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2013-03-14 14:42:52 +0000 |
commit | 0d36830a37fcdb64c2b2d00990e084e7f8d63456 (patch) | |
tree | 78cc505c6874907ce2a37ab2b94d15c848c0ce50 /nuttx/configs/open1788 | |
parent | 5be9588ed42d1a4ed297bdc76d9e05e582e78969 (diff) | |
download | px4-nuttx-0d36830a37fcdb64c2b2d00990e084e7f8d63456.tar.gz px4-nuttx-0d36830a37fcdb64c2b2d00990e084e7f8d63456.tar.bz2 px4-nuttx-0d36830a37fcdb64c2b2d00990e084e7f8d63456.zip |
Rename g_heapbase to g_idle_topstack; Fix kernel build heap allocation which cannot use g_heapbase
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5739 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/configs/open1788')
-rw-r--r-- | nuttx/configs/open1788/kernel/Makefile | 6 | ||||
-rw-r--r-- | nuttx/configs/open1788/knsh/Make.defs | 26 | ||||
-rwxr-xr-x | nuttx/configs/open1788/scripts/kernel-space.ld | 32 | ||||
-rw-r--r-- | nuttx/configs/open1788/scripts/memory.ld | 77 | ||||
-rw-r--r-- | nuttx/configs/open1788/scripts/user-space.ld | 37 |
5 files changed, 103 insertions, 75 deletions
diff --git a/nuttx/configs/open1788/kernel/Makefile b/nuttx/configs/open1788/kernel/Makefile index 16731a24d..fb6850f36 100644 --- a/nuttx/configs/open1788/kernel/Makefile +++ b/nuttx/configs/open1788/kernel/Makefile @@ -50,11 +50,13 @@ ENTRYPT = $(patsubst "%",%,$(CONFIG_USER_ENTRYPOINT)) 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)scripts$(DELIM)user-space.ld}" + USER_LDSCRIPT = -T "${shell cygpath -w $(TOPDIR)$(DELIM)configs$(DELIM)$(CONFIG_ARCH_BOARD)$(DELIM)scripts$(DELIM)memory.ld}" + USER_LDSCRIPT += -T "${shell cygpath -w $(TOPDIR)$(DELIM)configs$(DELIM)$(CONFIG_ARCH_BOARD)$(DELIM)scripts$(DELIM)user-space.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)scripts$(DELIM)user-space.ld + USER_LDSCRIPT = -T$(TOPDIR)$(DELIM)configs$(DELIM)$(CONFIG_ARCH_BOARD)$(DELIM)scripts$(DELIM)memory.ld + USER_LDSCRIPT += -T$(TOPDIR)$(DELIM)configs$(DELIM)$(CONFIG_ARCH_BOARD)$(DELIM)scripts$(DELIM)user-space.ld endif USER_LDFLAGS = --undefined=$(ENTRYPT) --entry=$(ENTRYPT) $(USER_LDSCRIPT) diff --git a/nuttx/configs/open1788/knsh/Make.defs b/nuttx/configs/open1788/knsh/Make.defs index bf5073832..4ec863d1b 100644 --- a/nuttx/configs/open1788/knsh/Make.defs +++ b/nuttx/configs/open1788/knsh/Make.defs @@ -35,23 +35,25 @@ include ${TOPDIR}/.config include ${TOPDIR}/tools/Config.mk -include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs +include ${TOPDIR}$(DELIM)arch$(DELIM)arm$(DELIM)src$(DELIM)armv7-m$(DELIM)Toolchain.defs ifeq ($(WINTOOL),y) # Windows-native toolchains - DIRLINK = $(TOPDIR)/tools/copydir.sh - DIRUNLINK = $(TOPDIR)/tools/unlink.sh - MKDEP = $(TOPDIR)/tools/mknulldeps.sh - ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" - ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}" - ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/kernel-space.ld}" + DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)copydir.sh + DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh + MKDEP = $(TOPDIR)$(DELIM)tools$(DELIM)mknulldeps.sh + ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)$(DELIM)include}" + ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)$(DELIM)include}" -isystem "${shell cygpath -w $(TOPDIR)$(DELIM)include$(DELIM)cxx}" + ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)$(DELIM)configs$(DELIM)$(CONFIG_ARCH_BOARD)$(DELIM)scripts$(DELIM)memory.ld}" + ARCHSCRIPT += -T "${shell cygpath -w $(TOPDIR)$(DELIM)configs$(DELIM)$(CONFIG_ARCH_BOARD)$(DELIM)scripts$(DELIM)kernel-space.ld}" MAXOPTIMIZATION = -O2 else # Linux/Cygwin-native toolchain - MKDEP = $(TOPDIR)/tools/mkdeps.sh - ARCHINCLUDES = -I. -isystem $(TOPDIR)/include - ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx - ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/kernel-space.ld + MKDEP = $(TOPDIR)$(DELIM)tools$(DELIM)mkdeps.sh + ARCHINCLUDES = -I. -isystem $(TOPDIR)$(DELIM)include + ARCHXXINCLUDES = -I. -isystem $(TOPDIR)$(DELIM)include -isystem $(TOPDIR)$(DELIM)include$(DELIM)cxx + ARCHSCRIPT = -T$(TOPDIR)$(DELIM)configs$(DELIM)$(CONFIG_ARCH_BOARD)$(DELIM)scripts$(DELIM)memory.ld + ARCHSCRIPT += -T$(TOPDIR)$(DELIM)configs$(DELIM)$(CONFIG_ARCH_BOARD)$(DELIM)scripts$(DELIM)kernel-space.ld endif CC = $(CROSSDEV)gcc @@ -87,7 +89,7 @@ CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) AFLAGS = $(CFLAGS) -D__ASSEMBLY__ NXFLATLDFLAGS1 = -r -d -warn-common -NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections +NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)$(DELIM)binfmt$(DELIM)libnxflat$(DELIM)gnu-nxflat-pcrel.ld -no-check-sections LDNXFLATFLAGS = -e main -s 2048 OBJEXT = .o diff --git a/nuttx/configs/open1788/scripts/kernel-space.ld b/nuttx/configs/open1788/scripts/kernel-space.ld index 84cf9212c..e80fa7d11 100755 --- a/nuttx/configs/open1788/scripts/kernel-space.ld +++ b/nuttx/configs/open1788/scripts/kernel-space.ld @@ -1,7 +1,7 @@ /**************************************************************************** * configs/open1788/scripts/kernel-space.ld * - * Copyright (C) 2011, 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -33,36 +33,10 @@ * ****************************************************************************/ -/* The LPC1788 has 512Kb of FLASH beginning at address 0x0000:0000 and - * 96Kb of total SRAM: 64Kb of SRAM in the CPU block beginning at address - * 0x10000000 and 32Kb of Peripheral SRAM in two banks, 8Kb at addresses - * 0x20000000 bank0 first and 8kb at 0x20002000 at bank0 second. And 16Kb - * at 0x20004000 on bank1. - * - * For MPU support, the kernel-mode NuttX section is assumed to be 64Kb of - * FLASH and 4Kb of SRAM. That, of course, can be optimized as needed (See - * also configs/open1788/scripts/kernel-space.ld). +/* NOTE: This depends on the memory.ld script having been included prior to + * this script. */ -MEMORY -{ - /* 256Kb FLASH */ - - kflash (rx) : ORIGIN = 0x00000000, LENGTH = 64K - uflash (rx) : ORIGIN = 0x00010000, LENGTH = 448K - - /* 64Kb of SRAM in the CPU block */ - - ksram (rwx) : ORIGIN = 0x10000000, LENGTH = 4K - usram (rwx) : ORIGIN = 0x10001000, LENGTH = 60K - - /* Other peripheral memory (free, nothing is linked here) */ - - ahbram8_b0a(rwx) : ORIGIN = 0x20000000, LENGTH = 8K - ahbram8_b0b(rwx) : ORIGIN = 0x20002000, LENGTH = 8K - ahbram16(rwx) : ORIGIN = 0x20004000, LENGTH = 16K -} - OUTPUT_ARCH(arm) ENTRY(_stext) SECTIONS diff --git a/nuttx/configs/open1788/scripts/memory.ld b/nuttx/configs/open1788/scripts/memory.ld new file mode 100644 index 000000000..d1ae3aa6e --- /dev/null +++ b/nuttx/configs/open1788/scripts/memory.ld @@ -0,0 +1,77 @@ +/**************************************************************************** + * configs/open1788/knsh/memory.ld + * + * Copyright (C) 2013 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt <gnutt@nuttx.org> + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +/* The LPC1788 has 512Kb of FLASH beginning at address 0x0000:0000 and + * 96Kb of total SRAM: 64Kb of SRAM in the CPU block beginning at address + * 0x10000000 and 32Kb of Peripheral SRAM in two banks, 8Kb at addresses + * 0x20000000 bank0 first and 8kb at 0x20002000 at bank0 second. And 16Kb + * at 0x20004000 on bank1. + * + * For MPU support, the kernel-mode NuttX section is assumed to be 64Kb of + * FLASH and 4Kb of SRAM. That, of course, can be optimized as needed (See + * also configs/open1788/scripts/kernel-space.ld). A detailed memory map + * for the CPU SRAM region is as follows: + * + * 0x10000 0000: Kernel .data region. Typical size: 0.1KB + * ------- ---- Kernel .bss region. Typical size: 1.8KB + * 0x10000 0800: Kernel IDLE thread stack (approximate). Size is + * determined by CONFIG_IDLETHREAD_STACKSIZE and + * adjustments for alignment. Typical is 1KB. + * ------- ---- Padded to 4KB + * 0x10000 1000: User .data region. Size is variable. + * ------- ---- User .bss region Size is variable. + * ------- ---- Beginning of kernel heap + * 0x10000 8000: Beginning of user heap. Can vary with other settings. + * 0x10001 0000: End+1 of CPU RAM + */ + +MEMORY +{ + /* 256Kb FLASH */ + + kflash (rx) : ORIGIN = 0x00000000, LENGTH = 64K + uflash (rx) : ORIGIN = 0x00010000, LENGTH = 448K + + /* 64Kb of SRAM in the CPU block */ + + ksram (rwx) : ORIGIN = 0x10000000, LENGTH = 4K + usram (rwx) : ORIGIN = 0x10001000, LENGTH = 60K + + /* Other peripheral memory (free, nothing is linked here) */ + + ahbram8_b0a(rwx) : ORIGIN = 0x20000000, LENGTH = 8K + ahbram8_b0b(rwx) : ORIGIN = 0x20002000, LENGTH = 8K + ahbram16(rwx) : ORIGIN = 0x20004000, LENGTH = 16K +} diff --git a/nuttx/configs/open1788/scripts/user-space.ld b/nuttx/configs/open1788/scripts/user-space.ld index 149be92f1..e2979e4a3 100644 --- a/nuttx/configs/open1788/scripts/user-space.ld +++ b/nuttx/configs/open1788/scripts/user-space.ld @@ -1,7 +1,7 @@ /**************************************************************************** * configs/open1788/scripts/user-space.ld * - * Copyright (C) 2011, 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -33,39 +33,13 @@ * ****************************************************************************/ -/* The LPC1788 has 512Kb of FLASH beginning at address 0x0000:0000 and - * 96Kb of total SRAM: 64Kb of SRAM in the CPU block beginning at address - * 0x10000000 and 32Kb of Peripheral SRAM in two banks, 8Kb at addresses - * 0x20000000 bank0 first and 8kb at 0x20002000 at bank0 second. And 16Kb - * at 0x20004000 on bank1. - * - * For MPU support, the kernel-mode NuttX section is assumed to be 64Kb of - * FLASH and 4Kb of SRAM. That, of course, can be optimized as needed (See - * also configs/open1788/scripts/kernel-space.ld). +/* NOTE: This depends on the memory.ld script having been included prior to + * this script. */ -MEMORY -{ - /* 256Kb FLASH */ - - kflash (rx) : ORIGIN = 0x00000000, LENGTH = 64K - uflash (rx) : ORIGIN = 0x00010000, LENGTH = 448K - - /* 64Kb of SRAM in the CPU block */ - - ksram (rwx) : ORIGIN = 0x10000000, LENGTH = 4K - usram (rwx) : ORIGIN = 0x10001000, LENGTH = 60K - - /* Other peripheral memory (free, nothing is linked here) */ - - ahbram8_b0a(rwx) : ORIGIN = 0x20000000, LENGTH = 8K - ahbram8_b0b(rwx) : ORIGIN = 0x20002000, LENGTH = 8K - ahbram16(rwx) : ORIGIN = 0x20004000, LENGTH = 16K -} - /* 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 + * the user heap memory manager will reside in user-space but be usable both + * by kernel- and user-space code */ EXTERN(umm_initialize) @@ -79,7 +53,6 @@ EXTERN(zalloc) EXTERN(free) OUTPUT_ARCH(arm) - SECTIONS { .userspace : { |