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, Jan 14, 11:12 PM
Unknown Object (File)
Thu, Jan 9, 5:02 AM
Unknown Object (File)
Dec 14 2024, 4:42 PM
Unknown Object (File)
Nov 28 2024, 2:45 AM
Unknown Object (File)
Nov 27 2024, 6:05 AM
Unknown Object (File)
Nov 27 2024, 3:49 AM
Unknown Object (File)
Nov 22 2024, 8:15 PM
Unknown Object (File)
Nov 19 2024, 3:57 PM
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 Skipped
Unit
Tests Skipped
Build Status
Buildable 60619
Build 57503: arc lint + arc unit

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.