aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Sébastien Pédron <dumbbell@FreeBSD.org>2022-12-01 14:03:00 +0000
committerEmmanuel Vadot <manu@FreeBSD.org>2023-01-24 09:08:01 +0000
commita1a8fe77691694ebc55c0d940300badb48554a03 (patch)
tree9ac3c13c8c984775b8ad68d83a713d0a4f32033e
parentfe5b301ed2e8ea376d298f3adf60df822ee5df86 (diff)
downloadsrc-a1a8fe77691694ebc55c0d940300badb48554a03.tar.gz
src-a1a8fe77691694ebc55c0d940300badb48554a03.zip
linuxkpi: Introduce module_param() of type `bint`
In Linux, this limits the accepted value to -1, 0 and 1. In FreeBSD, this remains a signed integer with no specific constraints. This change is a requirement to update our DRM drivers to Linux 5.12. Differential Revision: https://reviews.freebsd.org/D37364 (cherry picked from commit e101c1c2c9ba18b1dd0eb2000106fafc915babdc)
-rw-r--r--sys/compat/linuxkpi/common/include/linux/moduleparam.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/compat/linuxkpi/common/include/linux/moduleparam.h b/sys/compat/linuxkpi/common/include/linux/moduleparam.h
index ebf3b7a95c02..b5c6ef95637c 100644
--- a/sys/compat/linuxkpi/common/include/linux/moduleparam.h
+++ b/sys/compat/linuxkpi/common/include/linux/moduleparam.h
@@ -90,6 +90,9 @@
LINUXKPI_PARAM_NAME(name), LINUXKPI_PARAM_PERM(perm), &(var), 0, \
LINUXKPI_PARAM_DESC(name)))
+#define LINUXKPI_PARAM_bint(name, var, perm) \
+ LINUXKPI_PARAM_int(name, var, perm)
+
#define LINUXKPI_PARAM_hexint(name, var, perm) \
extern const char LINUXKPI_PARAM_DESC(name)[]; \
LINUXKPI_PARAM_PASS(SYSCTL_UINT(LINUXKPI_PARAM_PARENT, OID_AUTO, \