Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 31 Jan 2025 16:03:18 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: 668fe90dc826 - main - linuxkpi: Add `xa_alloc_cyclic_irq()`
Message-ID:  <202501311603.50VG3IxQ038729@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=668fe90dc826704077de9e4dbe29b737363eeb5f

commit 668fe90dc826704077de9e4dbe29b737363eeb5f
Author:     Jean-Sébastien Pédron <dumbbell@FreeBSD.org>
AuthorDate: 2024-12-27 21:07:32 +0000
Commit:     Jean-Sébastien Pédron <dumbbell@FreeBSD.org>
CommitDate: 2025-01-31 16:00:48 +0000

    linuxkpi: Add `xa_alloc_cyclic_irq()`
    
    [Why]
    This function is used by the i915 DRM driver starting with Linux 6.7.
    
    Reviewed by:    manu
    Sponsored by:   The FreeBSD Foundation
    Differential Revision: https://reviews.freebsd.org/D48753
---
 sys/compat/linuxkpi/common/include/linux/xarray.h |  1 +
 sys/compat/linuxkpi/common/src/linux_xarray.c     | 13 +++++++++++++
 2 files changed, 14 insertions(+)

diff --git a/sys/compat/linuxkpi/common/include/linux/xarray.h b/sys/compat/linuxkpi/common/include/linux/xarray.h
index d293a8f7c2a3..ab98c8d66805 100644
--- a/sys/compat/linuxkpi/common/include/linux/xarray.h
+++ b/sys/compat/linuxkpi/common/include/linux/xarray.h
@@ -67,6 +67,7 @@ void *xa_erase(struct xarray *, uint32_t);
 void *xa_load(struct xarray *, uint32_t);
 int xa_alloc(struct xarray *, uint32_t *, void *, uint32_t, gfp_t);
 int xa_alloc_cyclic(struct xarray *, uint32_t *, void *, uint32_t, uint32_t *, gfp_t);
+int xa_alloc_cyclic_irq(struct xarray *, uint32_t *, void *, uint32_t, uint32_t *, gfp_t);
 int xa_insert(struct xarray *, uint32_t, void *, gfp_t);
 void *xa_store(struct xarray *, uint32_t, void *, gfp_t);
 void xa_init_flags(struct xarray *, uint32_t);
diff --git a/sys/compat/linuxkpi/common/src/linux_xarray.c b/sys/compat/linuxkpi/common/src/linux_xarray.c
index 44900666242f..746cd6029544 100644
--- a/sys/compat/linuxkpi/common/src/linux_xarray.c
+++ b/sys/compat/linuxkpi/common/src/linux_xarray.c
@@ -233,6 +233,19 @@ xa_alloc_cyclic(struct xarray *xa, uint32_t *pindex, void *ptr, uint32_t mask,
 	return (retval);
 }
 
+int
+xa_alloc_cyclic_irq(struct xarray *xa, uint32_t *pindex, void *ptr,
+    uint32_t mask, uint32_t *pnext_index, gfp_t gfp)
+{
+	int retval;
+
+	xa_lock_irq(xa);
+	retval = __xa_alloc_cyclic(xa, pindex, ptr, mask, pnext_index, gfp);
+	xa_unlock_irq(xa);
+
+	return (retval);
+}
+
 /*
  * This function tries to insert an element at the given index. The
  * "gfp" argument basically decides of this function can sleep or not



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202501311603.50VG3IxQ038729>