Re: git: 2a35f3cdf63d - main - sys/mutex.h: Include sys/lock.h instead of sys/_lock.h
Date: Fri, 24 Nov 2023 17:27:39 UTC
On 11/24/23 1:50 AM, Emmanuel Vadot wrote: > The branch main has been updated by manu: > > URL: https://cgit.FreeBSD.org/src/commit/?id=2a35f3cdf63d1f9b1ea5ab0174adabb631757210 > > commit 2a35f3cdf63d1f9b1ea5ab0174adabb631757210 > Author: Emmanuel Vadot <manu@FreeBSD.org> > AuthorDate: 2022-10-27 09:43:19 +0000 > Commit: Emmanuel Vadot <manu@FreeBSD.org> > CommitDate: 2023-11-24 09:49:58 +0000 > > sys/mutex.h: Include sys/lock.h instead of sys/_lock.h > > 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 > Differential Revision: https://reviews.freebsd.org/D37145 > Reviewed by: kib, mjg Avoiding the nested include here was originally an intentional design decision. It was supposed to be a compile error if you didn't include lock.h first, and callers are always supposed to include both (up until now). However, I'm fine with changing this, but we should be consistent and change all the other lock headers at once including sys/rwlock.h, sys/sx.h, and sys/lockmgr.h. You will also need to patch all of these headers to remove the #error if LOCK_DEBUG or LOCK_FILE isn't defined (including sys/mutex.h which you missed in this commit). You will also need to update all the relevant manpages (mutex.9, sx.9, rwlock.9, and lockmgr.9) to remove the #include <sys/lock.h>. For MFC purposes I would suggest to also fix dpaa2 to #include <sys/lock.h> explicitly as it was supposed to do previously. -- John Baldwin