walnux/libs
Xiang Xiao fb14b54b83 libc/semaphore: Use the while loop to handle the inerrupt correctly
If atomic_try_cmpxchg_xxxx runs on LL/SC architectures (e.g.ARMv7,
ARMv8, RISC-V), the weak CAS expands to a single LDREX/STREX pair.

If the CPU takes an IRQ/FIQ/SVC between the two instructions,
hardware performs an implicit CLREX and the following STREX returns
1, therefore atomic_try_cmpxchg_xxxx return failure even though
*addr* still holds the expected value.

So let's retry atomic_try_cmpxchg_xxxx in this case.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2025-07-08 09:47:44 -03:00
..
libbuiltin compiler-rt: distclean delete error 2025-07-03 00:17:58 +08:00
libc libc/semaphore: Use the while loop to handle the inerrupt correctly 2025-07-08 09:47:44 -03:00
libdsp style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
libm libs: unify Private Types banners 2025-05-28 10:17:15 +08:00
libnx style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
libxx style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
CMakeLists.txt libs: migrate to SPDX identifier 2024-10-01 12:25:52 +08:00