summaryrefslogtreecommitdiff
path: root/sys/compat/linuxkpi/common/src/linux_xarray.c
AgeCommit message (Collapse)Author
2025-01-31linuxkpi: Don't destroy the mutex in `xa_destroy()`Jean-Sébastien Pédron
[Why] The mutex initialized in `xa_init_flags()` is not destroyed here on purpose. The reason is that on Linux, the xarray remains usable after a call to `xa_destroy()`. For instance the i915 DRM driver relies on that during the initialixation of its GuC. Basically, `xa_destroy()` "resets" the structure to zero but doesn't really destroy it. Reviewed by: manu Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48762
2025-01-31linuxkpi: Use same field names in `struct xarray` as LinuxJean-Sébastien Pédron
[Why] The i915 DRM driver started to access the `xa_lock` field in Linux 6.7. Reviewed by: manu Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48754
2025-01-31linuxkpi: Add `xa_alloc_cyclic_irq()`Jean-Sébastien Pédron
[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
2023-08-16sys: Remove $FreeBSD$: one-line .c patternWarner Losh
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
2023-02-14linuxkpi: Accept NULL as a value in `linux_xarray`Jean-Sébastien Pédron
Linux' XArray allows to store a NULL pointer as a value. `xa_load()` would return NULL for both an unused index and an index set to NULL. But it impacts `xa_alloc()` which needs to find the next available index. However, our implementation relies on a radix tree (see `linux_radix.c`) which does not accept NULL pointers as values. I'm not sure if this is a limitation or a feature, so to work around this, a NULL value is replaced by `NULL_VALUE`, an unlikely address, when we pass it to linux_radix. Reviewed by: emaste, manu Approved by: emaste, manu Differential Revision: https://reviews.freebsd.org/D38543
2022-02-11linuxkpi xarray: Correct expression in assertion.John Baldwin
Reported by: GCC -Wparantheses Reviewed by: wulf, hselasky Differential Revision: https://reviews.freebsd.org/D34197
2022-01-10LinuxKPI: Add support for XA_FLAGS_ALLOC1 xarray flagVladimir Kondratyev
XA_FLAGS_ALLOC1 causes allocation of xarray entries starting at 1 Required by drm-kmod 5.7 MFC after: 1 week Reviewed by: hselasky, manu Differential Revision: https://reviews.freebsd.org/D33293
2020-08-27Implement extensible arrays API using the existing radix tree implementationHans Petter Selasky
in the LinuxKPI. Differential Revision: https://reviews.freebsd.org/D25101 Reviewed by: kib @ MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=364860