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
F102829380: D37145.id130502.diff
Sun, Nov 17, 5:32 PM
Unknown Object (File)
Thu, Nov 14, 8:55 PM
Unknown Object (File)
Mon, Nov 11, 5:10 AM
Unknown Object (File)
Mon, Nov 11, 12:05 AM
Unknown Object (File)
Sun, Nov 10, 9:50 PM
Unknown Object (File)
Sun, Nov 10, 6:20 PM
Unknown Object (File)
Sun, Nov 10, 6:20 PM
Unknown Object (File)
Sun, Nov 10, 4:17 PM
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 Passed
Unit
No Test Coverage
Build Status
Buildable 48077
Build 44964: arc lint + arc unit

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