diff options
Diffstat (limited to 'vmmon.patch')
-rw-r--r-- | vmmon.patch | 108 |
1 files changed, 3 insertions, 105 deletions
diff --git a/vmmon.patch b/vmmon.patch index 1b812a0ab760..a8d36efcc07d 100644 --- a/vmmon.patch +++ b/vmmon.patch @@ -45,57 +45,10 @@ index 2af7372..729aedc 100644 +#endif + #endif /* __COMPAT_MODULE_H__ */ -diff --git a/vmmon-only/include/compat_timer.h b/vmmon-only/include/compat_timer.h -new file mode 100644 -index 0000000..b68d9b2 ---- /dev/null -+++ b/vmmon-only/include/compat_timer.h -@@ -0,0 +1,33 @@ -+#ifndef __COMPAT_TIMER_H__ -+#define __COMPAT_TIMER_H__ -+ -+#include <linux/timer.h> -+ -+#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)) && !defined(timer_setup) -+ -+typedef unsigned long compat_timer_arg_t; -+ -+static inline void compat_timer_setup(struct timer_list *timer, -+ void (*func)(compat_timer_arg_t), -+ unsigned int flags) -+{ -+ init_timer(timer); -+ timer->function = func; -+ timer->data = 0; -+ timer->flags = flags; -+} -+ -+#else /* new timer interface since 4.15 */ -+ -+typedef struct timer_list *compat_timer_arg_t; -+ -+static inline void compat_timer_setup(struct timer_list *timer, -+ void (*func)(compat_timer_arg_t), -+ unsigned int flags) -+{ -+ timer_setup(timer, func, flags); -+} -+ -+#endif /* new timer interface since 4.15 */ -+ -+#endif /* __COMPAT_TIMER_H__ */ diff --git a/vmmon/linux/driver.c b/vmmon/linux/driver.c index 87cf45b..5390a93 100644 --- a/vmmon/linux/driver.c +++ b/vmmon/linux/driver.c -@@ -21,6 +21,7 @@ - - #define EXPORT_SYMTAB - -+#include "compat_timer.h" - #include <linux/file.h> - #include <linux/highmem.h> - #include <linux/mm.h> @@ -109,7 +109,15 @@ static struct vm_operations_struct vmuser_mops = { .fault = LinuxDriverFault }; @@ -113,26 +66,7 @@ index 87cf45b..5390a93 100644 static struct timer_list tscTimer; static Atomic_uint32 tsckHz; static VmTimeStart tsckHzStartTime; -@@ -216,7 +217,7 @@ LinuxDriverEstimateTSCkHz(void) - *---------------------------------------------------------------------- - */ - static void --LinuxDriverEstimateTSCkHzDeferred(unsigned long data) -+LinuxDriverEstimateTSCkHzDeferred(compat_timer_arg_t unused) - { - LinuxDriverEstimateTSCkHz(); - } -@@ -251,9 +252,7 @@ LinuxDriverInitTSCkHz(void) - } - - LinuxDriverReadTSCAndUptime(&tsckHzStartTime); -- tscTimer.function = LinuxDriverEstimateTSCkHzDeferred; - tscTimer.expires = jiffies + 4 * HZ; -- tscTimer.data = 0; - add_timer(&tscTimer); - } - -@@ -295,20 +304,6 @@ init_module(void) +@@ -293,20 +301,6 @@ init_module(void) linuxState.fastClockRate = 0; linuxState.swapSize = VMMON_UNKNOWN_SWAP_SIZE; @@ -153,16 +87,7 @@ index 87cf45b..5390a93 100644 #ifdef VMX86_DEVEL devel_init_module(); linuxState.minor = 0; -@@ -335,7 +334,7 @@ init_module(void) - linuxState.deviceName, linuxState.major, linuxState.minor); - - HostIF_InitUptime(); -- init_timer(&tscTimer); -+ compat_timer_setup(&tscTimer, LinuxDriverEstimateTSCkHzDeferred, 0); - LinuxDriverInitTSCkHz(); - Vmx86_InitIDList(); - -@@ -364,7 +373,9 @@ cleanup_module(void) +@@ -368,7 +362,9 @@ cleanup_module(void) #ifdef VMX86_DEVEL unregister_chrdev(linuxState.major, linuxState.deviceName); #else @@ -173,7 +98,7 @@ index 87cf45b..5390a93 100644 #endif Log("Module %s: unloaded\n", linuxState.deviceName); -@@ -977,7 +988,7 @@ LinuxDriverReadTSC(void *data, // OUT: TSC values +@@ -981,7 +977,7 @@ LinuxDriverReadTSC(void *data, // OUT: TSC values *----------------------------------------------------------------------------- */ @@ -186,14 +111,6 @@ diff --git a/vmmon/linux/hostif.c b/vmmon/linux/hostif.c index fd32013..583d6da 100644 --- a/vmmon/linux/hostif.c +++ b/vmmon/linux/hostif.c -@@ -29,6 +29,7 @@ - #include "driver-config.h" - - /* Must come before vmware.h --hpreg */ -+#include "compat_timer.h" - #include <linux/binfmts.h> - #include <linux/delay.h> - #include <linux/file.h> @@ -36,6 +36,9 @@ #include <linux/vmalloc.h> @@ -223,22 +140,3 @@ index fd32013..583d6da 100644 static struct { Atomic_uint64 uptimeBase; VersionedAtomic version; -@@ -1705,7 +1714,7 @@ HostIFReadUptimeWork(unsigned long *j) // OUT: current jiffies - */ - - static void --HostIFUptimeResyncMono(unsigned long data) // IN: ignored -+HostIFUptimeResyncMono(compat_timer_arg_t unused) // IN: ignored - { - unsigned long jifs; - uintptr_t flags; -@@ -1767,8 +1776,7 @@ HostIF_InitUptime(void) - -(tv.tv_usec * (UPTIME_FREQ / 1000000) + - tv.tv_sec * UPTIME_FREQ)); - -- init_timer(&uptimeState.timer); -- uptimeState.timer.function = HostIFUptimeResyncMono; -+ compat_timer_setup(&uptimeState.timer, HostIFUptimeResyncMono, 0); - mod_timer(&uptimeState.timer, jiffies + HZ); - } - |