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)
Tue, Nov 11, 10:54 AM
Unknown Object (File)
Mon, Nov 3, 4:30 AM
Unknown Object (File)
Mon, Nov 3, 4:30 AM
Unknown Object (File)
Thu, Oct 30, 11:53 PM
Unknown Object (File)
Thu, Oct 16, 5:04 AM
Unknown Object (File)
Thu, Oct 16, 5:04 AM
Unknown Object (File)
Oct 14 2025, 12:44 AM
Unknown Object (File)
Oct 14 2025, 12:35 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.