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)
Thu, May 23, 3:26 AM
Unknown Object (File)
Sun, May 12, 4:59 PM
Unknown Object (File)
May 4 2024, 3:15 PM
Unknown Object (File)
Mar 8 2024, 6:00 AM
Unknown Object (File)
Mar 8 2024, 6:00 AM
Unknown Object (File)
Mar 8 2024, 6:00 AM
Unknown Object (File)
Mar 8 2024, 6:00 AM
Unknown Object (File)
Mar 8 2024, 6:00 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