fixing Vmware 2 port for 5.x and 6.x.. kmem _alloc_pageable

From: Julian Elischer <julian_at_elischer.org>
Date: Mon, 28 Feb 2005 00:29:12 -0800
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?




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
_at__at_ -229,7 +229,13 _at__at_
  *
  *----------------------------------------------------------------------
  */
-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)
 {
_at__at_ -281,16 +287,18 _at__at_
 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;
_at__at_ -298,7 +306,9 _at__at_
 
 #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)
_at__at_ -353,7 +363,7 _at__at_
  *----------------------------------------------------------------------
  */
 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;
_at__at_ -433,7 +443,7 _at__at_
  */
 
 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;
 
_at__at_ -485,7 +495,7 _at__at_
  */
 
 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;
 
_at__at_ -567,7 +577,7 _at__at_
  *----------------------------------------------------------------------
  */
 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
_at__at_ -337,7 +337,7 _at__at_
 
    if (!(val & mask)) { 
       val = val | mask;
-      outb(val,0xA1);
+      outb(0xA1,val);
    }
 }
 
_at__at_ -838,10 +838,10 _at__at_
    /* 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();
_at__at_ -1039,7 +1039,7 _at__at_
 MA
 HostIF_APIC_Base(VMDriver *vm, Bool setVMPtr)
 {
-#if defined(SMP)
+#if defined(SMP) && ( __FreeBSD_version < 500000 )
    return cpu_apic_address;
 #else
    return 0;
_at__at_ -1068,7 +1068,7 _at__at_
 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;
Received on Mon Feb 28 2005 - 07:29:17 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:29 UTC