Index: vmware-modules/vmblock-only/shared/compat_semaphore.h
===================================================================
--- vmware-modules.orig/vmblock-only/shared/compat_semaphore.h	2011-03-05 04:31:55.253388001 +0800
+++ vmware-modules/vmblock-only/shared/compat_semaphore.h	2011-03-05 04:32:03.593388002 +0800
@@ -28,7 +28,7 @@
 #endif
 
 
-#if defined CONFIG_PREEMPT_RT && LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 31)
+#if (defined CONFIG_PREEMPT_RT && LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 31)) || LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)
    /*
     * The -rt patch series changes the name of semaphore/mutex initialization
     * routines (across the entire kernel).  Probably to identify locations that
@@ -41,7 +41,7 @@
       #define DECLARE_MUTEX(_m)  DEFINE_SEMAPHORE(_m)
    #endif
    #ifndef init_MUTEX
-      #define init_MUTEX(_m) semaphore_init(_m)
+      #define init_MUTEX(_m) sema_init(_m,1)
    #endif
 #endif
 
Index: vmware-modules/vmci-only/include/compat_semaphore.h
===================================================================
--- vmware-modules.orig/vmci-only/include/compat_semaphore.h	2011-03-05 04:31:55.203388001 +0800
+++ vmware-modules/vmci-only/include/compat_semaphore.h	2011-03-05 04:32:03.593388002 +0800
@@ -28,7 +28,7 @@
 #endif
 
 
-#if defined CONFIG_PREEMPT_RT && LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 31)
+#if (defined CONFIG_PREEMPT_RT && LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 31)) || LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)
    /*
     * The -rt patch series changes the name of semaphore/mutex initialization
     * routines (across the entire kernel).  Probably to identify locations that
@@ -41,7 +41,7 @@
       #define DECLARE_MUTEX(_m)  DEFINE_SEMAPHORE(_m)
    #endif
    #ifndef init_MUTEX
-      #define init_MUTEX(_m) semaphore_init(_m)
+      #define init_MUTEX(_m) sema_init(_m,1)
    #endif
 #endif
 
Index: vmware-modules/vmnet-only/compat_semaphore.h
===================================================================
--- vmware-modules.orig/vmnet-only/compat_semaphore.h	2011-03-05 04:31:55.183388001 +0800
+++ vmware-modules/vmnet-only/compat_semaphore.h	2011-03-05 04:32:03.603388002 +0800
@@ -28,7 +28,7 @@
 #endif
 
 
-#if defined CONFIG_PREEMPT_RT && LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 31)
+#if (defined CONFIG_PREEMPT_RT && LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 31)) || LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)
    /*
     * The -rt patch series changes the name of semaphore/mutex initialization
     * routines (across the entire kernel).  Probably to identify locations that
@@ -41,7 +41,7 @@
       #define DECLARE_MUTEX(_m)  DEFINE_SEMAPHORE(_m)
    #endif
    #ifndef init_MUTEX
-      #define init_MUTEX(_m) semaphore_init(_m)
+      #define init_MUTEX(_m) sema_init(_m,1)
    #endif
 #endif
 
Index: vmware-modules/vsock-only/shared/compat_semaphore.h
===================================================================
--- vmware-modules.orig/vsock-only/shared/compat_semaphore.h	2011-03-05 04:31:55.233388001 +0800
+++ vmware-modules/vsock-only/shared/compat_semaphore.h	2011-03-05 04:32:03.603388002 +0800
@@ -28,7 +28,7 @@
 #endif
 
 
-#if defined CONFIG_PREEMPT_RT && LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 31)
+#if (defined CONFIG_PREEMPT_RT && LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 31)) || LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)
    /*
     * The -rt patch series changes the name of semaphore/mutex initialization
     * routines (across the entire kernel).  Probably to identify locations that
@@ -41,7 +41,7 @@
       #define DECLARE_MUTEX(_m)  DEFINE_SEMAPHORE(_m)
    #endif
    #ifndef init_MUTEX
-      #define init_MUTEX(_m) semaphore_init(_m)
+      #define init_MUTEX(_m) sema_init(_m,1)
    #endif
 #endif
 
Index: vmware-modules/vmmon-only/linux/driver.c
===================================================================
--- vmware-modules.orig/vmmon-only/linux/driver.c	2011-03-05 04:31:55.303388001 +0800
+++ vmware-modules/vmmon-only/linux/driver.c	2011-03-05 04:32:03.603388002 +0800
@@ -145,7 +145,7 @@
 #endif
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) && \
     (defined(CONFIG_SMP) || defined(CONFIG_PREEMPT))
-#  define kernel_locked_by_current() kernel_locked()
+#  define kernel_locked_by_current() (current->lock_depth >= 0)
 #else
 #  define kernel_locked_by_current() 0
 #endif
@@ -170,6 +170,7 @@
 static int LinuxDriver_Ioctl(struct inode *inode, struct file *filp,
                            u_int iocmd, unsigned long ioarg);
 #if defined(HAVE_UNLOCKED_IOCTL) || defined(HAVE_COMPAT_IOCTL)
+#define VMW_HAVE_UNLOCKED_IOCTL
 static long LinuxDriver_UnlockedIoctl(struct file *filp,
                            u_int iocmd, unsigned long ioarg);
 #endif
Index: vmware-modules/vmmon-only/include/compat_semaphore.h
===================================================================
--- vmware-modules.orig/vmmon-only/include/compat_semaphore.h	2011-03-05 04:46:44.423388002 +0800
+++ vmware-modules/vmmon-only/include/compat_semaphore.h	2011-03-05 04:46:52.123388000 +0800
@@ -28,7 +28,7 @@
 #endif
 
 
-#if defined CONFIG_PREEMPT_RT && LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 31)
+#if (defined CONFIG_PREEMPT_RT && LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 31)) || LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)
    /*
     * The -rt patch series changes the name of semaphore/mutex initialization
     * routines (across the entire kernel).  Probably to identify locations that
@@ -41,7 +41,7 @@
       #define DECLARE_MUTEX(_m)  DEFINE_SEMAPHORE(_m)
    #endif
    #ifndef init_MUTEX
-      #define init_MUTEX(_m) semaphore_init(_m)
+      #define init_MUTEX(_m) sema_init(_m,1)
    #endif
 #endif
 

