arch: arm: update to use CMSIS_6 compatible macros

Zephyr switched to using CMSIS_6 module in f726cb51
which breaks certain boards like `nucleo_h745zi_q/stm32h745xx/m7` when
CONFIG_CORTEX_M_DWT, CONFIG_TIMING_FUNCTIONS are enabled and cmsis from
`module/hal/cmsis` is not available (deleted explicitly after west
update).

This commit adds a provision to be able to use CMSIS_6 macros when the
module cmsis is not available.

Signed-off-by: Sudan Landge <sudan.landge@arm.com>
This commit is contained in:
Sudan Landge 2025-05-14 22:09:53 +01:00 committed by Anas Nashif
commit 2ddec2f0a9

View file

@ -32,12 +32,18 @@ extern "C" {
/* Define DWT LSR masks which are currently not defined by the CMSIS V5.1.2.
* (LSR register is defined but not its bitfields).
* Reuse ITM LSR mask as it is the same offset than DWT LSR one.
* TODO: update these to use only CMSIS_6 when all of zephyr and modules have
* update to CMSIS_6.
*/
#if !defined DWT_LSR_Present_Msk
#define DWT_LSR_Present_Msk ITM_LSR_Present_Msk
#define DWT_LSR_Present_Msk \
IF_ENABLED(CONFIG_ZEPHYR_CMSIS_MODULE, (ITM_LSR_Present_Msk)) \
IF_DISABLED(CONFIG_ZEPHYR_CMSIS_MODULE, (ITM_LSR_PRESENT_Msk))
#endif
#if !defined DWT_LSR_Access_Msk
#define DWT_LSR_Access_Msk ITM_LSR_Access_Msk
#define DWT_LSR_Access_Msk \
IF_ENABLED(CONFIG_ZEPHYR_CMSIS_MODULE, (ITM_LSR_Access_Msk)) \
IF_DISABLED(CONFIG_ZEPHYR_CMSIS_MODULE, (ITM_LSR_ACCESS_Msk))
#endif
static inline void dwt_access(bool ena)