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)
Mon, Feb 2, 8:43 AM
Unknown Object (File)
Mon, Feb 2, 2:37 AM
Unknown Object (File)
Mon, Feb 2, 2:32 AM
Unknown Object (File)
Fri, Jan 30, 11:40 AM
Unknown Object (File)
Wed, Jan 28, 5:17 PM
Unknown Object (File)
Mon, Jan 12, 12:26 AM
Unknown Object (File)
Jan 4 2026, 1:17 AM
Unknown Object (File)
Dec 31 2025, 3:53 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.