diff options
author | Vadim Kuznetsov <vadimk@gentoo.org> | 2011-03-16 13:54:50 +0000 |
---|---|---|
committer | Vadim Kuznetsov <vadimk@gentoo.org> | 2011-03-16 13:54:50 +0000 |
commit | d5862db8b527b9c58d825ad548ae62c7f0a8d557 (patch) | |
tree | a7d3b7d7258e22529d27b0822e98e9bda5de0e76 /app-emulation/vmware-modules | |
parent | change to new style virtual/imap-c-client - bug 358993 (diff) | |
download | gentoo-2-d5862db8b527b9c58d825ad548ae62c7f0a8d557.tar.gz gentoo-2-d5862db8b527b9c58d825ad548ae62c7f0a8d557.tar.bz2 gentoo-2-d5862db8b527b9c58d825ad548ae62c7f0a8d557.zip |
bug 354383
(Portage version: 2.1.9.43/cvs/Linux x86_64)
Diffstat (limited to 'app-emulation/vmware-modules')
12 files changed, 18 insertions, 981 deletions
diff --git a/app-emulation/vmware-modules/ChangeLog b/app-emulation/vmware-modules/ChangeLog index 1da55d3a004f..67d626d11e40 100644 --- a/app-emulation/vmware-modules/ChangeLog +++ b/app-emulation/vmware-modules/ChangeLog @@ -1,6 +1,23 @@ # ChangeLog for app-emulation/vmware-modules # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-emulation/vmware-modules/ChangeLog,v 1.69 2011/02/17 21:04:54 tomka Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-emulation/vmware-modules/ChangeLog,v 1.70 2011/03/16 13:54:49 vadimk Exp $ + + 16 Mar 2011; Vadim Kuznetsov <vadimk@gentoo.org> + -vmware-modules-1.0.0.25-r1.ebuild, + cleanup + + 16 Mar 2011; Vadim Kuznetsov <vadimk@gentoo.org> + -files/patches/000_all_makefile-include-directory.patch, + -files/patches/020_all_epoll-def-warnings.patch, + -vmware-modules-1.0.0.15-r2.ebuild, + -files/patches/vmmon/035_all_kernel-2.6.25.patch, + -files/patches/vmmon/040_all_kernel-2.6.27.patch, + -files/patches/vmnet/021_all_wireless_fix.patch, + -files/patches/vmblock/010_all_kernel-2.6.25.patch, + -files/patches/vmnet/025_all_kernel-2.6.25.patch, + -files/patches/vmnet/030_all_kernel-2.6.27.patch, + -files/patches/vmmon/030_all_fix-linux-headers.patch: + Bug 354383 17 Feb 2011; Thomas Kahle <tomka@gentoo.org> vmware-modules-1.0.0.25-r3.ebuild: diff --git a/app-emulation/vmware-modules/files/patches/000_all_makefile-include-directory.patch b/app-emulation/vmware-modules/files/patches/000_all_makefile-include-directory.patch deleted file mode 100644 index 42ad13cdf2ac..000000000000 --- a/app-emulation/vmware-modules/files/patches/000_all_makefile-include-directory.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -uNr Makefile Makefile ---- Makefile 2006-02-05 00:20:08.000000000 +0000 -+++ Makefile 2006-02-19 16:49:34.000000000 +0000 -@@ -14,7 +14,7 @@ - VM_UNAME = $(shell uname -r) - - # Header directory for the running kernel --HEADER_DIR = /lib/modules/$(VM_UNAME)/build/include -+HEADER_DIR = ${KERNEL_DIR}/include - - BUILD_DIR = $(HEADER_DIR)/.. - diff --git a/app-emulation/vmware-modules/files/patches/020_all_epoll-def-warnings.patch b/app-emulation/vmware-modules/files/patches/020_all_epoll-def-warnings.patch deleted file mode 100644 index c30d7c9c5e3e..000000000000 --- a/app-emulation/vmware-modules/files/patches/020_all_epoll-def-warnings.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- include/compat_wait.h -+++ include/compat_wait.h -@@ -34,13 +34,13 @@ - * 2.4.20-wolk4.0s. - */ - --#if VMW_HAVE_EPOLL // { -+#ifdef VMW_HAVE_EPOLL // { - #define compat_poll_wqueues struct poll_wqueues - #else // } { - #define compat_poll_wqueues poll_table - #endif // } - --#if VMW_HAVE_EPOLL // { -+#ifdef VMW_HAVE_EPOLL // { - - /* If prototype does not match, build will abort here */ - extern void poll_initwait(compat_poll_wqueues *); diff --git a/app-emulation/vmware-modules/files/patches/vmblock/010_all_kernel-2.6.25.patch b/app-emulation/vmware-modules/files/patches/vmblock/010_all_kernel-2.6.25.patch deleted file mode 100644 index 6b1d58fc28b9..000000000000 --- a/app-emulation/vmware-modules/files/patches/vmblock/010_all_kernel-2.6.25.patch +++ /dev/null @@ -1,89 +0,0 @@ -diff --git a/linux/dentry.c b/linux/dentry.c -index a39bb76..07c6296 100644 ---- a/linux/dentry.c -+++ b/linux/dentry.c -@@ -112,7 +112,7 @@ DentryOpRevalidate(struct dentry *dentry, // IN: dentry revalidating - LOG(4, "DentryOpRevalidate: [%s] no longer exists\n", iinfo->name); - return 0; - } -- ret = actualNd.dentry && actualNd.dentry->d_inode; -+ ret = nd_dentry(&actualNd) && nd_dentry(&actualNd)->d_inode; - path_release(&actualNd); - - LOG(8, "DentryOpRevalidate: [%s] %s revalidated\n", -diff --git a/linux/filesystem.c b/linux/filesystem.c -index fb6d0bf..e979072 100644 ---- a/linux/filesystem.c -+++ b/linux/filesystem.c -@@ -273,7 +273,7 @@ Iget(struct super_block *sb, // IN: file system superblock object - - ASSERT(sb); - -- inode = iget(sb, ino); -+ inode = iget_locked(sb, ino); - if (!inode) { - return NULL; - } -@@ -301,7 +301,7 @@ Iget(struct super_block *sb, // IN: file system superblock object - return inode; - } - -- iinfo->actualDentry = actualNd.dentry; -+ iinfo->actualDentry = nd_dentry(&actualNd); - path_release(&actualNd); - - return inode; -@@ -307,7 +307,7 @@ Iget(struct super_block *sb, // IN: file system superblock object - return inode; - - error_inode: -- iput(inode); -+ iget_failed(inode); - return NULL; - } - -diff --git a/linux/filesystem.h b/linux/filesystem.h -index 697d112..0f5f32f 100644 ---- a/linux/filesystem.h -+++ b/linux/filesystem.h -@@ -51,6 +51,27 @@ - - #include "vm_basic_types.h" - -+#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 24) -+#define nd_dentry(nd) (nd)->path.dentry -+#define nd_mnt(nd) (nd)->path.mnt -+ -+static inline void path_release(struct nameidata *nd) -+{ -+ path_put(&nd->path); -+} -+ -+#else -+#define nd_dentry(nd) (nd)->dentry -+#define nd_mnt(nd) (nd)->mnt -+ -+static inline void iget_failed(struct inode *inode) -+{ -+ make_bad_inode(inode); -+ unlock_new_inode(inode); -+ iput(inode); -+} -+#endif -+ - #ifndef container_of - #define container_of(ptr, type, memb) ((type *)((char *)(ptr) - offsetof(type, memb))) - #endif -diff --git a/linux/super.c b/linux/super.c -index 2f2a9aa..697917d 100644 ---- a/linux/super.c -+++ b/linux/super.c -@@ -52,7 +52,7 @@ struct super_operations VMBlockSuperOps = { - #else - .clear_inode = SuperOpClearInode, - #endif -- .read_inode = SuperOpReadInode, -+// .read_inode = SuperOpReadInode, - .statfs = SuperOpStatfs, - }; - diff --git a/app-emulation/vmware-modules/files/patches/vmmon/030_all_fix-linux-headers.patch b/app-emulation/vmware-modules/files/patches/vmmon/030_all_fix-linux-headers.patch deleted file mode 100644 index 19c97d7e5b71..000000000000 --- a/app-emulation/vmware-modules/files/patches/vmmon/030_all_fix-linux-headers.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -uNr vmmon-only.old/include/vcpuset.h vmmon-only/include/vcpuset.h ---- vmmon-only.old/include/vcpuset.h 2007-07-22 12:21:17.000000000 +0100 -+++ vmmon-only/include/vcpuset.h 2007-12-01 15:52:11.000000000 +0000 -@@ -71,7 +71,7 @@ - #define ffs(x) ffs_x86_64(x) - - #elif defined MODULE -- #include "asm/bitops.h" -+ #include "linux/bitops.h" - #elif defined __APPLE__ && defined KERNEL - /* - * XXXMACOS An ugly hack to resolve redefinition of PAGE_ defines diff --git a/app-emulation/vmware-modules/files/patches/vmmon/035_all_kernel-2.6.25.patch b/app-emulation/vmware-modules/files/patches/vmmon/035_all_kernel-2.6.25.patch deleted file mode 100644 index 92f70f9a3b27..000000000000 --- a/app-emulation/vmware-modules/files/patches/vmmon/035_all_kernel-2.6.25.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/common/task.c b/common/task.c -index 3111098..8373d07 100644 ---- a/common/task.c -+++ b/common/task.c -@@ -25,7 +25,12 @@ extern "C" { - * we do not need asm/page.h anymore in this file - not surprising, this - * is common file, yes? And Windows do not have page.h, do they? - */ -+#include <linux/version.h> -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 25) - #define _I386_PAGE_H -+#else -+#define _ASM_X86_PAGE_H -+#endif - /* On Linux, must come before any inclusion of asm/page.h --hpreg */ - #include "hostKernel.h" - #ifdef linux 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 deleted file mode 100644 index f44377760cb5..000000000000 --- a/app-emulation/vmware-modules/files/patches/vmmon/040_all_kernel-2.6.27.patch +++ /dev/null @@ -1,596 +0,0 @@ -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..d0da703 100644 ---- a/include/compat_semaphore.h -+++ b/include/compat_semaphore.h -@@ -2,7 +2,11 @@ - # define __COMPAT_SEMAPHORE_H__ - - -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27) -+#include <linux/semaphore.h> -+#else - #include <asm/semaphore.h> -+#endif - - - /* -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/021_all_wireless_fix.patch b/app-emulation/vmware-modules/files/patches/vmnet/021_all_wireless_fix.patch deleted file mode 100644 index a550e89e99b1..000000000000 --- a/app-emulation/vmware-modules/files/patches/vmnet/021_all_wireless_fix.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff -uNr vmnet-only.old/bridge.c vmnet-only/bridge.c ---- vmnet-only.old/bridge.c 2008-01-06 21:25:04.000000000 +0000 -+++ vmnet-only/bridge.c 2008-01-06 21:27:42.000000000 +0000 -@@ -32,7 +32,7 @@ - #include <linux/tcp.h> - #include <net/tcp.h> - --#ifdef CONFIG_NET_RADIO -+#if defined CONFIG_NET_RADIO || defined CONFIG_WLAN_80211 - # include <linux/wireless.h> - #endif - #include "vmnetInt.h" -@@ -764,7 +764,7 @@ - { - #ifdef CONFIG_WIRELESS_EXT - return dev->wireless_handlers != NULL; --#elif !defined(CONFIG_NET_RADIO) -+#elif !defined CONFIG_NET_RADIO && !defined CONFIG_WLAN_80211 - return FALSE; - #elif WIRELESS_EXT > 19 - return dev->wireless_handlers != NULL; diff --git a/app-emulation/vmware-modules/files/patches/vmnet/025_all_kernel-2.6.25.patch b/app-emulation/vmware-modules/files/patches/vmnet/025_all_kernel-2.6.25.patch deleted file mode 100644 index a11a362347ec..000000000000 --- a/app-emulation/vmware-modules/files/patches/vmnet/025_all_kernel-2.6.25.patch +++ /dev/null @@ -1,34 +0,0 @@ -diff --git a/filter.c b/filter.c -index 7527fe4..7483c83 100644 ---- a/filter.c -+++ b/filter.c -@@ -12,6 +12,13 @@ - #include <linux/ip.h> - #include "compat_skbuff.h" - #include <linux/netdevice.h> -+ -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25) -+# define NF_IP_LOCAL_OUT NF_INET_LOCAL_OUT -+# define NF_IP_LOCAL_IN NF_INET_LOCAL_IN -+# define NF_IP_POST_ROUTING NF_INET_POST_ROUTING -+#endif -+ - /* - * All this makes sense only if NETFILTER support is configured in our kernel. - */ -diff --git a/vmnetInt.h b/vmnetInt.h -index bf2dff9..483c457 100644 ---- a/vmnetInt.h -+++ b/vmnetInt.h -@@ -78,8 +78,10 @@ - */ - #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 65) - # define SET_SK_DEAD(_sk, _val) (_sk)->dead = (_val) --#else -+#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 25) - # define SET_SK_DEAD(_sk, _val) sock_valbool_flag(_sk, SOCK_DEAD, _val) -+#else -+# define SET_SK_DEAD(_sk, _val) sock_set_flag(_sk, SOCK_DEAD) - #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 deleted file mode 100644 index 164830379d9c..000000000000 --- a/app-emulation/vmware-modules/files/patches/vmnet/030_all_kernel-2.6.27.patch +++ /dev/null @@ -1,84 +0,0 @@ -diff --git a/bridge.c b/bridge.c -index cdf9e0b..de78618 100644 ---- a/bridge.c -+++ b/bridge.c -@@ -275,7 +275,11 @@ VNetBridgeDevCompatible(VNetBridge *bridge, // IN: Bridge - struct net_device *net) // IN: Network device - { - #ifdef VMW_NETDEV_HAS_NET -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26) -+ if (dev_net(net) != dev_net(bridge->internalDev)) { -+#else - if (net->nd_net != bridge->internalDev->nd_net) { -+#endif - return 0; - } - #endif -diff --git a/compat_semaphore.h b/compat_semaphore.h -index a3a88c2..c3038d7 100644 ---- a/compat_semaphore.h -+++ b/compat_semaphore.h -@@ -6,7 +6,11 @@ - # define __COMPAT_SEMAPHORE_H__ - - -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27) -+#include <linux/semaphore.h> -+#else - #include <asm/semaphore.h> -+#endif - - - /* -diff --git a/procfs.c b/procfs.c -index 07e894d..73d31e8 100644 ---- a/procfs.c -+++ b/procfs.c -@@ -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 --git a/vmnetInt.h b/vmnetInt.h -index 483c457..2328ec6 100644 ---- a/vmnetInt.h -+++ b/vmnetInt.h -@@ -63,7 +63,11 @@ - # define dev_lock_list() read_lock(&dev_base_lock) - # define dev_unlock_list() read_unlock(&dev_base_lock) - # ifdef VMW_NETDEV_HAS_NET -+# if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26) - # define DEV_GET(x) __dev_get_by_name((x)->internalDev->nd_net, (x)->name) -+# else -+# define DEV_GET(x) __dev_get_by_name(dev_net((x)->internalDev), (x)->name) -+# endif - # else - # define DEV_GET(x) __dev_get_by_name((x)->name) - # endif -@@ -87,8 +91,13 @@ - - #ifdef VMW_NETDEV_HAS_NET - extern struct proto vmnet_proto; -+# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26) -+# define compat_sk_alloc(_bri, _pri) sk_alloc(dev_net((_bri)->internalDev), \ -+ PF_NETLINK, _pri, &vmnet_proto) -+# else - # define compat_sk_alloc(_bri, _pri) sk_alloc((_bri)->internalDev->nd_net, \ - PF_NETLINK, _pri, &vmnet_proto) -+# endif - #elif defined(VMW_HAVE_SK_ALLOC_WITH_PROTO) - extern struct proto vmnet_proto; - # define compat_sk_alloc(_bri, _pri) sk_alloc(PF_NETLINK, _pri, &vmnet_proto, 1) 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 deleted file mode 100644 index 659507cac8a6..000000000000 --- a/app-emulation/vmware-modules/vmware-modules-1.0.0.15-r2.ebuild +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright 1999-2011 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.3 2011/02/11 21:26:54 vadimk 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 -} diff --git a/app-emulation/vmware-modules/vmware-modules-1.0.0.25-r1.ebuild b/app-emulation/vmware-modules/vmware-modules-1.0.0.25-r1.ebuild deleted file mode 100644 index 0100dce8868c..000000000000 --- a/app-emulation/vmware-modules/vmware-modules-1.0.0.25-r1.ebuild +++ /dev/null @@ -1,79 +0,0 @@ -# Copyright 1999-2010 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.25-r1.ebuild,v 1.5 2010/11/05 16:27:29 lxnay Exp $ - -EAPI="2" - -inherit eutils flag-o-matic linux-mod - -DESCRIPTION="VMware kernel modules" -HOMEPAGE="http://www.vmware.com/" - -SRC_URI="x86? ( - mirror://gentoo/${P}.x86.tar.bz2 - http://dev.gentoo.org/~vadimk/${P}.x86.tar.bz2 - ) - amd64? ( - mirror://gentoo/${P}.amd64.tar.bz2 - http://dev.gentoo.org/~vadimk/${P}.amd64.tar.bz2 - )" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="amd64 x86" -IUSE="" - -DEPEND="" -RDEPEND="${DEPEND}" - -S="${WORKDIR}" - -pkg_setup() { - linux-mod_pkg_setup - - VMWARE_VER="VME_V65" # THIS VALUE IS JUST A PLACE HOLDER - VMWARE_GROUP=${VMWARE_GROUP:-vmware} - - VMWARE_MODULE_LIST="vmblock vmci vmmon vmnet vsock" - VMWARE_MOD_DIR="${PN}-${PVR}" - - BUILD_TARGETS="auto-build VMWARE_VER=${VMWARE_VER} KERNEL_DIR=${KERNEL_DIR} KBUILD_OUTPUT=${KV_OUT_DIR}" - - enewgroup "${VMWARE_GROUP}" - filter-flags -mfpmath=sse - - for mod in ${VMWARE_MODULE_LIST}; do - MODULE_NAMES="${MODULE_NAMES} ${mod}(misc:${S}/${mod}-only)" - done -} - -src_unpack() { - unpack ${A} - cd "${S}" - for mod in ${VMWARE_MODULE_LIST}; do - unpack ./"${P}"/${mod}.tar - done -} - -src_prepare() { - epatch "${FILESDIR}/${PV}-makefile-kernel-dir.patch" - epatch "${FILESDIR}/${PV}-makefile-include.patch" - epatch "${FILESDIR}/sched_h-2.6.32.patch" - epatch "${FILESDIR}/${PV}-autoconf-generated.patch" - epatch "${FILESDIR}/apic.patch" - #kernel_is 2 6 35 && epatch "${FILESDIR}/iommu_map.patch" - kernel_is ge 2 6 35 && epatch "${FILESDIR}/${PV}-sk_sleep.patch" - -} - -src_install() { - # this adds udev rules for vmmon* - if [[ -n "`echo ${VMWARE_MODULE_LIST} | grep vmmon`" ]]; - then - dodir /etc/udev/rules.d - echo 'KERNEL=="vmmon*", GROUP="'$VMWARE_GROUP'" MODE=660' >> "${D}/etc/udev/rules.d/60-vmware.rules" || die - echo 'KERNEL=="vmnet*", GROUP="'$VMWARE_GROUP'" MODE=660' >> "${D}/etc/udev/rules.d/60-vmware.rules" || die - fi - - linux-mod_src_install -} |