[vbox-dev] [PATCH] to repair recent breakage in Linux kernel.git

walt w41ter at gmail.com
Fri Jul 18 23:54:36 GMT 2008


Linus's recent commit 15c8b6c1 to his mainline kernel tree
has broken compilation of vbox.svn.  This fixes the problem
for 2.6.25 and 2.6.26 as well as the impending 2.6.27 series.
(Kernels 2.6.24 and earlier not tested):

--- src/VBox/Runtime/r0drv/linux/mp-r0drv-linux.c       (revision 10644)
+++ src/VBox/Runtime/r0drv/linux/mp-r0drv-linux.c       (working copy)
@@ -193,9 +193,11 @@
      Args.idCpu = NIL_RTCPUID;
      Args.cHits = 0;

-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
+    rc = on_each_cpu(rtmpLinuxWrapper, &Args, 1 /* wait */);
+    rc = smp_call_function(rtmpLinuxWrapper, &Args, 1 /* wait */);
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
      rc = on_each_cpu(rtmpLinuxWrapper, &Args, 0 /* retry */, 1 /* wait */);
-
  #else /* older kernels */

  # ifdef preempt_disable
@@ -228,7 +230,11 @@
  # ifdef preempt_disable
      preempt_disable();
  # endif
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
+    rc = smp_call_function(rtmpLinuxWrapper, &Args, 1 /* wait */);
+#else
      rc = smp_call_function(rtmpLinuxWrapper, &Args, 0 /* retry */, 1 /* wait */);
+#endif
  # ifdef preempt_enable
      preempt_enable();
  # endif
@@ -280,7 +286,9 @@
      {
          if (RTMpIsCpuOnline(idCpu))
          {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
+            rc = smp_call_function_single(idCpu, rtmpLinuxWrapper, &Args, 1 /* wait */);
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19)
              rc = smp_call_function_single(idCpu, rtmpLinuxWrapper, &Args, 0 /* retry */, 1 /* wait */);
  #else
              rc = smp_call_function(rtmpOnSpecificLinuxWrapper, &Args, 0 /* retry */, 1 /* wait */);





More information about the vbox-dev mailing list