Date: Wed, 22 Apr 2026 21:08:14 +0000 From: Bjoern A. Zeeb <bz@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Jean-=?utf-8?Q?S=C3=A9bast?==?utf-8?Q?ien P=C3=A9?=dron <dumbbell@FreeBSD.org> Subject: git: c24d1d070475 - stable/15 - linuxkpi: Define `raw_spinlock_t` in <linux/spinlock.h> Message-ID: <69e938be.27d28.2d2e10e3@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch stable/15 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=c24d1d070475daa23bba9aaebdb2370e16e74d72 commit c24d1d070475daa23bba9aaebdb2370e16e74d72 Author: Jean-Sébastien Pédron <dumbbell@FreeBSD.org> AuthorDate: 2025-08-12 21:55:04 +0000 Commit: Bjoern A. Zeeb <bz@FreeBSD.org> CommitDate: 2026-04-22 20:56:56 +0000 linuxkpi: Define `raw_spinlock_t` in <linux/spinlock.h> For now, it is synonymous to `spinlock_t`. The DRM generic code uses the `struct raw_spinlock` and not `raw_spinlock_t`, that's why the definition is a struct embedding a `struct mtx`, compared to `spinlock_t` which is a simpler typedef. The DRM generic code started to use it in Linux 6.10. Reviewed by: bz, christos Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D54489 (cherry picked from commit ac341353a0434408eec6388f3451be8517252c5f) --- sys/compat/linuxkpi/common/include/linux/spinlock.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/spinlock.h b/sys/compat/linuxkpi/common/include/linux/spinlock.h index 0ab81d92d4ef..a786cbab5e13 100644 --- a/sys/compat/linuxkpi/common/include/linux/spinlock.h +++ b/sys/compat/linuxkpi/common/include/linux/spinlock.h @@ -180,6 +180,26 @@ _atomic_dec_and_lock_irqsave(atomic_t *cnt, spinlock_t *lock, return (0); } +/* + * struct raw_spinlock + */ + +typedef struct raw_spinlock { + struct mtx lock; +} raw_spinlock_t; + +#define raw_spin_lock_init(rlock) \ + mtx_init(&(rlock)->lock, spin_lock_name("lnxspin_raw"), \ + NULL, MTX_DEF | MTX_NOWITNESS | MTX_NEW) + +#define raw_spin_lock(rl) spin_lock(&(rl)->lock) +#define raw_spin_trylock(rl) spin_trylock(&(rl)->lock) +#define raw_spin_unlock(rl) spin_unlock(&(rl)->lock) + +#define raw_spin_lock_irqsave(rl, f) spin_lock_irqsave(&(rl)->lock, (f)) +#define raw_spin_trylock_irqsave(rl, f) spin_trylock_irqsave(&(rl)->lock, (f)) +#define raw_spin_unlock_irqrestore(rl, f) spin_unlock_irqrestore(&(rl)->lock, (f)) + /* * cleanup.h related pre-defined cases. */home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69e938be.27d28.2d2e10e3>
