Commit de4a8af
committed
Cortex-R5/GNU: Add CLREX in solicited context restore
This clears exclusive monitor in the solicited (voluntary yield) path to
prevent silent data corruption when threads using LDREX/STREX (C11
atomics, GCC __sync builtins, lock-free code) yield via
tx_thread_relinquish() or blocking calls.
Without CLREX, the local exclusive monitor retains stale "exclusive"
state across context switches, causing subsequent STREX to succeed
without re-checking memory - breaking compare-and-swap guarantees.
The interrupt preemption path is already safe because exception entry
automatically clears the monitor per ARMv7-R ARM Section A3.4.4.1 parent f541a44 commit de4a8af
1 file changed
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
180 | 191 | | |
181 | 192 | | |
182 | 193 | | |
| |||
0 commit comments