Page MenuHomeFreeBSD

sys/mutex.h: Include sys/lock.h instead of sys/_lock.h
ClosedPublic

Authored by manu on Oct 27 2022, 9:46 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 30, 2:51 PM
Unknown Object (File)
Tue, Nov 25, 8:26 PM
Unknown Object (File)
Sat, Nov 22, 9:39 AM
Unknown Object (File)
Tue, Nov 18, 4:02 AM
Unknown Object (File)
Sun, Nov 9, 2:07 AM
Unknown Object (File)
Nov 7 2025, 2:49 PM
Unknown Object (File)
Nov 6 2025, 2:50 AM
Unknown Object (File)
Nov 5 2025, 7:13 AM
Subscribers

Details

Summary

It uses the LA_ defines when INVARIANTS is set.
This unbreak dpaa2 with FDT only kernel (like ALLWINNER or ROCKCHIP) as
the driver only include sys/lock.h via header polution for ACPI kernels.

Sponsored by: Beckhoff Automation GmbH & Co. KG

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

manu requested review of this revision.Oct 27 2022, 9:46 AM
This revision is now accepted and ready to land.Oct 27 2022, 1:54 PM

If you do this, include it unconditionally, otherwise it would be a source of continuous troubles, where people only build-test INVARIANTS kernels. Then you can (should ?) remove sys/_lock.h.

Always include sys/lock.h

This revision now requires review to proceed.Oct 28 2022, 7:07 AM
manu retitled this revision from sys/mutex.h: Include sys/lock when INVARIANTS is set to sys/mutex.h: Include sys/lock.h instead of sys/_lock.h.Oct 28 2022, 7:08 AM

This break buildworld, _lock is still needed for struct lock_object.
Will update the diff when I have something that compiles.

Compiles fines on amd64 and arm64.

I do not quite understand your problem, please take a look at sys/lock.h line 38.

In D37145#844216, @kib wrote:

I do not quite understand your problem, please take a look at sys/lock.h line 38.

I probably understand. You need to put sys/lock.h before sys/_mutex.h.

Directly include sys/lock.h

This revision is now accepted and ready to land.Oct 28 2022, 1:25 PM