File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
mcux/mcux-sdk/drivers/common Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -473,7 +473,23 @@ _Pragma("diag_suppress=Pm120")
473473#else
474474#error Toolchain not supported.
475475#endif /* defined(__ICCARM__) */
476- /* @} */
476+ /*! @} */
477+
478+ /*!
479+ * @def MSDK_REG_SECURE_ADDR(x)
480+ * Convert the register address to the one used in secure mode.
481+ *
482+ * @def MSDK_REG_NONSECURE_ADDR(x)
483+ * Convert the register address to the one used in non-secure mode.
484+ */
485+
486+ #if (defined(__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE & 0x2 ))
487+ #define MSDK_REG_SECURE_ADDR (x ) ((uintptr_t)(x) | (0x1UL << 28))
488+ #define MSDK_REG_NONSECURE_ADDR (x ) ((uintptr_t)(x) & ~(0x1UL << 28))
489+ #else
490+ #define MSDK_REG_SECURE_ADDR (x ) (x)
491+ #define MSDK_REG_NONSECURE_ADDR (x ) (x)
492+ #endif
477493
478494#if defined(__ARMCC_VERSION ) && (__ARMCC_VERSION >= 6010050 )
479495 void DefaultISR (void );
You can’t perform that action at this time.
0 commit comments