git: 0b8a423d0733 - main - linuxkpi: Introduce module_param() of type `hexint`

From: Jean-Sébastien Pédron <dumbbell_at_FreeBSD.org>
Date: Fri, 11 Nov 2022 17:57:43 UTC
The branch main has been updated by dumbbell (ports committer):

URL: https://cgit.FreeBSD.org/src/commit/?id=0b8a423d073309ab5f24501c2f6b3f6b2cd8f422

commit 0b8a423d073309ab5f24501c2f6b3f6b2cd8f422
Author:     Jean-Sébastien Pédron <dumbbell@FreeBSD.org>
AuthorDate: 2022-11-11 17:36:46 +0000
Commit:     Jean-Sébastien Pédron <dumbbell@FreeBSD.org>
CommitDate: 2022-11-11 17:36:46 +0000

    linuxkpi: Introduce module_param() of type `hexint`
    
    In Linux, this affects how the value is formatted. In FreeBSD, this
    remains an unsigned integer.
    
    Reviewed by:    manu
    Approved by:    manu
    Differential Revision:  https://reviews.freebsd.org/D36958
---
 sys/compat/linuxkpi/common/include/linux/moduleparam.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/sys/compat/linuxkpi/common/include/linux/moduleparam.h b/sys/compat/linuxkpi/common/include/linux/moduleparam.h
index d9485de88f56..ebf3b7a95c02 100644
--- a/sys/compat/linuxkpi/common/include/linux/moduleparam.h
+++ b/sys/compat/linuxkpi/common/include/linux/moduleparam.h
@@ -90,6 +90,12 @@
 	LINUXKPI_PARAM_NAME(name), LINUXKPI_PARAM_PERM(perm), &(var), 0, \
 	LINUXKPI_PARAM_DESC(name)))
 
+#define	LINUXKPI_PARAM_hexint(name, var, perm)				\
+	extern const char LINUXKPI_PARAM_DESC(name)[];			\
+	LINUXKPI_PARAM_PASS(SYSCTL_UINT(LINUXKPI_PARAM_PARENT, OID_AUTO, \
+	LINUXKPI_PARAM_NAME(name), LINUXKPI_PARAM_PERM(perm), &(var), 0, \
+	LINUXKPI_PARAM_DESC(name)))
+
 #define	LINUXKPI_PARAM_long(name, var, perm)				\
 	extern const char LINUXKPI_PARAM_DESC(name)[];			\
 	LINUXKPI_PARAM_PASS(SYSCTL_LONG(LINUXKPI_PARAM_PARENT, OID_AUTO, \