|
|
@@ -2,7 +2,7 @@
|
|
|
* @file cmsis_gcc.h
|
|
|
* @brief CMSIS Cortex-M Core Function/Instruction Header File
|
|
|
* @version V5.00
|
|
|
- * @date 07. September 2016
|
|
|
+ * @date 13. September 2016
|
|
|
******************************************************************************/
|
|
|
/*
|
|
|
* Copyright (c) 2009-2016 ARM Limited. All rights reserved.
|
|
|
@@ -104,7 +104,7 @@ __attribute__((always_inline)) __STATIC_INLINE uint32_t __get_CONTROL(void)
|
|
|
}
|
|
|
|
|
|
|
|
|
-#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3U))
|
|
|
+#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
|
|
|
/**
|
|
|
\brief Get Control Register (non-secure)
|
|
|
\details Returns the content of the non-secure Control Register when in secure mode.
|
|
|
@@ -125,19 +125,19 @@ __attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_CONTROL_NS(void
|
|
|
\details Writes the given value to the Control Register.
|
|
|
\param [in] control Control Register value to set
|
|
|
*/
|
|
|
-__attribute__((always_inline)) __STATIC_INLINE void __set_CONTROL(uint32_t const control)
|
|
|
+__attribute__((always_inline)) __STATIC_INLINE void __set_CONTROL(uint32_t control)
|
|
|
{
|
|
|
__ASM volatile ("MSR control, %0" : : "r" (control) : "memory");
|
|
|
}
|
|
|
|
|
|
|
|
|
-#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3U))
|
|
|
+#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
|
|
|
/**
|
|
|
\brief Set Control Register (non-secure)
|
|
|
\details Writes the given value to the non-secure Control Register when in secure state.
|
|
|
\param [in] control Control Register value to set
|
|
|
*/
|
|
|
-__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_CONTROL_NS(uint32_t const control)
|
|
|
+__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_CONTROL_NS(uint32_t control)
|
|
|
{
|
|
|
__ASM volatile ("MSR control_ns, %0" : : "r" (control) : "memory");
|
|
|
}
|
|
|
@@ -200,7 +200,7 @@ __attribute__((always_inline)) __STATIC_INLINE uint32_t __get_PSP(void)
|
|
|
}
|
|
|
|
|
|
|
|
|
-#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3U))
|
|
|
+#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
|
|
|
/**
|
|
|
\brief Get Process Stack Pointer (non-secure)
|
|
|
\details Returns the current value of the non-secure Process Stack Pointer (PSP) when in secure state.
|
|
|
@@ -221,19 +221,19 @@ __attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_PSP_NS(void)
|
|
|
\details Assigns the given value to the Process Stack Pointer (PSP).
|
|
|
\param [in] topOfProcStack Process Stack Pointer value to set
|
|
|
*/
|
|
|
-__attribute__((always_inline)) __STATIC_INLINE void __set_PSP(uint32_t const topOfProcStack)
|
|
|
+__attribute__((always_inline)) __STATIC_INLINE void __set_PSP(uint32_t topOfProcStack)
|
|
|
{
|
|
|
__ASM volatile ("MSR psp, %0" : : "r" (topOfProcStack) : "sp");
|
|
|
}
|
|
|
|
|
|
|
|
|
-#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3U))
|
|
|
+#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
|
|
|
/**
|
|
|
\brief Set Process Stack Pointer (non-secure)
|
|
|
\details Assigns the given value to the non-secure Process Stack Pointer (PSP) when in secure state.
|
|
|
\param [in] topOfProcStack Process Stack Pointer value to set
|
|
|
*/
|
|
|
-__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_PSP_NS(uint32_t const topOfProcStack)
|
|
|
+__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_PSP_NS(uint32_t topOfProcStack)
|
|
|
{
|
|
|
__ASM volatile ("MSR psp_ns, %0" : : "r" (topOfProcStack) : "sp");
|
|
|
}
|
|
|
@@ -254,7 +254,7 @@ __attribute__((always_inline)) __STATIC_INLINE uint32_t __get_MSP(void)
|
|
|
}
|
|
|
|
|
|
|
|
|
-#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3U))
|
|
|
+#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
|
|
|
/**
|
|
|
\brief Get Main Stack Pointer (non-secure)
|
|
|
\details Returns the current value of the non-secure Main Stack Pointer (MSP) when in secure state.
|
|
|
@@ -275,19 +275,19 @@ __attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_MSP_NS(void)
|
|
|
\details Assigns the given value to the Main Stack Pointer (MSP).
|
|
|
\param [in] topOfMainStack Main Stack Pointer value to set
|
|
|
*/
|
|
|
-__attribute__((always_inline)) __STATIC_INLINE void __set_MSP(uint32_t const topOfMainStack)
|
|
|
+__attribute__((always_inline)) __STATIC_INLINE void __set_MSP(uint32_t topOfMainStack)
|
|
|
{
|
|
|
__ASM volatile ("MSR msp, %0" : : "r" (topOfMainStack) : "sp");
|
|
|
}
|
|
|
|
|
|
|
|
|
-#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3U))
|
|
|
+#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
|
|
|
/**
|
|
|
\brief Set Main Stack Pointer (non-secure)
|
|
|
\details Assigns the given value to the non-secure Main Stack Pointer (MSP) when in secure state.
|
|
|
\param [in] topOfMainStack Main Stack Pointer value to set
|
|
|
*/
|
|
|
-__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_MSP_NS(uint32_t const topOfMainStack)
|
|
|
+__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_MSP_NS(uint32_t topOfMainStack)
|
|
|
{
|
|
|
__ASM volatile ("MSR msp_ns, %0" : : "r" (topOfMainStack) : "sp");
|
|
|
}
|
|
|
@@ -308,7 +308,7 @@ __attribute__((always_inline)) __STATIC_INLINE uint32_t __get_PRIMASK(void)
|
|
|
}
|
|
|
|
|
|
|
|
|
-#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3U))
|
|
|
+#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
|
|
|
/**
|
|
|
\brief Get Priority Mask (non-secure)
|
|
|
\details Returns the current state of the non-secure priority mask bit from the Priority Mask Register when in secure state.
|
|
|
@@ -329,28 +329,28 @@ __attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_PRIMASK_NS(void
|
|
|
\details Assigns the given value to the Priority Mask Register.
|
|
|
\param [in] priMask Priority Mask
|
|
|
*/
|
|
|
-__attribute__((always_inline)) __STATIC_INLINE void __set_PRIMASK(uint32_t const priMask)
|
|
|
+__attribute__((always_inline)) __STATIC_INLINE void __set_PRIMASK(uint32_t priMask)
|
|
|
{
|
|
|
__ASM volatile ("MSR primask, %0" : : "r" (priMask) : "memory");
|
|
|
}
|
|
|
|
|
|
|
|
|
-#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3U))
|
|
|
+#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
|
|
|
/**
|
|
|
\brief Set Priority Mask (non-secure)
|
|
|
\details Assigns the given value to the non-secure Priority Mask Register when in secure state.
|
|
|
\param [in] priMask Priority Mask
|
|
|
*/
|
|
|
-__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_PRIMASK_NS(uint32_t const priMask)
|
|
|
+__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_PRIMASK_NS(uint32_t priMask)
|
|
|
{
|
|
|
__ASM volatile ("MSR primask_ns, %0" : : "r" (priMask) : "memory");
|
|
|
}
|
|
|
#endif
|
|
|
|
|
|
|
|
|
-#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1U)) || \
|
|
|
- (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1U)) || \
|
|
|
- (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1U)) )
|
|
|
+#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \
|
|
|
+ (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \
|
|
|
+ (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) )
|
|
|
/**
|
|
|
\brief Enable FIQ
|
|
|
\details Enables FIQ interrupts by clearing the F-bit in the CPSR.
|
|
|
@@ -387,7 +387,7 @@ __attribute__((always_inline)) __STATIC_INLINE uint32_t __get_BASEPRI(void)
|
|
|
}
|
|
|
|
|
|
|
|
|
-#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3U))
|
|
|
+#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
|
|
|
/**
|
|
|
\brief Get Base Priority (non-secure)
|
|
|
\details Returns the current value of the non-secure Base Priority register when in secure state.
|
|
|
@@ -408,19 +408,19 @@ __attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_BASEPRI_NS(void
|
|
|
\details Assigns the given value to the Base Priority register.
|
|
|
\param [in] basePri Base Priority value to set
|
|
|
*/
|
|
|
-__attribute__((always_inline)) __STATIC_INLINE void __set_BASEPRI(uint32_t const basePri)
|
|
|
+__attribute__((always_inline)) __STATIC_INLINE void __set_BASEPRI(uint32_t basePri)
|
|
|
{
|
|
|
__ASM volatile ("MSR basepri, %0" : : "r" (basePri) : "memory");
|
|
|
}
|
|
|
|
|
|
|
|
|
-#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3U))
|
|
|
+#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
|
|
|
/**
|
|
|
\brief Set Base Priority (non-secure)
|
|
|
\details Assigns the given value to the non-secure Base Priority register when in secure state.
|
|
|
\param [in] basePri Base Priority value to set
|
|
|
*/
|
|
|
-__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_BASEPRI_NS(uint32_t const basePri)
|
|
|
+__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_BASEPRI_NS(uint32_t basePri)
|
|
|
{
|
|
|
__ASM volatile ("MSR basepri_ns, %0" : : "r" (basePri) : "memory");
|
|
|
}
|
|
|
@@ -433,7 +433,7 @@ __attribute__((always_inline)) __STATIC_INLINE void __TZ_set_BASEPRI_NS(uint32_t
|
|
|
or the new value increases the BASEPRI priority level.
|
|
|
\param [in] basePri Base Priority value to set
|
|
|
*/
|
|
|
-__attribute__((always_inline)) __STATIC_INLINE void __set_BASEPRI_MAX(uint32_t const basePri)
|
|
|
+__attribute__((always_inline)) __STATIC_INLINE void __set_BASEPRI_MAX(uint32_t basePri)
|
|
|
{
|
|
|
__ASM volatile ("MSR basepri_max, %0" : : "r" (basePri) : "memory");
|
|
|
}
|
|
|
@@ -453,7 +453,7 @@ __attribute__((always_inline)) __STATIC_INLINE uint32_t __get_FAULTMASK(void)
|
|
|
}
|
|
|
|
|
|
|
|
|
-#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3U))
|
|
|
+#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
|
|
|
/**
|
|
|
\brief Get Fault Mask (non-secure)
|
|
|
\details Returns the current value of the non-secure Fault Mask register when in secure state.
|
|
|
@@ -474,30 +474,31 @@ __attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_FAULTMASK_NS(vo
|
|
|
\details Assigns the given value to the Fault Mask register.
|
|
|
\param [in] faultMask Fault Mask value to set
|
|
|
*/
|
|
|
-__attribute__((always_inline)) __STATIC_INLINE void __set_FAULTMASK(uint32_t const faultMask)
|
|
|
+__attribute__((always_inline)) __STATIC_INLINE void __set_FAULTMASK(uint32_t faultMask)
|
|
|
{
|
|
|
__ASM volatile ("MSR faultmask, %0" : : "r" (faultMask) : "memory");
|
|
|
}
|
|
|
|
|
|
|
|
|
-#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3U))
|
|
|
+#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
|
|
|
/**
|
|
|
\brief Set Fault Mask (non-secure)
|
|
|
\details Assigns the given value to the non-secure Fault Mask register when in secure state.
|
|
|
\param [in] faultMask Fault Mask value to set
|
|
|
*/
|
|
|
-__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_FAULTMASK_NS(uint32_t const faultMask)
|
|
|
+__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_FAULTMASK_NS(uint32_t faultMask)
|
|
|
{
|
|
|
__ASM volatile ("MSR faultmask_ns, %0" : : "r" (faultMask) : "memory");
|
|
|
}
|
|
|
#endif
|
|
|
|
|
|
-#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1U)) || \
|
|
|
- (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1U)) || \
|
|
|
- (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1U)) ) */
|
|
|
+#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \
|
|
|
+ (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \
|
|
|
+ (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */
|
|
|
|
|
|
|
|
|
-#if ((__ARM_ARCH_8M_MAIN__ == 1U) || (__ARM_ARCH_8M_BASE__ == 1U))
|
|
|
+#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1U)) || \
|
|
|
+ (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1U)) )
|
|
|
|
|
|
/**
|
|
|
\brief Get Process Stack Pointer Limit
|
|
|
@@ -513,8 +514,8 @@ __attribute__((always_inline)) __STATIC_INLINE uint32_t __get_PSPLIM(void)
|
|
|
}
|
|
|
|
|
|
|
|
|
-#if ((defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3U)) && \
|
|
|
- (defined (__ARM_ARCH_8M_MAIN__) && (__ARM_ARCH_8M_MAIN__ == 1U)) )
|
|
|
+#if ((defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) && \
|
|
|
+ (defined (__ARM_ARCH_8M_MAIN__) && (__ARM_ARCH_8M_MAIN__ == 1)) )
|
|
|
/**
|
|
|
\brief Get Process Stack Pointer Limit (non-secure)
|
|
|
\details Returns the current value of the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state.
|
|
|
@@ -535,20 +536,20 @@ __attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_PSPLIM_NS(void)
|
|
|
\details Assigns the given value to the Process Stack Pointer Limit (PSPLIM).
|
|
|
\param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set
|
|
|
*/
|
|
|
-__attribute__((always_inline)) __STATIC_INLINE void __set_PSPLIM(uint32_t const ProcStackPtrLimit)
|
|
|
+__attribute__((always_inline)) __STATIC_INLINE void __set_PSPLIM(uint32_t ProcStackPtrLimit)
|
|
|
{
|
|
|
__ASM volatile ("MSR psplim, %0" : : "r" (ProcStackPtrLimit));
|
|
|
}
|
|
|
|
|
|
|
|
|
-#if ((defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3U)) && \
|
|
|
- (defined (__ARM_ARCH_8M_MAIN__) && (__ARM_ARCH_8M_MAIN__ == 1U)) )
|
|
|
+#if ((defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) && \
|
|
|
+ (defined (__ARM_ARCH_8M_MAIN__) && (__ARM_ARCH_8M_MAIN__ == 1)) )
|
|
|
/**
|
|
|
\brief Set Process Stack Pointer (non-secure)
|
|
|
\details Assigns the given value to the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state.
|
|
|
\param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set
|
|
|
*/
|
|
|
-__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_PSPLIM_NS(uint32_t const ProcStackPtrLimit)
|
|
|
+__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_PSPLIM_NS(uint32_t ProcStackPtrLimit)
|
|
|
{
|
|
|
__ASM volatile ("MSR psplim_ns, %0\n" : : "r" (ProcStackPtrLimit));
|
|
|
}
|
|
|
@@ -570,8 +571,8 @@ __attribute__((always_inline)) __STATIC_INLINE uint32_t __get_MSPLIM(void)
|
|
|
}
|
|
|
|
|
|
|
|
|
-#if ((defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3U)) && \
|
|
|
- (defined (__ARM_ARCH_8M_MAIN__) && (__ARM_ARCH_8M_MAIN__ == 1U)) )
|
|
|
+#if ((defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) && \
|
|
|
+ (defined (__ARM_ARCH_8M_MAIN__) && (__ARM_ARCH_8M_MAIN__ == 1)) )
|
|
|
/**
|
|
|
\brief Get Main Stack Pointer Limit (non-secure)
|
|
|
\details Returns the current value of the non-secure Main Stack Pointer Limit(MSPLIM) when in secure state.
|
|
|
@@ -592,30 +593,31 @@ __attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_MSPLIM_NS(void)
|
|
|
\details Assigns the given value to the Main Stack Pointer Limit (MSPLIM).
|
|
|
\param [in] MainStackPtrLimit Main Stack Pointer Limit value to set
|
|
|
*/
|
|
|
-__attribute__((always_inline)) __STATIC_INLINE void __set_MSPLIM(uint32_t const MainStackPtrLimit)
|
|
|
+__attribute__((always_inline)) __STATIC_INLINE void __set_MSPLIM(uint32_t MainStackPtrLimit)
|
|
|
{
|
|
|
__ASM volatile ("MSR msplim, %0" : : "r" (MainStackPtrLimit));
|
|
|
}
|
|
|
|
|
|
|
|
|
-#if ((defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3U)) && \
|
|
|
- (defined (__ARM_ARCH_8M_MAIN__) && (__ARM_ARCH_8M_MAIN__ == 1U)) )
|
|
|
+#if ((defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) && \
|
|
|
+ (defined (__ARM_ARCH_8M_MAIN__) && (__ARM_ARCH_8M_MAIN__ == 1)) )
|
|
|
/**
|
|
|
\brief Set Main Stack Pointer Limit (non-secure)
|
|
|
\details Assigns the given value to the non-secure Main Stack Pointer Limit (MSPLIM) when in secure state.
|
|
|
\param [in] MainStackPtrLimit Main Stack Pointer value to set
|
|
|
*/
|
|
|
-__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_MSPLIM_NS(uint32_t const MainStackPtrLimit)
|
|
|
+__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_MSPLIM_NS(uint32_t MainStackPtrLimit)
|
|
|
{
|
|
|
__ASM volatile ("MSR msplim_ns, %0" : : "r" (MainStackPtrLimit));
|
|
|
}
|
|
|
#endif
|
|
|
|
|
|
-#endif /* ((__ARM_ARCH_8M_MAIN__ == 1U) || (__ARM_ARCH_8M_BASE__ == 1U)) */
|
|
|
+#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1U)) || \
|
|
|
+ (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1U)) ) */
|
|
|
|
|
|
|
|
|
-#if ((defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1U)) || \
|
|
|
- (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1U)) )
|
|
|
+#if ((defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \
|
|
|
+ (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) )
|
|
|
|
|
|
/**
|
|
|
\brief Get FPSCR
|
|
|
@@ -643,7 +645,7 @@ __attribute__((always_inline)) __STATIC_INLINE uint32_t __get_FPSCR(void)
|
|
|
\details Assigns the given value to the Floating Point Status/Control register.
|
|
|
\param [in] fpscr Floating Point Status/Control value to set
|
|
|
*/
|
|
|
-__attribute__((always_inline)) __STATIC_INLINE void __set_FPSCR(uint32_t const fpscr)
|
|
|
+__attribute__((always_inline)) __STATIC_INLINE void __set_FPSCR(uint32_t fpscr)
|
|
|
{
|
|
|
#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \
|
|
|
(defined (__FPU_USED ) && (__FPU_USED == 1U)) )
|
|
|
@@ -653,7 +655,8 @@ __attribute__((always_inline)) __STATIC_INLINE void __set_FPSCR(uint32_t const f
|
|
|
#endif
|
|
|
}
|
|
|
|
|
|
-#endif /* ((__ARM_ARCH_7EM__ == 1U) || (__ARM_ARCH_8M_MAIN__ == 1U)) */
|
|
|
+#endif /* ((defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \
|
|
|
+ (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */
|
|
|
|
|
|
|
|
|
|
|
|
@@ -780,7 +783,7 @@ __attribute__((always_inline)) __STATIC_INLINE uint32_t __REV(uint32_t value)
|
|
|
\param [in] value Value to reverse
|
|
|
\return Reversed value
|
|
|
*/
|
|
|
-__attribute__((always_inline)) __STATIC_INLINE uint32_t __REV16(uint32_t const value)
|
|
|
+__attribute__((always_inline)) __STATIC_INLINE uint32_t __REV16(uint32_t value)
|
|
|
{
|
|
|
uint32_t result;
|
|
|
|
|
|
@@ -795,7 +798,7 @@ __attribute__((always_inline)) __STATIC_INLINE uint32_t __REV16(uint32_t const v
|
|
|
\param [in] value Value to reverse
|
|
|
\return Reversed value
|
|
|
*/
|
|
|
-__attribute__((always_inline)) __STATIC_INLINE int32_t __REVSH(int32_t const value)
|
|
|
+__attribute__((always_inline)) __STATIC_INLINE int32_t __REVSH(int32_t value)
|
|
|
{
|
|
|
#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)
|
|
|
return (short)__builtin_bswap16(value);
|
|
|
@@ -815,7 +818,7 @@ __attribute__((always_inline)) __STATIC_INLINE int32_t __REVSH(int32_t const val
|
|
|
\param [in] op2 Number of Bits to rotate
|
|
|
\return Rotated value
|
|
|
*/
|
|
|
-__attribute__((always_inline)) __STATIC_INLINE uint32_t __ROR(uint32_t const op1, uint32_t const op2)
|
|
|
+__attribute__((always_inline)) __STATIC_INLINE uint32_t __ROR(uint32_t op1, uint32_t op2)
|
|
|
{
|
|
|
return (op1 >> op2) | (op1 << (32U - op2));
|
|
|
}
|
|
|
@@ -841,12 +844,12 @@ __attribute__((always_inline)) __STATIC_INLINE uint32_t __RBIT(uint32_t value)
|
|
|
{
|
|
|
uint32_t result;
|
|
|
|
|
|
-#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1U)) || \
|
|
|
- (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1U)) || \
|
|
|
- (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1U)) )
|
|
|
+#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \
|
|
|
+ (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \
|
|
|
+ (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) )
|
|
|
__ASM volatile ("rbit %0, %1" : "=r" (result) : "r" (value) );
|
|
|
#else
|
|
|
- int32_t s = 4 /*sizeof(v)*/ * 8 - 1; /* extra shift needed at end */
|
|
|
+ int32_t s = (4 /*sizeof(v)*/ * 8) - 1; /* extra shift needed at end */
|
|
|
|
|
|
result = value; /* r will be reversed bits of v; first get LSB of v */
|
|
|
for (value >>= 1U; value; value >>= 1U)
|
|
|
@@ -870,10 +873,10 @@ __attribute__((always_inline)) __STATIC_INLINE uint32_t __RBIT(uint32_t value)
|
|
|
#define __CLZ __builtin_clz
|
|
|
|
|
|
|
|
|
-#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1U)) || \
|
|
|
- (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1U)) || \
|
|
|
- (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1U)) || \
|
|
|
- (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1U)) )
|
|
|
+#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \
|
|
|
+ (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \
|
|
|
+ (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \
|
|
|
+ (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) )
|
|
|
/**
|
|
|
\brief LDR Exclusive (8 bit)
|
|
|
\details Executes a exclusive LDR instruction for 8 bit value.
|
|
|
@@ -1031,7 +1034,7 @@ __attribute__((always_inline)) __STATIC_INLINE void __CLREX(void)
|
|
|
\param [in] value Value to rotate
|
|
|
\return Rotated value
|
|
|
*/
|
|
|
-__attribute__((always_inline)) __STATIC_INLINE uint32_t __RRX(uint32_t const value)
|
|
|
+__attribute__((always_inline)) __STATIC_INLINE uint32_t __RRX(uint32_t value)
|
|
|
{
|
|
|
uint32_t result;
|
|
|
|
|
|
@@ -1105,7 +1108,7 @@ __attribute__((always_inline)) __STATIC_INLINE uint32_t __LDRT(volatile uint32_t
|
|
|
\param [in] value Value to store
|
|
|
\param [in] ptr Pointer to location
|
|
|
*/
|
|
|
-__attribute__((always_inline)) __STATIC_INLINE void __STRBT(uint8_t const value, volatile uint8_t *ptr)
|
|
|
+__attribute__((always_inline)) __STATIC_INLINE void __STRBT(uint8_t value, volatile uint8_t *ptr)
|
|
|
{
|
|
|
__ASM volatile ("strbt %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) );
|
|
|
}
|
|
|
@@ -1117,7 +1120,7 @@ __attribute__((always_inline)) __STATIC_INLINE void __STRBT(uint8_t const value,
|
|
|
\param [in] value Value to store
|
|
|
\param [in] ptr Pointer to location
|
|
|
*/
|
|
|
-__attribute__((always_inline)) __STATIC_INLINE void __STRHT(uint16_t const value, volatile uint16_t *ptr)
|
|
|
+__attribute__((always_inline)) __STATIC_INLINE void __STRHT(uint16_t value, volatile uint16_t *ptr)
|
|
|
{
|
|
|
__ASM volatile ("strht %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) );
|
|
|
}
|
|
|
@@ -1129,19 +1132,19 @@ __attribute__((always_inline)) __STATIC_INLINE void __STRHT(uint16_t const value
|
|
|
\param [in] value Value to store
|
|
|
\param [in] ptr Pointer to location
|
|
|
*/
|
|
|
-__attribute__((always_inline)) __STATIC_INLINE void __STRT(uint32_t const value, volatile uint32_t *ptr)
|
|
|
+__attribute__((always_inline)) __STATIC_INLINE void __STRT(uint32_t value, volatile uint32_t *ptr)
|
|
|
{
|
|
|
__ASM volatile ("strt %1, %0" : "=Q" (*ptr) : "r" (value) );
|
|
|
}
|
|
|
|
|
|
-#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1U)) || \
|
|
|
- (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1U)) || \
|
|
|
- (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1U)) || \
|
|
|
- (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1U)) ) */
|
|
|
+#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \
|
|
|
+ (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \
|
|
|
+ (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \
|
|
|
+ (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */
|
|
|
|
|
|
|
|
|
-#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1U)) || \
|
|
|
- (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1U)) )
|
|
|
+#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \
|
|
|
+ (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) )
|
|
|
/**
|
|
|
\brief Load-Acquire (8 bit)
|
|
|
\details Executes a LDAB instruction for 8 bit value.
|
|
|
@@ -1318,8 +1321,8 @@ __attribute__((always_inline)) __STATIC_INLINE uint32_t __STLEX(uint32_t value,
|
|
|
return(result);
|
|
|
}
|
|
|
|
|
|
-#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1U)) || \
|
|
|
- (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1U)) ) */
|
|
|
+#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \
|
|
|
+ (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */
|
|
|
|
|
|
/*@}*/ /* end of group CMSIS_Core_InstructionInterface */
|
|
|
|
|
|
@@ -1330,7 +1333,7 @@ __attribute__((always_inline)) __STATIC_INLINE uint32_t __STLEX(uint32_t value,
|
|
|
@{
|
|
|
*/
|
|
|
|
|
|
-#if (__ARM_FEATURE_DSP == 1U) /* ToDo ARMCLANG: This should be ARCH >= ARMv7-M + SIMD */
|
|
|
+#if (__ARM_FEATURE_DSP == 1) /* ToDo ARMCLANG: This should be ARCH >= ARMv7-M + SIMD */
|
|
|
|
|
|
__attribute__((always_inline)) __STATIC_INLINE uint32_t __SADD8(uint32_t op1, uint32_t op2)
|
|
|
{
|
|
|
@@ -1873,7 +1876,7 @@ __attribute__((always_inline)) __STATIC_INLINE int32_t __SMMLA (int32_t op1, int
|
|
|
return(result);
|
|
|
}
|
|
|
|
|
|
-#endif /* (__ARM_FEATURE_DSP == 1U) */
|
|
|
+#endif /* (__ARM_FEATURE_DSP == 1) */
|
|
|
/*@} end of group CMSIS_SIMD_intrinsics */
|
|
|
|
|
|
|