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)
Mon, Jan 27, 4:57 PM
Unknown Object (File)
Sun, Jan 26, 6:16 PM
Unknown Object (File)
Thu, Jan 23, 6:23 PM
Unknown Object (File)
Wed, Jan 22, 2:14 AM
Unknown Object (File)
Sat, Jan 11, 8:30 PM
Unknown Object (File)
Dec 27 2024, 10:21 AM
Unknown Object (File)
Nov 30 2024, 5:09 PM
Unknown Object (File)
Nov 18 2024, 11:38 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