From owner-freebsd-current@FreeBSD.ORG Mon Feb 28 08:29:17 2005 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4830816A4CE for ; Mon, 28 Feb 2005 08:29:17 +0000 (GMT) Received: from pimout1-ext.prodigy.net (pimout1-ext.prodigy.net [207.115.63.77]) by mx1.FreeBSD.org (Postfix) with ESMTP id B38F243D39 for ; Mon, 28 Feb 2005 08:29:16 +0000 (GMT) (envelope-from julian@elischer.org) Received: from [192.168.1.103] (adsl-68-123-122-107.dsl.snfc21.pacbell.net [68.123.122.107])j1S8TDSJ215590 for ; Mon, 28 Feb 2005 03:29:14 -0500 Message-ID: <4222D658.1000303@elischer.org> Date: Mon, 28 Feb 2005 00:29:12 -0800 From: Julian Elischer User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.5) Gecko/20050214 X-Accept-Language: en, hu MIME-Version: 1.0 To: Current Content-Type: multipart/mixed; boundary="------------060204030802020005040207" Subject: fixing Vmware 2 port for 5.x and 6.x.. kmem _alloc_pageable X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Feb 2005 08:29:17 -0000 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 #include +#if __FreeBSD_version < 503000 #include +#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--