aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjoern A. Zeeb <bz@FreeBSD.org>2026-06-13 11:08:00 +0000
committerBjoern A. Zeeb <bz@FreeBSD.org>2026-06-15 14:14:19 +0000
commitc5d6e2085a471cbb75cc7b88b37a2fe6276c16f8 (patch)
tree66f029819c9b9d659681f4a4241d28b54ccdf00e
parent586a5bc03541397c432ce98a1551ebeee7c04ef2 (diff)
LinuxKPI: add KERNEL_VERSION() macro
Add a KERNEL_VERSION() macro which normally would be in linux/version.h. On Linux that file is auto-generated and we are supporting more than one Linux version in LinuxKPI anyway so any further defines in there would likely be wrong. Adding the macro helps to support (vendor/out of tree) drivers more easily which are supporting multiple Linux versions. MFC after: 3 days Reviewed by: dumbbell Differential Revision: https://reviews.freebsd.org/D57590
-rw-r--r--sys/compat/linuxkpi/common/include/linux/kernel.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/compat/linuxkpi/common/include/linux/kernel.h b/sys/compat/linuxkpi/common/include/linux/kernel.h
index afbd9208a410..3fcc6c1a925e 100644
--- a/sys/compat/linuxkpi/common/include/linux/kernel.h
+++ b/sys/compat/linuxkpi/common/include/linux/kernel.h
@@ -67,6 +67,9 @@
#include <linux/stdarg.h>
+#define KERNEL_VERSION(a,b,c) \
+ (((a) << 16) + ((b) << 8) + ((c) > 255 ? 255 : (c)))
+
#define KERN_CONT ""
#define KERN_EMERG "<0>"
#define KERN_ALERT "<1>"