Pelle wrote:
Hi,

What kernel is required to run this version?
I get the message
kvm: unknown symbol div64_64
when inserting this module in my ubuntu feisty 2.6.20-16-generic kernel.
A quick google led me to believe this is only recently included in the kernel.


Please try the attached patch.

--
error compiling committee.c: too many arguments to function

diff --git a/kernel/external-module-compat.h b/kernel/external-module-compat.h
index 74bc072..a60d98b 100644
--- a/kernel/external-module-compat.h
+++ b/kernel/external-module-compat.h
@@ -13,6 +13,7 @@
 #include <linux/cpu.h>
 #include <asm/processor.h>
 #include <linux/hrtimer.h>
+#include <asm/bitops.h>
 
 /*
  * 2.6.16 does not have GFP_NOWAIT
@@ -368,3 +369,38 @@ static inline void preempt_notifier_sys_exit(void) {}
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21)
 #define HRTIMER_MODE_ABS HRTIMER_ABS
 #endif
+
+/* div64_64 is fairly new */
+#ifdef LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,21)
+
+#ifdef CONFIG_64BIT
+
+static inline uint64_t div64_64(uint64_t dividend, uint64_t divisor)
+{
+	return dividend / divisor;
+}
+
+#else
+
+/* 64bit divisor, dividend and result. dynamic precision */
+static inline uint64_t div64_64(uint64_t dividend, uint64_t divisor)
+{
+	uint32_t high, d;
+
+	high = divisor >> 32;
+	if (high) {
+		unsigned int shift = fls(high);
+
+		d = divisor >> shift;
+		dividend >>= shift;
+	} else
+		d = divisor;
+
+	do_div(dividend, d);
+
+	return dividend;
+}
+
+#endif
+
+#endif
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel

Reply via email to