Index: trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-linux.c
===================================================================
--- trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-linux.c	(revision 85697)
+++ trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-linux.c	(revision 85698)
@@ -36,9 +36,9 @@
 #include "the-linux-kernel.h"
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 15)
+#if RTLNX_VER_MIN(2,6,15)
 # define VBOXGUEST_WITH_INPUT_DRIVER
 #endif
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
+#if RTLNX_VER_MIN(4,15,0)
 # define CONST_4_15 const
 #else
@@ -52,5 +52,5 @@
 #include <linux/miscdevice.h>
 #include <linux/poll.h>
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28)
+#if RTLNX_VER_MIN(2,6,28)
 # include <linux/tty.h>
 #endif
@@ -90,5 +90,5 @@
 
 /* uidgid.h was introduced in 3.5.0. */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 5, 0)
+#if RTLNX_VER_MAX(3,5,0)
 # define kgid_t gid_t
 # define kuid_t uid_t
@@ -142,5 +142,5 @@
 static VMMDevReqMouseStatus    *g_pMouseStatusReq;
 #endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
+#if RTLNX_VER_MIN(2,6,0)
 /** Whether we've create the logger or not. */
 static volatile bool            g_fLoggerCreated;
@@ -364,5 +364,5 @@
  * @param   pRegs           Register set. Removed in 2.6.19.
  */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19) && !defined(DOXYGEN_RUNNING)
+#if RTLNX_VER_MIN(2,6,19) && !defined(DOXYGEN_RUNNING)
 static irqreturn_t vgdrvLinuxISR(int iIrq, void *pvDevId)
 #else
@@ -385,5 +385,5 @@
     rc = request_irq(g_pPciDev->irq,
                      vgdrvLinuxISR,
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 20)
+#if RTLNX_VER_MIN(2,6,20)
                      IRQF_SHARED,
 #else
@@ -477,5 +477,5 @@
             g_pInputDevice->open       = vboxguestOpenInputDevice;
             g_pInputDevice->close      = vboxguestCloseInputDevice;
-# if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 22)
+# if RTLNX_VER_MAX(2,6,22)
             g_pInputDevice->cdev.dev   = &g_pPciDev->dev;
 # else
@@ -596,5 +596,5 @@
     if (RT_SUCCESS(rc))
     {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
+#if RTLNX_VER_MIN(2,6,0)
         RTLogGroupSettings(pRelLogger, g_szLogGrp);
         RTLogFlags(pRelLogger, g_szLogFlags);
@@ -603,5 +603,5 @@
         RTLogRelSetDefaultInstance(pRelLogger);
     }
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
+#if RTLNX_VER_MIN(2,6,0)
     g_fLoggerCreated = true;
 #endif
@@ -616,11 +616,11 @@
          * Call the common device extension initializer.
          */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) && defined(RT_ARCH_X86)
+#if RTLNX_VER_MIN(2,6,0) && defined(RT_ARCH_X86)
         VBOXOSTYPE enmOSType = VBOXOSTYPE_Linux26;
-#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) && defined(RT_ARCH_AMD64)
+#elif RTLNX_VER_MIN(2,6,0) && defined(RT_ARCH_AMD64)
         VBOXOSTYPE enmOSType = VBOXOSTYPE_Linux26_x64;
-#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 0) && defined(RT_ARCH_X86)
+#elif RTLNX_VER_MIN(2,4,0) && defined(RT_ARCH_X86)
         VBOXOSTYPE enmOSType = VBOXOSTYPE_Linux24;
-#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 0) && defined(RT_ARCH_AMD64)
+#elif RTLNX_VER_MIN(2,4,0) && defined(RT_ARCH_AMD64)
         VBOXOSTYPE enmOSType = VBOXOSTYPE_Linux24_x64;
 #else
@@ -740,6 +740,6 @@
 DECLINLINE(RTUID) vgdrvLinuxGetUid(void)
 {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29)
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 5, 0)
+#if RTLNX_VER_MIN(2,6,29)
+# if RTLNX_VER_MIN(3,5,0)
     return from_kuid(current_user_ns(), current->cred->uid);
 # else
@@ -760,5 +760,5 @@
 DECLINLINE(bool) vgdrvLinuxIsGroupZero(kgid_t gid)
 {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 5, 0)
+#if RTLNX_VER_MIN(3,5,0)
     return from_kgid(current_user_ns(), gid);
 #else
@@ -793,5 +793,5 @@
     uint32_t           fRet = VMMDEV_REQUESTOR_CON_DONT_KNOW;
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28) /* First with tty_kref_put(). */
+#if RTLNX_VER_MIN(2,6,28) /* First with tty_kref_put(). */
     /*
      * Check for tty0..63, ASSUMING that these are only used for the physical console.
@@ -800,5 +800,5 @@
     if (pTty)
     {
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
+# if RTLNX_VER_MIN(4,2,0)
         const char *pszName = tty_name(pTty);
 # else
@@ -879,5 +879,5 @@
          pFilp, pFilp->private_data, RTProcSelf(), current->pid, current->comm));
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 28)
+#if RTLNX_VER_MAX(2,6,28)
     /* This housekeeping was needed in older kernel versions to ensure that
      * the file pointer didn't get left on the polling queue. */
@@ -1188,5 +1188,5 @@
 
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
+#if RTLNX_VER_MIN(2,6,0)
 
 /** log and dbg_log parameter setter. */
Index: trunk/src/VBox/Additions/common/VBoxGuest/linux/files_vboxguest
===================================================================
--- trunk/src/VBox/Additions/common/VBoxGuest/linux/files_vboxguest	(revision 85697)
+++ trunk/src/VBox/Additions/common/VBoxGuest/linux/files_vboxguest	(revision 85698)
@@ -70,4 +70,5 @@
     ${PATH_ROOT}/include/iprt/utf16.h=>include/iprt/utf16.h \
     ${PATH_ROOT}/include/iprt/x86.h=>include/iprt/x86.h \
+    ${PATH_ROOT}/include/iprt/linux/version.h=>include/iprt/linux/version.h \
     ${PATH_ROOT}/include/VBox/cdefs.h=>include/VBox/cdefs.h \
     ${PATH_ROOT}/include/VBox/err.h=>include/VBox/err.h \
Index: trunk/src/VBox/Additions/linux/sharedfolders/dirops.c
===================================================================
--- trunk/src/VBox/Additions/linux/sharedfolders/dirops.c	(revision 85697)
+++ trunk/src/VBox/Additions/linux/sharedfolders/dirops.c	(revision 85698)
@@ -36,5 +36,5 @@
 #include <iprt/err.h>
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 7, 0)
+#if RTLNX_VER_MAX(4,7,0)
 # define d_in_lookup(a_pDirEntry)  (d_unhashed(a_pDirEntry))
 #endif
@@ -280,5 +280,5 @@
  */
 DECL_NO_INLINE(static, bool) vbsf_dir_emit_nls(
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
+# if RTLNX_VER_MIN(3,11,0)
                                                struct dir_context *ctx,
 # else
@@ -291,5 +291,5 @@
     int rc = vbsf_nlscpy(pSuperInfo, szDstName, sizeof(szDstName), pszSrcName, cchSrcName);
     if (rc == 0) {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
+#if RTLNX_VER_MIN(3,11,0)
         return dir_emit(ctx, szDstName, strlen(szDstName), d_ino, d_type);
 #else
@@ -327,5 +327,5 @@
  * c. filldir returns an error (see comment on that)
  */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
+#if RTLNX_VER_MIN(3,11,0)
 static int vbsf_dir_iterate(struct file *dir, struct dir_context *ctx)
 #else
@@ -333,5 +333,5 @@
 #endif
 {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
+#if RTLNX_VER_MIN(3,11,0)
     loff_t                  offPos = ctx->pos;
 #else
@@ -403,5 +403,5 @@
      */
     if (offPos < 2) {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
+#if RTLNX_VER_MIN(3,11,0)
         if (offPos == 0) {
             if (dir_emit_dot(dir, ctx))
@@ -431,5 +431,5 @@
         }
         if (offPos == 1) {
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 5)
+# if RTLNX_VER_MIN(2,5,5)
             rc = filldir(opaque, "..", 2, 1, parent_ino(VBSF_GET_F_DENTRY(dir)), DT_DIR);
 # else
@@ -506,5 +506,5 @@
                 bool        fContinue;
                 if (pSuperInfo->fNlsIsUtf8) {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
+#if RTLNX_VER_MIN(3,11,0)
                     fContinue = dir_emit(ctx, pEntry->name.String.ach, cchSrcName, d_ino, d_type);
 #else
@@ -512,5 +512,5 @@
 #endif
                 } else {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
+#if RTLNX_VER_MIN(3,11,0)
                     fContinue = vbsf_dir_emit_nls(ctx, pEntry->name.String.ach, cchSrcName, d_ino, d_type, pSuperInfo);
 #else
@@ -536,5 +536,5 @@
             offPos       += 1;
             dir->f_pos    = offPos;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
+#if RTLNX_VER_MIN(3,11,0)
             ctx->pos      = offPos;
 #endif
@@ -555,7 +555,7 @@
 struct file_operations vbsf_dir_fops = {
     .open           = vbsf_dir_open,
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
+#if RTLNX_VER_MIN(4,7,0)
     .iterate_shared = vbsf_dir_iterate,
-#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
+#elif RTLNX_VER_MIN(3,11,0)
     .iterate        = vbsf_dir_iterate,
 #else
@@ -564,5 +564,5 @@
     .release        = vbsf_dir_release,
     .read           = generic_read_dir,
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)
+#if RTLNX_VER_MIN(2,6,37)
     .llseek         = generic_file_llseek
 #endif
@@ -588,5 +588,5 @@
     if (sf_new_i) {
         ino_t         iNodeNo = iunique(parent->i_sb, 16);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 25)
+#if RTLNX_VER_MIN(2,4,25)
         struct inode *pInode  = iget_locked(parent->i_sb, iNodeNo);
 #else
@@ -614,5 +614,5 @@
             if (fInstantiate)
                 d_instantiate(dentry, pInode);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 25)
+#if RTLNX_VER_MIN(2,4,25)
             unlock_new_inode(pInode);
 #endif
@@ -632,5 +632,5 @@
 DECLINLINE(void) vbsf_d_add_inode(struct dentry *dentry, struct inode *pNewInode)
 {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 38)
+#if RTLNX_VER_MIN(2,6,38)
     Assert(dentry->d_op == &vbsf_dentry_ops); /* (taken from the superblock) */
 #else
@@ -651,7 +651,7 @@
  */
 static struct dentry *vbsf_inode_lookup(struct inode *parent, struct dentry *dentry
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)
+#if RTLNX_VER_MIN(3,6,0)
                                         , unsigned int flags
-#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
+#elif RTLNX_VER_MIN(2,6,0)
                                         , struct nameidata *nd
 #endif
@@ -664,7 +664,7 @@
     int                     rc;
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)
+#if RTLNX_VER_MIN(3,6,0)
     SFLOGFLOW(("vbsf_inode_lookup: parent=%p dentry=%p flags=%#x\n", parent, dentry, flags));
-#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
+#elif RTLNX_VER_MIN(2,6,0)
     SFLOGFLOW(("vbsf_inode_lookup: parent=%p dentry=%p nd=%p{.flags=%#x}\n", parent, dentry, nd, nd ? nd->flags : 0));
 #else
@@ -920,5 +920,5 @@
 
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0)
+#if RTLNX_VER_MIN(3,16,0)
 /**
  * More atomic way of handling creation.
@@ -930,5 +930,5 @@
 static int vbsf_inode_atomic_open(struct inode *pDirInode, struct dentry *dentry, struct file *file,  unsigned fOpen,
                                   umode_t fMode
-# if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0)
+# if RTLNX_VER_MAX(4,19,0)
                                   , int *opened
 # endif
@@ -982,5 +982,5 @@
                  * and call finish_open() to do the remaining open() work.
                  */
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0)
+# if RTLNX_VER_MIN(4,19,0)
                 if (fCreated)
                     file->f_mode |= FMODE_CREATED;
@@ -1045,9 +1045,9 @@
  * @returns 0 on success, Linux error code otherwise
  */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0) || defined(DOXYGEN_RUNNING)
+#if RTLNX_VER_MIN(3,6,0) || defined(DOXYGEN_RUNNING)
 static int vbsf_inode_create(struct inode *parent, struct dentry *dentry, umode_t mode, bool excl)
-#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3, 3, 0)
+#elif RTLNX_VER_MIN(3,3,0)
 static int vbsf_inode_create(struct inode *parent, struct dentry *dentry, umode_t mode, struct nameidata *nd)
-#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 75)
+#elif RTLNX_VER_MIN(2,5,75)
 static int vbsf_inode_create(struct inode *parent, struct dentry *dentry, int mode, struct nameidata *nd)
 #else
@@ -1058,5 +1058,5 @@
                           | SHFL_CF_ACT_FAIL_IF_EXISTS
                           | SHFL_CF_ACCESS_READWRITE;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 6, 0) && LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 75)
+#if RTLNX_VER_RANGE(2,5,75,  3,6,0)
     /* Clear the RD flag if write-only access requested.  Otherwise assume we
        need write access to create stuff. */
@@ -1082,5 +1082,5 @@
  * @returns 0 on success, Linux error code otherwise
  */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 3, 0)
+#if RTLNX_VER_MIN(3,3,0)
 static int vbsf_inode_mkdir(struct inode *parent, struct dentry *dentry, umode_t mode)
 #else
@@ -1203,5 +1203,5 @@
     uint32_t fRename = (old_dentry->d_inode->i_mode & S_IFDIR ? SHFL_RENAME_DIR : SHFL_RENAME_FILE)
                      | SHFL_RENAME_REPLACE_IF_EXISTS;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0)
+#if RTLNX_VER_MIN(3,15,0)
     if (!(flags & ~RENAME_NOREPLACE)) {
         if (flags & RENAME_NOREPLACE)
@@ -1273,5 +1273,5 @@
             rc = -EXDEV;
         }
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0)
+#if RTLNX_VER_MIN(3,15,0)
     } else {
         SFLOGFLOW(("vbsf_inode_rename: Unsupported flags: %#x\n", flags));
@@ -1285,5 +1285,5 @@
 
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 0)
+#if RTLNX_VER_MAX(4,9,0)
 /**
  * The traditional rename interface without any flags.
@@ -1373,5 +1373,5 @@
 struct inode_operations vbsf_dir_iops = {
     .lookup         = vbsf_inode_lookup,
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0)
+#if RTLNX_VER_MIN(3,16,0)
     .atomic_open    = vbsf_inode_atomic_open,
 #endif
@@ -1381,13 +1381,13 @@
     .rmdir          = vbsf_inode_rmdir,
     .unlink         = vbsf_inode_unlink,
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
+#if RTLNX_VER_MIN(4,9,0)
     .rename         = vbsf_inode_rename,
 #else
     .rename         = vbsf_inode_rename_no_flags,
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0)
+# if RTLNX_VER_MIN(3,15,0)
     .rename2        = vbsf_inode_rename,
 # endif
 #endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 18)
+#if RTLNX_VER_MIN(2,5,18)
     .getattr        = vbsf_inode_getattr,
 #else
Index: trunk/src/VBox/Additions/linux/sharedfolders/files_vboxsf
===================================================================
--- trunk/src/VBox/Additions/linux/sharedfolders/files_vboxsf	(revision 85697)
+++ trunk/src/VBox/Additions/linux/sharedfolders/files_vboxsf	(revision 85698)
@@ -45,4 +45,5 @@
     ${PATH_ROOT}/include/iprt/uni.h=>include/iprt/uni.h \
     ${PATH_ROOT}/include/iprt/utf16.h=>include/iprt/utf16.h \
+    ${PATH_ROOT}/include/iprt/linux/version.h=>include/iprt/linux/version.h \
     ${PATH_ROOT}/include/VBox/cdefs.h=>include/VBox/cdefs.h \
     ${PATH_ROOT}/include/VBox/err.h=>include/VBox/err.h \
Index: trunk/src/VBox/Additions/linux/sharedfolders/lnkops.c
===================================================================
--- trunk/src/VBox/Additions/linux/sharedfolders/lnkops.c	(revision 85697)
+++ trunk/src/VBox/Additions/linux/sharedfolders/lnkops.c	(revision 85698)
@@ -108,5 +108,5 @@
 }
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0)
+#if RTLNX_VER_MIN(4,5,0)
 
 /**
@@ -147,5 +147,5 @@
 #else /* < 4.5 */
 
-# if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 8)
+# if RTLNX_VER_MAX(2,6,8)
 /**
  * Reads the link into the given buffer.
@@ -183,7 +183,7 @@
  * Follow link in dentry.
  */
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
+# if RTLNX_VER_MIN(4,2,0)
 static const char *vbsf_follow_link(struct dentry *dentry, void **cookie)
-# elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13)
+# elif RTLNX_VER_MIN(2,6,13)
 static void       *vbsf_follow_link(struct dentry *dentry, struct nameidata *nd)
 # else
@@ -213,10 +213,10 @@
                  */
                 vbsf_dentry_chain_increase_ttl(dentry);
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
+# if RTLNX_VER_MIN(4,2,0)
                 *cookie = pszTarget;
                 return pszTarget;
-# elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 8)
+# elif RTLNX_VER_MIN(2,6,8)
                 nd_set_link(nd, pszTarget);
-#  if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13)
+#  if RTLNX_VER_MIN(2,6,13)
                 return NULL;
 #  else
@@ -241,10 +241,10 @@
         rc = -ENOMEM;
     }
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
+# if RTLNX_VER_MIN(4,2,0)
     *cookie = ERR_PTR(rc);
     return (const char *)ERR_PTR(rc);
-# elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 8)
+# elif RTLNX_VER_MIN(2,6,8)
     nd_set_link(nd, (char *)ERR_PTR(rc));
-#  if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13)
+#  if RTLNX_VER_MIN(2,6,13)
     return NULL;
 #  else
@@ -256,5 +256,5 @@
 }
 
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 8)
+# if RTLNX_VER_MIN(2,6,8)
 /**
  * For freeing target link buffer allocated by vbsf_follow_link.
@@ -262,7 +262,7 @@
  * For kernels before 2.6.8 memory isn't being kept around.
  */
-#  if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
+#  if RTLNX_VER_MIN(4,2,0)
 static void vbsf_put_link(struct inode *inode, void *cookie)
-#  elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13)
+#  elif RTLNX_VER_MIN(2,6,13)
 static void vbsf_put_link(struct dentry *dentry, struct nameidata *nd, void *cookie)
 #  else
@@ -270,5 +270,5 @@
 #  endif
 {
-#  if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13)
+#  if RTLNX_VER_MIN(2,6,13)
     char *page = cookie;
 #  else
@@ -287,6 +287,6 @@
  */
 struct inode_operations vbsf_lnk_iops = {
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 8)
+#if RTLNX_VER_MAX(4,10,0)
+# if RTLNX_VER_MIN(2,6,8)
     .readlink    = generic_readlink,
 # else
@@ -294,9 +294,9 @@
 # endif
 #endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0)
+#if RTLNX_VER_MIN(4,5,0)
     .get_link    = vbsf_get_link
 #else
     .follow_link = vbsf_follow_link,
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 8)
+# if RTLNX_VER_MIN(2,6,8)
     .put_link    = vbsf_put_link,
 # endif
Index: trunk/src/VBox/Additions/linux/sharedfolders/regops.c
===================================================================
--- trunk/src/VBox/Additions/linux/sharedfolders/regops.c	(revision 85697)
+++ trunk/src/VBox/Additions/linux/sharedfolders/regops.c	(revision 85698)
@@ -35,46 +35,43 @@
 #include "vfsmod.h"
 #include <linux/uio.h>
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 32)
+#if RTLNX_VER_MIN(2,5,32)
 # include <linux/aio.h> /* struct kiocb before 4.1 */
 #endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 12)
+#if RTLNX_VER_MIN(2,5,12)
 # include <linux/buffer_head.h>
 #endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 12) \
- && LINUX_VERSION_CODE <  KERNEL_VERSION(2, 6, 31)
+#if RTLNX_VER_RANGE(2,5,12,  2,6,31)
 # include <linux/writeback.h>
 #endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 23) \
- && LINUX_VERSION_CODE <  KERNEL_VERSION(3, 16, 0)
+#if RTLNX_VER_RANGE(2,6,23,  3,16,0)
 # include <linux/splice.h>
 #endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 17) \
- && LINUX_VERSION_CODE <  KERNEL_VERSION(2, 6, 23)
+#if RTLNX_VER_RANGE(2,6,17,  2,6,23)
 # include <linux/pipe_fs_i.h>
 #endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 10)
+#if RTLNX_VER_MIN(2,4,10)
 # include <linux/swap.h> /* for mark_page_accessed */
 #endif
 #include <iprt/err.h>
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18)
+#if RTLNX_VER_MAX(2,6,18)
 # define SEEK_END 2
 #endif
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 16, 0)
+#if RTLNX_VER_MAX(3,16,0)
 # define iter_is_iovec(a_pIter) ( !((a_pIter)->type & ITER_KVEC) )
-#elif LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0)
+#elif RTLNX_VER_MAX(3,19,0)
 # define iter_is_iovec(a_pIter) ( !((a_pIter)->type & (ITER_KVEC | ITER_BVEC)) )
 #endif
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 17, 0)
+#if RTLNX_VER_MAX(4,17,0)
 # define vm_fault_t int
 #endif
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 20)
+#if RTLNX_VER_MAX(2,5,20)
 # define pgoff_t    unsigned long
 #endif
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 12)
+#if RTLNX_VER_MAX(2,5,12)
 # define PageUptodate(a_pPage) Page_Uptodate(a_pPage)
 #endif
@@ -84,5 +81,5 @@
 *   Structures and Typedefs                                                                                                      *
 *********************************************************************************************************************************/
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 16, 0)
+#if RTLNX_VER_MAX(3,16,0)
 struct vbsf_iov_iter {
     unsigned int        type;
@@ -107,5 +104,5 @@
 #endif
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19)
+#if RTLNX_VER_MIN(2,6,19)
 /** Used by vbsf_iter_lock_pages() to keep the first page of the next segment. */
 struct vbsf_iter_stash {
@@ -113,5 +110,5 @@
     size_t          off;
     size_t          cb;
-# if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
+# if RTLNX_VER_MAX(4,11,0)
     size_t          offFromEnd;
     struct iov_iter Copy;
@@ -120,5 +117,5 @@
 #endif /* >= 3.16.0 */
 /** Initializer for struct vbsf_iter_stash. */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
+#if RTLNX_VER_MIN(4,11,0)
 # define VBSF_ITER_STASH_INITIALIZER    { NULL, 0 }
 #else
@@ -140,5 +137,5 @@
 *   Provide more recent uio.h functionality to older kernels.                                                                    *
 *********************************************************************************************************************************/
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 16, 0) && LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19)
+#if RTLNX_VER_RANGE(2,6,19,  3,16,0)
 
 /**
@@ -299,5 +296,5 @@
 
 #endif /* 2.6.19 <= linux < 3.16.0 */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(3, 16, 35)
+#if RTLNX_VER_RANGE(3,16,0,  3,16,35)
 
 /** This is for implementing cMaxPage on 3.16 which doesn't have it. */
@@ -319,5 +316,5 @@
 
 #endif /* 3.16.0-3.16.34 */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19) && LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0)
+#if RTLNX_VER_RANGE(2,6,19,  3,18,0)
 
 static size_t copy_from_iter(uint8_t *pbDst, size_t cbToCopy, struct iov_iter *pSrcIter)
@@ -325,5 +322,5 @@
     size_t const cbTotal = cbToCopy;
     Assert(iov_iter_count(pSrcIter) >= cbToCopy);
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0)
+# if RTLNX_VER_MIN(3,16,0)
     if (pSrcIter->type & ITER_BVEC) {
         while (cbToCopy > 0) {
@@ -364,5 +361,5 @@
     size_t const cbTotal = cbToCopy;
     Assert(iov_iter_count(pDstIter) >= cbToCopy);
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0)
+# if RTLNX_VER_MIN(3,16,0)
     if (pDstIter->type & ITER_BVEC) {
         while (cbToCopy > 0) {
@@ -555,9 +552,9 @@
 *********************************************************************************************************************************/
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 6)
+#if RTLNX_VER_MAX(2,6,6)
 /** Any writable mappings? */
 DECLINLINE(bool) mapping_writably_mapped(struct address_space const *mapping)
 {
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 6)
+# if RTLNX_VER_MIN(2,5,6)
     return !list_empty(&mapping->i_mmap_shared);
 # else
@@ -568,5 +565,5 @@
 
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 12)
+#if RTLNX_VER_MAX(2,5,12)
 /** Missing in 2.4.x, so just stub it for now. */
 DECLINLINE(bool) PageWriteback(struct page const *page)
@@ -604,8 +601,7 @@
 *********************************************************************************************************************************/
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 17) \
- && LINUX_VERSION_CODE <  KERNEL_VERSION(3, 16, 0)
-
-# if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 30)
+#if RTLNX_VER_RANGE(2,6,17,  3,16,0)
+
+# if RTLNX_VER_MAX(2,6,30)
 #  define LOCK_PIPE(a_pPipe)   do { if ((a_pPipe)->inode) mutex_lock(&(a_pPipe)->inode->i_mutex); } while (0)
 #  define UNLOCK_PIPE(a_pPipe) do { if ((a_pPipe)->inode) mutex_unlock(&(a_pPipe)->inode->i_mutex); } while (0)
@@ -647,6 +643,5 @@
 
 #endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 17) \
- && LINUX_VERSION_CODE <  KERNEL_VERSION(2, 6, 31)
+#if RTLNX_VER_RANGE(2,6,17,  2,6,31)
 
 /** Verify pipe buffer content (needed for page-cache to ensure idle page). */
@@ -721,5 +716,5 @@
 static struct pipe_buf_operations vbsf_pipe_buf_ops = {
     .can_merge = 0,
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 23)
+# if RTLNX_VER_MIN(2,6,23)
     .confirm   = vbsf_pipe_buf_confirm,
 # else
@@ -754,5 +749,5 @@
             pPipeBuf->len       = cbThisPage;
             pPipeBuf->offset    = offPg0;
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 23)
+# if RTLNX_VER_MIN(2,6,23)
             pPipeBuf->private   = 0;
 # endif
@@ -895,6 +890,5 @@
 
 #endif /* 2.6.17 <= LINUX_VERSION_CODE < 2.6.31 */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 17) \
- && LINUX_VERSION_CODE <  KERNEL_VERSION(3, 16, 0)
+#if RTLNX_VER_RANGE(2,6,17,  3,16,0)
 
 /**
@@ -1017,5 +1011,5 @@
                                 pPipeBuf = &pPipe->bufs[pPipe->curbuf];
 
-# if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 30)
+# if RTLNX_VER_MAX(2,6,30)
                                 fNeedWakeUp |= pPipe->inode != NULL;
 # else
@@ -1092,6 +1086,5 @@
 #endif /* 2.6.17 <= LINUX_VERSION_CODE < 3.16.0 */
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 30) \
- && LINUX_VERSION_CODE <  KERNEL_VERSION(2, 6, 23)
+#if RTLNX_VER_RANGE(2,5,30,  2,6,23)
 /**
  * Our own senfile implementation that does not go via the page cache like
@@ -1099,5 +1092,5 @@
  */
 static ssize_t vbsf_reg_sendfile(struct file *pFile, loff_t *poffFile, size_t cbToSend, read_actor_t pfnActor,
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 8)
+# if RTLNX_VER_MIN(2,6,8)
                                  void *pvUser
 # else
@@ -1161,5 +1154,5 @@
                 read_descriptor_t     RdDesc;
                 RdDesc.count    = cbToSend;
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 8)
+# if RTLNX_VER_MIN(2,6,8)
                 RdDesc.arg.data = pvUser;
 # else
@@ -1290,5 +1283,5 @@
 DECLINLINE(void) vbsf_put_page(struct page *pPage)
 {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
+#if RTLNX_VER_MIN(4,6,0)
     put_page(pPage);
 #else
@@ -1301,5 +1294,5 @@
 DECLINLINE(void) vbsf_get_page(struct page *pPage)
 {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
+#if RTLNX_VER_MIN(4,6,0)
     get_page(pPage);
 #else
@@ -1409,5 +1402,5 @@
      * Check that this is valid user memory that is actually in the kernel range.
      */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0) || defined(RHEL_81)
+#if RTLNX_VER_MIN(5,0,0) || defined(RHEL_81)
     if (   access_ok((void *)uPtrFrom, cPages << PAGE_SHIFT)
         && uPtrFrom >= USER_DS.seg)
@@ -1476,5 +1469,5 @@
 static ssize_t vbsf_reg_read_mapped(struct file *file, char /*__user*/ *buf, size_t size, loff_t *off)
 {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0)
+#if RTLNX_VER_MIN(3,16,0)
     struct iovec    iov = { .iov_base = buf, .iov_len = size };
     struct iov_iter iter;
@@ -1491,5 +1484,5 @@
     return cbRet;
 
-#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19)
+#elif RTLNX_VER_MIN(2,6,19)
     struct iovec    iov = { .iov_base = buf, .iov_len = size };
     struct kiocb    kiocb;
@@ -1778,5 +1771,5 @@
                     if (cbToCopy == PAGE_SIZE)
                         SetPageUptodate(pDstPage);
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 10)
+# if RTLNX_VER_MIN(2,4,10)
                     mark_page_accessed(pDstPage);
 # endif
@@ -1987,5 +1980,5 @@
         && mapping->nrpages > 0
         && mapping_writably_mapped(mapping)) {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 32)
+#if RTLNX_VER_MIN(2,6,32)
         int err = filemap_fdatawait_range(mapping, pos, pos + size - 1);
         if (err)
@@ -2079,5 +2072,5 @@
 }
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19)
+#if RTLNX_VER_MIN(2,6,19)
 
 /**
@@ -2147,5 +2140,5 @@
             SFLOG3(("vbsf_iter_lock_pages: Picked up stashed page: %#zx LB %#zx\n", offPage0, cbChunk));
         } else {
-# if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
+# if RTLNX_VER_MAX(4,11,0)
             /*
              * Copy out our starting point to assist rewinding.
@@ -2166,5 +2159,5 @@
             ssize_t cbSegRet;
             if (cPages == 0) {
-# if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0)
+# if RTLNX_VER_MAX(3,19,0)
                 while (!iov_iter_single_seg_count(iter)) /* Old code didn't skip empty segments which caused EFAULTs. */
                     iov_iter_advance(iter, 0);
@@ -2259,5 +2252,5 @@
          *       and vbsf_lock_user_pages_failed_check_kernel() as well.
          */
-# if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
+# if RTLNX_VER_MAX(4,11,0)
         pStash->offFromEnd = iov_iter_count(iter);
         pStash->Copy       = *iter;
@@ -2274,5 +2267,5 @@
             }
 
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
+# if RTLNX_VER_MIN(3,19,0)
             pbBuf    = iter->kvec->iov_base + iter->iov_offset;
 # else
@@ -2339,5 +2332,5 @@
     }
 
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) || LINUX_VERSION_CODE < KERNEL_VERSION(3, 16, 0)
+# if RTLNX_VER_MIN(4,11,0) || RTLNX_VER_MAX(3,16,0)
     iov_iter_revert(iter, cbToRewind + cbExtra);
     return true;
@@ -2369,5 +2362,5 @@
 {
     size_t cPages;
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0)
+# if RTLNX_VER_MIN(3,16,0)
     if (iter_is_iovec(iter) || (iter->type & ITER_KVEC)) {
 #endif
@@ -2429,5 +2422,5 @@
         if (cPagesSpan > cPages)
             cPages = cPagesSpan;
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0)
+# if RTLNX_VER_MIN(3,16,0)
     } else {
         /* Won't bother with accurate counts for the next two types, just make
@@ -2568,5 +2561,5 @@
  * @param   iter        The I/O vector iterator describing the buffer.
  */
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0)
+# if RTLNX_VER_MIN(3,16,0)
 static ssize_t vbsf_reg_read_iter(struct kiocb *kio, struct iov_iter *iter)
 # else
@@ -2574,5 +2567,5 @@
 # endif
 {
-# if LINUX_VERSION_CODE < KERNEL_VERSION(3, 16, 0)
+# if RTLNX_VER_MAX(3,16,0)
     struct vbsf_iov_iter    fake_iter  = VBSF_IOV_ITER_INITIALIZER(cSegs, iov, 0 /*write*/);
     struct vbsf_iov_iter   *iter       = &fake_iter;
@@ -2602,5 +2595,5 @@
      */
     if (vbsf_should_use_cached_read(kio->ki_filp, mapping, pSuperInfo)) {
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0)
+# if RTLNX_VER_MIN(3,16,0)
         return generic_file_read_iter(kio, iter);
 # else
@@ -2794,5 +2787,5 @@
  * @param   iter        The I/O vector iterator describing the buffer.
  */
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0)
+# if RTLNX_VER_MIN(3,16,0)
 static ssize_t vbsf_reg_write_iter(struct kiocb *kio, struct iov_iter *iter)
 # else
@@ -2800,5 +2793,5 @@
 # endif
 {
-# if LINUX_VERSION_CODE < KERNEL_VERSION(3, 16, 0)
+# if RTLNX_VER_MAX(3,16,0)
     struct vbsf_iov_iter    fake_iter  = VBSF_IOV_ITER_INITIALIZER(cSegs, iov, 1 /*write*/);
     struct vbsf_iov_iter   *iter       = &fake_iter;
@@ -2811,8 +2804,8 @@
     struct vbsf_reg_info   *sf_r       = kio->ki_filp->private_data;
     struct vbsf_super_info *pSuperInfo = VBSF_GET_SUPER_INFO(inode->i_sb);
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0)
+# if RTLNX_VER_MIN(3,16,0)
     loff_t                  offFile    = kio->ki_pos;
 # endif
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0)
+# if RTLNX_VER_MIN(4,1,0)
     bool const              fAppend    = RT_BOOL(kio->ki_flags & IOCB_APPEND);
 # else
@@ -2854,5 +2847,5 @@
         && mapping->nrpages > 0
         && mapping_writably_mapped(mapping)) {
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 32)
+# if RTLNX_VER_MIN(2,6,32)
         int err = filemap_fdatawait_range(mapping, offFile, offFile + cbToWrite - 1);
         if (err)
@@ -2890,5 +2883,5 @@
                             i_size_write(inode, offFile);
 
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
+# if RTLNX_VER_MIN(4,11,0)
                         if ((size_t)cbRet < cbToWrite)
                             iov_iter_revert(iter, cbToWrite - cbRet);
@@ -3129,5 +3122,5 @@
             && mapping->nrpages > 0
             /** @todo && last writable handle */ ) {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 25)
+#if RTLNX_VER_MIN(2,4,25)
             if (filemap_fdatawrite(mapping) != -EIO)
 #else
@@ -3176,5 +3169,5 @@
     }
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 8)
+#if RTLNX_VER_MIN(2,4,8)
     return generic_file_llseek(file, off, whence);
 #else
@@ -3192,9 +3185,9 @@
  * well as any host interaction with the file.
  */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 0) \
- || (defined(CONFIG_SUSE_KERNEL) && LINUX_VERSION_CODE >= KERNEL_VERSION(3, 0, 101) /** @todo figure when exactly */)
+#if RTLNX_VER_MIN(3,1,0) \
+ || (defined(CONFIG_SUSE_KERNEL) && RTLNX_VER_MIN(3,0,101) /** @todo figure when exactly */)
 static int vbsf_reg_fsync(struct file *file, loff_t start, loff_t end, int datasync)
 {
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0)
+# if RTLNX_VER_MIN(3,16,0)
     return __generic_file_fsync(file, start, end, datasync);
 # else
@@ -3202,5 +3195,5 @@
 # endif
 }
-#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35)
+#elif RTLNX_VER_MIN(2,6,35)
 static int vbsf_reg_fsync(struct file *file, int datasync)
 {
@@ -3210,5 +3203,5 @@
 static int vbsf_reg_fsync(struct file *file, struct dentry *dentry, int datasync)
 {
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 31)
+# if RTLNX_VER_MIN(2,6,31)
     return simple_fsync(file, dentry, datasync);
 # else
@@ -3219,5 +3212,5 @@
     /** @todo What about file_fsync()? (<= 2.5.11) */
 
-#  if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 12)
+#  if RTLNX_VER_MIN(2,5,12)
     rc = sync_mapping_buffers(inode->i_mapping);
     if (   rc == 0
@@ -3240,5 +3233,5 @@
      */
     rc = fsync_inode_buffers(inode);
-#   if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 10)
+#   if RTLNX_VER_MIN(2,4,10)
     if (rc == 0 && datasync)
         rc = fsync_inode_data_buffers(inode);
@@ -3252,5 +3245,5 @@
 
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0)
+#if RTLNX_VER_MIN(4,5,0)
 /**
  * Copy a datablock from one file to another on the host side.
@@ -3279,5 +3272,5 @@
         Assert(pInodeInfoDst->u32Magic == SF_INODE_INFO_MAGIC);
 
-# if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
+# if RTLNX_VER_MAX(4,11,0)
         if (!S_ISREG(pInodeSrc->i_mode) || !S_ISREG(pInodeDst->i_mode))
             return S_ISDIR(pInodeSrc->i_mode) || S_ISDIR(pInodeDst->i_mode) ? -EISDIR : -EINVAL;
@@ -3323,5 +3316,5 @@
 
 /* Generic page fault callback: */
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
+# if RTLNX_VER_MIN(4,11,0)
 static vm_fault_t vbsf_vmlog_fault(struct vm_fault *vmf)
 {
@@ -3332,9 +3325,9 @@
     return rc;
 }
-# elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 23)
+# elif RTLNX_VER_MIN(2,6,23)
 static int vbsf_vmlog_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
 {
     int rc;
-#  if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)
+#  if RTLNX_VER_MIN(4,10,0)
     SFLOGFLOW(("vbsf_vmlog_fault: vma=%p vmf=%p flags=%#x addr=%p\n", vma, vmf, vmf->flags, vmf->address));
 #  else
@@ -3349,6 +3342,6 @@
 
 /* Special/generic page fault handler: */
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26)
-# elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 1)
+# if RTLNX_VER_MIN(2,6,26)
+# elif RTLNX_VER_MIN(2,6,1)
 static struct page *vbsf_vmlog_nopage(struct vm_area_struct *vma, unsigned long address, int *type)
 {
@@ -3372,5 +3365,5 @@
 
 /* Special page fault callback for making something writable: */
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
+# if RTLNX_VER_MIN(4,11,0)
 static vm_fault_t vbsf_vmlog_page_mkwrite(struct vm_fault *vmf)
 {
@@ -3381,9 +3374,9 @@
     return rc;
 }
-# elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30)
+# elif RTLNX_VER_MIN(2,6,30)
 static int vbsf_vmlog_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
 {
     int rc;
-#  if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)
+#  if RTLNX_VER_MIN(4,10,0)
     SFLOGFLOW(("vbsf_vmlog_page_mkwrite: vma=%p vmf=%p flags=%#x addr=%p\n", vma, vmf, vmf->flags, vmf->address));
 #  else
@@ -3394,5 +3387,5 @@
     return rc;
 }
-# elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 18)
+# elif RTLNX_VER_MIN(2,6,18)
 static int vbsf_vmlog_page_mkwrite(struct vm_area_struct *vma, struct page *page)
 {
@@ -3407,5 +3400,5 @@
 
 /* Special page fault callback for mapping pages: */
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)
+# if RTLNX_VER_MIN(4,10,0)
 static void vbsf_vmlog_map_pages(struct vm_fault *vmf, pgoff_t start, pgoff_t end)
 {
@@ -3414,5 +3407,5 @@
     SFLOGFLOW(("vbsf_vmlog_map_pages: returns\n"));
 }
-# elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
+# elif RTLNX_VER_MIN(4,8,0)
 static void vbsf_vmlog_map_pages(struct fault_env *fenv, pgoff_t start, pgoff_t end)
 {
@@ -3421,5 +3414,5 @@
     SFLOGFLOW(("vbsf_vmlog_map_pages: returns\n"));
 }
-# elif LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0)
+# elif RTLNX_VER_MIN(3,15,0)
 static void vbsf_vmlog_map_pages(struct vm_area_struct *vma, struct vm_fault *vmf)
 {
@@ -3433,14 +3426,14 @@
 /** Overload template. */
 static struct vm_operations_struct const g_LoggingVmOpsTemplate = {
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 23)
+# if RTLNX_VER_MIN(2,6,23)
     .fault = vbsf_vmlog_fault,
 # endif
-# if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 25)
+# if RTLNX_VER_MAX(2,6,26)
     .nopage = vbsf_vmlog_nopage,
 # endif
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 18)
+# if RTLNX_VER_MIN(2,6,18)
     .page_mkwrite = vbsf_vmlog_page_mkwrite,
 # endif
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0)
+# if RTLNX_VER_MIN(3,15,0)
     .map_pages = vbsf_vmlog_map_pages,
 # endif
@@ -3499,8 +3492,8 @@
     .read            = vbsf_reg_read,
     .write           = vbsf_reg_write,
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0)
+#if RTLNX_VER_MIN(3,16,0)
     .read_iter       = vbsf_reg_read_iter,
     .write_iter      = vbsf_reg_write_iter,
-#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19)
+#elif RTLNX_VER_MIN(2,6,19)
     .aio_read        = vbsf_reg_aio_read,
     .aio_write       = vbsf_reg_aio_write,
@@ -3512,18 +3505,18 @@
     .mmap            = generic_file_mmap,
 #endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 17) && LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 31)
+#if RTLNX_VER_RANGE(2,6,17,  2,6,31)
     .splice_read     = vbsf_splice_read,
 #endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0)
+#if RTLNX_VER_MIN(3,16,0)
     .splice_write    = iter_file_splice_write,
-#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 17)
+#elif RTLNX_VER_MIN(2,6,17)
     .splice_write    = vbsf_splice_write,
 #endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 30) && LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 23)
+#if RTLNX_VER_RANGE(2,5,30,  2,6,23)
     .sendfile        = vbsf_reg_sendfile,
 #endif
     .llseek          = vbsf_reg_llseek,
     .fsync           = vbsf_reg_fsync,
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0)
+#if RTLNX_VER_MIN(4,5,0)
     .copy_file_range = vbsf_reg_copy_file_range,
 #endif
@@ -3535,5 +3528,5 @@
  */
 struct inode_operations vbsf_reg_iops = {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 18)
+#if RTLNX_VER_MIN(2,5,18)
     .getattr    = vbsf_inode_getattr,
 #else
@@ -3621,5 +3614,5 @@
  * fashion.
  */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 52)
+#if RTLNX_VER_MIN(2,5,52)
 static int vbsf_writepage(struct page *page, struct writeback_control *wbc)
 #else
@@ -3698,5 +3691,5 @@
 
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24)
+#if RTLNX_VER_MIN(2,6,24)
 /**
  * Called when writing thru the page cache (which we shouldn't be doing).
@@ -3724,5 +3717,5 @@
 
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 10)
+#if RTLNX_VER_MIN(2,4,10)
 
 # ifdef VBOX_UEK
@@ -3774,15 +3767,15 @@
     .writepage      = vbsf_writepage,
     /** @todo Need .writepages if we want msync performance...  */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 12)
+#if RTLNX_VER_MIN(2,5,12)
     .set_page_dirty = __set_page_dirty_buffers,
 #endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24)
+#if RTLNX_VER_MIN(2,6,24)
     .write_begin    = vbsf_write_begin,
     .write_end      = simple_write_end,
-#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 45)
+#elif RTLNX_VER_MIN(2,5,45)
     .prepare_write  = simple_prepare_write,
     .commit_write   = simple_commit_write,
 #endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 10)
+#if RTLNX_VER_MIN(2,4,10)
     .direct_IO      = vbsf_direct_IO,
 #endif
Index: trunk/src/VBox/Additions/linux/sharedfolders/utils.c
===================================================================
--- trunk/src/VBox/Additions/linux/sharedfolders/utils.c	(revision 85697)
+++ trunk/src/VBox/Additions/linux/sharedfolders/utils.c	(revision 85698)
@@ -51,5 +51,5 @@
 
         while (in_bound_len) {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 31)
+#if RTLNX_VER_MIN(2,6,31)
             unicode_t uni;
             int cbInEnc = utf8_to_utf32(in, in_bound_len, &uni);
@@ -112,5 +112,5 @@
             if (cbNlsCodepoint >= 0) {
                 char achTmp[16];
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 31)
+#if RTLNX_VER_MIN(2,6,31)
                 int cbUtf8Codepoint = utf32_to_utf8(uc, achTmp, sizeof(achTmp));
 #else
@@ -145,5 +145,5 @@
                     int const cbNlsCodepoint = pSuperInfo->nls->char2uni(&pszNls[offNls], cchNls - offNls, &uc);
                     if (cbNlsCodepoint >= 0) {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 31)
+#if RTLNX_VER_MIN(2,6,31)
                         int cbUtf8Codepoint = utf32_to_utf8(uc, pchDst, cchUtf8);
 #else
@@ -215,5 +215,5 @@
  * Convert from VBox to linux time.
  */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
+#if RTLNX_VER_MAX(2,6,0)
 DECLINLINE(void) vbsf_time_to_linux(time_t *pLinuxDst, PCRTTIMESPEC pVBoxSrc)
 {
@@ -223,5 +223,5 @@
 }
 #else   /* >= 2.6.0 */
-# if LINUX_VERSION_CODE < KERNEL_VERSION(4, 18, 0)
+# if RTLNX_VER_MAX(4,18,0)
 DECLINLINE(void) vbsf_time_to_linux(struct timespec *pLinuxDst, PCRTTIMESPEC pVBoxSrc)
 # else
@@ -239,5 +239,5 @@
  * Convert from linux to VBox time.
  */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
+#if RTLNX_VER_MAX(2,6,0)
 DECLINLINE(void) vbsf_time_to_vbox(PRTTIMESPEC pVBoxDst, time_t *pLinuxSrc)
 {
@@ -245,5 +245,5 @@
 }
 #else   /* >= 2.6.0 */
-# if LINUX_VERSION_CODE < KERNEL_VERSION(4, 18, 0)
+# if RTLNX_VER_MAX(4,18,0)
 DECLINLINE(void) vbsf_time_to_vbox(PRTTIMESPEC pVBoxDst, struct timespec const *pLinuxSrc)
 # else
@@ -327,6 +327,5 @@
         inode->i_fop = &vbsf_reg_fops;
         inode->i_mapping->a_ops = &vbsf_reg_aops;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 17) \
- && LINUX_VERSION_CODE <  KERNEL_VERSION(4, 0, 0)
+#if RTLNX_VER_RANGE(2,5,17,  4,0,0)
         inode->i_mapping->backing_dev_info = &pSuperInfo->bdi; /* This is needed for mmap. */
 #endif
@@ -334,5 +333,5 @@
     }
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 5, 0)
+#if RTLNX_VER_MIN(3,5,0)
     inode->i_uid = make_kuid(current_user_ns(), pSuperInfo->uid);
     inode->i_gid = make_kgid(current_user_ns(), pSuperInfo->gid);
@@ -343,8 +342,8 @@
 
     inode->i_size = pObjInfo->cbObject;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19) && !defined(KERNEL_FC6)
+#if RTLNX_VER_MAX(2,6,19) && !defined(KERNEL_FC6)
     inode->i_blksize = 4096;
 #endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 11)
+#if RTLNX_VER_MIN(2,4,11)
     inode->i_blkbits = 12;
 #endif
@@ -374,5 +373,5 @@
     TRACE();
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0)
+#if RTLNX_VER_MIN(4,5,0)
     if (!fInodeLocked)
         inode_lock(pInode);
@@ -402,5 +401,5 @@
             vbsf_init_inode(pInode, pInodeInfo, pObjInfo, pSuperInfo);
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0)
+#if RTLNX_VER_MIN(4,5,0)
             if (!fInodeLocked)
                 inode_unlock(pInode);
@@ -467,7 +466,7 @@
                     if (mapping && mapping->nrpages > 0) {
                         SFLOGFLOW(("vbsf_update_inode: Invalidating the mapping %s (%#x)\n", pInodeInfo->path->String.ach, fSetAttrs));
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 34)
+#if RTLNX_VER_MIN(2,6,34)
                         invalidate_mapping_pages(mapping, 0, ~(pgoff_t)0);
-#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 41)
+#elif RTLNX_VER_MIN(2,5,41)
                         invalidate_inode_pages(mapping);
 #else
@@ -487,5 +486,5 @@
      * Done.
      */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0)
+#if RTLNX_VER_MIN(4,5,0)
     if (!fInodeLocked)
         inode_unlock(pInode);
@@ -627,5 +626,5 @@
 
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 18)
+#if RTLNX_VER_MAX(2,5,18)
 /**
  * Revalidate an inode for 2.4.
@@ -700,7 +699,7 @@
    has inode at all) from these new attributes we derive [kstat] via
    [generic_fillattr] */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 18)
-
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
+#if RTLNX_VER_MIN(2,5,18)
+
+# if RTLNX_VER_MIN(4,11,0)
 int vbsf_inode_getattr(const struct path *path, struct kstat *kstat, u32 request_mask, unsigned int flags)
 # else
@@ -709,9 +708,9 @@
 {
     int            rc;
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
+# if RTLNX_VER_MIN(4,11,0)
     struct dentry *dentry = path->dentry;
 # endif
 
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
+# if RTLNX_VER_MIN(4,11,0)
     SFLOGFLOW(("vbsf_inode_getattr: dentry=%p request_mask=%#x flags=%#x\n", dentry, request_mask, flags));
 # else
@@ -719,5 +718,5 @@
 # endif
 
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
+# if RTLNX_VER_MIN(4,11,0)
     /*
      * With the introduction of statx() userland can control whether we
@@ -745,5 +744,5 @@
 
         /* Add birth time. */
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
+# if RTLNX_VER_MIN(4,11,0)
         if (dentry->d_inode) {
             struct vbsf_inode_info *pInodeInfo = VBSF_GET_INODE_INFO(dentry->d_inode);
@@ -807,5 +806,5 @@
      */
     iattr->ia_valid |= ATTR_FORCE;
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 39) && LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0)) || LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0) || (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 37) && LINUX_VERSION_CODE < KERNEL_VERSION(4, 2, 0))
+#if (RTLNX_VER_RANGE(3,16,39,  3,17,0)) || RTLNX_VER_MIN(4,9,0) || (RTLNX_VER_RANGE(4,1,37,  4,2,0))
     rc = setattr_prepare(dentry, iattr);
 #else
@@ -818,9 +817,9 @@
          */
         unsigned fAttrs = iattr->ia_valid;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 15)
+#if RTLNX_VER_MIN(2,6,15)
         fAttrs &= ~ATTR_FILE;
 #endif
         if (   fAttrs == (ATTR_SIZE | ATTR_MTIME | ATTR_CTIME)
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24)
+#if RTLNX_VER_MIN(2,6,24)
             || (fAttrs & (ATTR_OPEN | ATTR_SIZE)) == (ATTR_OPEN | ATTR_SIZE)
 #endif
@@ -1067,5 +1066,5 @@
             in += nb;
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 31)
+#if RTLNX_VER_MIN(2,6,31)
             nb = utf32_to_utf8(uni, out, out_bound_len);
 #else
@@ -1113,7 +1112,7 @@
  * @note Caller holds no relevant locks, just a dentry reference.
  */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)
+#if RTLNX_VER_MIN(3,6,0)
 static int vbsf_dentry_revalidate(struct dentry *dentry, unsigned flags)
-#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
+#elif RTLNX_VER_MIN(2,6,0)
 static int vbsf_dentry_revalidate(struct dentry *dentry, struct nameidata *nd)
 #else
@@ -1121,5 +1120,5 @@
 #endif
 {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(3, 6, 0)
+#if RTLNX_VER_RANGE(2,6,0,  3,6,0)
     int const flags = nd ? nd->flags : 0;
 #endif
@@ -1139,5 +1138,5 @@
      *
      */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 38)
+#if RTLNX_VER_MIN(2,6,38)
     if (flags & LOOKUP_RCU) {
         rc = -ECHILD;
@@ -1181,7 +1180,7 @@
              * later point).
              */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28)
+#if RTLNX_VER_MIN(2,6,28)
             if (flags & (LOOKUP_CREATE | LOOKUP_RENAME_TARGET))
-#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 75)
+#elif RTLNX_VER_MIN(2,5,75)
             if (flags & LOOKUP_CREATE)
 #else
@@ -1214,5 +1213,5 @@
 
 /** For logging purposes only. */
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 38)
+# if RTLNX_VER_MIN(2,6,38)
 static int vbsf_dentry_delete(const struct dentry *pDirEntry)
 # else
@@ -1224,5 +1223,5 @@
 }
 
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
+# if RTLNX_VER_MIN(4,8,0)
 /** For logging purposes only. */
 static int vbsf_dentry_init(struct dentry *pDirEntry)
@@ -1244,5 +1243,5 @@
 #ifdef SFLOG_ENABLED
     .d_delete = vbsf_dentry_delete,
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
+# if RTLNX_VER_MIN(4,8,0)
     .d_init = vbsf_dentry_init,
 # endif
Index: trunk/src/VBox/Additions/linux/sharedfolders/vfsmod.c
===================================================================
--- trunk/src/VBox/Additions/linux/sharedfolders/vfsmod.c	(revision 85697)
+++ trunk/src/VBox/Additions/linux/sharedfolders/vfsmod.c	(revision 85698)
@@ -46,12 +46,12 @@
 #include "revision-generated.h"
 #include "product-generated.h"
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0)
+#if RTLNX_VER_MIN(5,0,0)
 # include <uapi/linux/mount.h> /* for MS_REMOUNT */
-#elif LINUX_VERSION_CODE < KERNEL_VERSION(3, 3, 0)
+#elif RTLNX_VER_MAX(3,3,0)
 # include <linux/mount.h>
 #endif
 #include <linux/seq_file.h>
 #include <linux/vfs.h>
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 62) && LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0)
+#if RTLNX_VER_RANGE(2,5,62,  5,8,0)
 # include <linux/vermagic.h>
 #endif
@@ -356,8 +356,8 @@
 {
     int rc = 0;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
+#if RTLNX_VER_MIN(2,6,0)
     /* Each new shared folder map gets a new uint64_t identifier,
      * allocated in sequence.  We ASSUME the sequence will not wrap. */
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26)
+# if RTLNX_VER_MIN(2,6,26)
     static uint64_t s_u64Sequence = 0;
     uint64_t idSeqMine = ASMAtomicIncU64(&s_u64Sequence);
@@ -365,9 +365,9 @@
     struct backing_dev_info *bdi;
 
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(4, 2, 0)
+# if RTLNX_VER_RANGE(4,0,0,  4,2,0)
     pSuperInfo->bdi_org = sb->s_bdi;
 # endif
 
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
+# if RTLNX_VER_MIN(4,12,0)
     rc = super_setup_bdi_name(sb, "vboxsf-%llu", (unsigned long long)idSeqMine);
     if (!rc)
@@ -381,5 +381,5 @@
     bdi->ra_pages = 0;                      /* No readahead */
 
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 12)
+# if RTLNX_VER_MIN(2,6,12)
     bdi->capabilities = 0
 #  ifdef BDI_CAP_MAP_DIRECT
@@ -399,5 +399,5 @@
 #  endif
 #  ifdef BDI_CAP_STRICTLIMIT
-#   if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0) /* Trouble with 3.16.x/debian8.  Process stops after dirty page throttling.
+#   if RTLNX_VER_MIN(4,19,0) /* Trouble with 3.16.x/debian8.  Process stops after dirty page throttling.
                                                        * Only tested successfully with 4.19.  Maybe skip altogether? */
                       | BDI_CAP_STRICTLIMIT;
@@ -414,7 +414,7 @@
 # endif /* >= 2.6.12 */
 
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24) && LINUX_VERSION_CODE < KERNEL_VERSION(4, 12, 0)
+# if RTLNX_VER_RANGE(2,6,24,  4,12,0)
     rc = bdi_init(&pSuperInfo->bdi);
-#  if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26)
+#  if RTLNX_VER_MIN(2,6,26)
     if (!rc)
         rc = bdi_register(&pSuperInfo->bdi, NULL, "vboxsf-%llu", (unsigned long long)idSeqMine);
@@ -422,5 +422,5 @@
 # endif  /* 4.11.0 > version >= 2.6.24 */
 
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 34) && LINUX_VERSION_CODE < KERNEL_VERSION(4, 12, 0)
+# if RTLNX_VER_RANGE(2,6,34,  4,12,0)
     if (!rc)
         sb->s_bdi = bdi;
@@ -437,12 +437,12 @@
 static void vbsf_done_backing_dev(struct super_block *sb, struct vbsf_super_info *pSuperInfo)
 {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24) && LINUX_VERSION_CODE <= KERNEL_VERSION(4, 12, 0)
+#if RTLNX_VER_RANGE(2,6,24,  4,13,0)
     bdi_destroy(&pSuperInfo->bdi);    /* includes bdi_unregister() */
 
     /* Paranoia: Make sb->s_bdi not point at pSuperInfo->bdi, in case someone
                  trouches it after this point (we may screw up something).  */
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(4, 2, 0)
+# if RTLNX_VER_RANGE(4,0,0,  4,2,0)
     sb->s_bdi = pSuperInfo->bdi_org; /* (noop_backing_dev_info is not exported) */
-# elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 34) && LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
+# elif RTLNX_VER_RANGE(2,6,34,  4,10,0)
     sb->s_bdi = &noop_backing_dev_info;
 # endif
@@ -491,5 +491,5 @@
              * Note! ls -la does display '.' and '..' entries with st_ino == 0, so root is #1.
              */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 25)
+#if RTLNX_VER_MIN(2,4,25)
             struct inode *iroot = iget_locked(sb, 1);
 #else
@@ -500,5 +500,5 @@
                 VBSF_SET_INODE_INFO(iroot, sf_i);
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 25)
+#if RTLNX_VER_MIN(2,4,25)
                 unlock_new_inode(iroot);
 #endif
@@ -507,5 +507,5 @@
                  * Now make it a root inode.
                  */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0)
+#if RTLNX_VER_MIN(3,4,0)
                 sb->s_root = d_make_root(iroot);
 #else
@@ -518,5 +518,5 @@
 
                 SFLOGRELBOTH(("vboxsf: d_make_root failed!\n"));
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 4, 0) /* d_make_root calls iput */
+#if RTLNX_VER_MAX(3,4,0) /* d_make_root calls iput */
                 iput(iroot);
 #endif
@@ -582,5 +582,5 @@
         sb->s_magic     = 0xface;
         sb->s_blocksize = 1024;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 3)
+#if RTLNX_VER_MIN(2,4,3)
         /* Required for seek/sendfile (see 'loff_t max' in fs/read_write.c / do_sendfile()). */
 # if defined MAX_LFS_FILESIZE
@@ -592,9 +592,9 @@
 # endif
 #endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 11)
+#if RTLNX_VER_MIN(2,6,11)
         sb->s_time_gran = 1; /* This might be a little optimistic for windows hosts, where it should be 100. */
 #endif
         sb->s_op        = &g_vbsf_super_ops;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 38)
+#if RTLNX_VER_MIN(2,6,38)
         sb->s_d_op      = &vbsf_dentry_ops;
 #endif
@@ -629,5 +629,5 @@
  * We must free the inode info structure here.
  */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36)
+#if RTLNX_VER_MIN(2,6,36)
 static void vbsf_evict_inode(struct inode *inode)
 #else
@@ -642,7 +642,7 @@
      * Flush stuff.
      */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36)
+#if RTLNX_VER_MIN(2,6,36)
     truncate_inode_pages(&inode->i_data, 0);
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 5, 0)
+# if RTLNX_VER_MIN(3,5,0)
     clear_inode(inode);
 # else
@@ -673,5 +673,5 @@
    hence we can't do anything here, and let lookup/whatever with the
    job to properly fill then [inode] */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 25)
+#if RTLNX_VER_MAX(2,6,25)
 static void vbsf_read_inode(struct inode *inode)
 {
@@ -696,7 +696,7 @@
  * Get file system statistics.
  */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 18)
+#if RTLNX_VER_MIN(2,6,18)
 static int vbsf_statfs(struct dentry *dentry, struct kstatfs *stat)
-#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 73)
+#elif RTLNX_VER_MIN(2,5,73)
 static int vbsf_statfs(struct super_block *sb, struct kstatfs *stat)
 #else
@@ -704,5 +704,5 @@
 #endif
 {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 18)
+#if RTLNX_VER_MIN(2,6,18)
     struct super_block *sb = dentry->d_inode->i_sb;
 #endif
@@ -716,5 +716,5 @@
             stat->f_type   = UINT32_C(0x786f4256); /* 'VBox' little endian */
             stat->f_bsize  = pVolInfo->ulBytesPerAllocationUnit;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 73)
+#if RTLNX_VER_MIN(2,5,73)
             stat->f_frsize = pVolInfo->ulBytesPerAllocationUnit;
 #endif
@@ -731,5 +731,5 @@
             stat->f_fsid.val[1] = 0;
             stat->f_namelen = 255;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36)
+#if RTLNX_VER_MIN(2,6,36)
             stat->f_flags = 0; /* not valid */
 #endif
@@ -746,5 +746,5 @@
 static int vbsf_remount_fs(struct super_block *sb, int *flags, char *data)
 {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 23)
+#if RTLNX_VER_MIN(2,4,23)
     struct vbsf_super_info *pSuperInfo = pSuperInfo = VBSF_GET_SUPER_INFO(sb);
     struct vbsf_inode_info *sf_i;
@@ -774,7 +774,7 @@
     /*unlock_new_inode(iroot); */
     return 0;
-#else  /* LINUX_VERSION_CODE < 2.4.23 */
+#else  /* < 2.4.23 */
     return -ENOSYS;
-#endif /* LINUX_VERSION_CODE < 2.4.23 */
+#endif /* < 2.4.23 */
 }
 
@@ -786,5 +786,5 @@
  * the the 'szTag' option value it sets on its mount.
  */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 3, 0)
+#if RTLNX_VER_MAX(3,3,0)
 static int vbsf_show_options(struct seq_file *m, struct vfsmount *mnt)
 #else
@@ -792,5 +792,5 @@
 #endif
 {
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 3, 0)
+#if RTLNX_VER_MAX(3,3,0)
     struct super_block     *sb         = mnt->mnt_sb;
 #else
@@ -845,10 +845,10 @@
  */
 static struct super_operations g_vbsf_super_ops = {
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 36)
+#if RTLNX_VER_MAX(2,6,36)
     .clear_inode  = vbsf_clear_inode,
 #else
     .evict_inode  = vbsf_evict_inode,
 #endif
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 25)
+#if RTLNX_VER_MAX(2,6,25)
     .read_inode   = vbsf_read_inode,
 #endif
@@ -865,5 +865,5 @@
 *********************************************************************************************************************************/
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 4)
+#if RTLNX_VER_MIN(2,5,4)
 
 static int vbsf_read_super_26(struct super_block *sb, void *data, int flags)
@@ -879,5 +879,17 @@
 }
 
-# if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18)
+# if RTLNX_VER_MIN(2,6,39)
+static struct dentry *sf_mount(struct file_system_type *fs_type, int flags, const char *dev_name, void *data)
+{
+    TRACE();
+    return mount_nodev(fs_type, flags, data, vbsf_read_super_26);
+}
+# elif RTLNX_VER_MIN(2,6,18)
+static int vbsf_get_sb(struct file_system_type *fs_type, int flags, const char *dev_name, void *data, struct vfsmount *mnt)
+{
+    TRACE();
+    return get_sb_nodev(fs_type, flags, data, vbsf_read_super_26, mnt);
+}
+# else /* < 2.6.18 */
 static struct super_block *vbsf_get_sb(struct file_system_type *fs_type, int flags, const char *dev_name, void *data)
 {
@@ -885,17 +897,5 @@
     return get_sb_nodev(fs_type, flags, data, vbsf_read_super_26);
 }
-# elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 39)
-static int vbsf_get_sb(struct file_system_type *fs_type, int flags, const char *dev_name, void *data, struct vfsmount *mnt)
-{
-    TRACE();
-    return get_sb_nodev(fs_type, flags, data, vbsf_read_super_26, mnt);
-}
-# else /* LINUX_VERSION_CODE >= 2.6.39 */
-static struct dentry *sf_mount(struct file_system_type *fs_type, int flags, const char *dev_name, void *data)
-{
-    TRACE();
-    return mount_nodev(fs_type, flags, data, vbsf_read_super_26);
-}
-# endif /* LINUX_VERSION_CODE >= 2.6.39 */
+# endif
 
 /**
@@ -905,13 +905,13 @@
     .owner = THIS_MODULE,
     .name = "vboxsf",
-# if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 39)
+# if RTLNX_VER_MIN(2,6,39)
+    .mount = sf_mount,
+# else
     .get_sb = vbsf_get_sb,
-# else
-    .mount = sf_mount,
 # endif
     .kill_sb = kill_anon_super
 };
 
-#else  /* LINUX_VERSION_CODE < 2.5.4 */
+#else  /* < 2.5.4 */
 
 static struct super_block *vbsf_read_super_24(struct super_block *sb, void *data, int flags)
@@ -931,5 +931,5 @@
 static DECLARE_FSTYPE(g_vboxsf_fs_type, "vboxsf", vbsf_read_super_24, 0);
 
-#endif /* LINUX_VERSION_CODE < 2.5.4 */
+#endif /* < 2.5.4 */
 
 
@@ -1054,5 +1054,5 @@
  * Module parameters.
  */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 52)
+#if RTLNX_VER_MIN(2,5,52)
 module_param_named(follow_symlinks, g_fFollowSymlinks, int, 0);
 MODULE_PARM_DESC(follow_symlinks,
Index: trunk/src/VBox/Additions/linux/sharedfolders/vfsmod.h
===================================================================
--- trunk/src/VBox/Additions/linux/sharedfolders/vfsmod.h	(revision 85697)
+++ trunk/src/VBox/Additions/linux/sharedfolders/vfsmod.h	(revision 85698)
@@ -46,5 +46,5 @@
 #include <VBox/log.h>
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
+#if RTLNX_VER_MIN(2,6,0)
 # include <linux/backing-dev.h>
 #endif
@@ -83,5 +83,5 @@
  * inode compatibility glue.
  */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
+#if RTLNX_VER_MAX(2,6,0)
 
 DECLINLINE(loff_t) i_size_read(struct inode *pInode)
@@ -99,5 +99,5 @@
 #endif /* < 2.6.0 */
 
-#if  LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0) \
+#if  RTLNX_VER_MAX(3,2,0) \
   && (!defined(RHEL_MAJOR) || RHEL_MAJOR != 6 || RHEL_MINOR < 10)
 DECLINLINE(void) set_nlink(struct inode *pInode, unsigned int cLinks)
@@ -150,5 +150,5 @@
     /** Mount tag for VBoxService automounter.  @since 6.0 */
     char                    szTag[32];
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(4, 12, 0)
+#if RTLNX_VER_RANGE(2,6,0,  4,12,0)
     /** The backing device info structure. */
     struct backing_dev_info bdi;
@@ -160,5 +160,5 @@
     /** The time to live for inode information in milliseconds, for /proc/mounts. */
     int32_t                 msInodeTTL;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(4, 2, 0)
+#if RTLNX_VER_RANGE(4,0,0,  4,2,0)
     /** 4.0 and 4.1 are missing noop_backing_dev_info export, so take down the
      *  initial value so we can restore it in vbsf_done_backing_dev(). (paranoia) */
@@ -169,5 +169,5 @@
 /* Following casts are here to prevent assignment of void * to
    pointers of arbitrary type */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
+#if RTLNX_VER_MAX(2,6,0)
 # define VBSF_GET_SUPER_INFO(sb)                ((struct vbsf_super_info *)(sb)->u.generic_sbp)
 # define VBSF_SET_SUPER_INFO(sb, a_pSuperInfo)  do { (sb)->u.generic_sbp = a_pSuperInfo; } while (0)
@@ -249,5 +249,5 @@
 };
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19) || defined(KERNEL_FC6)
+#if RTLNX_VER_MIN(2,6,19) || defined(KERNEL_FC6)
 /* FC6 kernel 2.6.18, vanilla kernel 2.6.19+ */
 # define VBSF_GET_INODE_INFO(i)       ((struct vbsf_inode_info *) (i)->i_private)
@@ -265,6 +265,6 @@
 extern int  vbsf_inode_revalidate_worker(struct dentry *dentry, bool fForced, bool fInodeLocked);
 extern int  vbsf_inode_revalidate_with_handle(struct dentry *dentry, SHFLHANDLE hHostFile, bool fForced, bool fInodeLocked);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 18)
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
+#if RTLNX_VER_MIN(2,5,18)
+# if RTLNX_VER_MIN(4,11,0)
 extern int  vbsf_inode_getattr(const struct path *path, struct kstat *kstat, u32 request_mask, unsigned int query_flags);
 # else
@@ -420,7 +420,7 @@
 
 /** Macro for getting the dentry for a struct file. */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
+#if RTLNX_VER_MIN(4,6,0)
 # define VBSF_GET_F_DENTRY(f)   file_dentry(f)
-#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 20)
+#elif RTLNX_VER_MIN(2,6,20)
 # define VBSF_GET_F_DENTRY(f)   (f->f_path.dentry)
 #else
Index: trunk/src/VBox/HostDrivers/Support/SUPDrvInternal.h
===================================================================
--- trunk/src/VBox/HostDrivers/Support/SUPDrvInternal.h	(revision 85697)
+++ trunk/src/VBox/HostDrivers/Support/SUPDrvInternal.h	(revision 85698)
@@ -55,6 +55,6 @@
 
 #elif defined(RT_OS_LINUX)
-#   include <linux/version.h>
-#   if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 33)
+#   include <iprt/linux/version.h>
+#   if RTLNX_VER_MIN(2,6,33)
 #    include <generated/autoconf.h>
 #   else
@@ -65,10 +65,10 @@
 #   if defined(CONFIG_MODVERSIONS) && !defined(MODVERSIONS)
 #       define MODVERSIONS
-#       if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 71)
+#       if RTLNX_VER_MAX(2,5,71)
 #           include <linux/modversions.h>
 #       endif
 #   endif
 #   ifndef KBUILD_STR
-#       if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16)
+#       if RTLNX_VER_MAX(2,6,16)
 #            define KBUILD_STR(s) s
 #       else
@@ -79,5 +79,5 @@
 #   include <linux/spinlock.h>
 #   include <linux/slab.h>
-#   if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
+#   if RTLNX_VER_MIN(2,6,27)
 #       include <linux/semaphore.h>
 #   else /* older kernels */
Index: trunk/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c
===================================================================
--- trunk/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c	(revision 85697)
+++ trunk/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c	(revision 85698)
@@ -47,5 +47,5 @@
 
 /** @todo figure out the exact version number */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 16)
+#if RTLNX_VER_MIN(2,6,16)
 # include <iprt/power.h>
 # define VBOX_WITH_SUSPEND_NOTIFICATION
@@ -57,5 +57,5 @@
 # include <linux/platform_device.h>
 #endif
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28)) && defined(SUPDRV_WITH_MSR_PROBER)
+#if (RTLNX_VER_MIN(2,6,28)) && defined(SUPDRV_WITH_MSR_PROBER)
 # define SUPDRV_LINUX_HAS_SAFE_MSR_API
 # include <asm/msr.h>
@@ -72,5 +72,5 @@
 /* check kernel version */
 # ifndef SUPDRV_AGNOSTIC
-#  if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
+#  if RTLNX_VER_MAX(2,6,0)
 #   error Unsupported kernel version!
 #  endif
@@ -112,5 +112,5 @@
 #ifdef VBOX_WITH_SUSPEND_NOTIFICATION
 static int  VBoxDrvProbe(struct platform_device *pDev);
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30)
+# if RTLNX_VER_MIN(2,6,30)
 static int  VBoxDrvSuspend(struct device *pDev);
 static int  VBoxDrvResume(struct device *pDev);
@@ -140,5 +140,5 @@
 #define DEVICE_NAME_USR     "vboxdrvu"
 
-#if (defined(RT_ARCH_AMD64) && LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 23)) || defined(VBOX_WITH_TEXT_MODMEM_HACK)
+#if (defined(RT_ARCH_AMD64) && RTLNX_VER_MAX(2,6,23)) || defined(VBOX_WITH_TEXT_MODMEM_HACK)
 /**
  * Memory for the executable memory heap (in IPRT).
@@ -203,5 +203,5 @@
     name:       DEVICE_NAME_SYS,
     fops:       &gFileOpsVBoxDrvSys,
-# if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 17)
+# if RTLNX_VER_MAX(2,6,18)
     devfs_name: DEVICE_NAME_SYS,
 # endif
@@ -213,5 +213,5 @@
     name:       DEVICE_NAME_USR,
     fops:       &gFileOpsVBoxDrvUsr,
-# if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 17)
+# if RTLNX_VER_MAX(2,6,18)
     devfs_name: DEVICE_NAME_USR,
 # endif
@@ -220,5 +220,5 @@
 
 #ifdef VBOX_WITH_SUSPEND_NOTIFICATION
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30)
+# if RTLNX_VER_MIN(2,6,30)
 static struct dev_pm_ops gPlatformPMOps =
 {
@@ -233,5 +233,5 @@
 {
     .probe = VBoxDrvProbe,
-# if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 30)
+# if RTLNX_VER_MAX(2,6,30)
     .suspend = VBoxDrvSuspend,
     .resume  = VBoxDrvResume,
@@ -241,5 +241,5 @@
     {
         .name = "vboxdrv",
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30)
+# if RTLNX_VER_MIN(2,6,30)
         .pm = &gPlatformPMOps,
 # endif
@@ -260,6 +260,6 @@
 DECLINLINE(RTUID) vboxdrvLinuxUid(void)
 {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29)
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 5, 0)
+#if RTLNX_VER_MIN(2,6,29)
+# if RTLNX_VER_MIN(3,5,0)
     return from_kuid(current_user_ns(), current->cred->uid);
 # else
@@ -273,6 +273,6 @@
 DECLINLINE(RTGID) vboxdrvLinuxGid(void)
 {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29)
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 5, 0)
+#if RTLNX_VER_MIN(2,6,29)
+# if RTLNX_VER_MIN(3,5,0)
     return from_kgid(current_user_ns(), current->cred->gid);
 # else
@@ -286,6 +286,6 @@
 DECLINLINE(RTUID) vboxdrvLinuxEuid(void)
 {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29)
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 5, 0)
+#if RTLNX_VER_MIN(2,6,29)
+# if RTLNX_VER_MIN(3,5,0)
     return from_kuid(current_user_ns(), current->cred->euid);
 # else
@@ -332,5 +332,5 @@
         if (RT_SUCCESS(rc))
         {
-#if (defined(RT_ARCH_AMD64) && LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 23)) || defined(VBOX_WITH_TEXT_MODMEM_HACK)
+#if (defined(RT_ARCH_AMD64) && RTLNX_VER_MAX(2,6,23)) || defined(VBOX_WITH_TEXT_MODMEM_HACK)
 # ifdef VBOX_WITH_TEXT_MODMEM_HACK
             set_memory_x(&g_abExecMemory[0], sizeof(g_abExecMemory) / PAGE_SIZE);
@@ -516,5 +516,5 @@
  *                      Ignored.
  */
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30) && !defined(DOXYGEN_RUNNING)
+# if RTLNX_VER_MIN(2,6,30) && !defined(DOXYGEN_RUNNING)
 static int VBoxDrvSuspend(struct device *pDev)
 # else
@@ -531,5 +531,5 @@
  * @param   pDev        Pointer to the platform device.
  */
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30)
+# if RTLNX_VER_MIN(2,6,30)
 static int VBoxDrvResume(struct device *pDev)
 # else
@@ -757,7 +757,7 @@
 RTCCUINTREG VBOXCALL supdrvOSChangeCR4(RTCCUINTREG fOrMask, RTCCUINTREG fAndMask)
 {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
+#if RTLNX_VER_MIN(5,8,0)
     RTCCUINTREG const uOld = __read_cr4();
-#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3, 20, 0)
+#elif RTLNX_VER_MIN(3,20,0)
     RTCCUINTREG const uOld = this_cpu_read(cpu_tlbstate.cr4);
 #else
@@ -767,7 +767,7 @@
     if (uNew != uOld)
     {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
+#if RTLNX_VER_MIN(5,8,0)
         ASMSetCR4(uNew);
-#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3, 20, 0)
+#elif RTLNX_VER_MIN(3,20,0)
         this_cpu_write(cpu_tlbstate.cr4, uNew);
         __write_cr4(uNew);
@@ -1121,5 +1121,5 @@
 
         /* Nobody waiting and no exit function. */
-#  if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0)
+#  if RTLNX_VER_MAX(3,13,0)
         pMyMod->waiter              = NULL;
 #  endif
@@ -1128,5 +1128,5 @@
         /* References, very important as we must not allow the module
            to be unloaded using rmmod. */
-#  if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
+#  if RTLNX_VER_MIN(3,19,0)
         atomic_set(&pMyMod->refcnt, 42);
 #  else
@@ -1213,5 +1213,5 @@
         mutex_unlock(&module_mutex);
 
-# if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0)
+# if RTLNX_VER_MAX(3,19,0)
         free_percpu(pMyMod->refptr);
 # endif
@@ -1432,5 +1432,5 @@
     fFlags |= SUPKERNELFEATURES_GDT_READ_ONLY;
 #endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
+#if RTLNX_VER_MIN(4,12,0)
     fFlags |= SUPKERNELFEATURES_GDT_NEED_WRITABLE;
 #endif
@@ -1447,5 +1447,5 @@
 int VBOXCALL    supdrvOSGetCurrentGdtRw(RTHCUINTPTR *pGdtRw)
 {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
+#if RTLNX_VER_MIN(4,12,0)
     *pGdtRw = (RTHCUINTPTR)get_current_gdt_rw();
     return VINF_SUCCESS;
Index: trunk/src/VBox/HostDrivers/Support/linux/files_vboxdrv
===================================================================
--- trunk/src/VBox/HostDrivers/Support/linux/files_vboxdrv	(revision 85697)
+++ trunk/src/VBox/HostDrivers/Support/linux/files_vboxdrv	(revision 85698)
@@ -73,4 +73,5 @@
     ${PATH_ROOT}/include/iprt/uuid.h=>include/iprt/uuid.h \
     ${PATH_ROOT}/include/iprt/x86.h=>include/iprt/x86.h \
+    ${PATH_ROOT}/include/iprt/linux/version.h=>include/iprt/linux/version.h \
     ${PATH_ROOT}/include/iprt/nocrt/limits.h=>include/iprt/nocrt/limits.h \
     ${PATH_ROOT}/include/VBox/cdefs.h=>include/VBox/cdefs.h \
Index: trunk/src/VBox/HostDrivers/VBoxNetAdp/linux/VBoxNetAdp-linux.c
===================================================================
--- trunk/src/VBox/HostDrivers/VBoxNetAdp/linux/VBoxNetAdp-linux.c	(revision 85697)
+++ trunk/src/VBox/HostDrivers/VBoxNetAdp/linux/VBoxNetAdp-linux.c	(revision 85698)
@@ -76,18 +76,18 @@
 static int VBoxNetAdpLinuxOpen(struct inode *pInode, struct file *pFilp);
 static int VBoxNetAdpLinuxClose(struct inode *pInode, struct file *pFilp);
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 36)
+#if RTLNX_VER_MAX(2,6,36)
 static int VBoxNetAdpLinuxIOCtl(struct inode *pInode, struct file *pFilp,
                                 unsigned int uCmd, unsigned long ulArg);
-#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36) */
+#else  /* >= 2,6,36 */
 static long VBoxNetAdpLinuxIOCtlUnlocked(struct file *pFilp,
                                          unsigned int uCmd, unsigned long ulArg);
-#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36) */
+#endif /* >= 2,6,36 */
 
 static void vboxNetAdpEthGetDrvinfo(struct net_device *dev, struct ethtool_drvinfo *info);
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0)
+#if RTLNX_VER_MIN(4,20,0)
 static int vboxNetAdpEthGetLinkSettings(struct net_device *pNetDev, struct ethtool_link_ksettings *pLinkSettings);
-#else /* LINUX_VERSION_CODE < KERNEL_VERSION(4, 20, 0) */
+#else  /* < 4,20,0 */
 static int vboxNetAdpEthGetSettings(struct net_device *dev, struct ethtool_cmd *cmd);
-#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4, 20, 0) */
+#endif /* < 4,20,0 */
 
 
@@ -113,9 +113,9 @@
     open:       VBoxNetAdpLinuxOpen,
     release:    VBoxNetAdpLinuxClose,
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 36)
+#if RTLNX_VER_MAX(2,6,36)
     ioctl:      VBoxNetAdpLinuxIOCtl,
-#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36) */
+#else /* RTLNX_VER_MIN(2,6,36) */
     unlocked_ioctl: VBoxNetAdpLinuxIOCtlUnlocked,
-#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36) */
+#endif /* RTLNX_VER_MIN(2,6,36) */
 };
 
@@ -126,10 +126,10 @@
     name:       VBOXNETADP_CTL_DEV_NAME,
     fops:       &gFileOpsVBoxNetAdp,
-# if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 17)
+# if RTLNX_VER_MAX(2,6,18)
     devfs_name: VBOXNETADP_CTL_DEV_NAME
 # endif
 };
 
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19)
+# if RTLNX_VER_MIN(2,6,19)
 static const struct ethtool_ops gEthToolOpsVBoxNetAdp =
 # else
@@ -138,9 +138,9 @@
 {
     .get_drvinfo        = vboxNetAdpEthGetDrvinfo,
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0)
+# if RTLNX_VER_MIN(4,20,0)
     .get_link_ksettings = vboxNetAdpEthGetLinkSettings,
-# else /* LINUX_VERSION_CODE < KERNEL_VERSION(4, 20, 0) */
+# else
     .get_settings       = vboxNetAdpEthGetSettings,
-# endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4, 20, 0) */
+# endif
     .get_link           = ethtool_op_get_link,
 };
@@ -174,5 +174,5 @@
     pPriv->Stats.tx_packets++;
     pPriv->Stats.tx_bytes += pSkb->len;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 31)
+#if RTLNX_VER_MAX(2,6,31)
     /* Update transmission time stamp. */
     pNetDev->trans_start = jiffies;
@@ -214,5 +214,5 @@
 
 
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0)
+# if RTLNX_VER_MIN(4,20,0)
 /* ethtool_ops::get_link_ksettings */
 static int vboxNetAdpEthGetLinkSettings(struct net_device *pNetDev, struct ethtool_link_ksettings *pLinkSettings)
@@ -230,5 +230,5 @@
     return 0;
 }
-#else /* LINUX_VERSION_CODE < KERNEL_VERSION(4, 20, 0) */
+#else /* RTLNX_VER_MAX(4,20,0) */
 /* ethtool_ops::get_settings */
 static int vboxNetAdpEthGetSettings(struct net_device *pNetDev, struct ethtool_cmd *cmd)
@@ -236,5 +236,5 @@
     cmd->supported      = 0;
     cmd->advertising    = 0;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
+#if RTLNX_VER_MIN(2,6,27)
     ethtool_cmd_speed_set(cmd, SPEED_10);
 #else
@@ -250,8 +250,8 @@
     return 0;
 }
-#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4, 20, 0) */
-
-
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29)
+#endif /* RTLNX_VER_MAX(4,20,0) */
+
+
+#if RTLNX_VER_MIN(2,6,29)
 static const struct net_device_ops vboxNetAdpNetdevOps = {
     .ndo_open               = vboxNetAdpLinuxOpen,
@@ -267,12 +267,12 @@
 
     ether_setup(pNetDev);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29)
+#if RTLNX_VER_MIN(2,6,29)
     pNetDev->netdev_ops = &vboxNetAdpNetdevOps;
-#else /* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29) */
+#else /* RTLNX_VER_MAX(2,6,29) */
     pNetDev->open = vboxNetAdpLinuxOpen;
     pNetDev->stop = vboxNetAdpLinuxStop;
     pNetDev->hard_start_xmit = vboxNetAdpLinuxXmit;
     pNetDev->get_stats = vboxNetAdpLinuxGetStats;
-#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29) */
+#endif /* RTLNX_VER_MAX(2,6,29) */
 
     pNetDev->ethtool_ops = &gEthToolOpsVBoxNetAdp;
@@ -291,5 +291,5 @@
     pNetDev = alloc_netdev(sizeof(VBOXNETADPPRIV),
                            pThis->szName[0] ? pThis->szName : VBOXNETADP_LINUX_NAME,
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 17, 0)
+#if RTLNX_VER_MIN(3,17,0)
                            NET_NAME_UNKNOWN,
 #endif
@@ -391,11 +391,11 @@
  * @param   ulArg       The argument specified to ioctl().
  */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 36)
+#if RTLNX_VER_MAX(2,6,36)
 static int VBoxNetAdpLinuxIOCtl(struct inode *pInode, struct file *pFilp,
                                 unsigned int uCmd, unsigned long ulArg)
-#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36) */
+#else /* RTLNX_VER_MIN(2,6,36) */
 static long VBoxNetAdpLinuxIOCtlUnlocked(struct file *pFilp,
                                          unsigned int uCmd, unsigned long ulArg)
-#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36) */
+#endif /* RTLNX_VER_MIN(2,6,36) */
 {
     VBOXNETADPREQ Req;
Index: trunk/src/VBox/HostDrivers/VBoxNetAdp/linux/files_vboxnetadp
===================================================================
--- trunk/src/VBox/HostDrivers/VBoxNetAdp/linux/files_vboxnetadp	(revision 85697)
+++ trunk/src/VBox/HostDrivers/VBoxNetAdp/linux/files_vboxnetadp	(revision 85698)
@@ -66,4 +66,5 @@
     ${PATH_ROOT}/include/iprt/uuid.h=>include/iprt/uuid.h \
     ${PATH_ROOT}/include/iprt/x86.h=>include/iprt/x86.h \
+    ${PATH_ROOT}/include/iprt/linux/version.h=>include/iprt/linux/version.h \
     ${PATH_ROOT}/include/iprt/nocrt/limits.h=>include/iprt/nocrt/limits.h \
     ${PATH_ROOT}/include/VBox/cdefs.h=>include/VBox/cdefs.h \
Index: trunk/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c
===================================================================
--- trunk/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c	(revision 85697)
+++ trunk/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c	(revision 85698)
@@ -35,5 +35,5 @@
 #include "revision-generated.h"
 #include "product-generated.h"
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24)
+#if RTLNX_VER_MIN(2,6,24)
 #include <linux/nsproxy.h>
 #endif
@@ -46,5 +46,5 @@
 #include <linux/ip.h>
 #include <linux/if_vlan.h>
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0)
+#if RTLNX_VER_MIN(4,5,0)
 #include <uapi/linux/pkt_cls.h>
 #endif
@@ -90,5 +90,5 @@
 #endif
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
+#if RTLNX_VER_MIN(3,11,0)
 # define VBOX_NETDEV_NOTIFIER_INFO_TO_DEV(ptr) netdev_notifier_info_to_dev(ptr)
 #else
@@ -96,9 +96,9 @@
 #endif
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 5, 0)
+#if RTLNX_VER_MIN(3,5,0)
 # define VBOX_SKB_KMAP_FRAG(frag) kmap_atomic(skb_frag_page(frag))
 # define VBOX_SKB_KUNMAP_FRAG(vaddr) kunmap_atomic(vaddr)
 #else
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)
+# if RTLNX_VER_MIN(3,2,0)
 #  define VBOX_SKB_KMAP_FRAG(frag) kmap_atomic(skb_frag_page(frag), KM_SKB_DATA_SOFTIRQ)
 #  define VBOX_SKB_KUNMAP_FRAG(vaddr) kunmap_atomic(vaddr, KM_SKB_DATA_SOFTIRQ)
@@ -109,5 +109,5 @@
 #endif
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 34)
+#if RTLNX_VER_MIN(2,6,34)
 # define VBOX_NETDEV_NAME(dev)              netdev_name(dev)
 #else
@@ -115,5 +115,5 @@
 #endif
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)
+#if RTLNX_VER_MIN(2,6,25)
 # define VBOX_IPV4_IS_LOOPBACK(addr)        ipv4_is_loopback(addr)
 # define VBOX_IPV4_IS_LINKLOCAL_169(addr)   ipv4_is_linklocal_169(addr)
@@ -123,5 +123,5 @@
 #endif
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22)
+#if RTLNX_VER_MIN(2,6,22)
 # define VBOX_SKB_RESET_NETWORK_HDR(skb)    skb_reset_network_header(skb)
 # define VBOX_SKB_RESET_MAC_HDR(skb)        skb_reset_mac_header(skb)
@@ -133,12 +133,12 @@
 #endif
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19)
+#if RTLNX_VER_MIN(2,6,19)
 # define VBOX_SKB_CHECKSUM_HELP(skb)        skb_checksum_help(skb)
 #else
 # define CHECKSUM_PARTIAL                   CHECKSUM_HW
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 10)
+# if RTLNX_VER_MIN(2,6,10)
 #  define VBOX_SKB_CHECKSUM_HELP(skb)       skb_checksum_help(skb, 0)
 # else
-#  if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 7)
+#  if RTLNX_VER_MIN(2,6,7)
 #   define VBOX_SKB_CHECKSUM_HELP(skb)      skb_checksum_help(&skb, 0)
 #  else
@@ -151,5 +151,5 @@
 #endif
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 20, 0)
+#if RTLNX_VER_MIN(3,20,0)
 # define VBOX_HAVE_SKB_VLAN
 #else
@@ -177,5 +177,5 @@
 #endif
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 18)
+#if RTLNX_VER_MIN(2,6,18)
 
 /** Indicates that the linux kernel may send us GSO frames. */
@@ -196,7 +196,7 @@
 # define VBOXNETFLT_WITH_GSO_RECV           1
 
-#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 18) */
-
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29)
+#endif /* RTLNX_VER_MIN(2,6,18) */
+
+#if RTLNX_VER_MIN(2,6,29)
 /** This enables or disables handling of GSO frames coming from the wire (GRO). */
 # define VBOXNETFLT_WITH_GRO                1
@@ -246,5 +246,5 @@
 
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 12) && defined(LOG_ENABLED)
+#if RTLNX_VER_MAX(2,6,12) && defined(LOG_ENABLED)
 unsigned dev_get_flags(const struct net_device *dev)
 {
@@ -262,5 +262,5 @@
     return flags;
 }
-#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 12) */
+#endif /* RTLNX_VER_MAX(2,6,12) */
 
 
@@ -344,5 +344,5 @@
 #ifdef VBOXNETFLT_WITH_HOST2WIRE_FILTER
 
-# if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
+# if RTLNX_VER_MAX(2,6,29)
 
 # include <linux/ethtool.h>
@@ -352,5 +352,5 @@
 # define OVR_XMIT pfnStartXmit
 
-# else /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29) */
+# else /* RTLNX_VER_MIN(2,6,29) */
 
 typedef struct net_device_ops OVR_OPSTYPE;
@@ -358,5 +358,5 @@
 # define OVR_XMIT pOrgOps->ndo_start_xmit
 
-# endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29) */
+# endif /* RTLNX_VER_MIN(2,6,29) */
 
 /**
@@ -379,8 +379,8 @@
     /** Pointer to the original ops. */
     OVR_OPSTYPE const              *pOrgOps;
-# if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
+# if RTLNX_VER_MAX(2,6,29)
     /** Pointer to the original hard_start_xmit function. */
     int (*pfnStartXmit)(struct sk_buff *pSkb, struct net_device *pDev);
-# endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29) */
+# endif /* RTLNX_VER_MAX(2,6,29) */
     /** Pointer to the net filter instance. */
     PVBOXNETFLTINS                  pVBoxNetFlt;
@@ -419,7 +419,7 @@
     if (   !VALID_PTR(pOverride)
         || pOverride->u32Magic != VBOXNETDEVICEOPSOVERRIDE_MAGIC
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29)
+# if RTLNX_VER_MIN(2,6,29)
         || !VALID_PTR(pOverride->pOrgOps)
-# endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29) */
+# endif /* RTLNX_VER_MIN(2,6,29) */
         )
     {
@@ -479,9 +479,9 @@
     pOverride->pOrgOps              = pDev->OVR_OPS;
     pOverride->Ops                  = *pDev->OVR_OPS;
-# if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
+# if RTLNX_VER_MAX(2,6,29)
     pOverride->pfnStartXmit         = pDev->hard_start_xmit;
-# else /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29) */
+# else /* RTLNX_VER_MIN(2,6,29) */
     pOverride->Ops.ndo_start_xmit   = vboxNetFltLinuxStartXmitFilter;
-# endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29) */
+# endif /* RTLNX_VER_MIN(2,6,29) */
     pOverride->u32Magic             = VBOXNETDEVICEOPSOVERRIDE_MAGIC;
     pOverride->cTotal               = 0;
@@ -491,7 +491,7 @@
     RTSpinlockAcquire(pThis->hSpinlock); /* (this isn't necessary, but so what) */
     ASMAtomicWritePtr((void * volatile *)&pDev->OVR_OPS, pOverride);
-# if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
+# if RTLNX_VER_MAX(2,6,29)
     ASMAtomicXchgPtr((void * volatile *)&pDev->hard_start_xmit, vboxNetFltLinuxStartXmitFilter);
-# endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29) */
+# endif /* RTLNX_VER_MAX(2,6,29) */
     RTSpinlockRelease(pThis->hSpinlock);
 }
@@ -519,7 +519,7 @@
            )
         {
-# if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
+# if RTLNX_VER_MAX(2,6,29)
             ASMAtomicWritePtr((void * volatile *)&pDev->hard_start_xmit, pOverride->pfnStartXmit);
-# endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29) */
+# endif /* RTLNX_VER_MAX(2,6,29) */
             ASMAtomicWritePtr((void const * volatile *)&pDev->OVR_OPS, pOverride->pOrgOps);
             ASMAtomicWriteU32(&pOverride->u32Magic, 0);
@@ -566,5 +566,5 @@
             Log(("vboxNetFltLinuxRetainNetDev: Device %p(%s) retained. ref=%d\n",
                  pDev, pDev->name,
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)
+#if RTLNX_VER_MIN(2,6,37)
                  netdev_refcnt_read(pDev)
 #else
@@ -602,5 +602,5 @@
         Log(("vboxNetFltLinuxReleaseNetDev: Device %p(%s) released. ref=%d\n",
              pDev, pDev->name,
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)
+#if RTLNX_VER_MIN(2,6,37)
              netdev_refcnt_read(pDev)
 #else
@@ -773,5 +773,5 @@
         Assert(skb_headlen(pPkt) >= pSG->GsoCtx.cbHdrsTotal);
         pPkt->ip_summed  = CHECKSUM_PARTIAL;
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22)
+# if RTLNX_VER_MIN(2,6,22)
         pPkt->csum_start = skb_headroom(pPkt) + pSG->GsoCtx.offHdr2;
         if (fGsoType & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6))
@@ -817,7 +817,11 @@
 DECLINLINE(unsigned) vboxNetFltLinuxGetChecksumStartOffset(struct sk_buff *pBuf)
 {
-# if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 21)
+#if RTLNX_VER_MIN(2,6,38)
+    return skb_checksum_start_offset(pBuf);
+#elif RTLNX_VER_MIN(2,6,22)
+    return pBuf->csum_start - skb_headroom(pBuf);
+#else
     unsigned char *pTransportHdr = pBuf->h.raw;
-#  if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 18)
+# if RTLNX_VER_MAX(2,6,19)
     /*
      * Try to work around the problem with CentOS 4.7 and 5.2 (2.6.9
@@ -828,13 +832,7 @@
     if (pBuf->h.raw == pBuf->nh.raw && pBuf->protocol == htons(ETH_P_IP))
         pTransportHdr = pBuf->nh.raw + pBuf->nh.iph->ihl * 4;
-#  endif /* LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 18) */
+# endif
     return pTransportHdr - pBuf->data;
-# else /* LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 21) */
-#  if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 38)
-    return pBuf->csum_start - skb_headroom(pBuf);
-#  else /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 38) */
-    return skb_checksum_start_offset(pBuf);
-#  endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 38) */
-# endif /* LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 21) */
+#endif
 }
 
@@ -867,5 +865,5 @@
     unsigned cbProduced = 0;
 
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
+# if RTLNX_VER_MIN(2,6,27)
     /* Restore VLAN tag stripped by host hardware */
     if (vlan_tx_tag_present(pBuf))
@@ -882,5 +880,5 @@
         cbProduced += VLAN_ETH_HLEN;
     }
-# endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27) */
+# endif /* RTLNX_VER_MIN(2,6,27) */
 
     if (pBuf->ip_summed == CHECKSUM_PARTIAL && pBuf->pkt_type == PACKET_OUTGOING)
@@ -931,5 +929,5 @@
     {
         skb_frag_t *pFrag = &skb_shinfo(pBuf)->frags[i];
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0) || defined(OPENSUSE_152)
+# if RTLNX_VER_MIN(5,4,0) || defined(OPENSUSE_152)
         pSG->aSegs[iSeg].cb = pFrag->bv_len;
         pSG->aSegs[iSeg].pv = VBOX_SKB_KMAP_FRAG(pFrag) + pFrag->bv_offset;
@@ -952,5 +950,5 @@
         {
             skb_frag_t *pFrag = &skb_shinfo(pFragBuf)->frags[i];
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0) || defined(OPENSUSE_152)
+# if RTLNX_VER_MIN(5,4,0) || defined(OPENSUSE_152)
             pSG->aSegs[iSeg].cb = pFrag->bv_len;
             pSG->aSegs[iSeg].pv = VBOX_SKB_KMAP_FRAG(pFrag) + pFrag->bv_offset;
@@ -1027,5 +1025,5 @@
  * @returns 0 or EJUSTRETURN - this is probably copy & pastry and thus wrong.
  */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 14)
+#if RTLNX_VER_MIN(2,6,14)
 static int vboxNetFltLinuxPacketHandler(struct sk_buff *pBuf,
                                         struct net_device *pSkbDev,
@@ -1042,8 +1040,8 @@
     LogFlow(("vboxNetFltLinuxPacketHandler: pBuf=%p pSkbDev=%p pPacketType=%p\n",
              pBuf, pSkbDev, pPacketType));
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 18)
+#if RTLNX_VER_MIN(2,6,18)
     Log3(("vboxNetFltLinuxPacketHandler: skb len=%u data_len=%u truesize=%u next=%p nr_frags=%u gso_size=%u gso_seqs=%u gso_type=%x frag_list=%p pkt_type=%x\n",
           pBuf->len, pBuf->data_len, pBuf->truesize, pBuf->next, skb_shinfo(pBuf)->nr_frags, skb_shinfo(pBuf)->gso_size, skb_shinfo(pBuf)->gso_segs, skb_shinfo(pBuf)->gso_type, skb_shinfo(pBuf)->frag_list, pBuf->pkt_type));
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22)
+# if RTLNX_VER_MIN(2,6,22)
     Log6(("vboxNetFltLinuxPacketHandler: packet dump follows:\n%.*Rhxd\n", pBuf->len-pBuf->data_len, skb_mac_header(pBuf)));
 # endif
@@ -1102,5 +1100,5 @@
         /* Somehow skb_copy ignores mac_len */
         pBuf->mac_len = uMacLen;
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
+# if RTLNX_VER_MIN(2,6,27)
         /* Restore VLAN tag stripped by host hardware */
         if (vlan_tx_tag_present(pBuf) && skb_headroom(pBuf) >= VLAN_ETH_HLEN)
@@ -1114,16 +1112,16 @@
             pBuf->mac_len      += VLAN_HLEN;
         }
-# endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27) */
-
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 18)
+# endif /* RTLNX_VER_MIN(2,6,27) */
+
+# if RTLNX_VER_MIN(2,6,18)
         Log3(("vboxNetFltLinuxPacketHandler: skb copy len=%u data_len=%u truesize=%u next=%p nr_frags=%u gso_size=%u gso_seqs=%u gso_type=%x frag_list=%p pkt_type=%x\n",
               pBuf->len, pBuf->data_len, pBuf->truesize, pBuf->next, skb_shinfo(pBuf)->nr_frags, skb_shinfo(pBuf)->gso_size, skb_shinfo(pBuf)->gso_segs, skb_shinfo(pBuf)->gso_type, skb_shinfo(pBuf)->frag_list, pBuf->pkt_type));
-#  if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22)
+#  if RTLNX_VER_MIN(2,6,22)
         Log6(("vboxNetFltLinuxPacketHandler: packet dump follows:\n%.*Rhxd\n", pBuf->len-pBuf->data_len, skb_mac_header(pBuf)));
-#  endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22) */
-# else /* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18) */
+#  endif /* RTLNX_VER_MIN(2,6,22) */
+# else /* RTLNX_VER_MAX(2,6,18) */
         Log3(("vboxNetFltLinuxPacketHandler: skb copy len=%u data_len=%u truesize=%u next=%p nr_frags=%u tso_size=%u tso_seqs=%u frag_list=%p pkt_type=%x\n",
               pBuf->len, pBuf->data_len, pBuf->truesize, pBuf->next, skb_shinfo(pBuf)->nr_frags, skb_shinfo(pBuf)->tso_size, skb_shinfo(pBuf)->tso_segs, skb_shinfo(pBuf)->frag_list, pBuf->pkt_type));
-# endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18) */
+# endif /* RTLNX_VER_MAX(2,6,18) */
     }
 #endif /* !VBOXNETFLT_SG_SUPPORT */
@@ -1162,5 +1160,5 @@
         *pcbTemp = vboxNetFltLinuxGetChecksumStartOffset(pBuf) + VBOX_SKB_CSUM_OFFSET(pBuf) + sizeof(uint16_t);
     }
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
+# if RTLNX_VER_MIN(2,6,27)
     if (vlan_tx_tag_present(pBuf))
     {
@@ -1170,5 +1168,5 @@
             *pcbTemp = VLAN_ETH_HLEN;
     }
-# endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27) */
+# endif /* RTLNX_VER_MIN(2,6,27) */
     if (*pcbTemp)
         ++cSegs;
@@ -1554,5 +1552,5 @@
              * skb_gso_segment does the following. Do we need to do it as well?
              */
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22)
+# if RTLNX_VER_MIN(2,6,22)
             skb_reset_mac_header(pBuf);
             pBuf->mac_len = pBuf->network_header - pBuf->mac_header;
@@ -1604,5 +1602,7 @@
         if (pBuf->ip_summed == CHECKSUM_PARTIAL && pBuf->pkt_type == PACKET_OUTGOING)
         {
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 18)
+# if RTLNX_VER_MIN(2,6,19)
+            int rc = VBOX_SKB_CHECKSUM_HELP(pBuf);
+# else
             /*
              * Try to work around the problem with CentOS 4.7 and 5.2 (2.6.9
@@ -1614,11 +1614,10 @@
             if (pBuf->h.raw == pBuf->nh.raw && pBuf->protocol == htons(ETH_P_IP))
                 pBuf->h.raw = pBuf->nh.raw + pBuf->nh.iph->ihl * 4;
-#endif /* LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 18) */
             int rc = VBOX_SKB_CHECKSUM_HELP(pBuf);
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 18)
             /* Restore the original (wrong) pointer. */
             pBuf->h.raw = tmp;
-#endif /* LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 18) */
-            if (rc) {
+# endif
+            if (rc)
+            {
                 LogRel(("VBoxNetFlt: Failed to compute checksum, dropping the packet.\n"));
                 return;
@@ -1674,5 +1673,5 @@
  * @param   pWork               The work queue.
  */
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 20)
+# if RTLNX_VER_MIN(2,6,20)
 static void vboxNetFltLinuxXmitTask(struct work_struct *pWork)
 # else
@@ -1791,5 +1790,5 @@
             return true;
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36) /* TAP started doing carrier */
+#if RTLNX_VER_MIN(2,6,36) /* TAP started doing carrier */
         return !strncmp(Info.driver,   "tun", 4)
             && !strncmp(Info.bus_info, "tap", 4);
@@ -1800,5 +1799,5 @@
 }
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18)
+#if RTLNX_VER_MAX(2,6,18)
 DECLINLINE(void) netif_tx_lock_bh(struct net_device *pDev)
 {
@@ -1853,5 +1852,5 @@
     Log(("vboxNetFltLinuxAttachToInterface: Device %p(%s) retained. ref=%d\n",
           pDev, pDev->name,
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)
+#if RTLNX_VER_MIN(2,6,37)
           netdev_refcnt_read(pDev)
 #else
@@ -1950,5 +1949,5 @@
         Log(("vboxNetFltLinuxUnregisterDevice: Device %p(%s) released. ref=%d\n",
              pDev, pDev->name,
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)
+#if RTLNX_VER_MIN(2,6,37)
              netdev_refcnt_read(pDev)
 #else
@@ -2061,6 +2060,6 @@
     if (ulEventType == NETDEV_REGISTER)
     {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24) /* cgroups/namespaces introduced */
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26)
+#if RTLNX_VER_MIN(2,6,24) /* cgroups/namespaces introduced */
+# if RTLNX_VER_MIN(2,6,26)
 #  define VBOX_DEV_NET(dev)             dev_net(dev)
 #  define VBOX_NET_EQ(n1, n2)           net_eq((n1), (n2))
@@ -2133,5 +2132,5 @@
      * IPv4
      */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 14)
+#if RTLNX_VER_MIN(2,6,14)
     in_dev = __in_dev_get_rtnl(dev);
 #else
@@ -2168,5 +2167,5 @@
 
         read_lock_bh(&in6_dev->lock);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35)
+#if RTLNX_VER_MIN(2,6,35)
         list_for_each_entry(ifa, &in6_dev->addr_list, if_list)
 #else
@@ -2472,5 +2471,5 @@
         Log(("vboxNetFltOsDeleteInstance: Device %p(%s) released. ref=%d\n",
              pDev, pDev->name,
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)
+#if RTLNX_VER_MIN(2,6,37)
              netdev_refcnt_read(pDev)
 #else
@@ -2574,5 +2573,5 @@
 #ifndef VBOXNETFLT_LINUX_NO_XMIT_QUEUE
     skb_queue_head_init(&pThis->u.s.XmitQueue);
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 20)
+# if RTLNX_VER_MIN(2,6,20)
     INIT_WORK(&pThis->u.s.XmitTask, vboxNetFltLinuxXmitTask);
 # else
Index: trunk/src/VBox/HostDrivers/VBoxNetFlt/linux/files_vboxnetflt
===================================================================
--- trunk/src/VBox/HostDrivers/VBoxNetFlt/linux/files_vboxnetflt	(revision 85697)
+++ trunk/src/VBox/HostDrivers/VBoxNetFlt/linux/files_vboxnetflt	(revision 85698)
@@ -65,4 +65,5 @@
     ${PATH_ROOT}/include/iprt/utf16.h=>include/iprt/utf16.h \
     ${PATH_ROOT}/include/iprt/uuid.h=>include/iprt/uuid.h \
+    ${PATH_ROOT}/include/iprt/linux/version.h=>include/iprt/linux/version.h \
     ${PATH_ROOT}/include/iprt/nocrt/limits.h=>include/iprt/nocrt/limits.h \
     ${PATH_ROOT}/include/VBox/cdefs.h=>include/VBox/cdefs.h \
Index: trunk/src/VBox/HostDrivers/VBoxPci/VBoxPciInternal.h
===================================================================
--- trunk/src/VBox/HostDrivers/VBoxPci/VBoxPciInternal.h	(revision 85697)
+++ trunk/src/VBox/HostDrivers/VBoxPci/VBoxPciInternal.h	(revision 85698)
@@ -38,5 +38,5 @@
 #ifdef RT_OS_LINUX
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35) && defined(CONFIG_IOMMU_API)
+#if RTLNX_VER_MIN(2,6,35) && defined(CONFIG_IOMMU_API)
 # define VBOX_WITH_IOMMU
 #endif
Index: trunk/src/VBox/HostDrivers/VBoxPci/linux/VBoxPci-linux.c
===================================================================
--- trunk/src/VBox/HostDrivers/VBoxPci/linux/VBoxPci-linux.c	(revision 85697)
+++ trunk/src/VBox/HostDrivers/VBoxPci/linux/VBoxPci-linux.c	(revision 85698)
@@ -48,11 +48,11 @@
 # include <linux/intel-iommu.h>
 # include <linux/pci.h>
-# if LINUX_VERSION_CODE < KERNEL_VERSION(3, 1, 0) && \
-     (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 41) || LINUX_VERSION_CODE >= KERNEL_VERSION(3, 0, 0))
+# if RTLNX_VER_MAX(3,1,0) && \
+     (RTLNX_VER_MAX(2,6,41) || RTLNX_VER_MIN(3,0,0))
 #  include <asm/amd_iommu.h>
 # else
 #  include <linux/amd-iommu.h>
 # endif
-# if LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0)
+# if RTLNX_VER_MAX(3,2,0)
 #  define IOMMU_PRESENT()      iommu_found()
 #  define IOMMU_DOMAIN_ALLOC() iommu_domain_alloc()
@@ -87,8 +87,8 @@
 
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 20)
+#if RTLNX_VER_MIN(2,6,20)
 # define PCI_DEV_GET(v,d,p)            pci_get_device(v,d,p)
 # define PCI_DEV_PUT(x)                pci_dev_put(x)
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0)
+#if RTLNX_VER_MIN(4,17,0)
 /* assume the domain number to be zero - exactly the same assumption of
  * pci_get_bus_and_slot()
@@ -165,5 +165,5 @@
     if (request_module(PCI_STUB_MODULE) == 0)
     {
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30)
+# if RTLNX_VER_MIN(2,6,30)
         /* find_module() is static before Linux 2.6.30 */
         mutex_lock(&module_mutex);
@@ -320,5 +320,5 @@
     if (RT_LIKELY(pIns->pPciDev))
     {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28)
+#if RTLNX_VER_MIN(2,6,28)
         if (pci_reset_function(pIns->pPciDev))
         {
@@ -374,5 +374,5 @@
     fs_save = get_fs();
     set_fs(KERNEL_DS);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0)
+#if RTLNX_VER_MIN(4,14,0)
     ret = kernel_write(file, data, size, &offset);
 #else
@@ -448,5 +448,5 @@
         int                iCmdLen;
         const int          cMaxBuf = 128;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29)
+#if RTLNX_VER_MIN(2,6,29)
         const struct cred *pOldCreds;
         struct cred       *pNewCreds;
@@ -469,10 +469,10 @@
 
         /* Somewhat ugly hack - override current credentials */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29)
+#if RTLNX_VER_MIN(2,6,29)
         pNewCreds = prepare_creds();
         if (!pNewCreds)
                 goto done;
 
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 5, 0)
+# if RTLNX_VER_MIN(3,5,0)
         pNewCreds->fsuid = GLOBAL_ROOT_UID;
 # else
@@ -533,5 +533,5 @@
             printk(KERN_DEBUG "vboxpci: cannot open %s\n", szFileBuf);
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29)
+#if RTLNX_VER_MIN(2,6,29)
         revert_creds(pOldCreds);
         put_cred(pNewCreds);
@@ -560,5 +560,5 @@
         int                iCmdLen;
         const int          cMaxBuf = 128;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29)
+#if RTLNX_VER_MIN(2,6,29)
         const struct cred *pOldCreds;
         struct cred       *pNewCreds;
@@ -586,10 +586,10 @@
 
         /* Somewhat ugly hack - override current credentials */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29)
+#if RTLNX_VER_MIN(2,6,29)
         pNewCreds = prepare_creds();
         if (!pNewCreds)
             goto done;
 
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 5, 0)
+# if RTLNX_VER_MIN(3,5,0)
         pNewCreds->fsuid = GLOBAL_ROOT_UID;
 # else
@@ -627,5 +627,5 @@
             printk(KERN_DEBUG "vboxpci: cannot open %s\n", szFileBuf);
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29)
+#if RTLNX_VER_MIN(2,6,29)
         revert_creds(pOldCreds);
         put_cred(pNewCreds);
@@ -670,5 +670,5 @@
                 vbpci_printk(KERN_DEBUG, pPciDev, "%s\n", __func__);
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 1)
+#if RTLNX_VER_MIN(2,6,1)
                 if (pci_enable_msi(pPciDev) == 0)
                     pIns->fMsiUsed = true;
@@ -717,5 +717,5 @@
         vboxPciLinuxDevUnregisterWithIommu(pIns);
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 1)
+#if RTLNX_VER_MIN(2,6,1)
         if (pIns->fMsiUsed)
             pci_disable_msi(pPciDev);
@@ -843,5 +843,5 @@
         if (!rcLnx)
         {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)
+#if RTLNX_VER_MIN(2,6,25)
             /*
              * ioremap() defaults to no caching since the 2.6 kernels.
@@ -859,5 +859,5 @@
             else
             {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)
+#if RTLNX_VER_MIN(2,6,25)
                 vbpci_printk(KERN_DEBUG, pPciDev, "ioremap() failed\n");
 #else
@@ -956,5 +956,5 @@
  * @param   pRegs           Register set. Removed in 2.6.19.
  */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19) && !defined(DOXYGEN_RUNNING)
+#if RTLNX_VER_MIN(2,6,19) && !defined(DOXYGEN_RUNNING)
 static irqreturn_t vboxPciOsIrqHandler(int iIrq, void *pvDevId)
 #else
@@ -992,5 +992,5 @@
 #ifdef VBOX_WITH_SHARED_PCI_INTERRUPTS
                      /* Allow interrupts sharing. */
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 20)
+# if RTLNX_VER_MIN(2,6,20)
                      IRQF_SHARED,
 # else
@@ -1002,5 +1002,5 @@
                      /* We don't allow interrupts sharing */
                      /* XXX overhaul */
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 20) && LINUX_VERSION_CODE < KERNEL_VERSION(4, 1, 0)
+# if RTLNX_VER_MIN(2,6,20) && RTLNX_VER_MAX(4,1,0)
                      IRQF_DISABLED, /* keep irqs disabled when calling the action handler */
 # else
Index: trunk/src/VBox/HostDrivers/VBoxPci/linux/files_vboxpci
===================================================================
--- trunk/src/VBox/HostDrivers/VBoxPci/linux/files_vboxpci	(revision 85697)
+++ trunk/src/VBox/HostDrivers/VBoxPci/linux/files_vboxpci	(revision 85698)
@@ -64,4 +64,5 @@
     ${PATH_ROOT}/include/iprt/utf16.h=>include/iprt/utf16.h \
     ${PATH_ROOT}/include/iprt/uuid.h=>include/iprt/uuid.h \
+    ${PATH_ROOT}/include/iprt/linux/version.h=>include/iprt/linux/version.h \
     ${PATH_ROOT}/include/iprt/nocrt/limits.h=>include/iprt/nocrt/limits.h \
     ${PATH_ROOT}/include/VBox/cdefs.h=>include/VBox/cdefs.h \
Index: trunk/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c
===================================================================
--- trunk/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c	(revision 85697)
+++ trunk/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c	(revision 85698)
@@ -39,5 +39,5 @@
 
 #if (defined(RT_ARCH_AMD64) || defined(DOXYGEN_RUNNING)) && !defined(RTMEMALLOC_EXEC_HEAP)
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 23) && LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0)
+# if RTLNX_VER_MIN(2,6,23) && RTLNX_VER_MAX(5,8,0)
 /**
  * Starting with 2.6.23 we can use __get_vm_area and map_vm_area to allocate
@@ -197,5 +197,5 @@
          * in the free function, if nothing else...
          */
-# if LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0)
+# if RTLNX_VER_MAX(3,17,0)
         struct page **papPagesIterator = papPages;
 # endif
@@ -203,5 +203,5 @@
         pVmArea->pages    = papPages;
         if (!map_vm_area(pVmArea, PAGE_KERNEL_EXEC,
-# if LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0)
+# if RTLNX_VER_MAX(3,17,0)
                          &papPagesIterator
 # else
@@ -216,5 +216,5 @@
         }
         /* bail out */
-# if LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0)
+# if RTLNX_VER_MAX(3,17,0)
         pVmArea->nr_pages = papPagesIterator - papPages;
 # endif
Index: trunk/src/VBox/Runtime/r0drv/linux/initterm-r0drv-linux.c
===================================================================
--- trunk/src/VBox/Runtime/r0drv/linux/initterm-r0drv-linux.c	(revision 85697)
+++ trunk/src/VBox/Runtime/r0drv/linux/initterm-r0drv-linux.c	(revision 85698)
@@ -40,5 +40,5 @@
 *********************************************************************************************************************************/
 /** The IPRT work queue. */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 41)
+#if RTLNX_VER_MIN(2,5,41)
 static struct workqueue_struct *g_prtR0LnxWorkQueue;
 #else
@@ -58,6 +58,6 @@
     IPRT_LINUX_SAVE_EFL_AC();
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 41)
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 20)
+#if RTLNX_VER_MIN(2,5,41)
+# if RTLNX_VER_MIN(2,6,20)
     INIT_WORK(pWork, pfnWorker);
 # else
@@ -84,5 +84,5 @@
     IPRT_LINUX_SAVE_EFL_AC();
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 41)
+#if RTLNX_VER_MIN(2,5,41)
     flush_workqueue(g_prtR0LnxWorkQueue);
 #else
@@ -99,6 +99,6 @@
     IPRT_LINUX_SAVE_EFL_AC();
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 41)
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13)
+#if RTLNX_VER_MIN(2,5,41)
+ #if RTLNX_VER_MIN(2,6,13)
     g_prtR0LnxWorkQueue = create_workqueue("iprt-VBoxWQueue");
  #else
@@ -119,5 +119,5 @@
 
     rtR0LnxWorkqueueFlush();
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 41)
+#if RTLNX_VER_MIN(2,5,41)
     destroy_workqueue(g_prtR0LnxWorkQueue);
     g_prtR0LnxWorkQueue = NULL;
Index: trunk/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c
===================================================================
--- trunk/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c	(revision 85697)
+++ trunk/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c	(revision 85698)
@@ -57,5 +57,5 @@
  * This is a must for 5.8+, but we enable it all the way back to 3.2.x for
  * better W^R compliance (fExecutable flag). */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0) || defined(DOXYGEN_RUNNING)
+#if RTLNX_VER_MIN(3,2,0) || defined(DOXYGEN_RUNNING)
 # define IPRT_USE_ALLOC_VM_AREA_FOR_EXEC
 #endif
@@ -66,16 +66,15 @@
  * It should be safe to use vm_insert_page() older kernels as well.
  */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 23)
+#if RTLNX_VER_MIN(2,6,23)
 # define VBOX_USE_INSERT_PAGE
 #endif
 #if    defined(CONFIG_X86_PAE) \
     && (   defined(HAVE_26_STYLE_REMAP_PAGE_RANGE) \
-        || (   LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) \
-            && LINUX_VERSION_CODE <  KERNEL_VERSION(2, 6, 11)))
+        || RTLNX_VER_RANGE(2,6,0,  2,6,11) )
 # define VBOX_USE_PAE_HACK
 #endif
 
 /* gfp_t was introduced in 2.6.14, define it for earlier. */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 14)
+#if RTLNX_VER_MAX(2,6,14)
 # define gfp_t  unsigned
 #endif
@@ -84,5 +83,5 @@
  * Wrappers around mmap_lock/mmap_sem difference.
  */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
+#if RTLNX_VER_MIN(5,8,0)
 # define LNX_MM_DOWN_READ(a_pMm)    down_read(&(a_pMm)->mmap_lock)
 # define LNX_MM_UP_READ(a_pMm)        up_read(&(a_pMm)->mmap_lock)
@@ -252,5 +251,5 @@
     if (R3PtrFixed != (RTR3PTR)-1)
     {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 5, 0)
+#if RTLNX_VER_MIN(3,5,0)
         ulAddr = vm_mmap(NULL, R3PtrFixed, cb, fLnxProt, MAP_SHARED | MAP_ANONYMOUS | MAP_FIXED, 0);
 #else
@@ -262,5 +261,5 @@
     else
     {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 5, 0)
+#if RTLNX_VER_MIN(3,5,0)
         ulAddr = vm_mmap(NULL, 0, cb, fLnxProt, MAP_SHARED | MAP_ANONYMOUS, 0);
 #else
@@ -298,5 +297,5 @@
 static void rtR0MemObjLinuxDoMunmap(void *pv, size_t cb, struct task_struct *pTask)
 {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 5, 0)
+#if RTLNX_VER_MIN(3,5,0)
     Assert(pTask == current); RT_NOREF_PV(pTask);
     vm_munmap((unsigned long)pv, cb);
@@ -359,5 +358,5 @@
      * For small allocations we'll try contiguous first and then fall back on page by page.
      */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 22)
+#if RTLNX_VER_MIN(2,4,22)
     if (    fContiguous
         ||  cb <= PAGE_SIZE * 2)
@@ -418,5 +417,5 @@
     pMemLnx->fExecutable = fExecutable;
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0)
+#if RTLNX_VER_MAX(4,5,0)
     /*
      * Reserve the pages.
@@ -475,9 +474,9 @@
         while (iPage-- > 0)
         {
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0)
+#if RTLNX_VER_MAX(4,5,0)
             /* See SetPageReserved() in rtR0MemObjLinuxAllocPages() */
             ClearPageReserved(pMemLnx->apPages[iPage]);
 #endif
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 22)
+#if RTLNX_VER_MAX(2,4,22)
             if (pMemLnx->fExecutable)
                 MY_SET_PAGES_NOEXEC(pMemLnx->apPages[iPage], 1);
@@ -488,5 +487,5 @@
          * Free the pages.
          */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 22)
+#if RTLNX_VER_MIN(2,4,22)
         if (!pMemLnx->fContiguous)
         {
@@ -545,5 +544,5 @@
          * Use vmap - 2.4.22 and later.
          */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 22)
+#if RTLNX_VER_MIN(2,4,22)
         pgprot_t fPg;
         pgprot_val(fPg) = _PAGE_PRESENT | _PAGE_RW;
@@ -620,5 +619,5 @@
 static void rtR0MemObjLinuxVUnmap(PRTR0MEMOBJLNX pMemLnx)
 {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 22)
+#if RTLNX_VER_MIN(2,4,22)
 # ifdef IPRT_USE_ALLOC_VM_AREA_FOR_EXEC
     if (pMemLnx->pArea)
@@ -683,5 +682,5 @@
                     if (!PageReserved(pMemLnx->apPages[iPage]))
                         SetPageDirty(pMemLnx->apPages[iPage]);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
+#if RTLNX_VER_MIN(4,6,0)
                     put_page(pMemLnx->apPages[iPage]);
 #else
@@ -746,5 +745,5 @@
     int rc;
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 22)
+#if RTLNX_VER_MIN(2,4,22)
     rc = rtR0MemObjLinuxAllocPages(&pMemLnx, RTR0MEMOBJTYPE_PAGE, cb, PAGE_SIZE, GFP_HIGHUSER,
                                    false /* non-contiguous */, fExecutable, VERR_NO_MEMORY);
@@ -995,8 +994,8 @@
     {
         pgd_t       Global;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
+#if RTLNX_VER_MIN(4,12,0)
         p4d_t       Four;
 #endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 11)
+#if RTLNX_VER_MIN(2,6,11)
         pud_t       Upper;
 #endif
@@ -1013,6 +1012,6 @@
     if (RT_UNLIKELY(pgd_none(u.Global)))
         return NULL;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 11)
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
+#if RTLNX_VER_MIN(2,6,11)
+# if RTLNX_VER_MIN(4,12,0)
     u.Four  = *p4d_offset(&u.Global, ulAddr);
     if (RT_UNLIKELY(p4d_none(u.Four)))
@@ -1033,5 +1032,5 @@
     if (RT_UNLIKELY(pud_none(u.Upper)))
         return NULL;
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)
+# if RTLNX_VER_MIN(2,6,25)
     if (pud_large(u.Upper))
     {
@@ -1049,5 +1048,5 @@
     if (RT_UNLIKELY(pmd_none(u.Middle)))
         return NULL;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
+#if RTLNX_VER_MIN(2,6,0)
     if (pmd_large(u.Middle))
     {
@@ -1060,5 +1059,5 @@
 #endif
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 5) || defined(pte_offset_map) /* As usual, RHEL 3 had pte_offset_map earlier. */
+#if RTLNX_VER_MIN(2,5,5) || defined(pte_offset_map) /* As usual, RHEL 3 had pte_offset_map earlier. */
     pEntry = pte_offset_map(&u.Middle, ulAddr);
 #else
@@ -1068,5 +1067,5 @@
         return NULL;
     u.Entry = *pEntry;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 5) || defined(pte_offset_map)
+#if RTLNX_VER_MIN(2,5,5) || defined(pte_offset_map)
     pte_unmap(pEntry);
 #endif
@@ -1120,7 +1119,5 @@
 
 /* openSUSE Leap 42.3 detection :-/ */
-#if    LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0) \
-    && LINUX_VERSION_CODE <  KERNEL_VERSION(4, 6, 0) \
-    && defined(FAULT_FLAG_REMOTE)
+#if RTLNX_VER_RANGE(4,4,0,  4,6,0) && defined(FAULT_FLAG_REMOTE)
 # define GET_USER_PAGES_API     KERNEL_VERSION(4, 10, 0) /* no typo! */
 #else
@@ -1134,5 +1131,5 @@
     struct task_struct *pTask = rtR0ProcessToLinuxTask(R0Process);
     struct vm_area_struct **papVMAs;
-    PRTR0MEMOBJLNX pMemLnx;
+    PRTR0MEMOBJLNX  pMemLnx;
     int             rc      = VERR_NO_MEMORY;
     int  const      fWrite  = fAccess & RTMEM_PROT_WRITE ? 1 : 0;
@@ -1209,6 +1206,5 @@
                                 cPages,                 /* How many pages. */
 /* The get_user_pages API change was back-ported to 4.4.168. */
-# if    LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 168) \
-      && LINUX_VERSION_CODE <  KERNEL_VERSION(4, 5, 0)
+# if RTLNX_VER_RANGE(4,4,168,  4,5,0)
                                 fWrite ? FOLL_WRITE |   /* Write to memory. */
                                          FOLL_FORCE     /* force write access. */
@@ -1265,5 +1261,5 @@
             if (!PageReserved(pMemLnx->apPages[rc]))
                 SetPageDirty(pMemLnx->apPages[rc]);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
+#if RTLNX_VER_MIN(4,6,0)
             put_page(pMemLnx->apPages[rc]);
 #else
@@ -1375,5 +1371,5 @@
 DECLHIDDEN(int) rtR0MemObjNativeReserveKernel(PPRTR0MEMOBJINTERNAL ppMem, void *pvFixed, size_t cb, size_t uAlignment)
 {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 22)
+#if RTLNX_VER_MIN(2,4,22)
     IPRT_LINUX_SAVE_EFL_AC();
     const size_t cPages = cb >> PAGE_SHIFT;
@@ -1500,5 +1496,5 @@
         if (pMemLnxToMap->cPages)
         {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 22)
+#if RTLNX_VER_MIN(2,4,22)
             /*
              * Use vmap - 2.4.22 and later.
@@ -1545,5 +1541,5 @@
              */
             Assert(pMemLnxToMap->Core.enmType == RTR0MEMOBJTYPE_PHYS && !pMemLnxToMap->Core.u.Phys.fAllocated);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)
+#if RTLNX_VER_MIN(2,6,25)
             /*
              * ioremap() defaults to no caching since the 2.6 kernels.
@@ -1695,26 +1691,26 @@
                 for (iPage = offSub >> PAGE_SHIFT; iPage < cPages; iPage++, ulAddrCur += PAGE_SIZE)
                 {
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 11)
+#if RTLNX_VER_MAX(2,6,11)
                     RTHCPHYS Phys = page_to_phys(pMemLnxToMap->apPages[iPage]);
 #endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) || defined(HAVE_26_STYLE_REMAP_PAGE_RANGE)
+#if RTLNX_VER_MIN(2,6,0) || defined(HAVE_26_STYLE_REMAP_PAGE_RANGE)
                     struct vm_area_struct *vma = find_vma(pTask->mm, ulAddrCur); /* this is probably the same for all the pages... */
                     AssertBreakStmt(vma, rc = VERR_INTERNAL_ERROR);
 #endif
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0) && defined(RT_ARCH_X86)
+#if RTLNX_VER_MAX(2,6,0) && defined(RT_ARCH_X86)
                     /* remap_page_range() limitation on x86 */
                     AssertBreakStmt(Phys < _4G, rc = VERR_NO_MEMORY);
 #endif
 
-#if   defined(VBOX_USE_INSERT_PAGE) && LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22)
+#if   defined(VBOX_USE_INSERT_PAGE) && RTLNX_VER_MIN(2,6,22)
                     rc = vm_insert_page(vma, ulAddrCur, pMemLnxToMap->apPages[iPage]);
                     /* Thes flags help making 100% sure some bad stuff wont happen (swap, core, ++).
                      * See remap_pfn_range() in mm/memory.c */
-#if    LINUX_VERSION_CODE >= KERNEL_VERSION(3, 7, 0)
+#if    RTLNX_VER_MIN(3,7,0)
                     vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP;
 #else
                     vma->vm_flags |= VM_RESERVED;
 #endif
-#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 11)
+#elif RTLNX_VER_MIN(2,6,11)
                     rc = remap_pfn_range(vma, ulAddrCur, page_to_pfn(pMemLnxToMap->apPages[iPage]), PAGE_SIZE, fPg);
 #elif defined(VBOX_USE_PAE_HACK)
@@ -1722,5 +1718,5 @@
                     if (!rc)
                         rc = rtR0MemObjLinuxFixPte(pTask->mm, ulAddrCur, Phys);
-#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) || defined(HAVE_26_STYLE_REMAP_PAGE_RANGE)
+#elif RTLNX_VER_MIN(2,6,0) || defined(HAVE_26_STYLE_REMAP_PAGE_RANGE)
                     rc = remap_page_range(vma, ulAddrCur, Phys, PAGE_SIZE, fPg);
 #else /* 2.4 */
@@ -1750,14 +1746,14 @@
                     for (iPage = offSub >> PAGE_SHIFT; iPage < cPages; iPage++, ulAddrCur += PAGE_SIZE, Phys += PAGE_SIZE)
                     {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) || defined(HAVE_26_STYLE_REMAP_PAGE_RANGE)
+#if RTLNX_VER_MIN(2,6,0) || defined(HAVE_26_STYLE_REMAP_PAGE_RANGE)
                         struct vm_area_struct *vma = find_vma(pTask->mm, ulAddrCur); /* this is probably the same for all the pages... */
                         AssertBreakStmt(vma, rc = VERR_INTERNAL_ERROR);
 #endif
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0) && defined(RT_ARCH_X86)
+#if RTLNX_VER_MAX(2,6,0) && defined(RT_ARCH_X86)
                         /* remap_page_range() limitation on x86 */
                         AssertBreakStmt(Phys < _4G, rc = VERR_NO_MEMORY);
 #endif
 
-#if   LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 11)
+#if   RTLNX_VER_MIN(2,6,11)
                         rc = remap_pfn_range(vma, ulAddrCur, Phys, PAGE_SIZE, fPg);
 #elif defined(VBOX_USE_PAE_HACK)
@@ -1765,5 +1761,5 @@
                         if (!rc)
                             rc = rtR0MemObjLinuxFixPte(pTask->mm, ulAddrCur, Phys);
-#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) || defined(HAVE_26_STYLE_REMAP_PAGE_RANGE)
+#elif RTLNX_VER_MIN(2,6,0) || defined(HAVE_26_STYLE_REMAP_PAGE_RANGE)
                         rc = remap_page_range(vma, ulAddrCur, Phys, PAGE_SIZE, fPg);
 #else /* 2.4 */
@@ -1780,5 +1776,5 @@
 
 #ifdef CONFIG_NUMA_BALANCING
-# if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0)
+# if RTLNX_VER_MAX(3,13,0)
 #  ifdef RHEL_RELEASE_CODE
 #   if RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(7, 0)
Index: trunk/src/VBox/Runtime/r0drv/linux/memuserkernel-r0drv-linux.c
===================================================================
--- trunk/src/VBox/Runtime/r0drv/linux/memuserkernel-r0drv-linux.c	(revision 85697)
+++ trunk/src/VBox/Runtime/r0drv/linux/memuserkernel-r0drv-linux.c	(revision 85698)
@@ -67,5 +67,5 @@
 {
     IPRT_LINUX_SAVE_EFL_AC();
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0) || defined(RHEL_81)
+#if RTLNX_VER_MIN(5,0,0) || defined(RHEL_81)
     bool fRc = access_ok((void *)R3Ptr, 1);
 #else
@@ -87,9 +87,9 @@
 #else
 # error "PORT ME"
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0) || defined(RHEL_81)
+#if RTLNX_VER_MIN(5,0,0) || defined(RHEL_81)
     return !access_ok(pv, 1);
 #else
     return !access_ok(VERIFY_READ, pv, 1);
-#endif /* LINUX_VERSION_CODE */
+#endif
 #endif
 }
@@ -113,5 +113,5 @@
 static int rtR0MemKernelCopyLnxWorker(void *pvDst, void const *pvSrc, size_t cb)
 {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 55)
+#if RTLNX_VER_MIN(2,5,55)
 /* _ASM_EXTABLE was introduced in 2.6.25 from what I can tell. Using #ifndef
    here since it has to be a macro and you never know what someone might have
Index: trunk/src/VBox/Runtime/r0drv/linux/mp-r0drv-linux.c
===================================================================
--- trunk/src/VBox/Runtime/r0drv/linux/mp-r0drv-linux.c	(revision 85697)
+++ trunk/src/VBox/Runtime/r0drv/linux/mp-r0drv-linux.c	(revision 85698)
@@ -43,5 +43,5 @@
 *   Defined Constants And Macros                                                                                                 *
 *********************************************************************************************************************************/
-#if defined(nr_cpumask_bits) || LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28)
+#if defined(nr_cpumask_bits) || RTLNX_VER_MIN(2,6,28)
 # define VBOX_NR_CPUMASK_BITS   (nr_cpumask_bits)   /* same as nr_cpu_ids */
 #else
@@ -95,5 +95,5 @@
 {
 #if defined(CONFIG_SMP)
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 2) || defined(cpu_possible)
+# if RTLNX_VER_MIN(2,6,2) || defined(cpu_possible)
     return idCpu < VBOX_NR_CPUMASK_BITS && cpu_possible(idCpu);
 # else /* < 2.5.29 */
@@ -126,7 +126,7 @@
 {
 #ifdef CONFIG_SMP
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 4) || defined(num_possible_cpus)
+# if RTLNX_VER_MIN(2,6,4) || defined(num_possible_cpus)
     return num_possible_cpus();
-# elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)
+# elif RTLNX_VER_MAX(2,5,0)
     return smp_num_cpus;
 # else
@@ -145,5 +145,5 @@
 {
 #ifdef CONFIG_SMP
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) || defined(cpu_online)
+# if RTLNX_VER_MIN(2,6,0) || defined(cpu_online)
     return idCpu < VBOX_NR_CPUMASK_BITS && cpu_online(idCpu);
 # else /* 2.4: */
@@ -181,5 +181,5 @@
 {
 #ifdef CONFIG_SMP
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) || defined(num_online_cpus)
+# if RTLNX_VER_MIN(2,6,0) || defined(num_online_cpus)
     return num_online_cpus();
 # else
@@ -217,5 +217,5 @@
 #ifdef CONFIG_SMP
 
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
+# if RTLNX_VER_MIN(2,6,27)
 /**
  * Wrapper between the native linux per-cpu callbacks and PFNRTWORKER, does hit
@@ -281,7 +281,7 @@
     {
         /* Fire the function on all other CPUs without waiting for completion. */
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 3, 0)
+# if RTLNX_VER_MIN(5,3,0)
         smp_call_function(rtmpLinuxAllWrapper, &Args, 0 /* wait */);
-# elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
+# elif RTLNX_VER_MIN(2,6,27)
         int rc = smp_call_function(rtmpLinuxAllWrapper, &Args, 0 /* wait */);
         Assert(!rc); NOREF(rc);
@@ -337,7 +337,7 @@
 
     RTThreadPreemptDisable(&PreemptState);
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 3, 0)
+# if RTLNX_VER_MIN(5,3,0)
     smp_call_function(rtmpLinuxWrapper, &Args, 1 /* wait */);
-# elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
+# elif RTLNX_VER_MIN(2,6,27)
     int rc = smp_call_function(rtmpLinuxWrapper, &Args, 1 /* wait */);
     Assert(rc == 0); NOREF(rc);
@@ -357,5 +357,5 @@
 
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 27) && defined(CONFIG_SMP)
+#if RTLNX_VER_MAX(2,6,27) && defined(CONFIG_SMP)
 /**
  * Wrapper between the native linux per-cpu callbacks and PFNRTWORKER
@@ -385,7 +385,7 @@
     int                     rc;
     RTTHREADPREEMPTSTATE    PreemptState = RTTHREADPREEMPTSTATE_INITIALIZER;
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28) /* 2.6.28 introduces CONFIG_CPUMASK_OFFSTACK */
+# if RTLNX_VER_MIN(2,6,28) /* 2.6.28 introduces CONFIG_CPUMASK_OFFSTACK */
     cpumask_var_t           DstCpuMask;
-# elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
+# elif RTLNX_VER_MIN(2,6,27)
     cpumask_t               DstCpuMask;
 # endif
@@ -397,10 +397,10 @@
      * Prepare the CPU mask before we disable preemption.
      */
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30)
+# if RTLNX_VER_MIN(2,6,30)
     if (!zalloc_cpumask_var(&DstCpuMask, GFP_KERNEL))
         return VERR_NO_MEMORY;
     cpumask_set_cpu(idCpu1, DstCpuMask);
     cpumask_set_cpu(idCpu2, DstCpuMask);
-# elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28)
+# elif RTLNX_VER_MIN(2,6,28)
     if (!alloc_cpumask_var(&DstCpuMask, GFP_KERNEL))
         return VERR_NO_MEMORY;
@@ -408,5 +408,5 @@
     cpumask_set_cpu(idCpu1, DstCpuMask);
     cpumask_set_cpu(idCpu2, DstCpuMask);
-# elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
+# elif RTLNX_VER_MIN(2,6,27)
     cpus_clear(DstCpuMask);
     cpu_set(idCpu1, DstCpuMask);
@@ -437,8 +437,8 @@
         Args.cHits   = 0;
 
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28)
+# if RTLNX_VER_MIN(2,6,28)
         smp_call_function_many(DstCpuMask, rtmpLinuxWrapperPostInc, &Args, !fCallSelf /* wait */);
         rc = 0;
-# elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
+# elif RTLNX_VER_MIN(2,6,27)
         rc = smp_call_function_mask(DstCpuMask, rtmpLinuxWrapperPostInc, &Args, !fCallSelf /* wait */);
 # else /* older kernels */
@@ -481,5 +481,5 @@
 
     RTThreadPreemptRestore(&PreemptState);;
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28)
+# if RTLNX_VER_MIN(2,6,28)
     free_cpumask_var(DstCpuMask);
 # endif
@@ -502,5 +502,5 @@
 
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19) && defined(CONFIG_SMP)
+#if RTLNX_VER_MAX(2,6,19) && defined(CONFIG_SMP)
 /**
  * Wrapper between the native linux per-cpu callbacks and PFNRTWORKER
@@ -545,7 +545,7 @@
         if (RTMpIsCpuOnline(idCpu))
         {
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
+# if RTLNX_VER_MIN(2,6,27)
             rc = smp_call_function_single(idCpu, rtmpLinuxWrapper, &Args, 1 /* wait */);
-# elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19)
+# elif RTLNX_VER_MIN(2,6,19)
             rc = smp_call_function_single(idCpu, rtmpLinuxWrapper, &Args, 0 /* retry */, 1 /* wait */);
 # else /* older kernels */
@@ -573,5 +573,5 @@
 
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19) && defined(CONFIG_SMP)
+#if RTLNX_VER_MIN(2,6,19) && defined(CONFIG_SMP)
 /**
  * Dummy callback used by RTMpPokeCpu.
@@ -588,5 +588,5 @@
 RTDECL(int) RTMpPokeCpu(RTCPUID idCpu)
 {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19)
+#if RTLNX_VER_MIN(2,6,19)
     IPRT_LINUX_SAVE_EFL_AC();
     int rc;
@@ -596,7 +596,7 @@
         {
 # ifdef CONFIG_SMP
-#  if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
+#  if RTLNX_VER_MIN(2,6,27)
             rc = smp_call_function_single(idCpu, rtmpLinuxPokeCpuCallback, NULL, 0 /* wait */);
-#  elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19)
+#  elif RTLNX_VER_MIN(2,6,19)
             rc = smp_call_function_single(idCpu, rtmpLinuxPokeCpuCallback, NULL, 0 /* retry */, 0 /* wait */);
 #  else  /* older kernels */
Index: trunk/src/VBox/Runtime/r0drv/linux/mpnotification-r0drv-linux.c
===================================================================
--- trunk/src/VBox/Runtime/r0drv/linux/mpnotification-r0drv-linux.c	(revision 85697)
+++ trunk/src/VBox/Runtime/r0drv/linux/mpnotification-r0drv-linux.c	(revision 85698)
@@ -38,5 +38,5 @@
 #include "r0drv/mp-r0drv.h"
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)
+#if RTLNX_VER_MIN(4,10,0)
 
 static enum cpuhp_state g_rtR0MpOnline;
@@ -86,5 +86,5 @@
 }
 
-#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 71) && defined(CONFIG_SMP)
+#elif RTLNX_VER_MIN(2,5,71) && defined(CONFIG_SMP)
 
 static int rtMpNotificationLinuxCallback(struct notifier_block *pNotifierBlock, unsigned long ulNativeEvent, void *pvCpu);
Index: trunk/src/VBox/Runtime/r0drv/linux/rtStrFormatKernelAddress-r0drv-linux.c
===================================================================
--- trunk/src/VBox/Runtime/r0drv/linux/rtStrFormatKernelAddress-r0drv-linux.c	(revision 85697)
+++ trunk/src/VBox/Runtime/r0drv/linux/rtStrFormatKernelAddress-r0drv-linux.c	(revision 85698)
@@ -42,5 +42,5 @@
                                             signed int cchPrecision, unsigned int fFlags)
 {
-#if !defined(DEBUG) && LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 38)
+#if !defined(DEBUG) && RTLNX_VER_MIN(2,6,38)
     RT_NOREF(cchWidth, cchPrecision);
     /* use the Linux kernel function which is able to handle "%pK" */
Index: trunk/src/VBox/Runtime/r0drv/linux/the-linux-kernel.h
===================================================================
--- trunk/src/VBox/Runtime/r0drv/linux/the-linux-kernel.h	(revision 85697)
+++ trunk/src/VBox/Runtime/r0drv/linux/the-linux-kernel.h	(revision 85698)
@@ -49,24 +49,6 @@
 
 
-/** @def RTLNX_VER_MIN
- * Evaluates to true if the linux kernel version is equal or higher to the
- * one specfied. */
-#define RTLNX_VER_MIN(a_Major, a_Minor, a_Patch) \
-    (LINUX_VERSION_CODE >= KERNEL_VERSION(a_Major, a_Minor, a_Patch))
-/** @def RTLNX_VER_MAX
- * Evaluates to true if the linux kernel version is less to the one specfied
- * (exclusive). */
-#define RTLNX_VER_MAX(a_Major, a_Minor, a_Patch) \
-    (LINUX_VERSION_CODE <  KERNEL_VERSION(a_Major, a_Minor, a_Patch))
-/** @def RTLNX_VER_RANGE
- * Evaluates to true if the linux kernel version is equal or higher to the given
- * minimum version and less (but not equal) to the maximum version (exclusive). */
-#define RTLNX_VER_RANGE(a_MajorMin, a_MinorMin, a_PatchMin,  a_MajorMax, a_MinorMax, a_PatchMax) \
-    (   LINUX_VERSION_CODE >= KERNEL_VERSION(a_MajorMin, a_MinorMin, a_PatchMin) \
-     && LINUX_VERSION_CODE <  KERNEL_VERSION(a_MajorMax, a_MinorMax, a_PatchMax) )
-
-
-#include <linux/version.h>
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 33)
+#include <iprt/linux/version.h>
+#if RTLNX_VER_MIN(2,6,33)
 # include <generated/autoconf.h>
 #else
@@ -77,8 +59,8 @@
 
 /* We only support 2.4 and 2.6 series kernels */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 0)
+#if RTLNX_VER_MAX(2,4,0)
 # error Sorry, we do not support 2.3 and earlier kernels.
 #endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
+#if RTLNX_VER_MIN(2,5,0) && RTLNX_VER_MAX(2,6,0)
 # error Sorry, we do not support 2.5 series kernels (might work though).
 #endif
@@ -86,10 +68,10 @@
 #if defined(CONFIG_MODVERSIONS) && !defined(MODVERSIONS)
 # define MODVERSIONS
-# if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 71)
+# if RTLNX_VER_MAX(2,5,71)
 #  include <linux/modversions.h>
 # endif
 #endif
 #ifndef KBUILD_STR
-# if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16)
+# if RTLNX_VER_MAX(2,6,16)
 #  define KBUILD_STR(s) s
 # else
@@ -97,5 +79,5 @@
 # endif
 #endif
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 3, 0)
+# if RTLNX_VER_MIN(3,3,0)
 #  include <linux/kconfig.h> /* for macro IS_ENABLED */
 # endif
@@ -103,5 +85,5 @@
 #include <linux/spinlock.h>
 #include <linux/slab.h>
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
+#if RTLNX_VER_MIN(2,6,27)
 # include <linux/semaphore.h>
 #else /* older kernels */
@@ -109,5 +91,5 @@
 #endif /* older kernels */
 #include <linux/module.h>
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
+#if RTLNX_VER_MIN(2,6,0)
 # include <linux/moduleparam.h>
 #endif
@@ -115,5 +97,5 @@
 #include <linux/init.h>
 #include <linux/fs.h>
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
+#if RTLNX_VER_MIN(2,6,0)
 # include <linux/namei.h>
 #endif
@@ -124,29 +106,28 @@
 #include <linux/sched.h>
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 23) && \
-    LINUX_VERSION_CODE < KERNEL_VERSION(3, 9, 31)
-#include  <linux/splice.h>
-#endif
-
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0)
+#if RTLNX_VER_RANGE(3,9,23,  3,9,31)
+# include  <linux/splice.h>
+#endif
+
+#if RTLNX_VER_MIN(3,9,0)
 # include <linux/sched/rt.h>
 #endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
+#if RTLNX_VER_MIN(4,11,0)
 # include <linux/sched/signal.h>
 # include <linux/sched/types.h>
 #endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 7)
+#if RTLNX_VER_MIN(2,6,7)
 # include <linux/jiffies.h>
 #endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 16)
+#if RTLNX_VER_MIN(2,6,16)
 # include <linux/ktime.h>
 # include <linux/hrtimer.h>
 #endif
 #include <linux/wait.h>
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 71)
+#if RTLNX_VER_MIN(2,5,71)
 # include <linux/cpu.h>
 # include <linux/notifier.h>
 #endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0)
+#if RTLNX_VER_MIN(5,1,0)
 # include <uapi/linux/mman.h>
 #endif
@@ -171,10 +152,10 @@
 
 /* For thread-context hooks. */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 18) && defined(CONFIG_PREEMPT_NOTIFIERS)
+#if RTLNX_VER_MIN(2,6,18) && defined(CONFIG_PREEMPT_NOTIFIERS)
 # include <linux/preempt.h>
 #endif
 
 /* for workqueue / task queues. */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 41)
+#if RTLNX_VER_MIN(2,5,41)
 # include <linux/workqueue.h>
 #else
@@ -182,24 +163,24 @@
 #endif
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 4)
+#if RTLNX_VER_MIN(2,6,4)
 # include <linux/kthread.h>
 #endif
 
 /* for cr4_init_shadow() / cpu_tlbstate. */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 20, 0)
+#if RTLNX_VER_MIN(3,20,0)
 # include <asm/tlbflush.h>
 #endif
 
 /* for set_pages_x() */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
+#if RTLNX_VER_MIN(4,12,0)
 # include <asm/set_memory.h>
 #endif
 
 /* for __flush_tlb_all() */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28) && (defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86))
+#if RTLNX_VER_MIN(2,6,28) && (defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86))
 # include <asm/tlbflush.h>
 #endif
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 7, 0)
+#if RTLNX_VER_MIN(3,7,0)
 # include <asm/smap.h>
 #else
@@ -208,5 +189,5 @@
 #endif
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
+#if RTLNX_VER_MAX(2,6,0)
 # ifndef page_to_pfn
 #  define page_to_pfn(page) ((page) - mem_map)
@@ -225,5 +206,5 @@
  * 2.4 / early 2.6 compatibility wrappers
  */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 7)
+#if RTLNX_VER_MAX(2,6,7)
 
 # ifndef MAX_JIFFY_OFFSET
@@ -231,5 +212,5 @@
 # endif
 
-# if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 29) || LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
+# if RTLNX_VER_MAX(2,4,29) || RTLNX_VER_MIN(2,6,0)
 
 DECLINLINE(unsigned int) jiffies_to_msecs(unsigned long cJiffies)
@@ -266,5 +247,5 @@
  * 2.4 compatibility wrappers
  */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
+#if RTLNX_VER_MAX(2,6,0)
 
 # define prepare_to_wait(q, wait, state) \
@@ -300,7 +281,7 @@
  * This sucks soooo badly on x86! Why don't they export __PAGE_KERNEL_EXEC so PAGE_KERNEL_EXEC would be usable?
  */
-#if   LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 8) && defined(RT_ARCH_AMD64)
+#if   RTLNX_VER_MIN(2,6,8) && defined(RT_ARCH_AMD64)
 # define MY_PAGE_KERNEL_EXEC    PAGE_KERNEL_EXEC
-#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 8) && defined(PAGE_KERNEL_EXEC) && defined(CONFIG_X86_PAE)
+#elif RTLNX_VER_MIN(2,6,8) && defined(PAGE_KERNEL_EXEC) && defined(CONFIG_X86_PAE)
 # ifdef __PAGE_KERNEL_EXEC
    /* >= 2.6.27 */
@@ -320,5 +301,5 @@
 #ifndef NO_REDHAT_HACKS
 /* accounting. */
-# if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
+# if RTLNX_VER_MAX(2,6,0)
 #  ifdef VM_ACCOUNT
 #   define USE_RHEL4_MUNMAP
@@ -327,5 +308,5 @@
 
 /* backported remap_page_range. */
-# if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
+# if RTLNX_VER_MAX(2,6,0)
 #  include <asm/tlb.h>
 #  ifdef tlb_vma /* probably not good enough... */
@@ -361,6 +342,6 @@
 #endif
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)
-# if LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0) /* The interface was removed, but we only need it for < 2.4.22, so who cares. */
+#if RTLNX_VER_MIN(2,6,25)
+# if RTLNX_VER_MAX(5,4,0) /* The interface was removed, but we only need it for < 2.4.22, so who cares. */
 #  define MY_SET_PAGES_EXEC(pPages, cPages)     set_pages_x(pPages, cPages)
 #  define MY_SET_PAGES_NOEXEC(pPages, cPages)   set_pages_nx(pPages, cPages)
@@ -473,5 +454,5 @@
  * Whether the kernel support high resolution timers (Linux kernel versions
  * 2.6.28 and later (hrtimer_add_expires_ns() & schedule_hrtimeout). */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28)
+#if RTLNX_VER_MIN(2,6,28)
 # define IPRT_LINUX_HAS_HRTIMER
 #endif
@@ -480,5 +461,5 @@
  * Workqueue stuff, see initterm-r0drv-linux.c.
  */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 41)
+#if RTLNX_VER_MIN(2,5,41)
 typedef struct work_struct  RTR0LNXWORKQUEUEITEM;
 #else
Index: trunk/src/VBox/Runtime/r0drv/linux/thread-r0drv-linux.c
===================================================================
--- trunk/src/VBox/Runtime/r0drv/linux/thread-r0drv-linux.c	(revision 85697)
+++ trunk/src/VBox/Runtime/r0drv/linux/thread-r0drv-linux.c	(revision 85698)
@@ -34,5 +34,5 @@
 
 #include <iprt/asm.h>
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 28) || defined(CONFIG_X86_SMAP)
+#if RTLNX_VER_MAX(2,5,28) || defined(CONFIG_X86_SMAP)
 # include <iprt/asm-amd64-x86.h>
 #endif
@@ -88,5 +88,5 @@
 {
     IPRT_LINUX_SAVE_EFL_AC();
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 20)
+#if RTLNX_VER_MIN(2,4,20)
     yield();
 #else
@@ -119,9 +119,9 @@
     if (c != 0)
         return false;
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 32)
+# if RTLNX_VER_MIN(2,5,32)
     if (in_atomic())
         return false;
 # endif
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 28)
+# if RTLNX_VER_MIN(2,5,28)
     if (irqs_disabled())
         return false;
@@ -139,11 +139,11 @@
 {
     Assert(hThread == NIL_RTTHREAD); RT_NOREF_PV(hThread);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 4)
+#if RTLNX_VER_MIN(2,5,4)
     return !!test_tsk_thread_flag(current, TIF_NEED_RESCHED);
 
-#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 20)
+#elif RTLNX_VER_MIN(2,4,20)
     return !!need_resched();
 
-#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 1, 110)
+#elif RTLNX_VER_MIN(2,1,110)
     return current->need_resched != 0;
 
Index: trunk/src/VBox/Runtime/r0drv/linux/thread2-r0drv-linux.c
===================================================================
--- trunk/src/VBox/Runtime/r0drv/linux/thread2-r0drv-linux.c	(revision 85697)
+++ trunk/src/VBox/Runtime/r0drv/linux/thread2-r0drv-linux.c	(revision 85698)
@@ -37,5 +37,5 @@
 #include "internal/thread.h"
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
+#if RTLNX_VER_MIN(4,11,0)
     #include <uapi/linux/sched/types.h>
 #endif /* >= KERNEL_VERSION(4, 11, 0) */
@@ -55,5 +55,5 @@
 DECLHIDDEN(int) rtThreadNativeSetPriority(PRTTHREADINT pThread, RTTHREADTYPE enmType)
 {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 11)
+#if RTLNX_VER_MIN(2,6,11)
     /* See comment near MAX_RT_PRIO in linux/sched.h for details on
        sched_priority. */
@@ -123,5 +123,5 @@
 
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 4)
+#if RTLNX_VER_MIN(2,6,4)
 /**
  * Native kernel thread wrapper function.
@@ -143,5 +143,5 @@
 DECLHIDDEN(int) rtThreadNativeCreate(PRTTHREADINT pThreadInt, PRTNATIVETHREAD pNativeThread)
 {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 4)
+#if RTLNX_VER_MIN(2,6,4)
     struct task_struct *NativeThread;
     IPRT_LINUX_SAVE_EFL_AC();
Index: trunk/src/VBox/Runtime/r0drv/linux/threadctxhooks-r0drv-linux.c
===================================================================
--- trunk/src/VBox/Runtime/r0drv/linux/threadctxhooks-r0drv-linux.c	(revision 85697)
+++ trunk/src/VBox/Runtime/r0drv/linux/threadctxhooks-r0drv-linux.c	(revision 85698)
@@ -47,5 +47,5 @@
  * got it backported.
  */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 18) && defined(CONFIG_PREEMPT_NOTIFIERS)
+#if RTLNX_VER_MIN(2,6,18) && defined(CONFIG_PREEMPT_NOTIFIERS)
 
 
@@ -73,5 +73,5 @@
     /** The linux callbacks. */
     struct preempt_ops          PreemptOps;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 19) && defined(RT_ARCH_AMD64)
+#if RTLNX_VER_MIN(3,1,19) && defined(RT_ARCH_AMD64)
     /** Starting with 3.1.19, the linux kernel doesn't restore kernel RFLAGS during
      * task switch, so we have to do that ourselves. (x86 code is not affected.) */
@@ -110,5 +110,5 @@
 #if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86)
     ASMSetFlags(fSavedEFlags);
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 19) && defined(RT_ARCH_AMD64)
+# if RTLNX_VER_MIN(3,1,19) && defined(RT_ARCH_AMD64)
     pThis->fSavedRFlags = fSavedEFlags;
 # endif
@@ -143,5 +143,5 @@
 
 #if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86)
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 19) && defined(RT_ARCH_AMD64)
+# if RTLNX_VER_MIN(3,1,19) && defined(RT_ARCH_AMD64)
     fSavedEFlags &= ~RT_BIT_64(18) /*X86_EFL_AC*/;
     fSavedEFlags |= pThis->fSavedRFlags & RT_BIT_64(18) /*X86_EFL_AC*/;
@@ -199,5 +199,5 @@
     pThis->PreemptOps.sched_in  = rtThreadCtxHooksLnxSchedIn;
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
+#if RTLNX_VER_MIN(4,2,0)
     preempt_notifier_inc();
 #endif
@@ -236,5 +236,5 @@
     }
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
+#if RTLNX_VER_MIN(4,2,0)
     preempt_notifier_dec();
 #endif
Index: trunk/src/VBox/Runtime/r0drv/linux/time-r0drv-linux.c
===================================================================
--- trunk/src/VBox/Runtime/r0drv/linux/time-r0drv-linux.c	(revision 85697)
+++ trunk/src/VBox/Runtime/r0drv/linux/time-r0drv-linux.c	(revision 85698)
@@ -33,7 +33,7 @@
 #include "internal/iprt.h"
 /* Make sure we have the setting functions we need for RTTimeNow: */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16)
+#if RTLNX_VER_MAX(2,6,16)
 # define RTTIME_INCL_TIMEVAL
-#elif LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0)
+#elif RTLNX_VER_MAX(3,17,0)
 # define RTTIME_INCL_TIMESPEC
 #endif
@@ -45,5 +45,5 @@
 DECLINLINE(uint64_t) rtTimeGetSystemNanoTS(void)
 {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0)
+#if RTLNX_VER_MIN(5,6,0)
     /*
      * Starting with kernel version 5.6-rc3 only 64-bit time interfaces
@@ -57,5 +57,5 @@
     return u64;
 
-#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 16) /* This must match timer-r0drv-linux.c! */
+#elif RTLNX_VER_MIN(2,6,16) /* This must match timer-r0drv-linux.c! */
     /*
      * Use ktime_get_ts, this is also what clock_gettime(CLOCK_MONOTONIC,) is using.
@@ -67,5 +67,5 @@
     return u64;
 
-#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 60)
+#elif RTLNX_VER_MIN(2,5,60)
     /*
      * Seems there is no way of getting to the exact source of
@@ -189,5 +189,5 @@
 {
     IPRT_LINUX_SAVE_EFL_AC();
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 17, 0)
+#if RTLNX_VER_MIN(3,17,0)
     struct timespec64 Ts;
     ktime_get_real_ts64(&Ts);   /* ktime_get_real_ts64 was added as a macro in 3.17, function since 4.18. */
@@ -195,5 +195,5 @@
     return RTTimeSpecSetTimespec64(pTime, &Ts);
 
-#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 16)
+#elif RTLNX_VER_MIN(2,6,16)
     struct timespec Ts;
     ktime_get_real_ts(&Ts);     /* ktime_get_real_ts was removed in Linux 4.20. */
Index: trunk/src/VBox/Runtime/r0drv/linux/timer-r0drv-linux.c
===================================================================
--- trunk/src/VBox/Runtime/r0drv/linux/timer-r0drv-linux.c	(revision 85697)
+++ trunk/src/VBox/Runtime/r0drv/linux/timer-r0drv-linux.c	(revision 85698)
@@ -51,5 +51,5 @@
 #endif
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 31)
+#if RTLNX_VER_MAX(2,6,31)
 # define mod_timer_pinned               mod_timer
 # define HRTIMER_MODE_ABS_PINNED        HRTIMER_MODE_ABS
@@ -368,5 +368,5 @@
         if (fPinned)
         {
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
+# if RTLNX_VER_MIN(4,8,0)
             mod_timer(&pSubTimer->u.Std.LnxTimer, pSubTimer->u.Std.ulNextJiffies);
 # else
@@ -721,5 +721,5 @@
 
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
+#if RTLNX_VER_MIN(4,15,0)
 /**
  * Timer callback function for standard timers.
@@ -840,5 +840,5 @@
             if (pTimer->fSpecificCpu || pTimer->fAllCpus)
             {
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
+# if RTLNX_VER_MIN(4,8,0)
                 mod_timer(&pSubTimer->u.Std.LnxTimer, ulNextJiffies);
 # else
@@ -903,5 +903,5 @@
                     if (pTimer->fSpecificCpu || pTimer->fAllCpus)
                     {
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
+# if RTLNX_VER_MIN(4,8,0)
                         mod_timer(&pSubTimer->u.Std.LnxTimer, pSubTimer->u.Std.ulNextJiffies);
 # else
@@ -1520,5 +1520,5 @@
         /* For paranoid reasons, defer actually destroying the semaphore when
            in atomic or interrupt context. */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 32)
+#if RTLNX_VER_MIN(2,5,32)
         if (in_atomic() || in_interrupt())
 #else
@@ -1621,12 +1621,12 @@
 #endif
         {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
+#if RTLNX_VER_MIN(4,15,0)
             timer_setup(&pTimer->aSubTimers[iCpu].u.Std.LnxTimer, rtTimerLinuxStdCallback, TIMER_PINNED);
-#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
+#elif RTLNX_VER_MIN(4,8,0)
             init_timer_pinned(&pTimer->aSubTimers[iCpu].u.Std.LnxTimer);
 #else
             init_timer(&pTimer->aSubTimers[iCpu].u.Std.LnxTimer);
 #endif
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
+#if RTLNX_VER_MAX(4,15,0)
             pTimer->aSubTimers[iCpu].u.Std.LnxTimer.data        = (unsigned long)&pTimer->aSubTimers[iCpu];
             pTimer->aSubTimers[iCpu].u.Std.LnxTimer.function    = rtTimerLinuxStdCallback;
@@ -1687,5 +1687,5 @@
 #endif
     /* */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 0) || LINUX_VERSION_CODE >= KERNEL_VERSION(4, 13, 0)
+#if RTLNX_VER_MAX(4,9,0) || RTLNX_VER_MIN(4,13,0)
     /* On 4.9, 4.10 and 4.12 we've observed tstRTR0Timer failures of the omni timer tests
        where we get about half of the ticks we want.  The failing test is using this value
Index: trunk/src/VBox/Runtime/r0drv/linux/waitqueue-r0drv-linux.h
===================================================================
--- trunk/src/VBox/Runtime/r0drv/linux/waitqueue-r0drv-linux.h	(revision 85697)
+++ trunk/src/VBox/Runtime/r0drv/linux/waitqueue-r0drv-linux.h	(revision 85698)
@@ -184,5 +184,5 @@
      * Initialize the wait queue related bits.
      */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 39)
+#if RTLNX_VER_MIN(2,5,39)
     init_wait((&pWait->WaitQE));
 #else
