Date: Fri, 31 Jan 2025 16:03:17 GMT From: =?utf-8?Q?Jean-S=C3=A9bastien?= =?utf-8?Q?P=C3=A9dron?= <dumbbell@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: 3fd7fd4974c8 - main - linuxkpi: Add `__assign_bit()` Message-ID: <202501311603.50VG3HdR038691@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by dumbbell: URL: https://cgit.FreeBSD.org/src/commit/?id=3fd7fd4974c8000148360af2f02002f1c083681a commit 3fd7fd4974c8000148360af2f02002f1c083681a Author: Jean-Sébastien Pédron <dumbbell@FreeBSD.org> AuthorDate: 2024-12-27 00:33:08 +0000 Commit: Jean-Sébastien Pédron <dumbbell@FreeBSD.org> CommitDate: 2025-01-31 16:00:48 +0000 linuxkpi: Add `__assign_bit()` [Why] This function is used by the i915 DRM driver in Linux 6.7. Reviewed by: manu Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48752 --- sys/compat/linuxkpi/common/include/linux/bitops.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/bitops.h b/sys/compat/linuxkpi/common/include/linux/bitops.h index 1415d5224084..23aabb546cb2 100644 --- a/sys/compat/linuxkpi/common/include/linux/bitops.h +++ b/sys/compat/linuxkpi/common/include/linux/bitops.h @@ -288,6 +288,15 @@ find_next_zero_bit(const unsigned long *addr, unsigned long size, #define test_bit(i, a) \ !!(READ_ONCE(((volatile const unsigned long *)(a))[BIT_WORD(i)]) & BIT_MASK(i)) +static inline void +__assign_bit(long bit, volatile unsigned long *addr, bool value) +{ + if (value) + __set_bit(bit, addr); + else + __clear_bit(bit, addr); +} + static inline int test_and_clear_bit(long bit, volatile unsigned long *var) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202501311603.50VG3HdR038691>