Page MenuHomeFreeBSD

riscv: Add implementations of atomic_testand(set|clear)_(32|64|long)
ClosedPublic

Authored by jhb on Nov 15 2024, 8:40 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Jan 4, 1:17 AM
Unknown Object (File)
Wed, Dec 31, 3:53 AM
Unknown Object (File)
Nov 26 2025, 10:13 AM
Unknown Object (File)
Nov 25 2025, 11:19 AM
Unknown Object (File)
Nov 22 2025, 11:28 PM
Unknown Object (File)
Nov 22 2025, 12:26 PM
Unknown Object (File)
Nov 18 2025, 1:36 PM
Unknown Object (File)
Nov 11 2025, 10:54 AM
Subscribers

Details

Summary

These use amoor and amoand rather than a loop.

Also define atomic_testandset_acq_(64|long) using amoor.aq.

Sponsored by: AFRL, DARPA

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

I did boot this under qemu, and if you get this wrong the first attempt to create a UMA zone panics due to BIT_TEST_SET_ATOMIC being wrong (I had it wrong the first time).

This revision is now accepted and ready to land.Nov 16 2024, 6:57 PM
mhorne added inline comments.
sys/riscv/include/atomic.h
468–480

For consistency with those added above, decide if testandclear should precede or follow testandset.

sys/riscv/include/atomic.h
468–480

Oh, yes, I will sort clear before test above.