diff --git a/libc/machine/Kconfig b/libc/machine/Kconfig index 665b05ef18..192c0e7df6 100644 --- a/libc/machine/Kconfig +++ b/libc/machine/Kconfig @@ -113,18 +113,6 @@ config LIBM_ARCH_TRUNCF # One or more the of above may be selected by architecture specific logic -if ARCH_CORTEXA5 || ARCH_CORTEXA8 || ARCH_CORTEXA9 -source libc/machine/armv7-a/Kconfig -endif - -if ARCH_CORTEXR4 || ARCH_CORTEXR4F || ARCH_CORTEXR5 || ARCH_CORTEXR5F || ARCH_CORTEXR7 || ARCH_CORTEXR7F -source libc/machine/armv7-r/Kconfig -endif - -if ARCH_CORTEXM3 || ARCH_CORTEXM4 || ARCH_CORTEXM7 -source libc/machine/armv7-m/Kconfig -endif - -if ARCH_CORTEXM33 -source libc/machine/armv8/Kconfig +if ARCH_ARM +source libc/machine/arm/Kconfig endif diff --git a/libc/machine/Make.defs b/libc/machine/Make.defs index 7ffe7f00d5..56990d866c 100644 --- a/libc/machine/Make.defs +++ b/libc/machine/Make.defs @@ -33,30 +33,6 @@ # ############################################################################ -ifeq ($(CONFIG_ARCH_CORTEXA5),y) # Cortex-A5 is ARMv7-A -include ${TOPDIR}/libc/machine/armv7-a/Make.defs -else ifeq ($(CONFIG_ARCH_CORTEXA8),y) # Cortex-A8 is ARMv7-A -include ${TOPDIR}/libc/machine/armv7-a/Make.defs -else ifeq ($(CONFIG_ARCH_CORTEXA9),y) # Cortex-A9 is ARMv7-A -include ${TOPDIR}/libc/machine/armv7-a/Make.defs -else ifeq ($(CONFIG_ARCH_CORTEXR4),y) # Cortex-R4 is ARMv7-R -include ${TOPDIR}/libc/machine/armv7-r/Make.defs -else ifeq ($(CONFIG_ARCH_CORTEXR4F),y) # Cortex-R4F is ARMv7-R -include ${TOPDIR}/libc/machine/armv7-r/Make.defs -else ifeq ($(CONFIG_ARCH_CORTEXR5),y) # Cortex-R5 is ARMv7-R -include ${TOPDIR}/libc/machine/armv7-r/Make.defs -else ifeq ($(CONFIG_ARCH_CORTEXR5F),y) # Cortex-R5F is ARMv7-R -include ${TOPDIR}/libc/machine/armv7-r/Make.defs -else ifeq ($(CONFIG_ARCH_CORTEXR7),y) # Cortex-R7 is ARMv7-R -include ${TOPDIR}/libc/machine/armv7-r/Make.defs -else ifeq ($(CONFIG_ARCH_CORTEXR7F),y) # Cortex-R7F is ARMv7-R -include ${TOPDIR}/libc/machine/armv7-r/Make.defs -else ifeq ($(CONFIG_ARCH_CORTEXM3),y) # Cortex-M3 is ARMv7-M -include ${TOPDIR}/libc/machine/armv7-m/Make.defs -else ifeq ($(CONFIG_ARCH_CORTEXM33),y) # Cortex-M33 is ARMv8-M -include ${TOPDIR}/libc/machine/armv8/Make.defs -else ifeq ($(CONFIG_ARCH_CORTEXM4),y) # Cortex-M4 is ARMv7E-M -include ${TOPDIR}/libc/machine/armv7-m/Make.defs -else ifeq ($(CONFIG_ARCH_CORTEXM7),y) # Cortex-M4 is ARMv7E-M -include ${TOPDIR}/libc/machine/armv7-m/Make.defs +ifeq ($(CONFIG_ARCH_ARM),y) +include ${TOPDIR}/libc/machine/arm/Make.defs endif diff --git a/libc/machine/arm/Kconfig b/libc/machine/arm/Kconfig new file mode 100644 index 0000000000..8d115c6ac3 --- /dev/null +++ b/libc/machine/arm/Kconfig @@ -0,0 +1,20 @@ +# +# For a description of the syntax of this configuration file, +# see the file kconfig-language.txt in the NuttX tools repository. +# + +if ARCH_CORTEXA5 || ARCH_CORTEXA8 || ARCH_CORTEXA9 +source libc/machine/arm/armv7-a/Kconfig +endif + +if ARCH_CORTEXR4 || ARCH_CORTEXR4F || ARCH_CORTEXR5 || ARCH_CORTEXR5F || ARCH_CORTEXR7 || ARCH_CORTEXR7F +source libc/machine/arm/armv7-r/Kconfig +endif + +if ARCH_CORTEXM3 || ARCH_CORTEXM4 || ARCH_CORTEXM7 +source libc/machine/arm/armv7-m/Kconfig +endif + +if ARCH_CORTEXM33 +source libc/machine/arm/armv8/Kconfig +endif diff --git a/libc/machine/arm/Make.defs b/libc/machine/arm/Make.defs new file mode 100644 index 0000000000..e8ee7977f2 --- /dev/null +++ b/libc/machine/arm/Make.defs @@ -0,0 +1,62 @@ +############################################################################ +# libc/machine/arm/Make.defs +# +# Copyright (C) 2017 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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. +# +############################################################################ + +ifeq ($(CONFIG_ARCH_CORTEXA5),y) # Cortex-A5 is ARMv7-A +include ${TOPDIR}/libc/machine/arm/armv7-a/Make.defs +else ifeq ($(CONFIG_ARCH_CORTEXA8),y) # Cortex-A8 is ARMv7-A +include ${TOPDIR}/libc/machine/arm/armv7-a/Make.defs +else ifeq ($(CONFIG_ARCH_CORTEXA9),y) # Cortex-A9 is ARMv7-A +include ${TOPDIR}/libc/machine/arm/armv7-a/Make.defs +else ifeq ($(CONFIG_ARCH_CORTEXR4),y) # Cortex-R4 is ARMv7-R +include ${TOPDIR}/libc/machine/arm/armv7-r/Make.defs +else ifeq ($(CONFIG_ARCH_CORTEXR4F),y) # Cortex-R4F is ARMv7-R +include ${TOPDIR}/libc/machine/arm/armv7-r/Make.defs +else ifeq ($(CONFIG_ARCH_CORTEXR5),y) # Cortex-R5 is ARMv7-R +include ${TOPDIR}/libc/machine/arm/armv7-r/Make.defs +else ifeq ($(CONFIG_ARCH_CORTEXR5F),y) # Cortex-R5F is ARMv7-R +include ${TOPDIR}/libc/machine/arm/armv7-r/Make.defs +else ifeq ($(CONFIG_ARCH_CORTEXR7),y) # Cortex-R7 is ARMv7-R +include ${TOPDIR}/libc/machine/arm/armv7-r/Make.defs +else ifeq ($(CONFIG_ARCH_CORTEXR7F),y) # Cortex-R7F is ARMv7-R +include ${TOPDIR}/libc/machine/arm/armv7-r/Make.defs +else ifeq ($(CONFIG_ARCH_CORTEXM3),y) # Cortex-M3 is ARMv7-M +include ${TOPDIR}/libc/machine/arm/armv7-m/Make.defs +else ifeq ($(CONFIG_ARCH_CORTEXM33),y) # Cortex-M33 is ARMv8-M +include ${TOPDIR}/libc/machine/arm/armv8/Make.defs +else ifeq ($(CONFIG_ARCH_CORTEXM4),y) # Cortex-M4 is ARMv7E-M +include ${TOPDIR}/libc/machine/arm/armv7-m/Make.defs +else ifeq ($(CONFIG_ARCH_CORTEXM7),y) # Cortex-M4 is ARMv7E-M +include ${TOPDIR}/libc/machine/arm/armv7-m/Make.defs +endif diff --git a/libc/machine/armv7-a/Kconfig b/libc/machine/arm/armv7-a/Kconfig similarity index 100% rename from libc/machine/armv7-a/Kconfig rename to libc/machine/arm/armv7-a/Kconfig diff --git a/libc/machine/armv7-a/Make.defs b/libc/machine/arm/armv7-a/Make.defs similarity index 93% rename from libc/machine/armv7-a/Make.defs rename to libc/machine/arm/armv7-a/Make.defs index affc2fc312..3a06c04999 100644 --- a/libc/machine/armv7-a/Make.defs +++ b/libc/machine/arm/armv7-a/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# libc/machine/armv7-a/Make.defs +# libc/machine/arm/armv7-a/Make.defs # # Copyright (C) 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt @@ -37,7 +37,7 @@ ifeq ($(CONFIG_ARMV7A_MEMCPY),y) ASRCS += arch_memcpy.S -DEPPATH += --dep-path machine/armv7-a/gnu -VPATH += :machine/armv7-a/gnu +DEPPATH += --dep-path machine/arm/armv7-a/gnu +VPATH += :machine/arm/armv7-a/gnu endif diff --git a/libc/machine/armv7-a/gnu/arch_memcpy.S b/libc/machine/arm/armv7-a/gnu/arch_memcpy.S similarity index 99% rename from libc/machine/armv7-a/gnu/arch_memcpy.S rename to libc/machine/arm/armv7-a/gnu/arch_memcpy.S index 278f398c2d..a2082d648f 100644 --- a/libc/machine/armv7-a/gnu/arch_memcpy.S +++ b/libc/machine/arm/armv7-a/gnu/arch_memcpy.S @@ -1,5 +1,5 @@ /************************************************************************************ - * nuttx/arch/arm/src/armv7-a/arm_memcpy.S + * libc/machine/arm/armv7-a/arm_memcpy.S * ARMv7-A optimized memcpy. * * Adapted for use with ARMv7-A and NuttX by: diff --git a/libc/machine/armv7-m/Kconfig b/libc/machine/arm/armv7-m/Kconfig similarity index 100% rename from libc/machine/armv7-m/Kconfig rename to libc/machine/arm/armv7-m/Kconfig diff --git a/libc/machine/armv7-m/Make.defs b/libc/machine/arm/armv7-m/Make.defs similarity index 93% rename from libc/machine/armv7-m/Make.defs rename to libc/machine/arm/armv7-m/Make.defs index 888799f7da..634ba38819 100644 --- a/libc/machine/armv7-m/Make.defs +++ b/libc/machine/arm/armv7-m/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# libc/machine/armv7-m/Make.defs +# libc/machine/arm/armv7-m/Make.defs # # Copyright (C) 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt @@ -37,7 +37,7 @@ ifeq ($(CONFIG_ARMV7M_MEMCPY),y) ASRCS += arch_memcpy.S -DEPPATH += --dep-path machine/armv7-m/gnu -VPATH += :machine/armv7-m/gnu +DEPPATH += --dep-path machine/arm/armv7-m/gnu +VPATH += :machine/arm/armv7-m/gnu endif diff --git a/libc/machine/armv7-m/gnu/arch_memcpy.S b/libc/machine/arm/armv7-m/gnu/arch_memcpy.S similarity index 99% rename from libc/machine/armv7-m/gnu/arch_memcpy.S rename to libc/machine/arm/armv7-m/gnu/arch_memcpy.S index a9b8505d35..584aaaf9c1 100644 --- a/libc/machine/armv7-m/gnu/arch_memcpy.S +++ b/libc/machine/arm/armv7-m/gnu/arch_memcpy.S @@ -1,5 +1,5 @@ /************************************************************************************ - * nuttx/arch/arm/src/armv7-m/gnu/up_memcpy.S + * libc/machine/arm/armv7-m/gnu/up_memcpy.S * * armv7m-optimized memcpy, contributed by Mike Smith. Apparently in the public * domain and is re-released here under the modified BSD license: diff --git a/libc/machine/armv7-r/Kconfig b/libc/machine/arm/armv7-r/Kconfig similarity index 100% rename from libc/machine/armv7-r/Kconfig rename to libc/machine/arm/armv7-r/Kconfig diff --git a/libc/machine/armv7-r/Make.defs b/libc/machine/arm/armv7-r/Make.defs similarity index 93% rename from libc/machine/armv7-r/Make.defs rename to libc/machine/arm/armv7-r/Make.defs index fe61e5ffe1..14963104cc 100644 --- a/libc/machine/armv7-r/Make.defs +++ b/libc/machine/arm/armv7-r/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# libc/machine/armv7-r/Make.defs +# libc/machine/arm/armv7-r/Make.defs # # Copyright (C) 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt @@ -37,7 +37,7 @@ ifeq ($(CONFIG_ARMV7R_MEMCPY),y) ASRCS += arch_memcpy.S -DEPPATH += --dep-path machine/armv7-r/gnu -VPATH += :machine/armv7-r/gnu +DEPPATH += --dep-path machine/arm/armv7-r/gnu +VPATH += :machine/arm/armv7-r/gnu endif diff --git a/libc/machine/armv7-r/gnu/arch_memcpy.S b/libc/machine/arm/armv7-r/gnu/arch_memcpy.S similarity index 99% rename from libc/machine/armv7-r/gnu/arch_memcpy.S rename to libc/machine/arm/armv7-r/gnu/arch_memcpy.S index 2649d6dd26..d8d3d2202e 100644 --- a/libc/machine/armv7-r/gnu/arch_memcpy.S +++ b/libc/machine/arm/armv7-r/gnu/arch_memcpy.S @@ -1,5 +1,5 @@ /************************************************************************************ - * nuttx/arch/arm/src/armv7-r/arm_memcpy.S + * libc/marchine/arm/armv7-r/arm_memcpy.S * ARMv7-R optimized memcpy. * * Adapted for use with ARMv7-R and NuttX by: diff --git a/libc/machine/armv8/Kconfig b/libc/machine/arm/armv8/Kconfig similarity index 100% rename from libc/machine/armv8/Kconfig rename to libc/machine/arm/armv8/Kconfig diff --git a/libc/machine/armv8/Make.defs b/libc/machine/arm/armv8/Make.defs similarity index 96% rename from libc/machine/armv8/Make.defs rename to libc/machine/arm/armv8/Make.defs index 078d9b1460..4339d241bc 100644 --- a/libc/machine/armv8/Make.defs +++ b/libc/machine/arm/armv8/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# libc/machine/armv8/Make.defs +# libc/machine/arm/armv8/Make.defs # # Copyright (C) 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt @@ -83,7 +83,7 @@ ifeq ($(LIBM_ARCH_TRUNC),y) CSRCS += arch_trunc.c endif -DEPPATH += --dep-path machine/armv8 -VPATH += :machine/armv8 +DEPPATH += --dep-path machine/arm/armv8 +VPATH += :machine/arm/armv8 endif # CONFIG_ARMV8_LIBM diff --git a/libc/machine/armv8/arch_ceil.c b/libc/machine/arm/armv8/arch_ceil.c similarity index 98% rename from libc/machine/armv8/arch_ceil.c rename to libc/machine/arm/armv8/arch_ceil.c index a4a584bdfd..ab951545b9 100644 --- a/libc/machine/armv8/arch_ceil.c +++ b/libc/machine/arm/armv8/arch_ceil.c @@ -1,5 +1,5 @@ /**************************************************************************** - * libc/machine/armv8/arch_ceil.c + * libc/machine/arm/armv8/arch_ceil.c * * Copyright (C) 2017 Gregory Nutt. All rights reserved. * diff --git a/libc/machine/armv8/arch_ceilf.c b/libc/machine/arm/armv8/arch_ceilf.c similarity index 98% rename from libc/machine/armv8/arch_ceilf.c rename to libc/machine/arm/armv8/arch_ceilf.c index 44d246354b..8763e7104b 100644 --- a/libc/machine/armv8/arch_ceilf.c +++ b/libc/machine/arm/armv8/arch_ceilf.c @@ -1,5 +1,5 @@ /**************************************************************************** - * libc/machine/armv8/arch_ceilf.c + * libc/machine/arm/armv8/arch_ceilf.c * * Copyright (C) 2017 Gregory Nutt. All rights reserved. * diff --git a/libc/machine/armv8/arch_floor.c b/libc/machine/arm/armv8/arch_floor.c similarity index 98% rename from libc/machine/armv8/arch_floor.c rename to libc/machine/arm/armv8/arch_floor.c index a1278dc98f..ac3afdd494 100644 --- a/libc/machine/armv8/arch_floor.c +++ b/libc/machine/arm/armv8/arch_floor.c @@ -1,5 +1,5 @@ /**************************************************************************** - * libc/machine/armv8/arch_floor.c + * libc/machine/arm/armv8/arch_floor.c * * Copyright (C) 2017 Gregory Nutt. All rights reserved. * diff --git a/libc/machine/armv8/arch_floorf.c b/libc/machine/arm/armv8/arch_floorf.c similarity index 98% rename from libc/machine/armv8/arch_floorf.c rename to libc/machine/arm/armv8/arch_floorf.c index 1c76571042..0172bffee8 100644 --- a/libc/machine/armv8/arch_floorf.c +++ b/libc/machine/arm/armv8/arch_floorf.c @@ -1,5 +1,5 @@ /**************************************************************************** - * libc/machine/armv8/arch_floorf.c + * libc/machine/arm/armv8/arch_floorf.c * * Copyright (C) 2017 Gregory Nutt. All rights reserved. * diff --git a/libc/machine/armv8/arch_nearbyint.c b/libc/machine/arm/armv8/arch_nearbyint.c similarity index 98% rename from libc/machine/armv8/arch_nearbyint.c rename to libc/machine/arm/armv8/arch_nearbyint.c index ca8df7fe4f..8345d7de1e 100644 --- a/libc/machine/armv8/arch_nearbyint.c +++ b/libc/machine/arm/armv8/arch_nearbyint.c @@ -1,5 +1,5 @@ /**************************************************************************** - * libc/machine/armv8/arch_nearbyint.c + * libc/machine/arm/armv8/arch_nearbyint.c * * Copyright (C) 2017 Gregory Nutt. All rights reserved. * diff --git a/libc/machine/armv8/arch_nearbyintf.c b/libc/machine/arm/armv8/arch_nearbyintf.c similarity index 98% rename from libc/machine/armv8/arch_nearbyintf.c rename to libc/machine/arm/armv8/arch_nearbyintf.c index 3a2b2d1e07..a2a1d2d77f 100644 --- a/libc/machine/armv8/arch_nearbyintf.c +++ b/libc/machine/arm/armv8/arch_nearbyintf.c @@ -1,5 +1,5 @@ /**************************************************************************** - * libc/machine/armv8/arch_nearbyintf.c + * libc/machine/arm/armv8/arch_nearbyintf.c * * Copyright (C) 2017 Gregory Nutt. All rights reserved. * diff --git a/libc/machine/armv8/arch_rint.c b/libc/machine/arm/armv8/arch_rint.c similarity index 98% rename from libc/machine/armv8/arch_rint.c rename to libc/machine/arm/armv8/arch_rint.c index 27bebb60a5..6b1223e6c0 100644 --- a/libc/machine/armv8/arch_rint.c +++ b/libc/machine/arm/armv8/arch_rint.c @@ -1,5 +1,5 @@ /**************************************************************************** - * libc/machine/armv8/arch_rint.c + * libc/machine/arm/armv8/arch_rint.c * * Copyright (C) 2017 Gregory Nutt. All rights reserved. * diff --git a/libc/machine/armv8/arch_rintf.c b/libc/machine/arm/armv8/arch_rintf.c similarity index 98% rename from libc/machine/armv8/arch_rintf.c rename to libc/machine/arm/armv8/arch_rintf.c index e17c1e8e58..e6d73a2185 100644 --- a/libc/machine/armv8/arch_rintf.c +++ b/libc/machine/arm/armv8/arch_rintf.c @@ -1,5 +1,5 @@ /**************************************************************************** - * libc/machine/armv8/arch_rintf.c + * libc/machine/arm/armv8/arch_rintf.c * * Copyright (C) 2017 Gregory Nutt. All rights reserved. * diff --git a/libc/machine/armv8/arch_round.c b/libc/machine/arm/armv8/arch_round.c similarity index 98% rename from libc/machine/armv8/arch_round.c rename to libc/machine/arm/armv8/arch_round.c index 07bcd8e333..e4efa0a27b 100644 --- a/libc/machine/armv8/arch_round.c +++ b/libc/machine/arm/armv8/arch_round.c @@ -1,5 +1,5 @@ /**************************************************************************** - * libc/machine/armv8/arch_round.c + * libc/machine/arm/armv8/arch_round.c * * Copyright (C) 2017 Gregory Nutt. All rights reserved. * diff --git a/libc/machine/armv8/arch_roundf.c b/libc/machine/arm/armv8/arch_roundf.c similarity index 98% rename from libc/machine/armv8/arch_roundf.c rename to libc/machine/arm/armv8/arch_roundf.c index 382ffb1682..53b7571c58 100644 --- a/libc/machine/armv8/arch_roundf.c +++ b/libc/machine/arm/armv8/arch_roundf.c @@ -1,5 +1,5 @@ /**************************************************************************** - * libc/machine/armv8/arch_roundf.c + * libc/machine/arm/armv8/arch_roundf.c * * Copyright (C) 2017 Gregory Nutt. All rights reserved. * diff --git a/libc/machine/armv8/arch_trunc.c b/libc/machine/arm/armv8/arch_trunc.c similarity index 98% rename from libc/machine/armv8/arch_trunc.c rename to libc/machine/arm/armv8/arch_trunc.c index b482c0a1a3..e8a16d4c6f 100644 --- a/libc/machine/armv8/arch_trunc.c +++ b/libc/machine/arm/armv8/arch_trunc.c @@ -1,5 +1,5 @@ /**************************************************************************** - * libc/machine/armv8/arch_trunc.c + * libc/machine/arm/armv8/arch_trunc.c * * Copyright (C) 2017 Gregory Nutt. All rights reserved. * diff --git a/libc/machine/armv8/arch_truncf.c b/libc/machine/arm/armv8/arch_truncf.c similarity index 98% rename from libc/machine/armv8/arch_truncf.c rename to libc/machine/arm/armv8/arch_truncf.c index 4f5246ced3..02f3d581d2 100644 --- a/libc/machine/armv8/arch_truncf.c +++ b/libc/machine/arm/armv8/arch_truncf.c @@ -1,5 +1,5 @@ /**************************************************************************** - * libc/machine/armv8/arch_truncf.c + * libc/machine/arm/armv8/arch_truncf.c * * Copyright (C) 2017 Gregory Nutt. All rights reserved. *