diff --git a/emulators/virtualbox-ose-kmod/Makefile b/emulators/virtualbox-ose-kmod/Makefile index 20fd1a844e14..12d782482868 100644 --- a/emulators/virtualbox-ose-kmod/Makefile +++ b/emulators/virtualbox-ose-kmod/Makefile @@ -7,7 +7,7 @@ PORTNAME= virtualbox-ose DISTVERSION= 4.0.12 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= emulators kld MASTER_SITES= http://tmp.chruetertee.ch/ \ http://freebsd.unixfreunde.de/sources/ \ diff --git a/emulators/virtualbox-ose-kmod/files/patch-src-VBox-HostDrivers-Support-freebsd-SUPDrv-freebsd.c b/emulators/virtualbox-ose-kmod/files/patch-src-VBox-HostDrivers-Support-freebsd-SUPDrv-freebsd.c new file mode 100644 index 000000000000..9f891907b92d --- /dev/null +++ b/emulators/virtualbox-ose-kmod/files/patch-src-VBox-HostDrivers-Support-freebsd-SUPDrv-freebsd.c @@ -0,0 +1,13 @@ +--- src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c.orig 2011-11-04 07:19:39.000000000 -0400 ++++ src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c 2011-11-29 17:34:56.000000000 -0500 +@@ -100,7 +100,9 @@ + static struct cdevsw g_VBoxDrvFreeBSDChrDevSW = + { + .d_version = D_VERSION, +-#if __FreeBSD_version > 800061 ++#if __FreeBSD_version >= 1000000 ++ .d_flags = D_TRACKCLOSE | D_NEEDMINOR, ++#elif __FreeBSD_version > 800061 + .d_flags = D_PSEUDO | D_TRACKCLOSE | D_NEEDMINOR, + #else + .d_flags = D_PSEUDO | D_TRACKCLOSE, diff --git a/emulators/virtualbox-ose-kmod/files/patch-src-VBox-Runtime-r0drv-freebsd-memobj-r0drv-freebsd.c b/emulators/virtualbox-ose-kmod/files/patch-src-VBox-Runtime-r0drv-freebsd-memobj-r0drv-freebsd.c index fd376f9b528b..91bacd4eef20 100644 --- a/emulators/virtualbox-ose-kmod/files/patch-src-VBox-Runtime-r0drv-freebsd-memobj-r0drv-freebsd.c +++ b/emulators/virtualbox-ose-kmod/files/patch-src-VBox-Runtime-r0drv-freebsd-memobj-r0drv-freebsd.c @@ -5,9 +5,13 @@ to VPO_UNMANAGED for an additional assert. Reviewed by: kib See: http://svnweb.freebsd.org/base?view=revision&revision=224746 ---- src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c.orig 2011-04-05 14:34:09.000000000 +0200 -+++ src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c 2011-08-11 15:06:46.000000000 +0200 -@@ -394,9 +394,13 @@ +--- src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c.orig 2011-11-04 07:19:54.000000000 -0400 ++++ src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c 2011-11-29 18:13:32.000000000 -0500 +@@ -391,12 +391,18 @@ + + static void rtR0MemObjFreeBSDPhysPageInit(vm_page_t pPage, vm_pindex_t iPage) + { ++#if __FreeBSD_version <= 1000000 pPage->wire_count = 1; pPage->pindex = iPage; pPage->act_count = 0; @@ -19,7 +23,42 @@ See: http://svnweb.freebsd.org/base?view=revision&revision=224746 + Assert(pPage->oflags & VPO_UNMANAGED != 0); +#else + Assert(pPage->flags & PG_UNMANAGED != 0); ++#endif +#endif } +@@ -408,6 +414,9 @@ + int rc = VINF_SUCCESS; + uint32_t cPages = cb >> PAGE_SHIFT; + vm_paddr_t VmPhysAddrHigh; ++#if __FreeBSD_version >= 1000001 ++ int pFlags = VM_ALLOC_INTERRUPT | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED; ++#endif + + /* create the object. */ + PRTR0MEMOBJFREEBSD pMemFreeBSD = (PRTR0MEMOBJFREEBSD)rtR0MemObjNew(RT_OFFSETOF(RTR0MEMOBJFREEBSD, u.Phys.apPages[cPages]), +@@ -424,7 +433,11 @@ + + if (fContiguous) + { ++#if __FreeBSD_version >= 1000001 ++ vm_page_t pPage = vm_page_alloc_contig(NULL, 0, pFlags, cPages, 0, VmPhysAddrHigh, uAlignment, 0, VM_MEMATTR_DEFAULT); ++#else + vm_page_t pPage = vm_phys_alloc_contig(cPages, 0, VmPhysAddrHigh, uAlignment, 0); ++#endif + + if (pPage) + for (uint32_t iPage = 0; iPage < cPages; iPage++) +@@ -440,7 +453,11 @@ + /* Allocate page by page */ + for (uint32_t iPage = 0; iPage < cPages; iPage++) + { ++#if __FreeBSD_version >= 1000001 ++ vm_page_t pPage = vm_page_alloc_contig(NULL, iPage, pFlags, 1, 0, VmPhysAddrHigh, uAlignment, 0, VM_MEMATTR_DEFAULT); ++#else + vm_page_t pPage = vm_phys_alloc_contig(1, 0, VmPhysAddrHigh, uAlignment, 0); ++#endif + + if (!pPage) + {