From d42b6cbb971e60a789d3ee1ebf1ce35ccbcb1374 Mon Sep 17 00:00:00 2001 From: Juha Niskanen Date: Mon, 18 Jun 2018 07:14:52 -0600 Subject: [PATCH] arch/arm/src/stm32l4: STM32L4 has fetchadd and testset --- arch/arm/Kconfig | 3 ++- arch/arm/src/armv7-m/gnu/up_fetchadd.S | 12 ++++++------ arch/arm/src/armv7-m/iar/up_fetchadd.S | 12 ++++++------ arch/arm/src/stm32l4/Make.defs | 2 +- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index ec7e92a044..fc42218248 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -340,9 +340,10 @@ config ARCH_CHIP_STM32L4 bool "STMicro STM32 L4" select ARCH_CORTEXM4 select ARCH_HAVE_CMNVECTOR + select ARCH_HAVE_MPU + select ARCH_HAVE_FETCHADD select ARCH_HAVE_I2CRESET select ARCH_HAVE_HEAPCHECK - select ARCH_HAVE_MPU select ARCH_HAVE_PROGMEM select ARCH_HAVE_SPI_BITORDER select ARCH_HAVE_TICKLESS diff --git a/arch/arm/src/armv7-m/gnu/up_fetchadd.S b/arch/arm/src/armv7-m/gnu/up_fetchadd.S index 143c38e516..2d3c6b32b7 100644 --- a/arch/arm/src/armv7-m/gnu/up_fetchadd.S +++ b/arch/arm/src/armv7-m/gnu/up_fetchadd.S @@ -76,7 +76,7 @@ up_fetchadd32: add r2, r2, r1 /* Add the addend */ strex r3, r2, [r0] /* Attempt to save the result */ - teq r3, #0 /* r2 will be 1 is strex failed */ + teq r3, #0 /* r3 will be 1 if strex failed */ bne 1b /* Failed to lock... try again */ mov r0, r2 /* Return the incremented value */ @@ -110,7 +110,7 @@ up_fetchsub32: sub r2, r2, r1 /* Subtract the subtrahend */ strex r3, r2, [r0] /* Attempt to save the result */ - teq r3, #0 /* r2 will be 1 is strex failed */ + teq r3, #0 /* r3 will be 1 if strex failed */ bne 1b /* Failed to lock... try again */ mov r0, r2 /* Return the decremented value */ @@ -144,7 +144,7 @@ up_fetchadd16: add r2, r2, r1 /* Add the addend */ strexh r3, r2, [r0] /* Attempt to save the result */ - teq r3, #0 /* r2 will be 1 is strexh failed */ + teq r3, #0 /* r3 will be 1 if strexh failed */ bne 1b /* Failed to lock... try again */ mov r0, r2 /* Return the incremented value */ @@ -180,7 +180,7 @@ up_fetchsub16: /* Attempt to save the decremented value */ strexh r3, r2, [r0] /* Attempt to save the result */ - teq r3, #0 /* r2 will be 1 is strexh failed */ + teq r3, #0 /* r3 will be 1 if strexh failed */ bne 1b /* Failed to lock... try again */ mov r0, r2 /* Return the decremented value */ @@ -214,7 +214,7 @@ up_fetchadd8: add r2, r2, r1 /* Add the addend */ strexb r3, r2, [r0] /* Attempt to save the result */ - teq r3, #0 /* r2 will be 1 is strexb failed */ + teq r3, #0 /* r3 will be 1 if strexb failed */ bne 1b /* Failed to lock... try again */ mov r0, r2 /* Return the incremented value */ @@ -248,7 +248,7 @@ up_fetchsub8: sub r2, r2, r1 /* Subtract the subtrahend */ strexb r3, r2, [r0] /* Attempt to save the result */ - teq r3, #0 /* r2 will be 1 is strexb failed */ + teq r3, #0 /* r3 will be 1 if strexb failed */ bne 1b /* Failed to lock... try again */ mov r0, r2 /* Return the decremented value */ diff --git a/arch/arm/src/armv7-m/iar/up_fetchadd.S b/arch/arm/src/armv7-m/iar/up_fetchadd.S index f5db1837f6..21d52bfb94 100644 --- a/arch/arm/src/armv7-m/iar/up_fetchadd.S +++ b/arch/arm/src/armv7-m/iar/up_fetchadd.S @@ -82,7 +82,7 @@ up_fetchadd32: add r2, r2, r1 /* Add the addend */ strex r3, r2, [r0] /* Attempt to save the result */ - teq r3, #0 /* r2 will be 1 is strex failed */ + teq r3, #0 /* r3 will be 1 if strex failed */ bne up_fetchadd32 /* Failed to lock... try again */ mov r0, r2 /* Return the incremented value */ @@ -111,7 +111,7 @@ up_fetchsub32: sub r2, r2, r1 /* Subtract the subtrahend */ strex r3, r2, [r0] /* Attempt to save the result */ - teq r3, #0 /* r2 will be 1 is strex failed */ + teq r3, #0 /* r3 will be 1 if strex failed */ bne up_fetchsub32 /* Failed to lock... try again */ mov r0, r2 /* Return the decremented value */ @@ -140,7 +140,7 @@ up_fetchadd16: add r2, r2, r1 /* Add the addend */ strexh r3, r2, [r0] /* Attempt to save the result */ - teq r3, #0 /* r2 will be 1 is strexh failed */ + teq r3, #0 /* r3 will be 1 if strexh failed */ bne up_fetchadd16 /* Failed to lock... try again */ mov r0, r2 /* Return the incremented value */ @@ -171,7 +171,7 @@ up_fetchsub16: /* Attempt to save the decremented value */ strexh r3, r2, [r0] /* Attempt to save the result */ - teq r3, #0 /* r2 will be 1 is strexh failed */ + teq r3, #0 /* r3 will be 1 if strexh failed */ bne up_fetchsub16 /* Failed to lock... try again */ mov r0, r2 /* Return the decremented value */ @@ -200,7 +200,7 @@ up_fetchadd8: add r2, r2, r1 /* Add the addend */ strexb r3, r2, [r0] /* Attempt to save the result */ - teq r3, #0 /* r2 will be 1 is strexb failed */ + teq r3, #0 /* r3 will be 1 if strexb failed */ bne up_fetchadd8 /* Failed to lock... try again */ mov r0, r2 /* Return the incremented value */ @@ -229,7 +229,7 @@ up_fetchsub8: sub r2, r2, r1 /* Subtract the subtrahend */ strexb r3, r2, [r0] /* Attempt to save the result */ - teq r3, #0 /* r2 will be 1 is strexb failed */ + teq r3, #0 /* r3 will be 1 if strexb failed */ bne up_fetchsub8 /* Failed to lock... try again */ mov r0, r2 /* Return the decremented value */ diff --git a/arch/arm/src/stm32l4/Make.defs b/arch/arm/src/stm32l4/Make.defs index d48e13b1ae..8459f96310 100644 --- a/arch/arm/src/stm32l4/Make.defs +++ b/arch/arm/src/stm32l4/Make.defs @@ -45,7 +45,7 @@ CMN_UASRCS = CMN_UCSRCS = CMN_ASRCS = up_saveusercontext.S up_fullcontextrestore.S up_switchcontext.S -CMN_ASRCS += vfork.S +CMN_ASRCS += up_testset.S up_fetchadd.S vfork.S CMN_CSRCS = up_assert.c up_blocktask.c up_copyfullstate.c CMN_CSRCS += up_createstack.c up_mdelay.c up_udelay.c up_exit.c