Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workaround for __iar_builtin_clrex bug #99

Merged
merged 1 commit into from
Dec 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion CMSIS/Core/Include/m-profile/cmsis_iccarm_m.h
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,13 @@ __STATIC_FORCEINLINE void __TZ_set_CONTROL_NS(uint32_t control)
#define __NOP __iar_builtin_no_operation

#define __CLZ __iar_builtin_CLZ
#define __CLREX __iar_builtin_CLREX

/*
* __iar_builtin_CLREX can be reordered w.r.t. STREX during high optimizations.
* As a workaround we use inline assembly and a memory barrier.
* (IAR issue EWARM-11901)
*/
#define __CLREX() (__ASM volatile ("CLREX" ::: "memory"))
JonatanAntoni marked this conversation as resolved.
Show resolved Hide resolved

#define __DMB __iar_builtin_DMB
#define __DSB __iar_builtin_DSB
Expand Down
Loading