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
F151298418: D37145.id112328.diff
Tue, Apr 7, 10:12 AM
Unknown Object (File)
Sun, Apr 5, 4:46 AM
Unknown Object (File)
Fri, Apr 3, 1:12 PM
Unknown Object (File)
Thu, Apr 2, 12:06 PM
Unknown Object (File)
Sat, Mar 21, 8:31 AM
Unknown Object (File)
Fri, Mar 20, 4:16 AM
Unknown Object (File)
Thu, Mar 19, 11:32 PM
Unknown Object (File)
Thu, Mar 19, 5:31 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