aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Sébastien Pédron <dumbbell@FreeBSD.org>2026-04-11 12:42:14 +0000
committerJean-Sébastien Pédron <dumbbell@FreeBSD.org>2026-04-21 22:18:25 +0000
commit4dab15e96d40352e1a0b161a2a1cd763176108b6 (patch)
tree19daf8b5b08d8b93e677ec2fc35aaf0a62420222
parent8f95998393f42f368fe22abd9a25c7fa4304e02a (diff)
linuxkpi: Define `sort_r()`
Like Linux `sort()` and FreeBSD `qsort()`, `sort_r()` is a wrapper around FreeBSD `qsort_r()`. The i915 DRM driver started to use it in Linux 6.12. Reviewed by: bz Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D56437
-rw-r--r--sys/compat/linuxkpi/common/include/linux/sort.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/compat/linuxkpi/common/include/linux/sort.h b/sys/compat/linuxkpi/common/include/linux/sort.h
index 361b37c587c8..972c8514e6fb 100644
--- a/sys/compat/linuxkpi/common/include/linux/sort.h
+++ b/sys/compat/linuxkpi/common/include/linux/sort.h
@@ -38,4 +38,9 @@
qsort(base, num, size, cmp); \
} while (0)
+#define sort_r(base, num, size, cmp, swap, priv) do { \
+ BUILD_BUG_ON(swap); \
+ qsort_r(base, num, size, cmp, priv); \
+} while (0)
+
#endif /* _LINUXKPI_LINUX_SORT_H_ */