summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Auty <ikelos@gentoo.org>2009-01-10 12:10:56 +0000
committerMike Auty <ikelos@gentoo.org>2009-01-10 12:10:56 +0000
commit4e265257d543136b7cd7d3d8709611e856a1f480 (patch)
treed802c78813eb6cce9557ed826f2ab1e81eff4e76 /app-emulation/vmware-modules
parentVersion bump, bug 205934 (diff)
downloadhistorical-4e265257d543136b7cd7d3d8709611e856a1f480.tar.gz
historical-4e265257d543136b7cd7d3d8709611e856a1f480.tar.bz2
historical-4e265257d543136b7cd7d3d8709611e856a1f480.zip
Add in vmware-modules-1.0.0.15-r2. Should compile on kernels up to and including 2.6.28, big thanks go to Tim Yamin for help with the patches.
Package-Manager: portage-2.2_rc20/cvs/Linux 2.6.28 i686
Diffstat (limited to 'app-emulation/vmware-modules')
-rw-r--r--app-emulation/vmware-modules/ChangeLog13
-rw-r--r--app-emulation/vmware-modules/Manifest11
-rw-r--r--app-emulation/vmware-modules/files/patches/vmmon/040_all_kernel-2.6.27.patch593
-rw-r--r--app-emulation/vmware-modules/files/patches/vmnet/030_all_kernel-2.6.27.patch66
-rw-r--r--app-emulation/vmware-modules/vmware-modules-1.0.0.15-r2.ebuild18
5 files changed, 695 insertions, 6 deletions
diff --git a/app-emulation/vmware-modules/ChangeLog b/app-emulation/vmware-modules/ChangeLog
index 04fbcc5217c0..ec00356c7969 100644
--- a/app-emulation/vmware-modules/ChangeLog
+++ b/app-emulation/vmware-modules/ChangeLog
@@ -1,6 +1,15 @@
# ChangeLog for app-emulation/vmware-modules
-# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-emulation/vmware-modules/ChangeLog,v 1.34 2008/11/09 20:04:05 ikelos Exp $
+# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/vmware-modules/ChangeLog,v 1.35 2009/01/10 12:10:53 ikelos Exp $
+
+*vmware-modules-1.0.0.15-r2 (10 Jan 2009)
+
+ 10 Jan 2009; Mike Auty <ikelos@gentoo.org>
+ +files/patches/vmmon/040_all_kernel-2.6.27.patch,
+ +files/patches/vmnet/030_all_kernel-2.6.27.patch,
+ +vmware-modules-1.0.0.15-r2.ebuild:
+ Add in vmware-modules-1.0.0.15-r2. Should compile on kernels up to and
+ including 2.6.28, big thanks go to Tim Yamin for help with the patches.
*vmware-modules-1.0.0.23 (09 Nov 2008)
diff --git a/app-emulation/vmware-modules/Manifest b/app-emulation/vmware-modules/Manifest
index 7d342ee71436..59687ced9a4e 100644
--- a/app-emulation/vmware-modules/Manifest
+++ b/app-emulation/vmware-modules/Manifest
@@ -14,8 +14,10 @@ AUX patches/020_all_epoll-def-warnings.patch 435 RMD160 b9152d9af93862c99c72abc1
AUX patches/vmblock/010_all_kernel-2.6.25.patch 2398 RMD160 d0a3464f03486eda983b230d0bd90bca8a5d7ed3 SHA1 b5de035a7d1f0051a76512be7e25b04ff3d0dbdd SHA256 4036d37415cad6109e95e82c3789f32ea2c4901961612fb158d5f7148671b32e
AUX patches/vmmon/030_all_fix-linux-headers.patch 472 RMD160 164b926b0cf53c1a695e7d9ee3e52c5bc1305443 SHA1 b2e485bd21c4106cccc00293df20bce6917e62a4 SHA256 092254308afc9848fd5cc63fb691ee67103fe6413a20e01a568278153d5e876c
AUX patches/vmmon/035_all_kernel-2.6.25.patch 541 RMD160 fb0ec4af96238541ef3d5c6d28436166ccacfe7d SHA1 87b1226bc6b74e35c2945c65c7902c03eafa5058 SHA256 e6bba380c0943ee02b3c19cae340238b0a40614b3f5f840a40516ed05e1d964c
+AUX patches/vmmon/040_all_kernel-2.6.27.patch 17774 RMD160 d477896bf50746e8e5c4bc6f9b04b9a45b845cce SHA1 305e00e5d0a8aebdb402ae797f3dea03529e244f SHA256 9044096efd21a7003c63a3c35a2a6de0aa598948a27525b00ef89648a99f9da1
AUX patches/vmnet/021_all_wireless_fix.patch 668 RMD160 dbcd47fc4749b36417d028a5701b831035853d9e SHA1 a3e714383be2e0abbc434d5f3ef5253b72978c81 SHA256 231e4c15eb67753da10c01cfebecd851a01f6956263df69e4fb5a9a42957ff60
AUX patches/vmnet/025_all_kernel-2.6.25.patch 939 RMD160 c7f9f0b9e7bf98b4b37db70926c1c463874e8458 SHA1 43f8f9a5a0b9a28223ad901afd5b45749447bdc4 SHA256 a3247b261376f7cde78724d5704c4ea2511d54644f9c2b776b41f19d261cba17
+AUX patches/vmnet/030_all_kernel-2.6.27.patch 2427 RMD160 0d983187f130d82b724447fab1ebdbc25b500387 SHA1 029a0ebd4ea32dcf2fa00a6ab9bf2a4cf3275b2b SHA256 e284c34e4dff2a1ca54d141eaa90b2886a9aac564e1e886cbabf19a28eda19e2
DIST VMware-player-2.0.2-59824.i386.tar.gz 67762051 RMD160 bdf0375045aa2702f0c19cf755e019307316db2e SHA1 52a9018438746ac88e965ae081120da6f8e9fbf5 SHA256 2fcaca511c0344333d9f306bab09507573c17cc4d71807a545624953cc68e138
DIST VMware-player-2.0.2-59824.x86_64.tar.gz 33049210 RMD160 1d4351d7cc8bec4d4fe492c46656807ac2220717 SHA1 a7aace822f5a730ec7d289d074c607832abd8c72 SHA256 b0fce2e1552070d492e04ab684aa32fecf587ec06e3ab802373d5e94e0e9f72b
DIST VMware-player-2.0.4-93057.i386.tar.gz 68617186 RMD160 b0e7934ca27573aac74b4ce5275c207ed0db0661 SHA1 7ae213660f05e7c1e8fa3dd177a8ebe71478b9ac SHA256 59045fa684754b95e3928fbdb9f30c7df25dff4f273e8a235b58edc16d7fafe5
@@ -26,18 +28,19 @@ DIST vmware-any-any-update115.tar.gz 493641 RMD160 56cabe56f70c01a22a7671e861cc5
DIST vmware-modules-1.0.0.23.amd64.tar.bz2 489196 RMD160 5ef5d18ec22129cd4563d14ed8b213fdd3ad86ec SHA1 64a2fb7b1195d3ee773b9e49fe8dc9b5d7ffc43a SHA256 7d8028b9da2ad1694a6e71f1f6b1f63a9a03e78249f4cacdfccd1ea508e07d2a
DIST vmware-modules-1.0.0.23.x86.tar.bz2 486085 RMD160 d039206f0ed3fcd93f7acf3bc24c340b8641057a SHA1 5a4e9ed931f6592c8332239e424afdd80b1b46e5 SHA256 5780292e519da9e1512bf78b1e0e6c21e44f4e10f214dcc0caf83af482dedf68
EBUILD vmware-modules-1.0.0.15-r1.ebuild 311 RMD160 910dd70caac0af5c1bdb6d714b96f9c134cbdd8a SHA1 c56288915c67790e3b38207e14598923203b2c7c SHA256 dbce7d028f4fe0f042323a7e05754e311366ac33feb7361dab63af70017683f7
+EBUILD vmware-modules-1.0.0.15-r2.ebuild 447 RMD160 a2da68f18996a03a9f2169f354beaa99d2dec123 SHA1 97c5dd57b8b93243a88a8107249fcdda2e5bdf1b SHA256 0f9d900e669a5dbf3d1bdbe83269801e0e16632529bedbe1a8db2ecd1f3383d0
EBUILD vmware-modules-1.0.0.16-r1.ebuild 350 RMD160 1be5daf6e1bbf0a83dace59330e327d628624cde SHA1 5c77c28e8449d3c1a9be5fef18a3f0efafcfbd51 SHA256 191e9998c8351111566e9e2dc68ac5e20f6dd48b6ad1998eb60403b7334158bc
EBUILD vmware-modules-1.0.0.17-r1.ebuild 459 RMD160 2ef0f8d190cec299cccf440e7cc53aea95000f1d SHA1 86d85a23f0574a33da06309e8d470b89ceff5fac SHA256 0701e46f0b3cf2fb1bbc20d3b3eb8a6be680889ed3bcc8c06aa8e905a9be74fb
EBUILD vmware-modules-1.0.0.17.ebuild 631 RMD160 ff0c15ea2f767f35d7ffa7a611f931ced71eff47 SHA1 dcd2851c5e6c591772dd7fa75ac4ce2f857d69df SHA256 d4514fc8c500f87342fa9cd971400919c3b727d71581ab9d6c85e9859036f8ae
EBUILD vmware-modules-1.0.0.20.ebuild 1345 RMD160 6a9021b9d7c826b98331a3f48b08d312835816f7 SHA1 f15546947bf924c0c00a5f0982cb24ddedc0301d SHA256 8faa01aacb7986dfac03963c2b21136989976b7e3248867ecc33e9f28b03adc2
EBUILD vmware-modules-1.0.0.22.ebuild 1355 RMD160 1064c34e307c8c70b32161d8c06e9e27eee97833 SHA1 105aa9d158b61fff03d95bcaee41d740a6597f8f SHA256 2cca5e1a19ebb984805a6b67289184d6d043f1e69dca1791366a228c831ee65e
EBUILD vmware-modules-1.0.0.23.ebuild 726 RMD160 4e6f53456d0b6bbb559a0701cacec7ac50b28c6c SHA1 a021f3e9d9b4240d8b3e6ac8b4aeef2757ee222a SHA256 8580407ea7370c132c92ebb6c9feb15b0cba6b004f5af7c9e1d0d48603ba820f
-MISC ChangeLog 8089 RMD160 a9551f46f8be6594233c39a9c69a3a7cfa125487 SHA1 ba5357939de04020ad9728440ea8d8d1c0945479 SHA256 9cfa43e8c486c50dca0bab793b6f71dd101febdd5b24471e995dd6dee660562f
+MISC ChangeLog 8467 RMD160 13a33b56232e4e10a2aa8529e74042915f717a37 SHA1 8c9c30a88d83e7c00697b3353088b410e79b71aa SHA256 516fa18e425f884b0b91949607f974ed37c250abef7a20843b41887fb15eb181
MISC metadata.xml 159 RMD160 fc7f68a382390e5916b0fb43f37a893fad4f9798 SHA1 f46b02a39bcd0165558de67ff4256cfc812418a3 SHA256 8581ae1c90a48f50fa0542c7fb28cb8984baaf12f50fa18f33e467081effb215
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
-iEYEARECAAYFAkkXQkoACgkQu7rWomwgFXqrAgCcCuCXqx0WOJuZ2rFMXbWPk+of
-Z3IAoIVe7gFQ99oGpmcIeY69KhTEl8rm
-=GLQw
+iEYEARECAAYFAklokGQACgkQu7rWomwgFXrdoACeJjUuNgi0Ue2LSw8J51VyYeNw
+JfcAnR7PDoHO2WuEJleKAy7xQkGuYfOd
+=Sxpd
-----END PGP SIGNATURE-----
diff --git a/app-emulation/vmware-modules/files/patches/vmmon/040_all_kernel-2.6.27.patch b/app-emulation/vmware-modules/files/patches/vmmon/040_all_kernel-2.6.27.patch
new file mode 100644
index 000000000000..e24a1de41a35
--- /dev/null
+++ b/app-emulation/vmware-modules/files/patches/vmmon/040_all_kernel-2.6.27.patch
@@ -0,0 +1,593 @@
+diff --git a/common/task.c b/common/task.c
+index 264948d..62f4487 100644
+--- a/common/task.c
++++ b/common/task.c
+@@ -35,7 +35,6 @@ extern "C" {
+ #include "hostKernel.h"
+ #ifdef linux
+ # include <linux/string.h>
+-# include <linux/kernel.h>
+
+ # ifdef USE_PERFCTRS_HOSTED
+ # include "perfctr.h"
+diff --git a/common/task_compat.h b/common/task_compat.h
+index b9f4f61..7e9c3de 100644
+--- a/common/task_compat.h
++++ b/common/task_compat.h
+@@ -3646,6 +3646,5 @@ Task_CheckPadding(void)
+ return TRUE;
+ }
+
+- printk("/dev/vmmon: Cannot load module. Use standard gcc compiler\n");
+ return FALSE;
+ }
+diff --git a/include/compat_semaphore.h b/include/compat_semaphore.h
+index 6514067..b2e399d 100644
+--- a/include/compat_semaphore.h
++++ b/include/compat_semaphore.h
+@@ -2,7 +2,7 @@
+ # define __COMPAT_SEMAPHORE_H__
+
+
+-#include <asm/semaphore.h>
++#include <linux/semaphore.h>
+
+
+ /*
+diff --git a/include/vcpuset.h b/include/vcpuset.h
+index 977f3ce..03346df 100644
+--- a/include/vcpuset.h
++++ b/include/vcpuset.h
+@@ -71,7 +71,27 @@ ffs_x86_64(int x)
+ #define ffs(x) ffs_x86_64(x)
+
+ #elif defined MODULE
++#ifndef __cplusplus
+ #include "linux/bitops.h"
++#else
++static inline int ffs_x86_hack(int x)
++{
++ int r;
++#ifdef CONFIG_X86_CMOV
++ asm("bsfl %1,%0\n\t"
++ "cmovzl %2,%0"
++ : "=r" (r) : "rm" (x), "r" (-1));
++#else
++ asm("bsfl %1,%0\n\t"
++ "jnz 1f\n\t"
++ "movl $-1,%0\n"
++ "1:" : "=r" (r) : "rm" (x));
++#endif
++ return r + 1;
++}
++
++#define ffs(x) ffs_x86_hack(x)
++#endif
+ #elif defined __APPLE__ && defined KERNEL
+ /*
+ * XXXMACOS An ugly hack to resolve redefinition of PAGE_ defines
+diff --git a/include/x86paging.h b/include/x86paging.h
+index 688207f..abf26d2 100644
+--- a/include/x86paging.h
++++ b/include/x86paging.h
+@@ -58,7 +58,9 @@
+
+ #define PTE_AVAIL_MASK 0xe00
+ #define PTE_AVAIL_SHIFT 9
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 27)
+ #define PTE_PFN_MASK 0xfffff000
++#endif
+ #define PAE_PTE_PFN_MASK CONST64U(0xffffff000)
+ #define LM_PTE_PFN_MASK CONST64U(0xffffffffff000)
+ #define PTE_PFN_SHIFT 12
+diff --git a/linux/driver.c b/linux/driver.c
+index bd33762..802b91a 100644
+--- a/linux/driver.c
++++ b/linux/driver.c
+@@ -113,6 +113,15 @@ static int LinuxDriverAPMstate = APM_STATE_READY;
+ #define VMWare_SetVTracer(VTrace_Set)
+ #endif
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24)
++#define VMW_NOPAGE_2624
++
++#define VMMON_MAP_OFFSET_SHIFT 0
++#define VMMON_MAP_OFFSET_MASK 0x00000FFF
++#define VMMON_MAP_OFFSET(base) \
++ (((base) >> VMMON_MAP_OFFSET_SHIFT) & VMMON_MAP_OFFSET_MASK)
++#endif
++
+ struct VMXLinuxState linuxState;
+
+ static int vmversion = VME_DEFAULT;
+@@ -125,6 +134,7 @@ MODULE_PARM_DESC(vmversion, "VMware version you use: 1=VMware 2, 2=GSX 1, 3=VMwa
+ "5=GSX 2, 6=GSX 2.5, 7=VMware 4, 8=VMware 3.2.1, 9=GSX 2.5.1, "
+ "10=VMware 4.5, 11=VMware 4.5.2, 12=GSX 3.2, 13=VMware 5.0, 14=VMware 5.5, "
+ "15=Server 1.0, 16=VMware 6.0, 17=TOT");
++MODULE_LICENSE("Proprietary");
+
+ /*
+ *----------------------------------------------------------------------
+@@ -147,7 +157,10 @@ static long LinuxDriver_CompatIoctl(struct file *filp,
+
+ static int LinuxDriver_Close(struct inode *inode, struct file *filp);
+ static unsigned int LinuxDriverPoll(struct file *file, poll_table *wait);
+-#if defined(VMW_NOPAGE_261)
++#if defined(VMW_NOPAGE_2624)
++static int LinuxDriverFault(struct vm_area_struct *vma, struct vm_fault *fault);
++static int LinuxDriverLockedFault(struct vm_area_struct *vma, struct vm_fault *fault);
++#elif defined(VMW_NOPAGE_261)
+ static struct page *LinuxDriverNoPage(struct vm_area_struct *vma,
+ unsigned long address, int *type);
+ static struct page *LinuxDriverLockedNoPage(struct vm_area_struct *vma,
+@@ -168,11 +181,19 @@ static int LinuxDriverMmap(struct file *filp, struct vm_area_struct *vma);
+ static void LinuxDriverPollTimeout(unsigned long clientData);
+
+ static struct vm_operations_struct vmuser_mops = {
++#ifdef VMW_NOPAGE_2624
++ .fault = LinuxDriverFault
++#else
+ .nopage = LinuxDriverNoPage
++#endif
+ };
+
+ struct vm_operations_struct vmuser_locked_mops = {
++#ifdef VMW_NOPAGE_2624
++ .fault = LinuxDriverLockedFault
++#else
+ .nopage = LinuxDriverLockedNoPage
++#endif
+ };
+
+ static struct file_operations vmuser_fops;
+@@ -1143,7 +1164,10 @@ LinuxDriverIPIHandler(void *info)
+ *-----------------------------------------------------------------------------
+ */
+
+-#ifdef VMW_NOPAGE_261
++#if defined(VMW_NOPAGE_2624)
++static int LinuxDriverFault(struct vm_area_struct *vma, //IN
++ struct vm_fault *fault) //IN/OUT
++#elif defined(VMW_NOPAGE_261)
+ static struct page *LinuxDriverNoPage(struct vm_area_struct *vma, //IN
+ unsigned long address, //IN
+ int *type) //OUT: Fault type
+@@ -1161,14 +1185,25 @@ static unsigned long LinuxDriverNoPage(struct vm_area_struct *vma,//IN
+ unsigned long pg;
+ struct page* page;
+
++#ifdef VMW_NOPAGE_2624
++ pg = fault->pgoff;
++#else
+ pg = ((address - vma->vm_start) >> PAGE_SHIFT) + compat_vm_pgoff(vma);
++#endif
+ pg = VMMON_MAP_OFFSET(pg);
+ if (pg >= vmLinux->size4Gb) {
++#ifdef VMW_NOPAGE_2624
++ return VM_FAULT_SIGBUS;
++#else
+ return 0;
++#endif
+ }
+ page = vmLinux->pages4Gb[pg];
+ get_page(page);
+-#ifdef KERNEL_2_4_0
++#ifdef VMW_NOPAGE_2624
++ fault->page = page;
++ return 0;
++#elif defined(KERNEL_2_4_0)
+ #ifdef VMW_NOPAGE_261
+ *type = VM_FAULT_MINOR;
+ #endif
+diff --git a/linux/driver.h b/linux/driver.h
+index 89c1620..dec6877 100644
+--- a/linux/driver.h
++++ b/linux/driver.h
+@@ -131,7 +131,7 @@ typedef struct VMXLinuxState {
+ spinlock_t pollListLock;
+ #endif
+
+- volatile int fastClockThread;
++ volatile struct task_struct *fastClockThread;
+ unsigned fastClockRate;
+
+ /*
+diff --git a/linux/driver_compat.h b/linux/driver_compat.h
+index 2b1f520..13afc74 100644
+--- a/linux/driver_compat.h
++++ b/linux/driver_compat.h
+@@ -268,7 +268,10 @@ LinuxDriverDestructorLocked(VMLinux *vmLinux) // IN
+ *-----------------------------------------------------------------------------
+ */
+
+-#ifdef VMW_NOPAGE_261
++#if defined(VMW_NOPAGE_2624)
++static int LinuxDriverLockedFault(struct vm_area_struct *vma, //IN
++ struct vm_fault *fault) //IN/OUT
++#elif defined(VMW_NOPAGE_261)
+ static struct page *LinuxDriverLockedNoPage(struct vm_area_struct *vma, //IN
+ unsigned long address, //IN
+ int *type) //OUT: Fault type
+@@ -288,33 +291,60 @@ static unsigned long LinuxDriverLockedNoPage(struct vm_area_struct *vma, //IN
+ struct VMHostEntry* vmhe;
+ struct page* result;
+
++#ifdef VMW_NOPAGE_2624
++ pg = fault->pgoff;
++#else
+ pg = ((address - vma->vm_start) >> PAGE_SHIFT) + compat_vm_pgoff(vma);
++#endif
+ if (pg >= vmLinux->sizeLocked) {
+ printk(KERN_DEBUG "vmmon: Something went wrong: entry %08lX out of range (>=%08X) for mapping on filp %p\n", pg, vmLinux->sizeLocked, vmLinux);
++#ifdef VMW_NOPAGE_2624
++ return VM_FAULT_SIGBUS;
++#else
+ return NOPAGE_SIGBUS;
++#endif
+ }
+ if (!vmLinux->vm || !vmLinux->vm->vmhost) {
+ printk(KERN_DEBUG "vmmon: Something went wrong: no vm or vmhost for mapping on filp %p\n", vmLinux);
++#ifdef VMW_NOPAGE_2624
++ return VM_FAULT_SIGBUS;
++#else
+ return NOPAGE_SIGBUS;
++#endif
+ }
+ pgt = vmLinux->pagesLocked->ent[pg / VMHOST_MAPPING_PT];
+ if (!pgt) {
+ printk(KERN_DEBUG "vmmon: Something went wrong: missing entry %08lX from mapping on filp %p\n", pg, vmLinux);
++#ifdef VMW_NOPAGE_2624
++ return VM_FAULT_SIGBUS;
++#else
+ return NOPAGE_SIGBUS;
++#endif
+ }
+ vmhe = kmap(pgt);
+ result = vmhe->ent[pg % VMHOST_MAPPING_PT];
+ kunmap(pgt);
+ if (!result) {
+ printk(KERN_DEBUG "vmmon: Something went wrong: attempt to access non-existing entry %08lX in mapping on filp %p\n", pg, vmLinux);
++#ifdef VMW_NOPAGE_2624
++ return VM_FAULT_SIGBUS;
++#else
+ return NOPAGE_SIGBUS;
++#endif
+ }
+ if (!PhysTrack_Test(vmLinux->vm->vmhost->AWEPages, page_to_pfn(result))) {
+ printk(KERN_DEBUG "vmmon: MPN %08lX not tracked! Someone released it before removing it from VA first!\n", pg);
++#ifdef VMW_NOPAGE_2624
++ return VM_FAULT_SIGBUS;
++#else
+ return NOPAGE_SIGBUS;
++#endif
+ }
+ get_page(result);
+-#ifdef KERNEL_2_4_0
++#if defined(VMW_NOPAGE_2624)
++ fault->page = result;
++ return 0;
++#elif defined(KERNEL_2_4_0)
+ #ifdef VMW_NOPAGE_261
+ *type = VM_FAULT_MINOR;
+ #endif
+diff --git a/linux/hostif.c b/linux/hostif.c
+index 2ec1ab1..bd6ef1e 100644
+--- a/linux/hostif.c
++++ b/linux/hostif.c
+@@ -70,6 +70,10 @@
+ #include "compat_timer.h"
+ #include "x86.h"
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24)
++#include <linux/kthread.h>
++#include <linux/mutex.h>
++#endif
+ static COMPAT_DECLARE_COMPLETION(fastClockExited);
+
+ /*
+@@ -136,6 +140,95 @@ static COMPAT_DECLARE_COMPLETION(fastClockExited);
+ #define HOST_ISTRACKED_PFN(_vm, _pfn) (PhysTrack_Test(_vm->physTracker, _pfn))
+
+
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24))
++/*
++ *-----------------------------------------------------------------------------
++ *
++ * MutexInit --
++ *
++ * Initialize a Mutex. --hpreg
++ *
++ * Results:
++ * None
++ *
++ * Side effects:
++ * None
++ *
++ *-----------------------------------------------------------------------------
++ */
++
++#define MutexInit(_mutex, _name) mutex_init(_mutex)
++/*
++ *-----------------------------------------------------------------------------
++ *
++ * MutexIsLocked --
++ *
++ * Determine if a Mutex is locked by the current thread. --hpreg
++ *
++ * Results:
++ * TRUE if yes
++ * FALSE if no
++ *
++ * Side effects:
++ * None
++ *
++ *-----------------------------------------------------------------------------
++ */
++
++#define MutexIsLocked(_mutex) mutex_is_locked(_mutex)
++
++/*
++ *-----------------------------------------------------------------------------
++ *
++ * MutexLock --
++ *
++ * Acquire a Mutex. --hpreg
++ *
++ * Results:
++ * None
++ *
++ * Side effects:
++ * None
++ *
++ *-----------------------------------------------------------------------------
++ */
++
++#define MutexLock(_mutex, _callerID) mutex_lock(_mutex)
++
++/*
++ *-----------------------------------------------------------------------------
++ *
++ * MutexUnlock --
++ *
++ * Release a Mutex. --hpreg
++ *
++ * Results:
++ * None
++ *
++ * Side effects:
++ * None
++ *
++ *-----------------------------------------------------------------------------
++ */
++
++#define MutexUnlock(_mutex, _callerID) mutex_unlock(_mutex)
++
++/* This mutex protects the driver-wide state. --hpreg */
++static DEFINE_MUTEX(globalMutex);
++
++/*
++ * This mutex protects the fast clock rate and is held while
++ * creating/destroying the fastClockThread. It ranks below
++ * globalMutex. We can't use globalMutex for this purpose because the
++ * fastClockThread itself acquires the globalMutex, so trying to hold
++ * the mutex while destroying the thread can cause a deadlock.
++ */
++static DEFINE_MUTEX(fastClockMutex);
++
++/* This mutex protects linuxState.pollList. */
++static DEFINE_MUTEX(pollListMutex);
++
++#else
+ /*
+ *-----------------------------------------------------------------------------
+ *
+@@ -278,6 +371,7 @@ static Mutex fastClockMutex;
+ /* This mutex protects linuxState.pollList. */
+ static Mutex pollListMutex;
+
++#endif /* USE_KTHREAD */
+
+ /*
+ *-----------------------------------------------------------------------------
+@@ -350,7 +444,7 @@ HostIF_GlobalUnlock(int callerID) // IN
+ MutexUnlock(&globalMutex, callerID);
+ }
+
+-
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24)
+ #ifdef VMX86_DEBUG
+ /*
+ *-----------------------------------------------------------------------------
+@@ -375,6 +469,7 @@ HostIF_GlobalLockIsHeld(void)
+ return MutexIsLocked(&globalMutex);
+ }
+ #endif
++#endif
+
+
+ /*
+@@ -583,7 +678,7 @@ DoClearNXBit(VA vaddr)
+ #else
+ pte_val(*pte) &= ~_PAGE_NX;
+ #endif
+- smp_call_function (TLBInvalidatePage, (void *)vaddr, 1, 1);
++ compat_smp_call_function (TLBInvalidatePage, (void *)vaddr, 1, 1);
+ TLBInvalidatePage((void *)vaddr);
+ }
+ if (ptemap) {
+@@ -3240,6 +3335,46 @@ HostIF_NumOnlineLogicalCPUs(void)
+ /*
+ *----------------------------------------------------------------------
+ *
++ * HostIFDoIoctl --
++ *
++ * Issue ioctl. Assume kernel is not locked. It is not true now,
++ * but it makes things easier to understand, and won't surprise us
++ * later when we get rid of kernel lock from our code.
++ *
++ * Results:
++ * Same as ioctl method.
++ *
++ * Side effects:
++ * none.
++ *
++ *----------------------------------------------------------------------
++ */
++
++static long
++HostIFDoIoctl(struct file *filp,
++ u_int iocmd,
++ unsigned long ioarg)
++{
++#ifdef HAVE_UNLOCKED_IOCTL
++ if (filp->f_op->unlocked_ioctl) {
++ return filp->f_op->unlocked_ioctl(filp, iocmd, ioarg);
++ }
++#endif
++ if (filp->f_op->ioctl) {
++ long err;
++
++ lock_kernel();
++ err = filp->f_op->ioctl(filp->f_dentry->d_inode, filp, iocmd, ioarg);
++ unlock_kernel();
++ return err;
++ }
++ return -ENOIOCTLCMD;
++}
++
++
++/*
++ *----------------------------------------------------------------------
++ *
+ * HostIFFastClockThread --
+ *
+ * Kernel thread that provides finer-grained wakeups than the
+@@ -3265,7 +3400,9 @@ HostIFFastClockThread(void *data)
+ mm_segment_t oldFS;
+ unsigned rate = 0;
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24)
+ compat_daemonize("vmware-rtc");
++#endif
+ oldFS = get_fs();
+ set_fs(KERNEL_DS);
+ compat_allow_signal(SIGKILL);
+@@ -3286,8 +3423,7 @@ HostIFFastClockThread(void *data)
+ p2rate <<= 1;
+ }
+
+- res = filp->f_op->ioctl(filp->f_dentry->d_inode,
+- filp, RTC_IRQP_SET, p2rate);
++ res = HostIFDoIoctl(filp, RTC_IRQP_SET, p2rate);
+ if (res < 0) {
+ Warning("/dev/rtc set rate %d failed: %d\n", p2rate, res);
+ goto out;
+@@ -3392,19 +3528,19 @@ HostIF_SetFastClockRate(unsigned int rate) // IN: Frequency in Hz.
+ struct file *filp;
+ int fsuid, res;
+ Bool cap;
+- long pid;
++ struct task_struct *t;
+
+ fsuid = current->fsuid;
+ current->fsuid = 0;
+ filp = filp_open("/dev/rtc", O_RDONLY, 0);
+ current->fsuid = fsuid;
+- if (IS_ERR(filp)) {
++ if (IS_ERR(filp) || !filp) {
+ Warning("/dev/rtc open failed: %d\n", (int)(VA)filp);
+ return -(int)(VA)filp;
+ }
+ cap = cap_raised(current->cap_effective, CAP_SYS_RESOURCE);
+ cap_raise(current->cap_effective, CAP_SYS_RESOURCE);
+- res = filp->f_op->ioctl(filp->f_dentry->d_inode, filp, RTC_PIE_ON, 0);
++ res = HostIFDoIoctl(filp, RTC_PIE_ON, 0);
+ if (!cap) {
+ cap_lower(current->cap_effective, CAP_SYS_RESOURCE);
+ }
+@@ -3413,26 +3549,27 @@ HostIF_SetFastClockRate(unsigned int rate) // IN: Frequency in Hz.
+ compat_filp_close(filp, current->files);
+ return -res;
+ }
+- pid = kernel_thread(HostIFFastClockThread, filp, 0);
+- if (pid < 0) {
++ t = kthread_create(HostIFFastClockThread, filp, "vmware-rtc");
++ if (IS_ERR(t)) {
+ /*
+ * Ignore ERESTARTNOINTR silently, it occurs when signal is
+ * pending, and syscall layer automatically reissues operation
+ * after signal is handled.
+ */
+- if (pid != -ERESTARTNOINTR) {
+- Warning("/dev/rtc cannot start watch thread: %ld\n", pid);
++ if (PTR_ERR(t) != -ERESTARTNOINTR) {
++ Warning("/dev/rtc cannot start watch thread: %ld\n", PTR_ERR(t));
+ }
+ compat_filp_close(filp, current->files);
+- return -pid;
++ return -PTR_ERR(t);
+ }
+- linuxState.fastClockThread = pid;
++ linuxState.fastClockThread = t;
++ wake_up_process(t);
+ }
+ } else {
+ if (linuxState.fastClockThread) {
+- kill_proc(linuxState.fastClockThread, SIGKILL, 1);
+- linuxState.fastClockThread = 0;
++ send_sig(SIGKILL, linuxState.fastClockThread, 1);
+ compat_wait_for_completion(&fastClockExited);
++ linuxState.fastClockThread = NULL;
+ }
+ }
+ return 0;
+diff --git a/linux/vmhost.h b/linux/vmhost.h
+index 7bb43f1..d5f2f64 100644
+--- a/linux/vmhost.h
++++ b/linux/vmhost.h
+@@ -13,7 +13,7 @@
+ #include "compat_semaphore.h"
+ #include "compat_wait.h"
+
+-
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24)
+ #ifdef VMX86_DEBUG
+ /*
+ * A MutexHolder object. In debug builds, we record information about the
+@@ -54,7 +54,7 @@ typedef struct Mutex {
+ MutexHolder cur;
+ #endif
+ } Mutex;
+-
++#endif
+
+ /*
+ * Per-vm host-specific state.
+@@ -65,7 +65,11 @@ typedef struct VMHost {
+ * Used for shared modifications to VM's VMDriver data, mostly page locking.
+ * It has higher rank than the global mutex.
+ */
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24)
++ struct mutex vmMutex;
++#else
+ Mutex vmMutex;
++#endif
+
+ atomic_t pendingUserCalls;
+ wait_queue_head_t callQueue;
+diff --git a/linux/vmmonInt.h b/linux/vmmonInt.h
+index 12a121d..08b7f59 100644
+--- a/linux/vmmonInt.h
++++ b/linux/vmmonInt.h
+@@ -32,7 +32,11 @@
+ #endif
+
+ #if defined(CONFIG_SMP) && LINUX_VERSION_CODE >= KERNEL_VERSION(2, 2, 8)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
++#define compat_smp_call_function(_a0,_a1,_a2,_a3) smp_call_function(_a0,_a1,_a3)
++#else
+ #define compat_smp_call_function smp_call_function
++#endif
+ #else
+ #define compat_smp_call_function(_a0,_a1,_a2,_a3) 0
+ #endif
diff --git a/app-emulation/vmware-modules/files/patches/vmnet/030_all_kernel-2.6.27.patch b/app-emulation/vmware-modules/files/patches/vmnet/030_all_kernel-2.6.27.patch
new file mode 100644
index 000000000000..7670978b0536
--- /dev/null
+++ b/app-emulation/vmware-modules/files/patches/vmnet/030_all_kernel-2.6.27.patch
@@ -0,0 +1,66 @@
+diff -pur vmnet-only.orig/bridge.c vmnet-only/bridge.c
+--- vmnet-only.orig/bridge.c 2008-05-10 06:25:56.000000000 +0200
++++ vmnet-only/bridge.c 2008-10-16 18:36:57.000000000 +0200
+@@ -274,7 +274,7 @@ VNetBridgeDevCompatible(VNetBridge *brid
+ struct net_device *net) // IN: Network device
+ {
+ #ifdef VMW_NETDEV_HAS_NET
+- if (net->nd_net != bridge->internalDev->nd_net) {
++ if (dev_net(net) != dev_net(bridge->internalDev)) {
+ return 0;
+ }
+ #endif
+diff -pur vmnet-only.orig/compat_semaphore.h vmnet-only/compat_semaphore.h
+--- vmnet-only.orig/compat_semaphore.h 2008-05-10 06:25:56.000000000 +0200
++++ vmnet-only/compat_semaphore.h 2008-10-16 18:37:21.000000000 +0200
+@@ -2,7 +2,7 @@
+ # define __COMPAT_SEMAPHORE_H__
+
+
+-#include <asm/semaphore.h>
++#include <linux/semaphore.h>
+
+
+ /*
+diff -pur vmnet-only.orig/procfs.c vmnet-only/procfs.c
+--- vmnet-only.orig/procfs.c 2008-05-10 06:25:56.000000000 +0200
++++ vmnet-only/procfs.c 2008-10-16 18:36:57.000000000 +0200
+@@ -63,7 +63,7 @@ VNetProc_Init(void)
+ {
+ int retval;
+
+- retval = VNetProc_MakeEntry(&proc_root, "vmnet", S_IFDIR, &base);
++ retval = VNetProc_MakeEntry(NULL, "vmnet", S_IFDIR, &base);
+ if (retval) {
+ return retval;
+ }
+@@ -95,7 +95,7 @@ VNetProc_Init(void)
+ void
+ VNetProc_Cleanup(void)
+ {
+- VNetProc_RemoveEntry(base, &proc_root);
++ VNetProc_RemoveEntry(base, NULL);
+ base = NULL;
+ }
+
+diff -pur vmnet-only.orig/vmnetInt.h vmnet-only/vmnetInt.h
+--- vmnet-only.orig/vmnetInt.h 2008-05-10 06:25:56.000000000 +0200
++++ vmnet-only/vmnetInt.h 2008-10-16 18:36:57.000000000 +0200
+@@ -63,7 +63,7 @@
+ # define dev_lock_list() read_lock(&dev_base_lock)
+ # define dev_unlock_list() read_unlock(&dev_base_lock)
+ # ifdef VMW_NETDEV_HAS_NET
+-# define DEV_GET(x) __dev_get_by_name((x)->internalDev->nd_net, (x)->name)
++# define DEV_GET(x) __dev_get_by_name(dev_net((x)->internalDev), (x)->name)
+ # else
+ # define DEV_GET(x) __dev_get_by_name((x)->name)
+ # endif
+@@ -89,7 +89,7 @@
+
+ #ifdef VMW_NETDEV_HAS_NET
+ extern struct proto vmnet_proto;
+-# define compat_sk_alloc(_bri, _pri) sk_alloc((_bri)->internalDev->nd_net, \
++# define compat_sk_alloc(_bri, _pri) sk_alloc(dev_net((_bri)->internalDev), \
+ PF_NETLINK, _pri, &vmnet_proto)
+ #elif defined(VMW_HAVE_SK_ALLOC_WITH_PROTO)
+ extern struct proto vmnet_proto;
diff --git a/app-emulation/vmware-modules/vmware-modules-1.0.0.15-r2.ebuild b/app-emulation/vmware-modules/vmware-modules-1.0.0.15-r2.ebuild
new file mode 100644
index 000000000000..9d5c1e20d006
--- /dev/null
+++ b/app-emulation/vmware-modules/vmware-modules-1.0.0.15-r2.ebuild
@@ -0,0 +1,18 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/vmware-modules/vmware-modules-1.0.0.15-r2.ebuild,v 1.1 2009/01/10 12:10:53 ikelos Exp $
+
+KEYWORDS="~amd64 ~x86"
+VMWARE_VER="VME_S1B1"
+IUSE=""
+
+inherit vmware-mod
+
+pkg_setup() {
+ if kernel_is lt 2 6 25; then
+ CONFIG_CHECK=""
+ else
+ CONFIG_CHECK="UNUSED_SYMBOLS"
+ fi
+ vmware-mod_pkg_setup
+}