Page MenuHomeFreeBSD

LinuxKPI: fix WRITE_ONCE()
ClosedPublic

Authored by bz on May 13 2023, 3:37 PM.
Tags
None
Referenced Files
F175398463: D40084.id121928.diff
Sat, Oct 10, 2:01 PM
Unknown Object (File)
Thu, Oct 8, 6:29 PM
Unknown Object (File)
Mon, Oct 5, 1:12 PM
Unknown Object (File)
Mon, Oct 5, 12:50 PM
Unknown Object (File)
Mon, Oct 5, 12:40 PM
Unknown Object (File)
Fri, Oct 2, 9:20 AM
Unknown Object (File)
Thu, Sep 24, 4:36 AM
Unknown Object (File)
Mon, Sep 21, 4:50 AM

Details

Summary

Fix a gcc warning: to be safe all intermediate pointers in cast from
'...' to '...' must be 'const' qualified [-Wcast-qual].
Doing what is essentially a __DECONST() adding the uintptr_t gets
rid of the massive amount of warnings we get in LinuxKPI and lets
us see the actual problems a lot better.
This is a follow-up to 74e908b3c63b28de1d590dc42502fbe959a6da2e which
fixed READ_ONCE().

Suggested by: jhb
MFC after: 10 days

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 51479
Build 48370: arc lint + arc unit

Event Timeline

bz requested review of this revision.May 13 2023, 3:37 PM
• hselasky added a subscriber: • hselasky.
• hselasky added inline comments.
sys/compat/linuxkpi/common/include/linux/compiler.h
91

Hi,

ACCESS_ONCE() used to be a valid Linux API:

Documentation/RCU/RTFP.txt: ACCESS_ONCE().

But I think it is obsolete. Maybe say something about that in the commit message!

--HPS

93

This also works for CheriBSD and capability pointers?

sys/compat/linuxkpi/common/include/linux/compiler.h
93

Yes.

This revision is now accepted and ready to land.May 21 2023, 4:38 PM
This revision was automatically updated to reflect the committed changes.