diff options
author | bsam <bsam@FreeBSD.org> | 2008-04-01 22:04:00 +0800 |
---|---|---|
committer | bsam <bsam@FreeBSD.org> | 2008-04-01 22:04:00 +0800 |
commit | 52224dd76fc469e7524a358839f6abe086723e1f (patch) | |
tree | 0e78eb2cc35eca50e72cf939828c0f41fe60a65d /emulators | |
parent | a9d3e969feb0c1383abd38658318446ac707391a (diff) | |
download | freebsd-ports-gnome-52224dd76fc469e7524a358839f6abe086723e1f.tar.gz freebsd-ports-gnome-52224dd76fc469e7524a358839f6abe086723e1f.tar.zst freebsd-ports-gnome-52224dd76fc469e7524a358839f6abe086723e1f.zip |
Unbreak compiling at FreeBSD-7.x. The port seems to work only with
an UP kernel.
PR: 117350
Submitted by: Yi Wang <wangyi6854 at gmail.com>
Patch by: fchang at cs.ubc.ca
Tested by: Yi Wang <wangyi6854 at gmail.com>
Diffstat (limited to 'emulators')
-rw-r--r-- | emulators/vmware3/Makefile | 4 | ||||
-rw-r--r-- | emulators/vmware3/files/fbsd7-1.patch | 45 | ||||
-rw-r--r-- | emulators/vmware3/files/fbsd7-2.patch | 18 |
3 files changed, 67 insertions, 0 deletions
diff --git a/emulators/vmware3/Makefile b/emulators/vmware3/Makefile index a49cc6b01a78..0cddbb8fa396 100644 --- a/emulators/vmware3/Makefile +++ b/emulators/vmware3/Makefile @@ -105,6 +105,10 @@ post-patch: cd ${WRKSRC} && ${PATCH} < ${FILESDIR}/fbsd6-1.patch cd ${WRKSRC} && ${PATCH} < ${FILESDIR}/fbsd6-2.patch .endif +.if ${OSVERSION} > 700000 + cd ${WRKSRC} && ${PATCH} < ${FILESDIR}/fbsd7-1.patch + cd ${WRKSRC} && ${PATCH} < ${FILESDIR}/fbsd7-2.patch +.endif pre-install: ${INSTALL_MAN} ${WRKSRC}/man/man1/vmware.1 ${MANPREFIX}/man/man1 diff --git a/emulators/vmware3/files/fbsd7-1.patch b/emulators/vmware3/files/fbsd7-1.patch new file mode 100644 index 000000000000..73565321d2ea --- /dev/null +++ b/emulators/vmware3/files/fbsd7-1.patch @@ -0,0 +1,45 @@ +--- vmmon-only/freebsd/driver.c.orig 2008-03-04 10:05:14.000000000 +0300 ++++ vmmon-only/freebsd/driver.c 2008-03-04 10:09:23.000000000 +0300 +@@ -397,12 +397,12 @@ + if ((error = falloc(td, &fp, &fd)) != 0) + return error; + +- FILEDESC_LOCK(p->p_fd); ++ FILEDESC_XLOCK(p->p_fd); + fp->f_data = data; + fp->f_flag = flags & FMASK; + fp->f_ops = &vmmon_fileops; + fp->f_type = DTYPE_SOCKET; +- FILEDESC_UNLOCK(p->p_fd); ++ FILEDESC_XUNLOCK(p->p_fd); + + #if __FreeBSD_version >= 501111 + /* falloc now returns TWO references to the file, not one. */ +@@ -1309,6 +1309,19 @@ + return FALSE; + } + ++static vm_paddr_t ++get_avail_end(void) ++{ ++ vm_paddr_t avail_end; ++ int i; ++ avail_end = phys_avail[1]; ++ for (i = 0; phys_avail[i + 1]; i += 2) { ++ if (phys_avail[i + 1] > avail_end) ++ avail_end = phys_avail[i + 1]; ++ } ++ return avail_end; ++} ++ + /* + * Allocate and lock numPages of memory physically continguous addresses + * below 4GB. +@@ -1341,6 +1354,7 @@ + VMDEBUG("vmmon_alloc_low_pages: malloc MemRange failed\n"); + return ENOMEM; + } ++ vm_paddr_t avail_end = get_avail_end(); + if (avail_end > ISA_DMA_BOUNCE_THRESHOLD) + high = trunc_page(ISA_DMA_BOUNCE_THRESHOLD); + else diff --git a/emulators/vmware3/files/fbsd7-2.patch b/emulators/vmware3/files/fbsd7-2.patch new file mode 100644 index 000000000000..b9e8a16c7248 --- /dev/null +++ b/emulators/vmware3/files/fbsd7-2.patch @@ -0,0 +1,18 @@ +--- vmmon-only/include/vm_asm.h.orig 2003-07-24 01:43:38.000000000 +0400 ++++ vmmon-only/include/vm_asm.h 2008-03-04 09:29:45.000000000 +0300 +@@ -1020,6 +1020,7 @@ + *----------------------------------------------------------------------------- + */ + ++#if 0 + static INLINE void + Div643264(uint64 dividend, + uint32 divisor, +@@ -1047,6 +1048,7 @@ + *quotient = (uint64)hQuotient << 32 | lQuotient; + } + #endif ++#endif + + + #endif /* VM_ASM_H */ |