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
F132130293: D47627.id146564.diff
Tue, Oct 14, 12:44 AM
F132129641: D47627.diff
Tue, Oct 14, 12:35 AM
Unknown Object (File)
Mon, Oct 13, 3:03 PM
Unknown Object (File)
Fri, Oct 10, 12:49 AM
Unknown Object (File)
Wed, Oct 1, 3:55 PM
Unknown Object (File)
Tue, Sep 30, 11:36 PM
Unknown Object (File)
Mon, Sep 22, 7:10 AM
Unknown Object (File)
Sep 5 2025, 2:34 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.