vmware2 patch for -CURRENT
Ian Dowse
iedowse at maths.tcd.ie
Sat Apr 10 10:01:09 PDT 2004
Below is a quick patch to make vmware2 compile on -CURRENT. It might
not work on SMP boxes due to not getting the correct APIC IDs, but
seems to work on my laptop. Vmware2 hasn't compiled on -CURRENT for
quite a few months now.
Note that some of the patch is hand-generated as there is such a
complex set of conditional patches that I couldn't figure out how
to generate them in exactly the same way as before. I have also
tested that the port still compiles on a reasonably recent RELENG_4
with this patch.
With approval from a ports committer I can commit this. Any takers?
Ian
Index: cdevsw.patch
===================================================================
RCS file: /dump/FreeBSD-CVS/ports/emulators/vmware2/files/cdevsw.patch,v
retrieving revision 1.1
diff -u -r1.1 cdevsw.patch
--- cdevsw.patch 10 Apr 2003 12:29:07 -0000 1.1
+++ cdevsw.patch 10 Apr 2004 16:22:23 -0000
@@ -1,10 +1,14 @@
--- 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 @@
+@@ -155,6 +155,18 @@
/* static struct cdevsw vmmon_cdevsw = { */
static struct cdevsw vmmon_cdevsw = {
+#if __FreeBSD_version >= 500104
++#if __FreeBSD_version >= 502103
++ .d_version = D_VERSION,
++ .d_flags = D_NEEDGIANT,
++#endif
+ .d_open = FreeBSD_Driver_Open,
+ .d_close = FreeBSD_Driver_Close,
+ .d_ioctl = FreeBSD_Driver_Ioctl,
@@ -54,11 +58,15 @@
}
--- 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 @@
+@@ -103,6 +103,20 @@
static int vmnet_modeevent(module_t mod, int cmd, void *arg);
static struct cdevsw vmnet_cdevsw = {
+#if __FreeBSD_version >= 500104
++#if __FreeBSD_version >= 502103
++ .d_version = D_VERSION,
++ .d_flags = D_NEEDGIANT,
++#else
+ .d_open = vmnet_open,
+ .d_close = vmnet_close,
+ .d_read = vmnet_read,
Index: patch-bd
===================================================================
RCS file: /dump/FreeBSD-CVS/ports/emulators/vmware2/files/patch-bd,v
retrieving revision 1.2
diff -u -r1.2 patch-bd
--- patch-bd 22 Sep 2000 16:55:01 -0000 1.2
+++ patch-bd 10 Apr 2004 15:59:38 -0000
@@ -1,5 +1,5 @@
---- vmmon-only/freebsd/driver.c.orig Thu Jun 29 21:06:18 2000
-+++ vmmon-only/freebsd/driver.c Sat Sep 23 01:41:34 2000
+--- vmmon-only/freebsd/driver.c.orig Sat Apr 10 16:52:28 2004
++++ vmmon-only/freebsd/driver.c Sat Apr 10 16:54:39 2004
@@ -73,6 +73,24 @@
#include "private.h"
#endif
@@ -25,3 +25,13 @@
#ifdef SUPPORT_PASSTHROUGH
#include "passthrough.h" // _driver_ version of passthrough.h
#endif
+@@ -256,7 +274,9 @@
+
+ #include <machine/md_var.h>
+ #include <machine/segments.h>
++#if __FreeBSD_version < 501114
+ #include <i386/isa/intr_machdep.h>
++#endif
+
+ static int
+ vmmon_modeevent(module_t mod, int cmd, void *arg)
Index: patch-be
===================================================================
RCS file: /dump/FreeBSD-CVS/ports/emulators/vmware2/files/patch-be,v
retrieving revision 1.3
diff -u -r1.3 patch-be
--- patch-be 18 Oct 2002 16:33:02 -0000 1.3
+++ patch-be 10 Apr 2004 16:19:36 -0000
@@ -1,5 +1,5 @@
---- vmmon-only/freebsd/hostif.c.orig Mon Sep 2 19:19:50 2002
-+++ vmmon-only/freebsd/hostif.c Mon Sep 2 19:30:03 2002
+--- vmmon-only/freebsd/hostif.c.orig Sat Apr 10 16:52:23 2004
++++ vmmon-only/freebsd/hostif.c Sat Apr 10 16:54:17 2004
@@ -55,7 +55,11 @@
#include <vm/vm.h>
@@ -57,7 +57,33 @@
return 0;
}
-@@ -1066,10 +1098,33 @@
+@@ -1006,8 +1038,12 @@
+ HostIF_APIC_Base(VMDriver *vm, Bool setVMPtr)
+ {
+ #if defined(SMP)
++#if __FreeBSD_version < 501114
+ return cpu_apic_address;
++#else
++ return 0; /* XXX */
++#endif
+ #else
+ return 0;
+ #endif
+ }
+@@ -1035,8 +1070,12 @@
+ HostIF_IOAPIC_Base(VMDriver *vm)
+ {
+ #if defined(SMP)
++#if __FreeBSD_version < 501114
+ return io_apic_address[0]; /* XXX How about another APIC's */
+ #else
++ return 0; /* XXX */
++#endif
++#else
+ return 0;
+ #endif
+ }
+@@ -1066,10 +1105,33 @@
return NULL;
}
paddr = vtophys(addr);
@@ -91,7 +117,7 @@
return ka->kaddr;
}
-@@ -1079,9 +1134,29 @@
+@@ -1079,9 +1141,29 @@
if (ka->map==NULL)
return 0;
More information about the freebsd-emulation
mailing list