diff options
author | Christian Cunningham <cc@localhost> | 2022-02-01 17:19:16 -0700 |
---|---|---|
committer | Christian Cunningham <cc@localhost> | 2022-02-01 17:19:16 -0700 |
commit | 36f2d87ee57e841be5fe60f6430bdd167f9f03af (patch) | |
tree | 4668df28fa099cb1111cd7b4657ce7ef4c5db290 /include/cpu/atomic/swap.h | |
parent | 352c8713ddb99f4b9f3c73b5b6b8bc9e83f6b6bd (diff) |
Added spinlock condition
Diffstat (limited to 'include/cpu/atomic/swap.h')
-rw-r--r-- | include/cpu/atomic/swap.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/cpu/atomic/swap.h b/include/cpu/atomic/swap.h index ebaaa1d..57a5add 100644 --- a/include/cpu/atomic/swap.h +++ b/include/cpu/atomic/swap.h @@ -13,7 +13,8 @@ static inline void atm_lock(unsigned long pid, unsigned long* addr) { unsigned long tmp, current_lock_value; asm volatile( -"1: ldrex %0, [%3]\n" +"1: clrex\n" +" ldrex %0, [%3]\n" " cmp %0, #0\n" " wfene\n" " strexeq %1, %2, [%3]\n" |