Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 8 Apr 2003 16:03:38 +0200
From:      Mark Santcroos <marks@ripe.net>
To:        freebsd-emulation@freebsd.org
Cc:        vsilyaev@mindspring.com
Subject:   Re: VMware2 build under -CURRENT  ... is Broken?
Message-ID:  <20030408140338.GA44767@laptop.6bone.nl>
In-Reply-To: <p05200f15bab87ce72dc0@[128.113.24.47]>

next in thread | previous in thread | raw e-mail | index | archive | help

--n8g4imXOkfNTN/H1
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

All,

The attached patch fixes all problems that have come up recently and not so
recently with vmware2 for -current.

howto: 

# cd /usr/ports/emulator/vmware2
# patch < /path/to/vmware.patch

Some of them are mine, some of them are not.

Friendly committer: thanks ;-)

Mark

-- 
Mark Santcroos                    RIPE Network Coordination Centre
http://www.ripe.net/home/mark/    New Projects Group/TTM

--n8g4imXOkfNTN/H1
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="vmware.patch"

diff -Nur vmware2/Makefile vmware2_patched/Makefile
--- Makefile	Sun Mar 23 16:01:23 2003
+++ Makefile	Tue Apr  8 15:48:52 2003
@@ -120,6 +120,11 @@
 .endif
 .if ${OSVERSION} >= 500104
 	cat ${FILESDIR}/devfs.patch | (cd ${WRKSRC} && patch) > /dev/null 2>&1
+	cat ${FILESDIR}/cdevsw.patch | (cd ${WRKSRC} && patch) > /dev/null 2>&1
+.endif
+.if ${OSVERSION} >= 500109
+	cat ${FILESDIR}/hostif_c.patch | (cd ${WRKSRC} && patch) > /dev/null 2>&1
+	cat ${FILESDIR}/vm_types_h.patch | (cd ${WRKSRC} && patch) > /dev/null 2>&1
 .endif
 
 setoptions:
diff -Nur vmware2/files/cdevsw.patch vmware2_patched/files/cdevsw.patch
--- files/cdevsw.patch	Thu Jan  1 01:00:00 1970
+++ files/cdevsw.patch	Tue Apr  8 15:36:47 2003
@@ -0,0 +1,130 @@
+--- vmmon-only/freebsd/driver.c_original	Wed Mar  5 19:22:35 2003
++++ vmmon-only/freebsd/driver.c	Wed Mar  5 19:22:44 2003
+@@ -155,6 +155,14 @@
+ 
+ /* static struct cdevsw vmmon_cdevsw = { */
+ static struct cdevsw vmmon_cdevsw = {
++#if __FreeBSD_version >= 500104
++	.d_open =	FreeBSD_Driver_Open,
++	.d_close =	FreeBSD_Driver_Close,
++	.d_ioctl =	FreeBSD_Driver_Ioctl,
++	.d_poll =	FreeBSD_Driver_Poll,
++	.d_name =	DEVICE_NAME,
++	.d_maj =	CDEV_MAJOR
++#else
+ 	/* open */	FreeBSD_Driver_Open,
+ 	/* close */	FreeBSD_Driver_Close,
+ 	/* read */	noread,
+@@ -169,8 +177,7 @@
+ 	/* psize */	nopsize,
+ 	/* flags */	0,
+ 	/* bmaj */	-1
+-
+-
++#endif
+ };
+ 
+ 
+@@ -242,7 +249,11 @@
+    sprintf(freebsdState.deviceBuf,DEVICE_NAME);
+    freebsdState.major = CDEV_MAJOR;
+    freebsdState.minor = CDEV_MINOR;
++#if __FreeBSD_version < 500104
+    retval = cdevsw_add(&vmmon_cdevsw);
++#else
++   retval = 0;
++#endif
+ 
+ #endif
+    if (retval) {
+@@ -273,12 +284,14 @@
+    int retval=0;
+    
+    destroy_dev(vmmon_dev);
++#if __FreeBSD_version < 500104
+    retval = cdevsw_remove(&vmmon_cdevsw);
+    if (retval) {
+       Warning("Module %s: error unregistering\n", freebsdState.deviceBuf);
+    } else {
+       Log("Module %s: unloaded\n", freebsdState.deviceBuf);
+    }
++#endif
+ 	
+    return 0;
+ }
+--- vmnet-only/freebsd/vmnet.c_original	Wed Mar  5 19:21:51 2003
++++ vmnet-only/freebsd/vmnet.c	Wed Mar  5 19:22:00 2003
+@@ -103,6 +103,16 @@
+ static int vmnet_modeevent(module_t mod, int cmd, void *arg);
+ 
+ static struct cdevsw vmnet_cdevsw = {
++#if __FreeBSD_version >= 500104
++	.d_open = 	vmnet_open,
++	.d_close = 	vmnet_close,
++	.d_read = 	vmnet_read,
++	.d_write = 	vmnet_write,
++	.d_ioctl = 	vmnet_ioctl,
++	.d_poll = 	vmnet_poll,
++	.d_name = 	DEVICE_NAME,
++	.d_maj = 	CDEV_MAJOR
++#else
+ 	/* open */	vmnet_open,
+ 	/* close */	vmnet_close,
+ 	/* read */	vmnet_read,
+@@ -115,10 +125,11 @@
+ 	/* maj */	CDEV_MAJOR,
+ 	/* dump */	nodump,
+ 	/* psize */	nopsize,
+-	/* flags */	0,
+-	/* bmaj */	-1
++	/* flags */	0, -/* bmaj */	-1
++#endif
+ };
+ 
++
+ /* 
+  * Now declare the module to the system. 
+  * IMPORTANT: Must be before netgraph node declaration.
+@@ -164,7 +175,7 @@
+ 
+ 	s = splimp();
+ 	if_attach(ifp);
+-	ether_ifattach(ifp, ETHER_BPF_SUPPORTED);
++	ether_ifattach(ifp);
+ 	bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header));
+ 	splx(s);
+ 	
+@@ -604,11 +615,13 @@
+ static int
+ init_module(void)
+ {
+-int error;
++	int error = 0;
+ 
++#if __FreeBSD_version < 500104
+    	error = cdevsw_add(&vmnet_cdevsw);
+ 	if (error) 
+ 		return error;
++#endif
+ 
+ 	return error;
+ }
+@@ -618,7 +631,7 @@
+ static int
+ cleanup_module(void)
+ {
+-	int error;
++	int error = 0;
+ 	struct vmnet_softc *sc;
+ 
+ 	DLog(Lenter, "");
+@@ -629,7 +642,9 @@
+ 			return error;
+ 		}
+    	}
++#if __FreeBSD_version < 500104
+ 	error = cdevsw_remove(&vmnet_cdevsw);
++#endif
+ 	DLog(Linfo, "return %d", error);
+ 	return error;
+ }
diff -Nur vmware2/files/hostif_c.patch vmware2_patched/files/hostif_c.patch
--- files/hostif_c.patch	Thu Jan  1 01:00:00 1970
+++ files/hostif_c.patch	Tue Apr  8 15:26:50 2003
@@ -0,0 +1,11 @@
+--- vmmon-only/freebsd/hostif.c.patched	Tue Apr  8 15:15:20 2003
++++ vmmon-only/freebsd/hostif.c	Tue Apr  8 15:16:21 2003
+@@ -183,7 +183,7 @@
+ {
+ #define DEB(x) 
+    caddr_t addr = (caddr_t)VPN_2_VA(ppn);
+-   pt_entry_t *pteptr = vtopte(addr);
++   pt_entry_t *pteptr = vtopte((unsigned)addr);
+    PTE pte;
+ 
+    DEB(printf("FindMPN: for page %d address %p(phys %p) pteptr %p", ppn, addr, (caddr_t)vtophys(addr), pteptr));
diff -Nur vmware2/files/vm_types_h.patch vmware2_patched/files/vm_types_h.patch
--- files/vm_types_h.patch	Thu Jan  1 01:00:00 1970
+++ files/vm_types_h.patch	Tue Apr  8 15:26:57 2003
@@ -0,0 +1,13 @@
+--- vmmon-only/include/vm_types.h.patched	Tue Apr  8 15:10:25 2003
++++ vmmon-only/include/vm_types.h	Tue Apr  8 15:12:07 2003
+@@ -144,10 +144,6 @@
+ #define offsetof(type, member) ( (int) & ((type*)0) -> member )
+ #endif
+ 
+-
+-#define MIN(_a, _b)   (((_a) < (_b)) ? (_a) : (_b))
+-#define MAX(_a, _b)   (((_a) > (_b)) ? (_a) : (_b))
+-
+ #define ROUNDUP(x,y)		(((x) + (y) - 1) / (y) * (y))
+ #define ROUNDDOWN(x,y)		((x) / (y) * (y))
+ #define ROUNDUPBITS(x, bits)	(((uint32) (x) + MASK(bits)) & ~MASK(bits))
diff -Nur vmware2/pkg-plist vmware2_patched/pkg-plist
--- pkg-plist	Thu Feb 22 22:10:34 2001
+++ pkg-plist	Tue Apr  8 15:38:21 2003
@@ -70,6 +70,7 @@
 lib/vmware/lib/help/Wizos.htm
 lib/vmware/lib/help/Wizpath.htm
 lib/vmware/lib/help/toc.htm
+lib/vmware/lib/modules/linker.hints
 lib/vmware/lib/modules/vmmon_smp.ko
 lib/vmware/lib/modules/vmmon_up.ko
 lib/vmware/lib/xkeymap/be101

--n8g4imXOkfNTN/H1--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030408140338.GA44767>