summaryrefslogtreecommitdiff
path: root/emulators/vmware3/files/patch-ab
blob: 31395f22462f0e7afb6cfab3de3d780254529519 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
--- vmmon-only/freebsd/driver.c.orig	Wed Jun 23 22:11:40 2004
+++ vmmon-only/freebsd/driver.c	Wed Jun 23 22:14:46 2004
@@ -50,6 +50,7 @@
 #include <sys/filedesc.h>
 #include <sys/fcntl.h>
 #include <sys/malloc.h>
+#include <sys/module.h>
 #include <sys/proc.h>
 #include <sys/ioccom.h>
 #include <sys/syslog.h>
@@ -163,9 +164,14 @@
 
 static struct cdevsw vmmon_cdevsw = {
 #if __FreeBSD_version >= 500104
+#if __FreeBSD_version >= 502103
+	.d_version =    D_VERSION,
+	.d_flags =	D_NEEDGIANT,
+#else
+	.d_maj =        CDEV_MAJOR,
+#endif
 	.d_open =       FreeBSD_Driver_Open,
 	.d_name =       DEVICE_NAME,
-	.d_maj =        CDEV_MAJOR
 #else
         /* open */      FreeBSD_Driver_Open,
         /* close */     noclose,
@@ -224,7 +230,11 @@
  *----------------------------------------------------------------------
  */
 
+#if __FreeBSD_version >= 502017
+static struct cdev *vmmon_dev;
+#else
 static dev_t vmmon_dev;
+#endif
 
 static int 
 init_module(void)
@@ -364,7 +374,11 @@
  * Based on dev/streams/streams.c
  */
 static int
+#if __FreeBSD_version >= 502017
+vmmon_clone(struct cdev *dev, int flags, void *data, struct thread *td)
+#else
 vmmon_clone(dev_t dev, int flags, void *data, struct thread *td)
+#endif
 {
 	int fd, error;
 	struct file *fp;
@@ -391,6 +405,11 @@
 	fp->f_type = DTYPE_VNODE;
 	FILEDESC_UNLOCK(p->p_fd);
 
+#if __FreeBSD_version >= 501111
+	/* falloc now returns TWO references to the file, not one. */
+	fdrop(fp, td);
+#endif
+
 	PROC_LOCK(p);
 	td->td_dupfd = fd;
 	PROC_UNLOCK(p);
@@ -415,7 +434,11 @@
  *----------------------------------------------------------------------
  */
 static int
+#if __FreeBSD_version >= 502017
+FreeBSD_Driver_Open(struct cdev *dev, int oflag, int devtype, struct thread *td)
+#else
 FreeBSD_Driver_Open(dev_t dev, int oflag, int devtype, struct thread *td)
+#endif
 {
 	VMFreeBSD *vmFreeBSD;