Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Feb 2005 00:29:12 -0800
From:      Julian Elischer <julian@elischer.org>
To:        Current <freebsd-current@freebsd.org>
Subject:   fixing Vmware 2 port for 5.x and 6.x.. kmem _alloc_pageable
Message-ID:  <4222D658.1000303@elischer.org>

next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------060204030802020005040207
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit


So I have a vmware 2 licence and I'd like to fix the vmware port..

he following allows it to compile again (at least on 5.x)
but when I link it in I find it's looking for kmem_alloc_pageable()

This has dissappeared...
what is the suggested replacement for this?




--------------060204030802020005040207
Content-Type: text/plain;
 name="vmwarediffs"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="vmwarediffs"

diff -r -u xwork/vmware-distrib/vmmon-only/freebsd/driver.c work/vmware-distrib/vmmon-only/freebsd/driver.c
--- xwork/vmware-distrib/vmmon-only/freebsd/driver.c	Sun Feb 27 16:26:25 2005
+++ work/vmware-distrib/vmmon-only/freebsd/driver.c	Sun Feb 27 16:54:11 2005
@@ -229,7 +229,13 @@
  *
  *----------------------------------------------------------------------
  */
-static dev_t vmmon_dev;
+#if __FreeBSD_version > 503000
+#define DEVTYPE struct cdev *
+#else
+#define DEVTYPE dev_t
+#endif
+
+static DEVTYPE vmmon_dev;
 static int 
 init_module(void)
 {
@@ -281,16 +287,18 @@
 static int 
 cleanup_module(void)
 {
+#if __FreeBSD_version < 500104
    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);
    }
+#else
+   destroy_dev(vmmon_dev);
 #endif
 	
    return 0;
@@ -298,7 +306,9 @@
 
 #include <machine/md_var.h>
 #include <machine/segments.h>
+#if __FreeBSD_version < 503000
 #include <i386/isa/intr_machdep.h>
+#endif
 
 static int
 vmmon_modeevent(module_t mod, int cmd, void *arg)
@@ -353,7 +363,7 @@
  *----------------------------------------------------------------------
  */
 static int 
-FreeBSD_Driver_Open(dev_t dev, int oflag, int devtype, struct thread *td)
+FreeBSD_Driver_Open(DEVTYPE dev, int oflag, int devtype, struct thread *td)
 {
    VMFreeBSD *vmFreeBSD;
    VMDriver *vm;
@@ -433,7 +443,7 @@
  */
 
 static int
-FreeBSD_Driver_Close(dev_t dev, int fflag, int devtype, struct thread *td)
+FreeBSD_Driver_Close(DEVTYPE dev, int fflag, int devtype, struct thread *td)
 {
    VMFreeBSD *vmFreeBSD = (VMFreeBSD *) dev->si_drv1;
 
@@ -485,7 +495,7 @@
  */
 
 static int 
-FreeBSD_Driver_Poll(dev_t dev, int events, struct thread *td)
+FreeBSD_Driver_Poll(DEVTYPE dev, int events, struct thread *td)
 {
    int revents = 0;
 
@@ -567,7 +577,7 @@
  *----------------------------------------------------------------------
  */
 static int 
-FreeBSD_Driver_Ioctl( dev_t dev, u_long cmd, caddr_t parg, int mode, 
+FreeBSD_Driver_Ioctl( DEVTYPE dev, u_long cmd, caddr_t parg, int mode, 
 		      struct thread *td)
 {
    VMFreeBSD *vmFreeBSD = (VMFreeBSD *) dev->si_drv1;
diff -r -u xwork/vmware-distrib/vmmon-only/freebsd/hostif.c work/vmware-distrib/vmmon-only/freebsd/hostif.c
--- xwork/vmware-distrib/vmmon-only/freebsd/hostif.c	Sun Feb 27 16:26:25 2005
+++ work/vmware-distrib/vmmon-only/freebsd/hostif.c	Sun Feb 27 17:12:54 2005
@@ -337,7 +337,7 @@
 
    if (!(val & mask)) { 
       val = val | mask;
-      outb(val,0xA1);
+      outb(0xA1,val);
    }
 }
 
@@ -838,10 +838,10 @@
    /* set up Timer 2 to count down */
    byte = inb(SPEAKER_PORT);
    byte = (byte & ~0x2) | 0x1;
-   outb(byte, SPEAKER_PORT);
-   outb(0xb0, 0x43);
-   outb_p((COUNTDOWN & 0xff), 0x42);
-   outb((COUNTDOWN >> 8), 0x42);	
+   outb(SPEAKER_PORT, byte);
+   outb(0x43, 0xb0);
+   outb_p(0x42, (COUNTDOWN & 0xff));
+   outb(0x42, (COUNTDOWN >> 8));	
 
    /* count number of processor cycles for Timer 2 countdown */
    startTSC = GET_TSC();
@@ -1039,7 +1039,7 @@
 MA
 HostIF_APIC_Base(VMDriver *vm, Bool setVMPtr)
 {
-#if defined(SMP)
+#if defined(SMP) && ( __FreeBSD_version < 500000 )
    return cpu_apic_address;
 #else
    return 0;
@@ -1068,7 +1068,7 @@
 MA
 HostIF_IOAPIC_Base(VMDriver *vm)
 {
-#if defined(SMP)
+#if defined(SMP) && ( __FreeBSD_version < 500000 )
    return io_apic_address[0]; /* XXX How about another APIC's */
 #else
    return 0;

--------------060204030802020005040207--



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