ARMv7-M: Add toolchain option to select the IAR tools. Move ARMv7-M assembly language into a gnu/ subdirectory. Makefile selects iar/ or gnu/ directory based upon tool configuration

This commit is contained in:
Gregory Nutt 2016-04-02 07:53:52 -06:00
parent 29ab0fb991
commit bd2da2f543
15 changed files with 67 additions and 30 deletions

View File

@ -425,6 +425,14 @@ config ARCH_CHIP
default "tms570" if ARCH_CHIP_TMS570 default "tms570" if ARCH_CHIP_TMS570
default "moxart" if ARCH_CHIP_MOXART default "moxart" if ARCH_CHIP_MOXART
config ARM_TOOLCHAIN_IAR
bool
default n
config ARM_TOOLCHAIN_GNU
bool
default n
config ARMV7M_USEBASEPRI config ARMV7M_USEBASEPRI
bool "Use BASEPRI Register" bool "Use BASEPRI Register"
default n default n

View File

@ -34,7 +34,7 @@
############################################################################ ############################################################################
-include $(TOPDIR)/Make.defs -include $(TOPDIR)/Make.defs
-include chip/Make.defs -include chip$(DELIM)Make.defs
ifeq ($(CONFIG_ARCH_CORTEXA5),y) # Cortex-A5 is ARMv7-A ifeq ($(CONFIG_ARCH_CORTEXA5),y) # Cortex-A5 is ARMv7-A
ARCH_SUBDIR = armv7-a ARCH_SUBDIR = armv7-a
@ -167,9 +167,17 @@ VPATH += chip
VPATH += common VPATH += common
VPATH += $(ARCH_SUBDIR) VPATH += $(ARCH_SUBDIR)
ifeq ($(CONFIG_ARM_TOOLCHAIN_IAR),y)
VPATH += chip$(DELIM)iar
VPATH += $(ARCH_SUBDIR)$(DELIM)iar
else # ifeq ($(CONFIG_ARM_TOOLCHAIN_GNU),y)
VPATH += chip$(DELIM)gnu
VPATH += $(ARCH_SUBDIR)$(DELIM)gnu
endif
all: $(HEAD_OBJ) $(BIN) all: $(HEAD_OBJ) $(BIN)
.PHONY: board/libboard$(LIBEXT) .PHONY: board$(DELIM)libboard$(LIBEXT)
$(AOBJS) $(UAOBJS) $(HEAD_OBJ): %$(OBJEXT): %.S $(AOBJS) $(UAOBJS) $(HEAD_OBJ): %$(OBJEXT): %.S
$(call ASSEMBLE, $<, $@) $(call ASSEMBLE, $<, $@)
@ -183,10 +191,10 @@ $(BIN) $(KBIN): $(OBJS)
$(UBIN): $(UOBJS) $(UBIN): $(UOBJS)
$(call ARCHIVE, $@, $(UOBJS)) $(call ARCHIVE, $@, $(UOBJS))
board/libboard$(LIBEXT): board$(DELIM)libboard$(LIBEXT):
$(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" libboard$(LIBEXT) EXTRADEFINES=$(EXTRADEFINES) $(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" libboard$(LIBEXT) EXTRADEFINES=$(EXTRADEFINES)
nuttx$(EXEEXT): $(HEAD_OBJ) board/libboard$(LIBEXT) nuttx$(EXEEXT): $(HEAD_OBJ) board$(DELIM)libboard$(LIBEXT)
$(Q) echo "LD: nuttx" $(Q) echo "LD: nuttx"
$(Q) $(LD) --entry=__start $(LDFLAGS) $(LIBPATHS) $(EXTRA_LIBPATHS) \ $(Q) $(LD) --entry=__start $(LDFLAGS) $(LIBPATHS) $(EXTRA_LIBPATHS) \
-o $(NUTTX) $(HEAD_OBJ) $(EXTRA_OBJS) \ -o $(NUTTX) $(HEAD_OBJ) $(EXTRA_OBJS) \
@ -194,26 +202,26 @@ nuttx$(EXEEXT): $(HEAD_OBJ) board/libboard$(LIBEXT)
ifneq ($(CONFIG_WINDOWS_NATIVE),y) ifneq ($(CONFIG_WINDOWS_NATIVE),y)
$(Q) $(NM) $(NUTTX) | \ $(Q) $(NM) $(NUTTX) | \
grep -v '\(compiled\)\|\(\$(OBJEXT)$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \ grep -v '\(compiled\)\|\(\$(OBJEXT)$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
sort > $(TOPDIR)/System.map sort > $(TOPDIR)$(DELIM)System.map
endif endif
# This is part of the top-level export target # This is part of the top-level export target
# Note that there may not be a head object if layout is handled # Note that there may not be a head object if layout is handled
# by the linker configuration. # by the linker configuration.
export_startup: board/libboard$(LIBEXT) $(STARTUP_OBJS) export_startup: board$(DELIM)libboard$(LIBEXT) $(STARTUP_OBJS)
ifneq ($(STARTUP_OBJS),) ifneq ($(STARTUP_OBJS),)
$(Q) if [ -d "$(EXPORT_DIR)/startup" ]; then \ $(Q) if [ -d "$(EXPORT_DIR)$(DELIM)startup" ]; then \
cp -f $(STARTUP_OBJS) "$(EXPORT_DIR)/startup/."; \ cp -f $(STARTUP_OBJS) "$(EXPORT_DIR)$(DELIM)startup$(DELIM)."; \
else \ else \
echo "$(EXPORT_DIR)/startup does not exist"; \ echo "$(EXPORT_DIR)$(DELIM)startup does not exist"; \
exit 1; \ exit 1; \
fi fi
endif endif
# Dependencies # Dependencies
.depend: Makefile chip/Make.defs $(SRCS) .depend: Makefile chip$(DELIM)Make.defs $(SRCS)
ifeq ($(BOARDMAKE),y) ifeq ($(BOARDMAKE),y)
$(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" depend $(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" depend
endif endif

View File

@ -51,36 +51,55 @@ choice
default ARMV7M_TOOLCHAIN_GNU_EABIW if HOST_WINDOWS default ARMV7M_TOOLCHAIN_GNU_EABIW if HOST_WINDOWS
default ARMV7M_TOOLCHAIN_GNU_EABIL if !HOST_WINDOWS default ARMV7M_TOOLCHAIN_GNU_EABIL if !HOST_WINDOWS
config ARMV7M_TOOLCHAIN_IARW
bool "IAR for Windows"
depends on HOST_WINDOWS
select ARM_TOOLCHAIN_IAR
config ARMV7M_TOOLCHAIN_IARL
bool "IAR for Linux"
depends on HOST_LINUX
select ARM_TOOLCHAIN_IAR
config ARMV7M_TOOLCHAIN_ATOLLIC config ARMV7M_TOOLCHAIN_ATOLLIC
bool "Atollic Lite/Pro for Windows" bool "Atollic Lite/Pro for Windows"
depends on HOST_WINDOWS depends on HOST_WINDOWS
select ARM_TOOLCHAIN_GNU
config ARMV7M_TOOLCHAIN_BUILDROOT config ARMV7M_TOOLCHAIN_BUILDROOT
bool "Buildroot (Cygwin or Linux)" bool "Buildroot (Cygwin or Linux)"
depends on !WINDOWS_NATIVE depends on !WINDOWS_NATIVE
select ARM_TOOLCHAIN_GNU
config ARMV7M_TOOLCHAIN_CODEREDL config ARMV7M_TOOLCHAIN_CODEREDL
bool "CodeRed for Linux" bool "CodeRed for Linux"
depends on HOST_LINUX depends on HOST_LINUX
select ARM_TOOLCHAIN_GNU
config ARMV7M_TOOLCHAIN_CODEREDW config ARMV7M_TOOLCHAIN_CODEREDW
bool "CodeRed for Windows" bool "CodeRed for Windows"
depends on HOST_WINDOWS depends on HOST_WINDOWS
select ARM_TOOLCHAIN_GNU
config ARMV7M_TOOLCHAIN_CODESOURCERYL config ARMV7M_TOOLCHAIN_CODESOURCERYL
bool "CodeSourcery GNU toolchain under Linux" bool "CodeSourcery GNU toolchain under Linux"
depends on HOST_LINUX depends on HOST_LINUX
select ARM_TOOLCHAIN_GNU
config ARMV7M_TOOLCHAIN_CODESOURCERYW config ARMV7M_TOOLCHAIN_CODESOURCERYW
bool "CodeSourcery GNU toolchain under Windows" bool "CodeSourcery GNU toolchain under Windows"
depends on HOST_WINDOWS depends on HOST_WINDOWS
select ARM_TOOLCHAIN_GNU
config ARMV7M_TOOLCHAIN_DEVKITARM config ARMV7M_TOOLCHAIN_DEVKITARM
bool "devkitARM GNU toolchain" bool "devkitARM GNU toolchain"
depends on HOST_WINDOWS depends on HOST_WINDOWS
select ARM_TOOLCHAIN_GNU
config ARMV7M_TOOLCHAIN_GNU_EABIL config ARMV7M_TOOLCHAIN_GNU_EABIL
bool "Generic GNU EABI toolchain under Linux (or other POSIX environment)" bool "Generic GNU EABI toolchain under Linux (or other POSIX environment)"
depends on !WINDOWS_NATIVE
select ARM_TOOLCHAIN_GNU
---help--- ---help---
This option should work for any modern GNU toolchain (GCC 4.5 or newer) This option should work for any modern GNU toolchain (GCC 4.5 or newer)
configured for arm-none-eabi. configured for arm-none-eabi.
@ -88,6 +107,7 @@ config ARMV7M_TOOLCHAIN_GNU_EABIL
config ARMV7M_TOOLCHAIN_GNU_EABIW config ARMV7M_TOOLCHAIN_GNU_EABIW
bool "Generic GNU EABI toolchain under Windows" bool "Generic GNU EABI toolchain under Windows"
depends on HOST_WINDOWS depends on HOST_WINDOWS
select ARM_TOOLCHAIN_GNU
---help--- ---help---
This option should work for any modern GNU toolchain (GCC 4.5 or newer) This option should work for any modern GNU toolchain (GCC 4.5 or newer)
configured for arm-none-eabi. configured for arm-none-eabi.
@ -95,6 +115,7 @@ config ARMV7M_TOOLCHAIN_GNU_EABIW
config ARMV7M_TOOLCHAIN_RAISONANCE config ARMV7M_TOOLCHAIN_RAISONANCE
bool "STMicro Raisonance for Windows" bool "STMicro Raisonance for Windows"
depends on HOST_WINDOWS depends on HOST_WINDOWS
select ARM_TOOLCHAIN_GNU
endchoice endchoice

View File

@ -1,7 +1,7 @@
############################################################################ ############################################################################
# arch/arm/src/armv7-m/Toolchain.defs # arch/arm/src/armv7-m/Toolchain.defs
# #
# Copyright (C) 2012-2013, 2015 Gregory Nutt. All rights reserved. # Copyright (C) 2012-2013, 2015-2016 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org> # Author: Gregory Nutt <gnutt@nuttx.org>
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without

View File

@ -1,7 +1,7 @@
/************************************************************************************ /************************************************************************************
* arch/arm/src/armv7-m/up_exception.S * arch/arm/src/armv7-m/gnu/up_exception.S
* *
* Copyright (C) 2009-2013, 2015 Gregory Nutt. All rights reserved. * Copyright (C) 2009-2013, 2015-2016 Gregory Nutt. All rights reserved.
* Copyright (C) 2012 Michael Smith. All rights reserved. * Copyright (C) 2012 Michael Smith. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *

View File

@ -1,7 +1,7 @@
/************************************************************************************ /************************************************************************************
* arch/arm/src/armv7-m/up_fpu.S * arch/arm/src/armv7-m/gnu/up_fpu.S
* *
* Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. * Copyright (C) 2011-2012, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without

View File

@ -1,7 +1,7 @@
/************************************************************************************ /************************************************************************************
* arch/arm/src/armv7-m/up_fullcontextrestore.S * arch/arm/src/armv7-m/gnu/up_fullcontextrestore.S
* *
* Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved. * Copyright (C) 2009, 2011, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without

View File

@ -1,7 +1,7 @@
/************************************************************************************************ /************************************************************************************************
* arch/arm/src/armv7-m/up_lazyexcption.S * arch/arm/src/armv7-m/gnu/up_lazyexcption.S
* *
* Copyright (C) 2009-2010, 2013-2015 Gregory Nutt. All rights reserved. * Copyright (C) 2009-2010, 2013-2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without

View File

@ -1,5 +1,5 @@
/************************************************************************************ /************************************************************************************
* nuttx/arch/arm/src/armv7-m/up_memcpy.S * nuttx/arch/arm/src/armv7-m/gnu/up_memcpy.S
* *
* armv7m-optimised memcpy, contributed by Mike Smith. Apparently in the public * armv7m-optimised memcpy, contributed by Mike Smith. Apparently in the public
* domain and is re-released here under the modified BSD license: * domain and is re-released here under the modified BSD license:

View File

@ -1,7 +1,7 @@
/************************************************************************************ /************************************************************************************
* arch/arm/src/armv7-m/up_saveusercontext.S * arch/arm/src/armv7-m/gnu/up_saveusercontext.S
* *
* Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved. * Copyright (C) 2009, 2011, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/armv7-m/up_signal_handler.S * arch/arm/src/armv7-m/gnu/up_signal_handler.S
* *
* Copyright (C) 2013 Gregory Nutt. All rights reserved. * Copyright (C) 2013, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without

View File

@ -1,7 +1,7 @@
/************************************************************************************ /************************************************************************************
* arch/arm/src/armv7-m/up_switchcontext.S * arch/arm/src/armv7-m/gnu/up_switchcontext.S
* *
* Copyright (C) 2009-2011 Gregory Nutt. All rights reserved. * Copyright (C) 2009-2011, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without

View File

@ -1,5 +1,5 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/armv7-m/up_testset.S * arch/arm/src/armv7-m/gnu/up_testset.S
* *
* Copyright (C) 2016 Gregory Nutt. All rights reserved. * Copyright (C) 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>

View File

@ -1,7 +1,7 @@
/************************************************************************************ /************************************************************************************
* arch/arm/src/armv7-m/vfork.S * arch/arm/src/armv7-m/gnu/vfork.S
* *
* Copyright (C) 2013 Gregory Nutt. All rights reserved. * Copyright (C) 2013, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without

View File

@ -280,7 +280,7 @@ void __start(void)
* certain that there are no issues with the state of global variables. * certain that there are no issues with the state of global variables.
*/ */
for (dest = _START_BSS; dest < __END_BSS; ) for (dest = _START_BSS; dest < _END_BSS; )
{ {
*dest++ = 0; *dest++ = 0;
} }