1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-03 01:23:49 +00:00

- Should fix compilation and vmmon in latest 5.x.

PR:		ports/68202
Submitted by:	Marc van Kempen <marc@bowtie.nl>
Approved by:	maintainer
This commit is contained in:
Florent Thoumie 2005-04-15 10:20:18 +00:00
parent 2869303e73
commit 4b19291d48
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=133402
7 changed files with 140 additions and 15 deletions

View File

@ -71,9 +71,9 @@ IGNORE= "Kernel source files required"
.endif
.if ${OSVERSION} < 500023
VMNET1_MINOR= 0x00010001
VMNET1_MINOR= 0x00010001
.else
VMNET1_MINOR= 0x00800001
VMNET1_MINOR= 0x00800001
.endif
SCRIPTS_ENV+= LINUXBASE="${LINUXBASE}" \
@ -89,6 +89,12 @@ PLIST_SUB+= FREEBSD5="@comment "
PLIST_SUB+= FREEBSD5=""
.endif
.if ${OSVERSION} >= 500104
LINUXBASE_MAYBE=
.else
LINUXBASE_MAYBE= ${LINUXBASE}
.endif
post-extract:
.for m in ${MODULES}
${TAR} -xf ${WRKSRC}/lib/modules/source/${m}.tar -C ${WRKSRC}
@ -123,10 +129,11 @@ post-patch:
cd ${WRKSRC}/vmmon-only/freebsd && ${TOUCH} bus_if.h device_if.h
.if ${OSVERSION} >= 500019
${PERL} -i -pe 's,<machine/ioctl_fd\.h>,<sys/fdcio.h>,' \
${WRKSRC}/vmmon-only/freebsd/*.c \
${WRKSRC}/vmware-distrib/vmmon-only/freebsd/*.c
${WRKDIR}/vmmon-only/freebsd/*.c \
${WRKDIR}/vmware-distrib/vmmon-only/freebsd/*.c
.endif
${CAT} ${FILESDIR}/kmoddeps.patch | (cd ${WRKSRC} && patch) > /dev/null 2>&1
${CAT} ${FILESDIR}/Makefile_FreeBSD.patch | (cd ${WRKSRC} && patch) > /dev/null 2>&1
.if ${OSVERSION} >= 500038
${CAT} ${FILESDIR}/fo_ioctl.patch | (cd ${WRKSRC} && patch) > /dev/null 2>&1
.endif
@ -136,6 +143,7 @@ post-patch:
.endif
.if ${OSVERSION} >= 500104
${CAT} ${FILESDIR}/cdevsw.patch | (cd ${WRKSRC} && patch) > /dev/null 2>&1
${CAT} ${FILESDIR}/driver_c.patch | (cd ${WRKSRC} && patch) > /dev/null 2>&1
.endif
.if ${OSVERSION} >= 500109 || ${OSVERSION} < 500000 && ${OSVERSION} >= 480102
${CAT} ${FILESDIR}/hostif_c.patch | (cd ${WRKSRC} && patch) > /dev/null 2>&1
@ -152,7 +160,7 @@ setoptions:
${FILESDIR}/config > ${WRKDIR}/config
${SED} -e 's;@@PREFIX@@;${PREFIX};' \
-e 's;@@LINUXBASE@@;${LINUXBASE};' \
-e 's;@@LINUXBASE@@;${LINUXBASE_MAYBE};' \
-e 's;@@NETWORKING@@;${VMNET_NETWORKING};' \
-e 's;@@BRIDGED@@;${VMNET_BRIDGED};' \
-e 's;@@BRIDGE_INTF@@;${VMNET_BRIDGED_INTERFACE};' \

View File

@ -0,0 +1,12 @@
--- vmmon-only/Makefile.FreeBSD.orig Tue Jun 22 16:52:23 2004
+++ vmmon-only/Makefile.FreeBSD Tue Jun 22 16:51:58 2004
@@ -57,7 +59,9 @@
device:
rm -f /compat/linux/dev/${DEVNAME}
+.if ${OSVERSION} > 500104
mknod /compat/linux/dev/${DEVNAME} c ${CDEV_MAJOR} 0
+.endif
.include <bsd.kmod.mk>

View File

@ -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,
+#endif
+ .d_open = vmnet_open,
+ .d_close = vmnet_close,
+ .d_read = vmnet_read,

View File

@ -0,0 +1,58 @@
--- vmmon-only/freebsd/driver.c.original Tue Jun 22 15:24:52 2004
+++ vmmon-only/freebsd/driver.c Tue Jun 22 10:01:30 2004
@@ -157,8 +157,8 @@
static struct cdevsw vmmon_cdevsw = {
#if __FreeBSD_version >= 500104
#if __FreeBSD_version >= 502103
- .d_version = D_VERSION,
- .d_flags = D_NEEDGIANT,
+ .d_version = D_VERSION,
+ .d_flags = D_NEEDGIANT,
#endif
.d_open = FreeBSD_Driver_Open,
.d_close = FreeBSD_Driver_Close,
@@ -233,7 +233,7 @@
*
*----------------------------------------------------------------------
*/
-static dev_t vmmon_dev;
+static struct cdev * vmmon_dev;
static int
init_module(void)
{
@@ -359,7 +359,7 @@
*----------------------------------------------------------------------
*/
static int
-FreeBSD_Driver_Open(dev_t dev, int oflag, int devtype, struct thread *td)
+FreeBSD_Driver_Open(struct cdev * dev, int oflag, int devtype, struct thread *td)
{
VMFreeBSD *vmFreeBSD;
VMDriver *vm;
@@ -439,7 +439,7 @@
*/
static int
-FreeBSD_Driver_Close(dev_t dev, int fflag, int devtype, struct thread *td)
+FreeBSD_Driver_Close(struct cdev * dev, int fflag, int devtype, struct thread *td)
{
VMFreeBSD *vmFreeBSD = (VMFreeBSD *) dev->si_drv1;
@@ -491,7 +491,7 @@
*/
static int
-FreeBSD_Driver_Poll(dev_t dev, int events, struct thread *td)
+FreeBSD_Driver_Poll(struct cdev * dev, int events, struct thread *td)
{
int revents = 0;
@@ -573,7 +573,7 @@
*----------------------------------------------------------------------
*/
static int
-FreeBSD_Driver_Ioctl( dev_t dev, u_long cmd, caddr_t parg, int mode,
+FreeBSD_Driver_Ioctl( struct cdev * dev, u_long cmd, caddr_t parg, int mode,
struct thread *td)
{
VMFreeBSD *vmFreeBSD = (VMFreeBSD *) dev->si_drv1;

View File

@ -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_machep.h>
+#endif
static int
vmmon_modeevent(module_t mod, int cmd, void *arg)

View File

@ -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;

View File

@ -17,8 +17,11 @@ ln -s /dev/ttyvb ${linux_dev}/tty12
ln -s ${linux_dev}/tty1 ${linux_dev}/tty0
mknod ${linux_dev}/null c 2 2
chmod 666 ${linux_dev}/null
echo Creating vmnet1 node
mknod /compat/linux/dev/vmnet1 c 149 ${VMNET1_MINOR}
rm -f /compat/linux/dev/vmnet1
if [ "$OSVERSION" -lt "500104" ]; then
echo Creating vmnet1 node
mknod /compat/linux/dev/vmnet1 c 149 ${VMNET1_MINOR}
fi
echo Creating $linux_dev/hd\?
mknod ${linux_dev}/hda b 0 0x00010002
mknod ${linux_dev}/hdb b 0 0x0001000a