diff options
author | Jean-Marc Lenoir | 2017-12-06 15:56:16 +0100 |
---|---|---|
committer | Jean-Marc Lenoir | 2017-12-06 15:56:16 +0100 |
commit | 985036e23b2c9d2a87f25600269fb42d919cf9bd (patch) | |
tree | 609a0c7ebc1f7a2533fa1eff73c4c6eaa346077b | |
parent | 73a116f0432eca9813cccf6280e5b10c3d259b1d (diff) | |
download | aur-985036e23b2c9d2a87f25600269fb42d919cf9bd.tar.gz |
Add compatibility with Linux 4.15
Source: https://github.com/mkubecek/vmware-host-modules/commit/562121d7bc06
-rw-r--r-- | .SRCINFO | 2 | ||||
-rw-r--r-- | PKGBUILD | 2 | ||||
-rw-r--r-- | vmmon.patch | 95 |
3 files changed, 97 insertions, 2 deletions
@@ -74,7 +74,7 @@ pkgbase = vmware-workstation sha256sums = d7a9fbf39a0345ae2f14f7f389f30b1110f605d187e0c241e99bbb18993c250d sha256sums = 05e26d8b21d190ebabb7f693998114d9d5991d9dfb71acb4d990293a65b6b487 sha256sums = 6ce902b1dab8fc69be253abd8e79017011985eca850ff7acc7282f9ab668e35d - sha256sums = caa200a78a29e786753b27a42970ee86865c15fd529fd413080b3f053d541dd1 + sha256sums = a3a02e3daff9a122d4d7f45df9555b6e94e3030e024cc9a59890ace5252453cd sha256sums = 4f07320c1f9e71e649cf3e98ec107ba5521d52e50ad781ccc9dc1b61817342ae sha256sums = 3aeee4ddad2e94e5dbd8da3f995ad3f887f35a241d82e8c64a22f792c159cc44 sha256sums = 2c6076d55da659723fb7b7871baaee95df3bdcd90e448955ed1ec53df6a1f2d0 @@ -109,7 +109,7 @@ sha256sums=( '05e26d8b21d190ebabb7f693998114d9d5991d9dfb71acb4d990293a65b6b487' '6ce902b1dab8fc69be253abd8e79017011985eca850ff7acc7282f9ab668e35d' - 'caa200a78a29e786753b27a42970ee86865c15fd529fd413080b3f053d541dd1' + 'a3a02e3daff9a122d4d7f45df9555b6e94e3030e024cc9a59890ace5252453cd' '4f07320c1f9e71e649cf3e98ec107ba5521d52e50ad781ccc9dc1b61817342ae' ) options=(!strip emptydirs) diff --git a/vmmon.patch b/vmmon.patch index ac4bb2a80033..ae0850d972e2 100644 --- a/vmmon.patch +++ b/vmmon.patch @@ -45,10 +45,50 @@ 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,26 @@ ++#ifndef __COMPAT_TIMER_H__ ++#define __COMPAT_TIMER_H__ ++ ++#include <linux/timer.h> ++ ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0)) && !defined(timer_setup) ++ ++typedef unsigned long compat_timer_arg_t; ++ ++static inline void 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; ++ ++#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 }; @@ -66,6 +106,25 @@ 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) linuxState.fastClockRate = 0; linuxState.swapSize = VMMON_UNKNOWN_SWAP_SIZE; @@ -87,6 +146,15 @@ 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); ++ timer_setup(&tscTimer, LinuxDriverEstimateTSCkHzDeferred, 0); + LinuxDriverInitTSCkHz(); + Vmx86_InitIDList(); + @@ -364,7 +373,9 @@ cleanup_module(void) #ifdef VMX86_DEVEL unregister_chrdev(linuxState.major, linuxState.deviceName); @@ -111,6 +179,14 @@ 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> @@ -199,3 +275,22 @@ index fd32013..583d6da 100644 unsigned int swapPages = BYTES_2_PAGES(linuxState.swapSize); if (anonPages > swapPages) { +@@ -1688,7 +1723,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; +@@ -1750,8 +1785,7 @@ HostIF_InitUptime(void) + -(tv.tv_usec * (UPTIME_FREQ / 1000000) + + tv.tv_sec * UPTIME_FREQ)); + +- init_timer(&uptimeState.timer); +- uptimeState.timer.function = HostIFUptimeResyncMono; ++ timer_setup(&uptimeState.timer, HostIFUptimeResyncMono, 0); + mod_timer(&uptimeState.timer, jiffies + HZ); + } + |