Index: emulators/virtualbox-ose/Makefile =================================================================== --- emulators/virtualbox-ose/Makefile (revision 501807) +++ emulators/virtualbox-ose/Makefile (working copy) @@ -2,7 +2,7 @@ # $FreeBSD$ PORTNAME= virtualbox-ose -PORTVERSION= 5.2.30 +PORTVERSION= 6.0.8 CATEGORIES= emulators MASTER_SITES= https://download.oracle.com/virtualbox/${PORTVERSION}/ DISTFILES= VirtualBox-${PORTVERSION}${EXTRACT_SUFX} ${GUESTADDITIONS} @@ -40,8 +40,6 @@ CONFLICTS_INSTALL= virtualbox-ose-additions-* \ virtualbox-ose-legacy-[0-9]* \ virtualbox-ose-lite-[0-9]* -LDFLAGS= -lpthread - VBOXUSER?= vboxusers VBOXWSUSER?= vboxusers VBOXGROUP?= vboxusers @@ -55,7 +53,7 @@ VBOX_PROGS= VBoxAutostart VBoxBalloonCtrl VBoxBugR VBOX_UTILS= VBoxExtPackHelperApp VBoxNetAdpCtl VBoxNetDHCP VBoxNetNAT \ VBoxSVC VBoxXPCOMIPCD -OPTIONS_DEFINE= ALSA DBUS DEBUG GUESTADDITIONS MANUAL NLS PULSEAUDIO \ +OPTIONS_DEFINE= ALSA DBUS DEBUG GUESTADDITIONS MANUAL NLS OPUS PULSEAUDIO \ PYTHON QT5 R0LOGGING UDPTUNNEL VDE VNC WEBSERVICE VPX X11 OPTIONS_DEFAULT= DBUS QT5 UDPTUNNEL VNC WEBSERVICE X11 OPTIONS_SUB= yes @@ -64,6 +62,7 @@ DEBUG_DESC= Debug symbols, additional logs and ass GUESTADDITIONS_DESC= Build with Guest Additions MANUAL_DESC= Build with user manual NLS_DESC= Native language support (requires QT5) +OPUS_DESC= Use libvpx for audio recording (requires VPX) QT5_DESC= Build with QT5 frontend (requires X11) R0LOGGING_DESC= Enable R0 logging (requires DEBUG) UDPTUNNEL_DESC= Build with UDP tunnel support @@ -80,6 +79,9 @@ DEBUG_CONFIGURE_ON= --build-debug MANUAL_BUILD_DEPENDS= ${LOCALBASE}/share/xml/docbook/4.4/docbookx.dtd:textproc/docbook-xml MANUAL_CONFIGURE_OFF= --disable-docs NLS_IMPLIES= QT5 +OPUS_CONFIGURE_OFF= --disable-libopus +OPUS_LIB_DEPENDS= libopus.so:audio/opus +OPUS_IMPLIES= VPX PULSEAUDIO_CONFIGURE_OFF= --disable-pulse PULSEAUDIO_LIB_DEPENDS= libpulse.so:audio/pulseaudio PYTHON_CONFIGURE_OFF= --disable-python @@ -156,7 +158,7 @@ USE_QT= buildtools_build core dbus gui linguistto USE_QT+= printsupport widgets x11extras USE_XORG= xcb INSTALLS_ICONS= yes -VBOX_PROGS+= VirtualBox +VBOX_PROGS+= VirtualBox VirtualBoxVM VBOX_UTILS+= VBoxTestOGL VBOX_WITH_QT= 1 .else @@ -285,6 +287,9 @@ post-patch: @${ECHO} 'VBOX_GCC_PEDANTIC_CXX = -Wshadow $$(VBOX_GCC_WARN) -Wno-long-long' >> \ ${WRKSRC}/LocalConfig.kmk .endif +.if empty(PORT_OPTIONS:MX11) + @${ECHO} 'VBOX_WITH_VMSVGA3D =' >> ${WRKSRC}/LocalConfig.kmk +.endif .if ${COMPILER_TYPE} == clang @${REINPLACE_CMD} -e 's| -finline-limit=8000||' \ -e 's| -mpreferred-stack-boundary=2||' ${WRKSRC}/Config.kmk Index: emulators/virtualbox-ose/distinfo =================================================================== --- emulators/virtualbox-ose/distinfo (revision 501807) +++ emulators/virtualbox-ose/distinfo (working copy) @@ -1,5 +1,5 @@ -TIMESTAMP = 1558040644 -SHA256 (VirtualBox-5.2.30.tar.bz2) = caf19d4a5310d63e31e564acb24cb63e412c8ce56193a804e38c7dcc8db35609 -SIZE (VirtualBox-5.2.30.tar.bz2) = 118462289 -SHA256 (VBoxGuestAdditions_5.2.30.iso) = dd07da975f346608b0f6843f4be4bfdf48b4610ef49a0c0e6aa689ef81c1bd69 -SIZE (VBoxGuestAdditions_5.2.30.iso) = 58578944 +TIMESTAMP = 1558045317 +SHA256 (VirtualBox-6.0.8.tar.bz2) = 1b5aa85118c62fb67867b95167b05e66aa154b2caf44c0a3dc932ea5bee85d87 +SIZE (VirtualBox-6.0.8.tar.bz2) = 155404889 +SHA256 (VBoxGuestAdditions_6.0.8.iso) = 4cb9a805267d8d338bfad0f3cef8b83132be6cad622c311daa41a18cc2ea4fda +SIZE (VBoxGuestAdditions_6.0.8.iso) = 86562816 Index: emulators/virtualbox-ose/files/extrapatch-Config.kmk =================================================================== --- emulators/virtualbox-ose/files/extrapatch-Config.kmk (revision 501807) +++ emulators/virtualbox-ose/files/extrapatch-Config.kmk (working copy) @@ -1,22 +1,22 @@ ---- Config.kmk.orig 2016-07-18 11:50:32 UTC +--- Config.kmk.orig 2019-01-25 18:10:01 UTC +++ Config.kmk -@@ -3537,6 +3537,7 @@ ifdef VBOX_WITH_RAW_MODE +@@ -4249,6 +4249,7 @@ ifdef VBOX_WITH_RAW_MODE TEMPLATE_VBoxRc_TOOL = $(VBOX_GCC32_TOOL) TEMPLATE_VBoxRc_CXXFLAGS = -fno-pie -nostdinc -g $(VBOX_GCC_pipe) $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_CXX) $(VBOX_GCC32_Wno-variadic-macros) -fno-exceptions $(VBOX_GCC_GC_OPT) $(VBOX_GCC_GC_FP) -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-strict-aliasing $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_fvisibility-hidden) $(VBOX_GCC_fvisibility-inlines-hidden) -fno-rtti $(VBOX_GCC_IPRT_FMT_CHECK) TEMPLATE_VBoxRc_CFLAGS = -fno-pie -nostdinc -g $(VBOX_GCC_pipe) $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_C) $(VBOX_GCC32_Wno-variadic-macros) -fno-exceptions $(VBOX_GCC_GC_OPT) $(VBOX_GCC_GC_FP) -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-strict-aliasing $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_fvisibility-hidden) $(VBOX_GCC_IPRT_FMT_CHECK) + TEMPLATE_VBoxRc_CXXFLAGS.freebsd = -fno-builtin - ifeq ($(KBUILD_TARGET),solaris) - TEMPLATE_VBoxRc_LDFLAGS = -r - else -@@ -3677,6 +3678,7 @@ ifeq ($(VBOX_LDR_FMT),elf) + if $(VBOX_GCC32_VERSION_CC) < 30400 + TEMPLATE_VBoxRc_DEFS += RT_WITHOUT_PRAGMA_ONCE + endif +@@ -4396,6 +4397,7 @@ ifeq ($(VBOX_LDR_FMT),elf) TEMPLATE_VBoxR0_TOOL = $(VBOX_GCC_TOOL) TEMPLATE_VBoxR0_CFLAGS = -fno-pie -nostdinc -g $(VBOX_GCC_pipe) $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_C) $(VBOX_GCC_Wno-variadic-macros) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) -fno-strict-aliasing -fno-exceptions $(VBOX_GCC_fno-stack-protector) -fno-common $(VBOX_GCC_fvisibility-hidden) -std=gnu99 $(VBOX_GCC_IPRT_FMT_CHECK) TEMPLATE_VBoxR0_CXXFLAGS = -fno-pie -nostdinc -g $(VBOX_GCC_pipe) $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_CXX) $(VBOX_GCC_Wno-variadic-macros) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) -fno-strict-aliasing -fno-exceptions $(VBOX_GCC_fno-stack-protector) -fno-common $(VBOX_GCC_fvisibility-inlines-hidden) $(VBOX_GCC_fvisibility-hidden) -fno-rtti $(VBOX_GCC_IPRT_FMT_CHECK) +TEMPLATE_VBoxR0_CXXFLAGS.freebsd = -fno-builtin - TEMPLATE_VBoxR0_CFLAGS.amd64 = -m64 -mno-red-zone -mcmodel=kernel -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-asynchronous-unwind-tables -ffreestanding - TEMPLATE_VBoxR0_CXXFLAGS.amd64 = -m64 -mno-red-zone -mcmodel=kernel -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-asynchronous-unwind-tables - ifeq ($(KBUILD_TARGET),solaris) -@@ -3945,7 +3947,7 @@ define TOOL_FREEBSDKMODLD_LINK_SYSMOD_CM + TEMPLATE_VBoxR0_CFLAGS.amd64 = -m64 -mno-red-zone -mcmodel=kernel -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fasynchronous-unwind-tables -ffreestanding + TEMPLATE_VBoxR0_CXXFLAGS.amd64 = -m64 -mno-red-zone -mcmodel=kernel -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fasynchronous-unwind-tables + if $(VBOX_GCC_VERSION_CC) < 30400 +@@ -4815,7 +4817,7 @@ define TOOL_FREEBSDKMODLD_LINK_SYSMOD_CMDS | xargs -J% objcopy % $(out) ## Strip debug info (comment out if debugging or something). Index: emulators/virtualbox-ose/files/extrapatch-src_VBox_Frontends_VirtualBox_src_net_UIDownloaderAdditions.cpp =================================================================== --- emulators/virtualbox-ose/files/extrapatch-src_VBox_Frontends_VirtualBox_src_net_UIDownloaderAdditions.cpp (revision 501807) +++ emulators/virtualbox-ose/files/extrapatch-src_VBox_Frontends_VirtualBox_src_net_UIDownloaderAdditions.cpp (nonexistent) @@ -1,11 +0,0 @@ ---- src/VBox/Frontends/VirtualBox/src/net/UIDownloaderAdditions.cpp.orig 2017-01-17 07:26:50 UTC -+++ src/VBox/Frontends/VirtualBox/src/net/UIDownloaderAdditions.cpp -@@ -143,7 +143,7 @@ void UIDownloaderAdditions::handleVerifi - { - const QString strFileName = strRecord.section(" *", 1); - const QString strDownloadedSumm = strRecord.section(" *", 0, 0); -- if (strFileName == source().fileName()) -+ if (strFileName == QFileInfo(source().toString()).fileName()) - { - /* Calc the SHA-256 on the bytes, creating a string: */ - uint8_t abHash[RTSHA256_HASH_SIZE]; Property changes on: emulators/virtualbox-ose/files/extrapatch-src_VBox_Frontends_VirtualBox_src_net_UIDownloaderAdditions.cpp ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: emulators/virtualbox-ose/files/extrapatch-src_VBox_Frontends_VirtualBox_src_net_UIDownloaderExtensionPack.cpp =================================================================== --- emulators/virtualbox-ose/files/extrapatch-src_VBox_Frontends_VirtualBox_src_net_UIDownloaderExtensionPack.cpp (revision 501807) +++ emulators/virtualbox-ose/files/extrapatch-src_VBox_Frontends_VirtualBox_src_net_UIDownloaderExtensionPack.cpp (nonexistent) @@ -1,11 +0,0 @@ ---- src/VBox/Frontends/VirtualBox/src/net/UIDownloaderExtensionPack.cpp.orig 2017-01-17 07:26:50 UTC -+++ src/VBox/Frontends/VirtualBox/src/net/UIDownloaderExtensionPack.cpp -@@ -127,7 +127,7 @@ void UIDownloaderExtensionPack::handleVe - { - const QString strFileName = strRecord.section(" *", 1); - const QString strDownloadedSumm = strRecord.section(" *", 0, 0); -- if (strFileName == source().fileName()) -+ if (strFileName == QFileInfo(source().toString()).fileName()) - { - /* Calc the SHA-256 on the bytes, creating a string: */ - uint8_t abHash[RTSHA256_HASH_SIZE]; Property changes on: emulators/virtualbox-ose/files/extrapatch-src_VBox_Frontends_VirtualBox_src_net_UIDownloaderExtensionPack.cpp ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: emulators/virtualbox-ose/files/extrapatch-src_VBox_Frontends_VirtualBox_src_settings_global_UIGlobalSettingsNetworkDetailsHost.cpp =================================================================== --- emulators/virtualbox-ose/files/extrapatch-src_VBox_Frontends_VirtualBox_src_settings_global_UIGlobalSettingsNetworkDetailsHost.cpp (revision 501807) +++ emulators/virtualbox-ose/files/extrapatch-src_VBox_Frontends_VirtualBox_src_settings_global_UIGlobalSettingsNetworkDetailsHost.cpp (nonexistent) @@ -1,10 +0,0 @@ ---- src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsNetworkDetailsHost.cpp.orig 2017-03-08 17:19:57 UTC -+++ src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsNetworkDetailsHost.cpp -@@ -243,6 +243,6 @@ QString UIGlobalSettingsNetworkDetailsHo - address.prepend(QString::number(uPart)); - uAddress = uAddress >> 8; - } -- return address.join('.'); -+ return address.join("."); - } - Property changes on: emulators/virtualbox-ose/files/extrapatch-src_VBox_Frontends_VirtualBox_src_settings_global_UIGlobalSettingsNetworkDetailsHost.cpp ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: emulators/virtualbox-ose/files/patch-Config.kmk =================================================================== --- emulators/virtualbox-ose/files/patch-Config.kmk (revision 501807) +++ emulators/virtualbox-ose/files/patch-Config.kmk (working copy) @@ -1,6 +1,6 @@ ---- Config.kmk.orig 2019-04-12 15:47:38 UTC +--- Config.kmk.orig 2019-04-16 10:06:42 UTC +++ Config.kmk -@@ -445,11 +445,11 @@ ifn1of ($(KBUILD_TARGET), win darwin) +@@ -456,11 +456,11 @@ ifn1of ($(KBUILD_TARGET), win darwin) # Enable OSS audio support. VBOX_WITH_AUDIO_OSS = 1 endif @@ -14,7 +14,7 @@ # Enable PulseAudio audio support. VBOX_WITH_AUDIO_PULSE = 1 endif -@@ -464,11 +464,11 @@ VBOX_WITH_AUDIO_MMNOTIFICATION_CLIENT = 1 +@@ -475,11 +475,11 @@ VBOX_WITH_AUDIO_MMNOTIFICATION_CLIENT = 1 # Enable PCI passthrough support. VBOX_WITH_PCI_PASSTHROUGH = 1 # Enable statically linked dbus support. @@ -28,16 +28,16 @@ VBOX_WITH_PAM = 1 endif # Enable internal networking. -@@ -664,7 +664,7 @@ VBOX_WITH_TESTCASES = 1 - VBOX_WITH_VDITOOL = - # Enable this to build vbox-img even if VBOX_WITH_TESTCASES is disabled - VBOX_WITH_VBOX_IMG = --if1of ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH), darwin.x86 darwin.amd64 linux.x86 linux.amd64 solaris.amd64 win.x86 win.amd64) -+if1of ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH), darwin.x86 darwin.amd64 freebsd.x86 freebsd.amd64 linux.x86 linux.amd64 solaris.amd64 win.x86 win.amd64) - # Enables the video capturing support. - VBOX_WITH_VIDEOREC = 1 - # Enable VPX (VP8 / VP9 codec), used for video capturing. -@@ -992,10 +992,6 @@ ifeq ($(KBUILD_TARGET),darwin) +@@ -487,7 +487,7 @@ VBOX_WITH_INTERNAL_NETWORKING = 1 + # Enable vmsvga (svga2) graphics device variant, 2D part + VBOX_WITH_VMSVGA = 1 + # Enable vmsvga (svga2) graphics device variant, 3D part +-if1of ($(KBUILD_TARGET), darwin linux win) ++if1of ($(KBUILD_TARGET), darwin freebsd linux win) + VBOX_WITH_VMSVGA3D = 1 + endif + # Enable Host Guest Shared Memory Interface. +@@ -1029,10 +1029,6 @@ ifeq ($(KBUILD_TARGET),darwin) VBOX_WITH_VBOXSDL= endif @@ -48,7 +48,7 @@ ifeq ($(KBUILD_TARGET),haiku) # Don't bother with SDL ttf for now. VBOX_WITH_SECURELABEL= -@@ -1155,7 +1151,7 @@ ifdef VBOX_OSE +@@ -1195,7 +1191,7 @@ ifdef VBOX_OSE VBOX_WITH_KCHMVIEWER= VBOX_WITH_PLUGIN_CRYPT= VBOX_WITH_DRAG_AND_DROP_PROMISES= @@ -57,16 +57,7 @@ VBOX_WITH_DOCS= VBOX_WITH_DOCS_PACKING= endif -@@ -4556,7 +4552,7 @@ TEMPLATE_VBOXR0DRV_CFLAGS = \ - -O2 -ffreestanding -fno-strict-aliasing -fno-common -finline-limit=8000 \ - $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) \ - -nostdinc -std=c99 --TEMPLATE_VBOXR0DRV_CFLAGS.x86 = -m32 -mno-align-long-strings -mpreferred-stack-boundary=2 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -+TEMPLATE_VBOXR0DRV_CFLAGS.x86 = -m32 -mpreferred-stack-boundary=2 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 - TEMPLATE_VBOXR0DRV_CFLAGS.amd64 = -m64 --param inline-unit-growth=100 --param large-function-growth=1000 \ - -fno-omit-frame-pointer -mcmodel=kernel -mno-red-zone -mfpmath=387 -mno-sse -mno-sse2 -mno-mmx \ - -mno-3dnow -msoft-float -fno-asynchronous-unwind-tables -Wundef -@@ -4603,7 +4599,7 @@ define TOOL_FREEBSDKMODLD_LINK_SYSMOD_CMDS +@@ -4835,7 +4831,7 @@ define TOOL_FREEBSDKMODLD_LINK_SYSMOD_CMDS | xargs -J% objcopy % $(outbase).kld # Link the final .ko (a shared object). @@ -75,7 +66,15 @@ endef endif # x86 -@@ -4889,10 +4885,18 @@ TEMPLATE_VBOXR3EXE_LIBPATH += \ +@@ -5106,6 +5102,7 @@ TEMPLATE_VBOXR3EXE_LDFLAGS.x86 = -m32 + TEMPLATE_VBOXR3EXE_LDFLAGS.amd64 = -m64 + TEMPLATE_VBOXR3EXE_LDFLAGS.sparc32 = -m32 + TEMPLATE_VBOXR3EXE_LDFLAGS.sparc64 = -m64 ++TEMPLATE_VBOXR3EXE_LDFLAGS.freebsd = -Wl,-z,noexecstack,-z,relro $(VBOX_LD_as_needed) + TEMPLATE_VBOXR3EXE_LDFLAGS.linux = -Wl,-z,noexecstack,-z,relro $(VBOX_LD_as_needed) + TEMPLATE_VBOXR3EXE_LDFLAGS.solaris = -Wl,-z,ignore # same as VBOX_LD_as_needed + TEMPLATE_VBOXR3EXE_LDFLAGS.debug = $(VBOX_GCC_SANITIZER_FLAGS) +@@ -5139,10 +5136,18 @@ TEMPLATE_VBOXR3EXE_LIBPATH += \ TEMPLATE_VBOXR3EXE_CFLAGS += -fno-pic TEMPLATE_VBOXR3EXE_CXXFLAGS += -fno-pic TEMPLATE_VBOXR3EXE_LDFLAGS += -fno-pic @@ -95,7 +94,7 @@ /usr/include \ /usr/X11R6/include \ /usr/local/include -@@ -5183,7 +5187,7 @@ ifeq ($(KBUILD_TARGET),win) # No CRT! +@@ -5457,7 +5462,7 @@ ifeq ($(KBUILD_TARGET),win) # No CRT! TEMPLATE_VBOXR3HARDENEDEXE_LDFLAGS.win.amd64 = $(TEMPLATE_VBOXR3EXE_LDFLAGS.win.amd64) /entry:suplibHardenedWindowsMain TEMPLATE_VBOXR3HARDENEDEXE_LIBS.x86 = $(NOT_SUCH_VARIABLE) TEMPLATE_VBOXR3HARDENEDEXE_LIBS.amd64 = $(NOT_SUCH_VARIABLE) @@ -104,7 +103,7 @@ # We want to keep the RPATH on Solaris to be able to find libgcc_1/libstdc++ within $(VBOX_WITH_RUNPATH) TEMPLATE_VBOXR3HARDENEDEXE_LDFLAGS = $(filter-out '$(VBOX_GCC_RPATH_OPT)%,$(TEMPLATE_VBOXR3EXE_LDFLAGS)) TEMPLATE_VBOXR3HARDENEDEXE_LDFLAGS.linux = $(filter-out $(VBOX_GCC_ORIGIN_OPT),$(TEMPLATE_VBOXR3EXE_LDFLAGS.linux)) -@@ -5710,10 +5714,18 @@ TEMPLATE_VBOXMAINEXE_LIBS = $(LIB_RUNTI +@@ -6035,10 +6040,19 @@ TEMPLATE_VBOXMAINEXE_LIBS = $(LIB_RUNTI else ifeq ($(KBUILD_TARGET),haiku) TEMPLATE_VBOXMAINEXE_TOOL = GXX3 TEMPLATE_VBOXMAINEXE_LIBS = $(LIB_RUNTIME) network stdc++ supc++ @@ -112,6 +111,7 @@ + else ifeq ($(KBUILD_TARGET),freebsd) TEMPLATE_VBOXMAINEXE_TOOL = GXX3 TEMPLATE_VBOXMAINEXE_LIBS = $(LIB_RUNTIME) ++TEMPLATE_VBOXMAINEXE_LDFLAGS.freebsd = -Wl,-z,noexecstack,-z,relro $(VBOX_LD_as_needed) +TEMPLATE_VBOXMAINEXE_LDFLAGS.freebsd.x86 = -Wl,-z,notext TEMPLATE_VBOXMAINEXE_INCS += \ + /usr/local/include @@ -124,10 +124,11 @@ /usr/include \ /usr/X11R6/include \ /usr/local/include -@@ -6252,13 +6264,10 @@ ifdef VBOX_WITH_QTGUI +@@ -6627,13 +6641,11 @@ ifdef VBOX_WITH_QTGUI TEMPLATE_VBOXQTGUIEXE_LIBPATH += \ $(VBOX_LIBPATH_X11) ifeq ($(KBUILD_TARGET),freebsd) ++ TEMPLATE_VBOXQTGUIEXE_LDFLAGS += -Wl,-z,noexecstack,-z,relro $(VBOX_LD_as_needed) + TEMPLATE_VBOXQTGUIEXE_LDFLAGS.freebsd.x86 = -Wl,-z,notext TEMPLATE_VBOXQTGUIEXE_INCS += \ - /usr/include \ @@ -139,20 +140,42 @@ /usr/local/lib endif ifeq ($(KBUILD_TARGET),solaris) -@@ -6481,12 +6490,8 @@ TEMPLATE_VBoxBldProg_LIBPATH += \ +@@ -6872,10 +6884,17 @@ TEMPLATE_VBoxBldProg_TOOL = GXX3 + TEMPLATE_VBoxBldProg_LIBS = network iconv + TEMPLATE_VBoxBldProg_LIBPATH += \ + /boot/common/lib +- else if1of ($(KBUILD_HOST), freebsd openbsd) ++ else ifeq ($(KBUILD_HOST),freebsd) TEMPLATE_VBoxBldProg_TOOL = GXX3 TEMPLATE_VBoxBldProg_LIBS = pthread TEMPLATE_VBoxBldProg_INCS += \ -- /usr/include \ -- /usr/X11R6/include \ ++ /usr/local/include ++TEMPLATE_VBoxBldProg_LIBPATH += \ ++ /usr/local/lib ++ else ifeq ($(KBUILD_HOST),openbsd) ++TEMPLATE_VBoxBldProg_TOOL = GXX3 ++TEMPLATE_VBoxBldProg_LIBS = pthread ++TEMPLATE_VBoxBldProg_INCS += \ + /usr/include \ + /usr/X11R6/include \ /usr/local/include - TEMPLATE_VBoxBldProg_LIBPATH += \ -- /usr/lib \ -- /usr/X11R6/lib \ - /usr/local/lib - else ifeq ($(KBUILD_HOST),netbsd) - TEMPLATE_VBoxBldProg_TOOL = GXX3 -@@ -6887,6 +6892,7 @@ TEMPLATE_VBOXCROGLR3HOSTDLL_LDFLAGS.darwin += \ +@@ -7023,6 +7042,7 @@ TEMPLATE_VBOXGUESTR3EXE_CXXFLAGS.linux = \ + $(VBOX_GCC_fno-stack-protector) + TEMPLATE_VBOXGUESTR3EXE_CFLAGS.linux = $(TEMPLATE_VBOXGUESTR3EXE_CXXFLAGS.linux) + # The GNU_HASH ELF tag is not supported by older systems. ++TEMPLATE_VBOXGUESTR3EXE_LDFLAGS.freebsd += $(VBOX_LD_hash_style_sysv) + TEMPLATE_VBOXGUESTR3EXE_LDFLAGS.linux += $(VBOX_LD_hash_style_sysv) + + # +@@ -7233,6 +7253,7 @@ TEMPLATE_VBOXGUESTR3XF86MOD_LIBS.$(KBUILD_TYPE) = + TEMPLATE_VBOXGUESTR3XF86MOD_LIBS.$(KBUILD_TARGET) = $(NO_SUCH_VARIABLE) + TEMPLATE_VBOXGUESTR3XF86MOD_LDFLAGS.$(KBUILD_TARGET) = $(NO_SUCH_VARIABLE) + # The GNU_HASH ELF tag is not supported by older glibc dynamic linkers. ++TEMPLATE_VBOXGUESTR3XF86MOD_LDFLAGS.freebsd = $(subst -Wl$(COMMA),,$(VBOX_LD_hash_style_sysv)) + TEMPLATE_VBOXGUESTR3XF86MOD_LDFLAGS.linux = $(subst -Wl$(COMMA),,$(VBOX_LD_hash_style_sysv)) + TEMPLATE_VBOXGUESTR3XF86MOD_LDFLAGS.$(KBUILD_TYPE) = $(NO_SUCH_VARIABLE) + TEMPLATE_VBOXGUESTR3XF86MOD_LDFLAGS = -r +@@ -7342,6 +7363,7 @@ TEMPLATE_VBOXCROGLR3HOSTDLL_LDFLAGS.darwin += \ -current_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \ -compatibility_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) TEMPLATE_VBOXCROGLR3HOSTDLL_LDFLAGS.linux = -Wl,--no-as-needed Index: emulators/virtualbox-ose/files/patch-configure =================================================================== --- emulators/virtualbox-ose/files/patch-configure (revision 501807) +++ emulators/virtualbox-ose/files/patch-configure (working copy) @@ -1,6 +1,6 @@ ---- configure.orig 2018-07-16 14:56:48 UTC +--- configure.orig 2019-04-16 10:06:42 UTC +++ configure -@@ -138,10 +138,14 @@ CXX_FLAGS="" +@@ -139,10 +139,14 @@ CXX_FLAGS="" if [ "$OS" = "freebsd" ]; then INCCURL="-I/usr/local/include" LIBCURL="-L/usr/local/lib -lcurl" @@ -15,17 +15,7 @@ else INCCURL="" LIBCURL="-lcurl" -@@ -436,6 +440,9 @@ check_gcc() - elif [ $cc_maj -eq 4 -a $cc_min -eq 0 -a "$OS" = "darwin" ]; then - log_success "found version $cc_ver" - # gcc-4.0 is allowed for Darwin only -+ elif [ $cc_maj -eq 4 -a $cc_min -eq 2 -a "$OS" = "freebsd" ]; then -+ log_success "found version $cc_ver" -+ # gcc-4.2 is allowed for FreeBSD only - elif [ $cc_maj -lt 4 \ - -o \( $cc_maj -eq 4 -a $cc_min -lt 4 -a "$OS" != "darwin" \) \ - -o \( $cc_maj -eq 4 -a $cc_min -lt 2 -a "$OS" = "darwin" \) \ -@@ -1204,7 +1211,7 @@ extern "C" int main(void) +@@ -1217,7 +1221,7 @@ extern "C" int main(void) #endif } EOF @@ -34,7 +24,7 @@ test_execute fi } -@@ -1504,8 +1511,7 @@ EOF +@@ -1517,8 +1521,7 @@ EOF if [ $? -eq 0 ]; then echo "(Qt5 from pkg-config)" >> $LOG FLGQT5=`pkg-config Qt5Core --cflags` @@ -44,7 +34,7 @@ INCQT5=`strip_I "$FLGQT5"` LIBDIR5=`pkg-config Qt5Core --variable=libdir` LIBQT5=`pkg-config Qt5Core --libs` -@@ -1644,7 +1650,7 @@ check_libopus() +@@ -1657,7 +1660,7 @@ check_libopus() fi cat > $ODIR.tmp_src.cc << EOF #include @@ -53,7 +43,7 @@ extern "C" int main(void) { OpusEncoder *test; -@@ -1976,8 +1982,8 @@ EOF +@@ -1989,8 +1992,8 @@ EOF echo "compiling the following source file:" >> $LOG cat $ODIR.tmp_src.cc >> $LOG echo "using the following command line:" >> $LOG @@ -64,7 +54,7 @@ if [ $? -eq 0 ]; then found=1 break -@@ -2449,7 +2455,7 @@ for option in "$@"; do +@@ -2466,7 +2469,7 @@ for option in "$@"; do --with-openssl-dir=*) OPENSSLDIR=`echo $option | cut -d'=' -f2` INCCRYPTO="-I${OPENSSLDIR}/include" @@ -73,16 +63,7 @@ ;; --with-ow-dir=*) WATCOM=`echo $option | cut -d'=' -f2` -@@ -2763,7 +2769,7 @@ if [ $ONLY_ADDITIONS -eq 0 ]; then - check_ssl - check_curl - [ $WITH_LIBVPX -eq 1 ] && check_vpx -- check_libopus -+ [ $OSE -eq 0 -a "$OS" != "win" ] && check_libopus - [ "$OS" != "darwin" ] && check_z - [ "$OS" != "darwin" ] && check_png - [ $OSE -eq 0 -a "$OS" = "linux" ] && check_pam -@@ -2784,13 +2790,20 @@ if [ $ONLY_ADDITIONS -eq 0 ]; then +@@ -2808,13 +2811,20 @@ if [ $ONLY_ADDITIONS -eq 0 ]; then [ $WITH_PYTHON -eq 1 ] && check_python [ $WITH_JAVA -eq 1 ] && check_java @@ -104,7 +85,7 @@ fi fi -@@ -2806,14 +2819,6 @@ if [ "$OS" = "linux" ]; then +@@ -2830,14 +2840,6 @@ if [ "$OS" = "linux" ]; then cnf_append "VBOX_WITHOUT_LINUX_TEST_BUILDS" "1" fi if [ $ONLY_ADDITIONS -eq 0 ]; then Index: emulators/virtualbox-ose/files/patch-include_VBox_com_array.h =================================================================== --- emulators/virtualbox-ose/files/patch-include_VBox_com_array.h (revision 501807) +++ emulators/virtualbox-ose/files/patch-include_VBox_com_array.h (working copy) @@ -1,6 +1,6 @@ ---- include/VBox/com/array.h.orig 2019-04-12 15:47:42 UTC +--- include/VBox/com/array.h.orig 2019-01-25 18:10:05 UTC +++ include/VBox/com/array.h -@@ -168,7 +168,7 @@ +@@ -171,7 +171,7 @@ #include "VBox/com/defs.h" @@ -9,7 +9,7 @@ /** @def VBOX_WITH_TYPE_TRAITS * Type traits are a C++ 11 feature, so not available everywhere (yet). * Only GCC 4.6 or newer and MSVC++ 16.0 (Visual Studio 2010) or newer. -@@ -940,12 +940,12 @@ class SafeArray : public Traits (public) +@@ -943,12 +943,12 @@ class SafeArray : public Traits (public) */ T &operator[] (size_t aIdx) { @@ -25,7 +25,7 @@ return m.raw[aIdx]; #endif } -@@ -960,7 +960,7 @@ class SafeArray : public Traits (public) +@@ -963,7 +963,7 @@ class SafeArray : public Traits (public) #ifdef VBOX_WITH_XPCOM return m.arr[aIdx]; #else Index: emulators/virtualbox-ose/files/patch-include_iprt_assertcompile.h =================================================================== --- emulators/virtualbox-ose/files/patch-include_iprt_assertcompile.h (revision 501807) +++ emulators/virtualbox-ose/files/patch-include_iprt_assertcompile.h (nonexistent) @@ -1,15 +0,0 @@ ---- include/iprt/assertcompile.h.orig 2018-01-15 14:49:42 UTC -+++ include/iprt/assertcompile.h -@@ -104,7 +104,11 @@ RT_C_DECLS_END - * @param expr Expression which should be true. - */ - #ifdef RTASSERT_HAVE_STATIC_ASSERT --# define AssertCompile(expr) static_assert(!!(expr), #expr) -+# ifdef __cplusplus -+# define AssertCompile(expr) static_assert(!!(expr), #expr) -+# else -+# define AssertCompile(expr) _Static_assert(!!(expr), #expr) -+# endif - #else - # define AssertCompile(expr) AssertCompileNS(expr) - #endif Property changes on: emulators/virtualbox-ose/files/patch-include_iprt_assertcompile.h ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: emulators/virtualbox-ose/files/patch-include_iprt_cdefs.h =================================================================== --- emulators/virtualbox-ose/files/patch-include_iprt_cdefs.h (revision 501807) +++ emulators/virtualbox-ose/files/patch-include_iprt_cdefs.h (nonexistent) @@ -1,39 +0,0 @@ ---- include/iprt/cdefs.h.orig 2018-10-15 14:24:52 UTC -+++ include/iprt/cdefs.h -@@ -2611,28 +2611,28 @@ - - /** @def RT_BYTE1 - * Gets the first byte of something. */ --#define RT_BYTE1(a) ( (a) & 0xff ) -+#define RT_BYTE1(a) ( (uint8_t)((a) & 0xff) ) - /** @def RT_BYTE2 - * Gets the second byte of something. */ --#define RT_BYTE2(a) ( ((a) >> 8) & 0xff ) -+#define RT_BYTE2(a) ( (uint8_t)(((a) >> 8) & 0xff) ) - /** @def RT_BYTE3 - * Gets the second byte of something. */ --#define RT_BYTE3(a) ( ((a) >> 16) & 0xff ) -+#define RT_BYTE3(a) ( (uint8_t)(((a) >> 16) & 0xff) ) - /** @def RT_BYTE4 - * Gets the fourth byte of something. */ --#define RT_BYTE4(a) ( ((a) >> 24) & 0xff ) -+#define RT_BYTE4(a) ( (uint8_t)(((a) >> 24) & 0xff) ) - /** @def RT_BYTE5 - * Gets the fifth byte of something. */ --#define RT_BYTE5(a) ( ((a) >> 32) & 0xff ) -+#define RT_BYTE5(a) ( (uint8_t)(((a) >> 32) & 0xff) ) - /** @def RT_BYTE6 - * Gets the sixth byte of something. */ --#define RT_BYTE6(a) ( ((a) >> 40) & 0xff ) -+#define RT_BYTE6(a) ( (uint8_t)(((a) >> 40) & 0xff) ) - /** @def RT_BYTE7 - * Gets the seventh byte of something. */ --#define RT_BYTE7(a) ( ((a) >> 48) & 0xff ) -+#define RT_BYTE7(a) ( (uint8_t)(((a) >> 48) & 0xff) ) - /** @def RT_BYTE8 - * Gets the eight byte of something. */ --#define RT_BYTE8(a) ( ((a) >> 56) & 0xff ) -+#define RT_BYTE8(a) ( (uint8_t)(((a) >> 56) & 0xff) ) - - - /** @def RT_LODWORD Property changes on: emulators/virtualbox-ose/files/patch-include_iprt_cdefs.h ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: emulators/virtualbox-ose/files/patch-include_iprt_types.h =================================================================== --- emulators/virtualbox-ose/files/patch-include_iprt_types.h (revision 501807) +++ emulators/virtualbox-ose/files/patch-include_iprt_types.h (nonexistent) @@ -1,26 +0,0 @@ ---- include/iprt/types.h.orig 2018-05-09 16:32:07 UTC -+++ include/iprt/types.h -@@ -56,22 +56,9 @@ RT_C_DECLS_END - # include - - # elif defined(RT_OS_FREEBSD) && defined(_KERNEL) -- /* -- * Kludge for the FreeBSD kernel: -- * stddef.h and sys/types.h have slightly different offsetof definitions -- * when compiling in kernel mode. This is just to make GCC shut up. -- */ --# ifndef _STDDEF_H_ --# undef offsetof --# endif -+ - # include --# ifndef _SYS_TYPES_H_ --# undef offsetof --# endif - # include --# ifndef offsetof --# error "offsetof is not defined!" --# endif - - # elif defined(RT_OS_FREEBSD) && HC_ARCH_BITS == 64 && defined(RT_ARCH_X86) - /* Property changes on: emulators/virtualbox-ose/files/patch-include_iprt_types.h ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-VBoxGuest-VBoxGuest-freebsd.c =================================================================== --- emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-VBoxGuest-VBoxGuest-freebsd.c (revision 501807) +++ emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-VBoxGuest-VBoxGuest-freebsd.c (working copy) @@ -1,6 +1,22 @@ ---- src/VBox/Additions/common/VBoxGuest/VBoxGuest-freebsd.c.orig 2017-10-18 07:06:43 UTC +--- src/VBox/Additions/common/VBoxGuest/VBoxGuest-freebsd.c.orig 2019-01-25 18:12:28 UTC +++ src/VBox/Additions/common/VBoxGuest/VBoxGuest-freebsd.c -@@ -93,8 +93,6 @@ struct VBoxGuestDeviceState +@@ -45,6 +45,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -61,6 +62,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -102,8 +104,6 @@ struct VBoxGuestDeviceState struct resource *pIrqRes; /** Pointer to the IRQ handler. */ void *pfnIrqHandler; @@ -9,7 +25,7 @@ }; -@@ -104,8 +102,7 @@ struct VBoxGuestDeviceState +@@ -113,8 +113,7 @@ struct VBoxGuestDeviceState /* * Character device file handlers. */ @@ -19,7 +35,7 @@ static d_ioctl_t vgdrvFreeBSDIOCtl; static int vgdrvFreeBSDIOCtlSlow(PVBOXGUESTSESSION pSession, u_long ulCmd, caddr_t pvData, struct thread *pTd); static d_write_t vgdrvFreeBSDWrite; -@@ -136,8 +133,7 @@ static struct cdevsw g_vgdrvFreeBSDCh +@@ -145,8 +144,7 @@ static struct cdevsw g_vgdrvFreeBSDChrDevSW = { .d_version = D_VERSION, .d_flags = D_TRACKCLOSE | D_NEEDMINOR, @@ -29,7 +45,7 @@ .d_ioctl = vgdrvFreeBSDIOCtl, .d_read = vgdrvFreeBSDRead, .d_write = vgdrvFreeBSDWrite, -@@ -145,81 +141,28 @@ static struct cdevsw g_vgdrvFreeBSDCh +@@ -154,81 +152,28 @@ static struct cdevsw g_vgdrvFreeBSDChrDevSW = .d_name = "vboxguest" }; @@ -118,7 +134,7 @@ { int rc; PVBOXGUESTSESSION pSession; -@@ -227,25 +170,18 @@ static int vgdrvFreeBSDOpen(struct cdev +@@ -240,12 +185,6 @@ static int vgdrvFreeBSDOpen(struct cdev *pDev, int fOp LogFlow(("vgdrvFreeBSDOpen:\n")); /* @@ -130,7 +146,9 @@ - /* * Create a new session. */ - rc = VGDrvCommonCreateUserSession(&g_DevExt, &pSession); + fRequestor = VMMDEV_REQUESTOR_USERMODE | VMMDEV_REQUESTOR_TRUST_NOT_GIVEN; +@@ -262,14 +201,13 @@ static int vgdrvFreeBSDOpen(struct cdev *pDev, int fOp + rc = VGDrvCommonCreateUserSession(&g_DevExt, fRequestor, &pSession); if (RT_SUCCESS(rc)) { - if (ASMAtomicCmpXchgPtr(&pDev->si_drv1, pSession, (void *)0x42)) @@ -150,7 +168,7 @@ } LogRel(("vgdrvFreeBSDOpen: failed. rc=%d\n", rc)); -@@ -253,33 +189,6 @@ static int vgdrvFreeBSDOpen(struct cdev +@@ -277,33 +215,6 @@ static int vgdrvFreeBSDOpen(struct cdev *pDev, int fOp } /** @@ -184,20 +202,21 @@ * I/O control request. * * @returns depends... -@@ -292,7 +201,11 @@ static int vgdrvFreeBSDClose(struct cdev +@@ -316,8 +227,12 @@ static int vgdrvFreeBSDClose(struct cdev *pDev, int fF static int vgdrvFreeBSDIOCtl(struct cdev *pDev, u_long ulCmd, caddr_t pvData, int fFile, struct thread *pTd) { PVBOXGUESTSESSION pSession; - devfs_get_cdevpriv((void **)&pSession); + int rc; -+ + + rc = devfs_get_cdevpriv((void **)&pSession); + if (rc) + return rc; - ++ /* * Deal with the fast ioctl path first. -@@ -488,12 +401,14 @@ int VBOXCALL VBoxGuestIDC(void *pvSessio + */ +@@ -512,12 +427,14 @@ int VBOXCALL VBoxGuestIDC(void *pvSession, uintptr_t u static int vgdrvFreeBSDPoll(struct cdev *pDev, int fEvents, struct thread *td) { @@ -215,21 +234,22 @@ Log(("vgdrvFreeBSDPoll: no state data for %s\n", devtoname(pDev))); return (fEvents & (POLLHUP|POLLIN|POLLRDNORM|POLLOUT|POLLWRNORM)); } -@@ -534,10 +449,7 @@ static int vgdrvFreeBSDDetach(device_t p +@@ -558,11 +475,8 @@ static int vgdrvFreeBSDDetach(device_t pDevice) /* * Reverse what we did in vgdrvFreeBSDAttach. */ - if (g_vgdrvFreeBSDEHTag != NULL) - EVENTHANDLER_DEREGISTER(dev_clone, g_vgdrvFreeBSDEHTag); -- -- clone_cleanup(&g_pvgdrvFreeBSDClones); + destroy_dev(g_pDev); +- clone_cleanup(&g_pvgdrvFreeBSDClones); +- vgdrvFreeBSDRemoveIRQ(pDevice, pState); -@@ -689,18 +601,21 @@ static int vgdrvFreeBSDAttach(device_t p - if (RT_SUCCESS(rc)) - { + if (pState->pVMMDevMemRes) +@@ -727,18 +641,21 @@ static int vgdrvFreeBSDAttach(device_t pDevice) + VGDrvCommonProcessOptionsFromHost(&g_DevExt); + /* - * Configure device cloning. + * Configure device. Index: emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-VBoxGuest-freebsd-Makefile =================================================================== --- emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-VBoxGuest-freebsd-Makefile (revision 501807) +++ emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-VBoxGuest-freebsd-Makefile (working copy) @@ -1,6 +1,15 @@ ---- src/VBox/Additions/common/VBoxGuest/freebsd/Makefile.orig 2017-10-18 07:06:43 UTC +--- src/VBox/Additions/common/VBoxGuest/freebsd/Makefile.orig 2019-04-16 10:09:09 UTC +++ src/VBox/Additions/common/VBoxGuest/freebsd/Makefile -@@ -70,6 +70,7 @@ SRCS += \ +@@ -25,7 +25,7 @@ + # + KMOD = vboxguest + +-CFLAGS += -DRT_OS_FREEBSD -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX -Iinclude -I. -Ir0drv -w -DVBGL_VBOXGUEST -DVBOX_WITH_HGCM -DVBOX_WITH_64_BITS_GUESTS ++CFLAGS += -DRT_OS_FREEBSD -DIN_RING0 -DIN_RT_R0 -DIN_GUEST -DIN_GUEST_R0 -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX -Iinclude -I. -Ir0drv -w -DVBGL_VBOXGUEST -DVBOX_WITH_HGCM -DVBOX_WITH_64_BITS_GUESTS + + .if (${MACHINE_ARCH} == "i386") + CFLAGS += -DRT_ARCH_X86 +@@ -80,6 +80,7 @@ SRCS += \ handletable.c \ handletablectx.c \ once.c \ @@ -8,7 +17,7 @@ thread.c .PATH: ${.CURDIR}/common/string -@@ -128,6 +129,7 @@ SRCS += \ +@@ -147,6 +148,7 @@ SRCS += \ .PATH: ${.CURDIR}/r0drv SRCS += \ Index: emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-VBoxGuest-freebsd-files_vboxguest =================================================================== --- emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-VBoxGuest-freebsd-files_vboxguest (revision 501807) +++ emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-VBoxGuest-freebsd-files_vboxguest (working copy) @@ -1,6 +1,14 @@ ---- src/VBox/Additions/common/VBoxGuest/freebsd/files_vboxguest.orig 2017-10-18 07:06:43 UTC +--- src/VBox/Additions/common/VBoxGuest/freebsd/files_vboxguest.orig 2019-01-25 18:12:28 UTC +++ src/VBox/Additions/common/VBoxGuest/freebsd/files_vboxguest -@@ -99,6 +99,7 @@ FILES_VBOXGUEST_NOBIN=" \ +@@ -63,6 +63,7 @@ FILES_VBOXGUEST_NOBIN=" \ + ${PATH_ROOT}/include/iprt/time.h=>include/iprt/time.h \ + ${PATH_ROOT}/include/iprt/timer.h=>include/iprt/timer.h \ + ${PATH_ROOT}/include/iprt/types.h=>include/iprt/types.h \ ++ ${PATH_ROOT}/include/iprt/uni.h=>include/iprt/uni.h \ + ${PATH_ROOT}/include/iprt/utf16.h=>include/iprt/utf16.h \ + ${PATH_ROOT}/include/iprt/uuid.h=>include/iprt/uuid.h \ + ${PATH_ROOT}/include/iprt/crc.h=>include/iprt/crc.h \ +@@ -111,6 +112,7 @@ FILES_VBOXGUEST_NOBIN=" \ ${PATH_ROOT}/src/VBox/Runtime/common/misc/handletable.h=>common/misc/handletable.h \ ${PATH_ROOT}/src/VBox/Runtime/common/misc/handletablectx.cpp=>common/misc/handletablectx.c \ ${PATH_ROOT}/src/VBox/Runtime/common/misc/once.cpp=>common/misc/once.c \ @@ -8,7 +16,7 @@ ${PATH_ROOT}/src/VBox/Runtime/common/misc/thread.cpp=>common/misc/thread.c \ ${PATH_ROOT}/src/VBox/Runtime/common/misc/RTAssertMsg1Weak.cpp=>common/misc/RTAssertMsg1Weak.c \ ${PATH_ROOT}/src/VBox/Runtime/common/misc/RTAssertMsg2.cpp=>common/misc/RTAssertMsg2.c \ -@@ -160,6 +161,7 @@ FILES_VBOXGUEST_NOBIN=" \ +@@ -181,6 +183,7 @@ FILES_VBOXGUEST_NOBIN=" \ ${PATH_ROOT}/src/VBox/Runtime/generic/errvars-generic.cpp=>generic/errvars-generic.c \ ${PATH_ROOT}/src/VBox/Runtime/generic/timer-generic.cpp=>generic/timer-generic.c \ ${PATH_ROOT}/src/VBox/Runtime/generic/mppresent-generic.cpp=>generic/mppresent-generic.c \ @@ -16,7 +24,7 @@ ${PATH_ROOT}/src/VBox/Runtime/r0drv/alloc-r0drv.cpp=>r0drv/alloc-r0drv.c \ ${PATH_ROOT}/src/VBox/Runtime/r0drv/alloc-r0drv.h=>r0drv/alloc-r0drv.h \ ${PATH_ROOT}/src/VBox/Runtime/r0drv/initterm-r0drv.cpp=>r0drv/initterm-r0drv.c \ -@@ -186,6 +188,7 @@ FILES_VBOXGUEST_NOBIN=" \ +@@ -207,6 +210,7 @@ FILES_VBOXGUEST_NOBIN=" \ ${PATH_ROOT}/src/VBox/Runtime/r0drv/freebsd/sleepqueue-r0drv-freebsd.h=>r0drv/freebsd/sleepqueue-r0drv-freebsd.h \ ${PATH_ROOT}/src/VBox/Runtime/r0drv/generic/semspinmutex-r0drv-generic.c=>r0drv/generic/semspinmutex-r0drv-generic.c \ ${PATH_ROOT}/src/VBox/Runtime/r0drv/generic/mpnotification-r0drv-generic.cpp=>r0drv/generic/mpnotification-r0drv-generic.c \ Index: emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-Support-freebsd-Makefile =================================================================== --- emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-Support-freebsd-Makefile (revision 501807) +++ emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-Support-freebsd-Makefile (working copy) @@ -1,6 +1,6 @@ ---- src/VBox/HostDrivers/Support/freebsd/Makefile.orig 2016-07-18 11:56:20 UTC +--- src/VBox/HostDrivers/Support/freebsd/Makefile.orig 2019-01-25 18:19:55 UTC +++ src/VBox/HostDrivers/Support/freebsd/Makefile -@@ -81,6 +81,7 @@ SRCS += \ +@@ -82,6 +82,7 @@ SRCS += \ assert.c \ handletable.c \ handletablectx.c \ @@ -8,12 +8,13 @@ once.c \ term.c \ thread.c -@@ -92,13 +93,14 @@ SRCS += \ +@@ -94,14 +95,15 @@ SRCS += \ RTStrCopy.c \ RTStrCopyEx.c \ RTStrCopyP.c \ + memchr.c \ strformat.c \ + strformatnum.c \ strformatrt.c \ strformattype.c \ + stringalloc.c \ Index: emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-Support-freebsd-files_vboxdrv =================================================================== --- emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-Support-freebsd-files_vboxdrv (revision 501807) +++ emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-Support-freebsd-files_vboxdrv (working copy) @@ -1,6 +1,6 @@ ---- src/VBox/HostDrivers/Support/freebsd/files_vboxdrv.orig 2016-07-18 11:56:20 UTC +--- src/VBox/HostDrivers/Support/freebsd/files_vboxdrv.orig 2019-01-25 18:19:55 UTC +++ src/VBox/HostDrivers/Support/freebsd/files_vboxdrv -@@ -116,6 +116,7 @@ FILES_VBOXDRV_NOBIN=" \ +@@ -119,6 +119,7 @@ FILES_VBOXDRV_NOBIN=" \ ${PATH_ROOT}/src/VBox/Runtime/common/misc/handletable.cpp=>common/misc/handletable.c \ ${PATH_ROOT}/src/VBox/Runtime/common/misc/handletable.h=>common/misc/handletable.h \ ${PATH_ROOT}/src/VBox/Runtime/common/misc/handletablectx.cpp=>common/misc/handletablectx.c \ @@ -8,12 +8,13 @@ ${PATH_ROOT}/src/VBox/Runtime/common/misc/once.cpp=>common/misc/once.c \ ${PATH_ROOT}/src/VBox/Runtime/common/misc/term.cpp=>common/misc/term.c \ ${PATH_ROOT}/src/VBox/Runtime/common/misc/thread.cpp=>common/misc/thread.c \ -@@ -124,13 +125,14 @@ FILES_VBOXDRV_NOBIN=" \ +@@ -128,14 +129,15 @@ FILES_VBOXDRV_NOBIN=" \ ${PATH_ROOT}/src/VBox/Runtime/common/string/RTStrCopyEx.cpp=>common/string/RTStrCopyEx.c \ ${PATH_ROOT}/src/VBox/Runtime/common/string/RTStrNCmp.cpp=>common/string/RTStrNCmp.c \ ${PATH_ROOT}/src/VBox/Runtime/common/string/RTStrNLen.cpp=>common/string/RTStrNLen.c \ + ${PATH_ROOT}/src/VBox/Runtime/common/string/memchr.cpp=>common/string/memchr.c \ ${PATH_ROOT}/src/VBox/Runtime/common/string/strformat.cpp=>common/string/strformat.c \ + ${PATH_ROOT}/src/VBox/Runtime/common/string/strformatnum.cpp=>common/string/strformatnum.c \ ${PATH_ROOT}/src/VBox/Runtime/common/string/strformatrt.cpp=>common/string/strformatrt.c \ ${PATH_ROOT}/src/VBox/Runtime/common/string/strformattype.cpp=>common/string/strformattype.c \ + ${PATH_ROOT}/src/VBox/Runtime/common/string/stringalloc.cpp=>common/string/stringalloc.c \ Index: emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-VBoxNetAdp-Makefile.kmk =================================================================== --- emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-VBoxNetAdp-Makefile.kmk (revision 501807) +++ emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-VBoxNetAdp-Makefile.kmk (working copy) @@ -1,25 +1,20 @@ -Fix kmod panic when VIMAGE is disabled in the kernel and port - -Submitted by: Gleb Kurtsou ---- src/VBox/HostDrivers/VBoxNetAdp/Makefile.kmk.orig 2013-04-12 03:38:10.000000000 -0700 -+++ src/VBox/HostDrivers/VBoxNetAdp/Makefile.kmk 2013-06-11 21:24:05.000000000 -0700 -@@ -143,12 +143,15 @@ +--- src/VBox/HostDrivers/VBoxNetAdp/Makefile.kmk.orig 2019-05-13 13:33:07 UTC ++++ src/VBox/HostDrivers/VBoxNetAdp/Makefile.kmk +@@ -206,10 +206,14 @@ $$(VBoxNetAdp-src_0_OUTDIR)/Makefile: \ $$(if $$(eq $$(VBoxNetAdp/freebsd/Makefile_VBOX_HARDENED),$$(VBOX_WITH_HARDENING)),,FORCE) \ | $$(dir $$@) $(QUIET)$(RM) -f -- $@ - ifndef VBOX_WITH_HARDENING -- $(QUIET)$(SED) -e "s;-DVBOX_WITH_HARDENING;;g" --output $@ $< +- $(QUIET)$(SED) -e "s;VBOX_WITH_HARDENING;;g" --output $@ $< - else $(QUIET)$(CP) -f $< $@ + ifndef VBOX_WITH_HARDENING + $(QUIET)$(SED) -e "s;-DVBOX_WITH_HARDENING;;g" --output $@.tmp $@ -+ ${QUIET}$(MV) -f $@.tmp $@ ++ $(QUIET)$(MV) -f $@.tmp $@ + endif + ifndef VBOX_WITH_NETFLT_VIMAGE + $(QUIET)$(SED) -e "s;-DVIMAGE;;g" --output $@.tmp $@ -+ ${QUIET}$(MV) -f $@.tmp $@ ++ $(QUIET)$(MV) -f $@.tmp $@ endif -- + endif # freebsd - - include $(FILE_KBUILD_SUB_FOOTER) Index: emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-VBoxNetAdp-freebsd-VBoxNetAdp-freebsd.c =================================================================== --- emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-VBoxNetAdp-freebsd-VBoxNetAdp-freebsd.c (revision 501807) +++ emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-VBoxNetAdp-freebsd-VBoxNetAdp-freebsd.c (nonexistent) @@ -1,14 +0,0 @@ ---- src/VBox/HostDrivers/VBoxNetAdp/freebsd/VBoxNetAdp-freebsd.c.orig 2014-09-09 15:54:30.000000000 -0400 -+++ src/VBox/HostDrivers/VBoxNetAdp/freebsd/VBoxNetAdp-freebsd.c 2014-09-30 15:36:06.000000000 -0400 -@@ -234,7 +234,11 @@ - ifp->if_drv_flags |= IFF_DRV_OACTIVE; - while (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - { -+#if __FreeBSD_version >= 1100036 -+ if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); -+#else - ifp->if_opackets++; -+#endif - IFQ_DRV_DEQUEUE(&ifp->if_snd, m); - BPF_MTAP(ifp, m); - m_freem(m); Property changes on: emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-VBoxNetAdp-freebsd-VBoxNetAdp-freebsd.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-VBoxNetFlt-freebsd-VBoxNetFlt-freebsd.c =================================================================== --- emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-VBoxNetFlt-freebsd-VBoxNetFlt-freebsd.c (revision 501807) +++ emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-VBoxNetFlt-freebsd-VBoxNetFlt-freebsd.c (working copy) @@ -1,4 +1,4 @@ ---- src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c.orig 2018-10-15 14:30:58 UTC +--- src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c.orig 2019-04-16 10:16:39 UTC +++ src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c @@ -52,6 +52,7 @@ #include @@ -16,31 +16,7 @@ static int vboxnetflt_modevent(struct module *, int, void *); static ng_constructor_t ng_vboxnetflt_constructor; -@@ -370,7 +372,11 @@ static int ng_vboxnetflt_rcvdata(hook_p hook, item_p i - mtx_lock_spin(&pThis->u.s.inq.ifq_mtx); - _IF_ENQUEUE(&pThis->u.s.inq, m); - mtx_unlock_spin(&pThis->u.s.inq.ifq_mtx); -+#if __FreeBSD_version >= 1100100 -+ taskqueue_enqueue(taskqueue_fast, &pThis->u.s.tskin); -+#else - taskqueue_enqueue_fast(taskqueue_fast, &pThis->u.s.tskin); -+#endif - } - /* - * Handle mbufs on the outgoing hook, frames going to the interface -@@ -388,7 +394,11 @@ static int ng_vboxnetflt_rcvdata(hook_p hook, item_p i - mtx_lock_spin(&pThis->u.s.outq.ifq_mtx); - _IF_ENQUEUE(&pThis->u.s.outq, m); - mtx_unlock_spin(&pThis->u.s.outq.ifq_mtx); -+#if __FreeBSD_version >= 1100100 -+ taskqueue_enqueue(taskqueue_fast, &pThis->u.s.tskout); -+#else - taskqueue_enqueue_fast(taskqueue_fast, &pThis->u.s.tskout); -+#endif - } - else - { -@@ -428,6 +438,8 @@ static void vboxNetFltFreeBSDinput(void *arg, int pend +@@ -436,6 +438,8 @@ static void vboxNetFltFreeBSDinput(void *arg, int pend struct ifnet *ifp = pThis->u.s.ifp; unsigned int cSegs = 0; bool fDropIt = false, fActive; @@ -49,7 +25,7 @@ PINTNETSG pSG; VBOXCURVNET_SET(ifp->if_vnet); -@@ -440,6 +452,19 @@ static void vboxNetFltFreeBSDinput(void *arg, int pend +@@ -448,6 +452,19 @@ static void vboxNetFltFreeBSDinput(void *arg, int pend if (m == NULL) break; @@ -69,7 +45,7 @@ for (m0 = m; m0 != NULL; m0 = m0->m_next) if (m0->m_len > 0) cSegs++; -@@ -454,6 +479,27 @@ static void vboxNetFltFreeBSDinput(void *arg, int pend +@@ -462,6 +479,27 @@ static void vboxNetFltFreeBSDinput(void *arg, int pend vboxNetFltFreeBSDMBufToSG(pThis, m, pSG, cSegs, 0); fDropIt = pThis->pSwitchPort->pfnRecv(pThis->pSwitchPort, NULL /* pvIf */, pSG, INTNETTRUNKDIR_WIRE); RTMemTmpFree(pSG); @@ -97,7 +73,7 @@ if (fDropIt) m_freem(m); else -@@ -513,6 +559,7 @@ static void vboxNetFltFreeBSDoutput(void *arg, int pen +@@ -521,6 +559,7 @@ static void vboxNetFltFreeBSDoutput(void *arg, int pen */ int vboxNetFltPortOsXmit(PVBOXNETFLTINS pThis, void *pvIfData, PINTNETSG pSG, uint32_t fDst) { @@ -105,7 +81,7 @@ NOREF(pvIfData); void (*input_f)(struct ifnet *, struct mbuf *); -@@ -529,10 +576,16 @@ int vboxNetFltPortOsXmit(PVBOXNETFLTINS pThis, void *p +@@ -537,10 +576,16 @@ int vboxNetFltPortOsXmit(PVBOXNETFLTINS pThis, void *p { m = vboxNetFltFreeBSDSGMBufFromSG(pThis, pSG); if (m == NULL) @@ -122,7 +98,7 @@ m->m_flags |= M_PKTHDR; ether_output_frame(ifp, m); -@@ -542,10 +595,16 @@ int vboxNetFltPortOsXmit(PVBOXNETFLTINS pThis, void *p +@@ -550,10 +595,16 @@ int vboxNetFltPortOsXmit(PVBOXNETFLTINS pThis, void *p { m = vboxNetFltFreeBSDSGMBufFromSG(pThis, pSG); if (m == NULL) @@ -139,7 +115,7 @@ /* * Delivering packets to the host will be captured by the * input hook. Tag the packet with a mbuf tag so that we -@@ -556,6 +615,7 @@ int vboxNetFltPortOsXmit(PVBOXNETFLTINS pThis, void *p +@@ -564,6 +615,7 @@ int vboxNetFltPortOsXmit(PVBOXNETFLTINS pThis, void *p if (mtag == NULL) { m_freem(m); @@ -147,7 +123,7 @@ return VERR_NO_MEMORY; } -@@ -566,6 +626,7 @@ int vboxNetFltPortOsXmit(PVBOXNETFLTINS pThis, void *p +@@ -574,6 +626,7 @@ int vboxNetFltPortOsXmit(PVBOXNETFLTINS pThis, void *p ifp->if_input(ifp, m); } VBOXCURVNET_RESTORE(); @@ -155,7 +131,7 @@ return VINF_SUCCESS; } -@@ -578,6 +639,7 @@ static bool vboxNetFltFreeBsdIsPromiscuous(PVBOXNETFLT +@@ -586,6 +639,7 @@ static bool vboxNetFltFreeBsdIsPromiscuous(PVBOXNETFLT int vboxNetFltOsInitInstance(PVBOXNETFLTINS pThis, void *pvContext) { @@ -163,7 +139,7 @@ char nam[NG_NODESIZ]; struct ifnet *ifp; node_p node; -@@ -586,7 +648,10 @@ int vboxNetFltOsInitInstance(PVBOXNETFLTINS pThis, voi +@@ -594,7 +648,10 @@ int vboxNetFltOsInitInstance(PVBOXNETFLTINS pThis, voi NOREF(pvContext); ifp = ifunit(pThis->szName); if (ifp == NULL) @@ -174,7 +150,7 @@ /* Create a new netgraph node for this instance */ if (ng_make_node_common(&ng_vboxnetflt_typestruct, &node) != 0) -@@ -630,12 +695,14 @@ int vboxNetFltOsInitInstance(PVBOXNETFLTINS pThis, voi +@@ -638,12 +695,14 @@ int vboxNetFltOsInitInstance(PVBOXNETFLTINS pThis, voi vboxNetFltRelease(pThis, true /*fBusy*/); } VBOXCURVNET_RESTORE(); @@ -189,7 +165,7 @@ struct ifnet *ifp, *ifp0; ifp = ASMAtomicUoReadPtrT(&pThis->u.s.ifp, struct ifnet *); -@@ -652,6 +719,7 @@ bool vboxNetFltOsMaybeRediscovered(PVBOXNETFLTINS pThi +@@ -660,6 +719,7 @@ bool vboxNetFltOsMaybeRediscovered(PVBOXNETFLTINS pThi pThis->u.s.node = NULL; } VBOXCURVNET_RESTORE(); @@ -197,7 +173,7 @@ if (ifp0 != NULL) { -@@ -664,6 +732,7 @@ bool vboxNetFltOsMaybeRediscovered(PVBOXNETFLTINS pThi +@@ -672,6 +732,7 @@ bool vboxNetFltOsMaybeRediscovered(PVBOXNETFLTINS pThi void vboxNetFltOsDeleteInstance(PVBOXNETFLTINS pThis) { @@ -205,7 +181,7 @@ taskqueue_drain(taskqueue_fast, &pThis->u.s.tskin); taskqueue_drain(taskqueue_fast, &pThis->u.s.tskout); -@@ -676,6 +745,7 @@ void vboxNetFltOsDeleteInstance(PVBOXNETFLTINS pThis) +@@ -684,6 +745,7 @@ void vboxNetFltOsDeleteInstance(PVBOXNETFLTINS pThis) ng_rmnode_self(pThis->u.s.node); VBOXCURVNET_RESTORE(); pThis->u.s.node = NULL; @@ -213,7 +189,7 @@ } int vboxNetFltOsPreInitInstance(PVBOXNETFLTINS pThis) -@@ -689,6 +759,7 @@ int vboxNetFltOsPreInitInstance(PVBOXNETFLTINS pThis) +@@ -697,6 +759,7 @@ int vboxNetFltOsPreInitInstance(PVBOXNETFLTINS pThis) void vboxNetFltPortOsSetActive(PVBOXNETFLTINS pThis, bool fActive) { @@ -221,7 +197,7 @@ struct ifnet *ifp; struct ifreq ifreq; int error; -@@ -722,7 +793,10 @@ void vboxNetFltPortOsSetActive(PVBOXNETFLTINS pThis, b +@@ -730,7 +793,10 @@ void vboxNetFltPortOsSetActive(PVBOXNETFLTINS pThis, b NG_MKMESSAGE(msg, NGM_GENERIC_COOKIE, NGM_CONNECT, sizeof(struct ngm_connect), M_NOWAIT); if (msg == NULL) @@ -232,7 +208,7 @@ con = (struct ngm_connect *)msg->data; snprintf(con->path, NG_PATHSIZ, "vboxnetflt_%s:", ifp->if_xname); strlcpy(con->ourhook, "lower", NG_HOOKSIZ); -@@ -736,7 +810,10 @@ void vboxNetFltPortOsSetActive(PVBOXNETFLTINS pThis, b +@@ -744,7 +810,10 @@ void vboxNetFltPortOsSetActive(PVBOXNETFLTINS pThis, b NG_MKMESSAGE(msg, NGM_GENERIC_COOKIE, NGM_CONNECT, sizeof(struct ngm_connect), M_NOWAIT); if (msg == NULL) @@ -243,7 +219,7 @@ con = (struct ngm_connect *)msg->data; snprintf(con->path, NG_PATHSIZ, "vboxnetflt_%s:", ifp->if_xname); -@@ -759,7 +836,10 @@ void vboxNetFltPortOsSetActive(PVBOXNETFLTINS pThis, b +@@ -767,7 +836,10 @@ void vboxNetFltPortOsSetActive(PVBOXNETFLTINS pThis, b NG_MKMESSAGE(msg, NGM_GENERIC_COOKIE, NGM_RMHOOK, sizeof(struct ngm_rmhook), M_NOWAIT); if (msg == NULL) @@ -254,7 +230,7 @@ rm = (struct ngm_rmhook *)msg->data; strlcpy(rm->ourhook, "input", NG_HOOKSIZ); NG_SEND_MSG_PATH(error, node, msg, path, 0); -@@ -770,12 +850,16 @@ void vboxNetFltPortOsSetActive(PVBOXNETFLTINS pThis, b +@@ -778,12 +850,16 @@ void vboxNetFltPortOsSetActive(PVBOXNETFLTINS pThis, b NG_MKMESSAGE(msg, NGM_GENERIC_COOKIE, NGM_RMHOOK, sizeof(struct ngm_rmhook), M_NOWAIT); if (msg == NULL) Index: emulators/virtualbox-ose/files/patch-src-VBox-Installer-freebsd-VBox.sh =================================================================== --- emulators/virtualbox-ose/files/patch-src-VBox-Installer-freebsd-VBox.sh (revision 501807) +++ emulators/virtualbox-ose/files/patch-src-VBox-Installer-freebsd-VBox.sh (working copy) @@ -1,6 +1,6 @@ --- src/VBox/Installer/freebsd/VBox.sh.orig 2016-08-27 05:10:34 UTC +++ src/VBox/Installer/freebsd/VBox.sh -@@ -0,0 +1,64 @@ +@@ -0,0 +1,67 @@ +#!/bin/sh +# +# Oracle VM VirtualBox startup script, FreeBSD hosts. @@ -38,6 +38,9 @@ + VirtualBox|virtualbox) + exec "$INSTALL_DIR/VirtualBox" "$@" + ;; ++ VirtualBoxVM|virtualboxvm) ++ exec "$INSTALL_DIR/VirtualBoxVM" "$@" ++ ;; + VBoxManage|vboxmanage) + exec "$INSTALL_DIR/VBoxManage" "$@" + ;; Index: emulators/virtualbox-ose/files/patch-src-VBox-Main-src-server-freebsd-HostHardwareFreeBSD.cpp =================================================================== --- emulators/virtualbox-ose/files/patch-src-VBox-Main-src-server-freebsd-HostHardwareFreeBSD.cpp (revision 501807) +++ emulators/virtualbox-ose/files/patch-src-VBox-Main-src-server-freebsd-HostHardwareFreeBSD.cpp (nonexistent) @@ -1,14 +0,0 @@ ---- src/VBox/Main/src-server/freebsd/HostHardwareFreeBSD.cpp.orig 2015-04-14 15:41:25.000000000 -0400 -+++ src/VBox/Main/src-server/freebsd/HostHardwareFreeBSD.cpp 2015-04-14 18:25:23.156536000 -0400 -@@ -251,8 +251,9 @@ - PeriphMatchPattern.pattern.periph_pattern.path_id = paMatches[i].result.device_result.path_id; - PeriphMatchPattern.pattern.periph_pattern.target_id = paMatches[i].result.device_result.target_id; - PeriphMatchPattern.pattern.periph_pattern.target_lun = paMatches[i].result.device_result.target_lun; -- PeriphMatchPattern.pattern.periph_pattern.flags = PERIPH_MATCH_PATH | PERIPH_MATCH_TARGET | -- PERIPH_MATCH_LUN; -+ PeriphMatchPattern.pattern.periph_pattern.flags = static_cast -+ (PERIPH_MATCH_PATH | PERIPH_MATCH_TARGET | -+ PERIPH_MATCH_LUN); - PeriphCCB.cdm.num_patterns = 1; - PeriphCCB.cdm.pattern_buf_len = sizeof(struct dev_match_result); - PeriphCCB.cdm.patterns = &PeriphMatchPattern; Property changes on: emulators/virtualbox-ose/files/patch-src-VBox-Main-src-server-freebsd-HostHardwareFreeBSD.cpp ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs.h =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs.h (revision 501807) +++ emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs.h (working copy) @@ -1,4 +1,4 @@ ---- src/VBox/Additions/freebsd/vboxvfs/vboxvfs.h.orig 2018-06-29 13:08:17 UTC +--- src/VBox/Additions/freebsd/vboxvfs/vboxvfs.h.orig 2019-04-16 10:09:14 UTC +++ src/VBox/Additions/freebsd/vboxvfs/vboxvfs.h @@ -1,8 +1,3 @@ -/* $Id: vboxvfs.h $ */ @@ -7,9 +7,9 @@ - */ - /* - * Copyright (C) 2010-2017 Oracle Corporation + * Copyright (C) 2010-2019 Oracle Corporation * -@@ -21,72 +16,413 @@ +@@ -24,72 +19,371 @@ #define VBOXVFS_VFSNAME "vboxvfs" #define VBOXVFS_VERSION 1 @@ -78,7 +78,6 @@ +#include "../../../../../include/iprt/err.h" +#include "../../../../../include/iprt/fs.h" +#include "../../../../../include/iprt/log.h" -+#include "../../../../../include/iprt/mangling.h" +#include "../../../../../include/iprt/mem.h" +#include "../../../../../include/iprt/param.h" +#include "../../../../../include/iprt/path.h" @@ -89,27 +88,6 @@ +#include "../../../../../include/iprt/time.h" +#include "../../../../../include/iprt/types.h" +#include "../../../../../include/iprt/uni.h" -+#include "../../../../../include/iprt/nocrt/limits.h" -+#include "../../../../../include/iprt/alloc.h" -+#include "../../../../../include/iprt/asm.h" -+#include "../../../../../include/iprt/asm-amd64-x86.h" -+#include "../../../../../include/iprt/asm-math.h" -+#include "../../../../../include/iprt/assert.h" -+#include "../../../../../include/iprt/cdefs.h" -+#include "../../../../../include/iprt/err.h" -+#include "../../../../../include/iprt/fs.h" -+#include "../../../../../include/iprt/log.h" -+#include "../../../../../include/iprt/mangling.h" -+#include "../../../../../include/iprt/mem.h" -+#include "../../../../../include/iprt/param.h" -+#include "../../../../../include/iprt/path.h" -+#include "../../../../../include/iprt/semaphore.h" -+#include "../../../../../include/iprt/stdarg.h" -+#include "../../../../../include/iprt/stdint.h" -+#include "../../../../../include/iprt/string.h" -+#include "../../../../../include/iprt/time.h" -+#include "../../../../../include/iprt/types.h" -+#include "../../../../../include/iprt/uni.h" -#include +#else @@ -134,26 +112,6 @@ +#include "iprt/time.h" +#include "iprt/types.h" +#include "iprt/uni.h" -+#include "iprt/nocrt/limits.h" -+#include "iprt/alloc.h" -+#include "iprt/asm.h" -+#include "iprt/asm-amd64-x86.h" -+#include "iprt/asm-math.h" -+#include "iprt/assert.h" -+#include "iprt/cdefs.h" -+#include "iprt/err.h" -+#include "iprt/fs.h" -+#include "iprt/log.h" -+#include "iprt/mem.h" -+#include "iprt/param.h" -+#include "iprt/path.h" -+#include "iprt/semaphore.h" -+#include "iprt/stdarg.h" -+#include "iprt/stdint.h" -+#include "iprt/string.h" -+#include "iprt/time.h" -+#include "iprt/types.h" -+#include "iprt/uni.h" + +#include "common/VBoxGuestLib/SysHlp.h" + @@ -459,5 +417,5 @@ + #endif /* KERNEL */ - #endif /* !___VBOXVFS_H___ */ + #endif /* !GA_INCLUDED_SRC_freebsd_vboxvfs_vboxvfs_h */ - Index: emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vfsops.c =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vfsops.c (revision 501807) +++ emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vfsops.c (working copy) @@ -1,6 +1,6 @@ ---- src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vfsops.c.orig 2017-04-28 16:59:22.000000000 +0200 -+++ src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vfsops.c 2017-07-12 19:24:26.109029000 +0200 -@@ -1,10 +1,5 @@ +--- src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vfsops.c.orig 2019-01-25 18:12:34 UTC ++++ src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vfsops.c +@@ -1,8 +1,3 @@ -/* $Id: vboxvfs_vfsops.c $ */ -/** @file - * Description. @@ -7,11 +7,9 @@ - */ - /* - * Copyright (C) 2008-2017 Oracle Corporation + * Copyright (C) 2008-2019 Oracle Corporation * - * This file is part of VirtualBox Open Source Edition (OSE), as - * available from http://www.virtualbox.org. This file is free software; -@@ -14,245 +9,479 @@ +@@ -14,245 +9,478 @@ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. */ @@ -38,20 +36,26 @@ +#include -#include -- --#define VFSMP2SFGLOBINFO(mp) ((struct sf_glob_info *)mp->mnt_data) -- --static int vboxvfs_version = VBOXVFS_VERSION; +#include +#include ++#include "vboxvfs.h" ++ + #define VFSMP2SFGLOBINFO(mp) ((struct sf_glob_info *)mp->mnt_data) + +-static int vboxvfs_version = VBOXVFS_VERSION; ++#ifdef MALLOC_DECLARE ++MALLOC_DEFINE(M_VBOXVFS, "vboxvfs", "VBOX VFS"); ++#endif + -SYSCTL_NODE(_vfs, OID_AUTO, vboxvfs, CTLFLAG_RW, 0, "VirtualBox shared filesystem"); -SYSCTL_INT(_vfs_vboxvfs, OID_AUTO, version, CTLFLAG_RD, &vboxvfs_version, 0, ""); -+#include "vboxvfs.h" ++static sfp_connection_t *sfprov = NULL; -/* global connection to the host service. */ -static VBGLSFCLIENT g_vboxSFClient; -+#define VFSMP2SFGLOBINFO(mp) ((struct sf_glob_info *)mp->mnt_data) ++static int vboxfs_version = VBOXVFS_VERSION; ++u_int vboxvfs_debug = 1; -static vfs_init_t vboxvfs_init; -static vfs_uninit_t vboxvfs_uninit; @@ -61,7 +65,10 @@ -static vfs_quotactl_t vboxvfs_quotactl; -static vfs_statfs_t vboxvfs_statfs; -static vfs_unmount_t vboxvfs_unmount; -- ++SYSCTL_NODE(_vfs, OID_AUTO, vboxfs, CTLFLAG_RW, 0, "VirtualBox shared filesystem"); ++SYSCTL_INT(_vfs_vboxfs, OID_AUTO, version, CTLFLAG_RD, &vboxfs_version, 0, ""); ++SYSCTL_UINT(_vfs_vboxfs, OID_AUTO, debug, CTLFLAG_RW, &vboxvfs_debug, 0, "Debug level"); + -static struct vfsops vboxvfs_vfsops = { - .vfs_init = vboxvfs_init, - .vfs_cmount = vboxvfs_cmount, @@ -72,19 +79,6 @@ - .vfs_sync = vfs_stdsync, - .vfs_uninit = vboxvfs_uninit, - .vfs_unmount = vboxvfs_unmount, -+#ifdef MALLOC_DECLARE -+MALLOC_DEFINE(M_VBOXVFS, "vboxvfs", "VBOX VFS"); -+#endif -+ -+static sfp_connection_t *sfprov = NULL; -+ -+static int vboxfs_version = VBOXVFS_VERSION; -+u_int vboxvfs_debug = 1; -+ -+SYSCTL_NODE(_vfs, OID_AUTO, vboxfs, CTLFLAG_RW, 0, "VirtualBox shared filesystem"); -+SYSCTL_INT(_vfs_vboxfs, OID_AUTO, version, CTLFLAG_RD, &vboxfs_version, 0, ""); -+SYSCTL_UINT(_vfs_vboxfs, OID_AUTO, debug, CTLFLAG_RW, &vboxvfs_debug, 0, "Debug level"); -+ +static vfs_init_t vboxfs_init; +static vfs_uninit_t vboxfs_uninit; +static vfs_cmount_t vboxfs_cmount; @@ -141,17 +135,9 @@ { - struct vboxvfs_mount_info args; - int rc = 0; -- -- printf("%s: Enter\n", __FUNCTION__); -- -- rc = copyin(data, &args, sizeof(struct vboxvfs_mount_info)); -- if (rc) -- return rc; + struct vboxfs_node *nnode; -- ma = mount_argf(ma, "uid", "%d", args.uid); -- ma = mount_argf(ma, "gid", "%d", args.gid); -- ma = mount_arg(ma, "from", args.name, -1); +- printf("%s: Enter\n", __FUNCTION__); + if ((mp->mnt_kern_flag & MNTK_UNMOUNT) != 0) { + /* + * When a new tmpfs node is created for fully @@ -169,10 +155,16 @@ + */ + return (EBUSY); + } -+ + +- rc = copyin(data, &args, sizeof(struct vboxvfs_mount_info)); +- if (rc) +- return rc; + nnode = (struct vboxfs_node *)uma_zalloc_arg( + vsfmp->sf_node_pool, vsfmp, M_WAITOK); -+ + +- ma = mount_argf(ma, "uid", "%d", args.uid); +- ma = mount_argf(ma, "gid", "%d", args.gid); +- ma = mount_arg(ma, "from", args.name, -1); + /* Generic initialization. */ + nnode->sf_type = type; + nnode->sf_ino = vsfmp->sf_ino++; @@ -179,7 +171,8 @@ + nnode->sf_path = strdup(fullpath, M_VBOXVFS); + nnode->sf_parent = parent; + nnode->vboxfsmp = vsfmp; -+ + +- rc = kernel_mount(ma, flags); + /* Type-specific initialization. */ + switch (nnode->sf_type) { + case VBLK: @@ -190,15 +183,12 @@ + case VLNK: + case VREG: + break; -+ + +- printf("%s: Leave rc=%d\n", __FUNCTION__, rc); + default: + panic("vboxfs_alloc_node: type %p %d", nnode, (int)nnode->sf_type); + } -- rc = kernel_mount(ma, flags); -- -- printf("%s: Leave rc=%d\n", __FUNCTION__, rc); -- - return rc; + *node = nnode; + return 0; @@ -219,33 +209,8 @@ - struct sf_glob_info *pShFlGlobalInfo; - SHFLSTRING *pShFlShareName = NULL; - int cbShFlShareName; -- + - printf("%s: Enter\n", __FUNCTION__); -- -- if (mp->mnt_flag & (MNT_UPDATE | MNT_ROOTFS)) -- return EOPNOTSUPP; -- -- if (vfs_filteropt(mp->mnt_optnew, vboxvfs_opts)) -- { -- vfs_mount_error(mp, "%s", "Invalid option"); -- return EINVAL; -- } -- -- rc = vfs_getopt(mp->mnt_optnew, "from", (void **)&pszShare, &cbShare); -- if (rc || pszShare[cbShare-1] != '\0' || cbShare > 0xfffe) -- return EINVAL; -- -- rc = vfs_getopt(mp->mnt_optnew, "gid", (void **)&gid, &cbOption); -- if ((rc != ENOENT) && (rc || cbOption != sizeof(gid))) -- return EINVAL; -- -- rc = vfs_getopt(mp->mnt_optnew, "uid", (void **)&uid, &cbOption); -- if ((rc != ENOENT) && (rc || cbOption != sizeof(uid))) -- return EINVAL; - -- pShFlGlobalInfo = RTMemAllocZ(sizeof(struct sf_glob_info)); -- if (!pShFlGlobalInfo) -- return ENOMEM; +#ifdef INVARIANTS + TMPFS_NODE_LOCK(node); + MPASS(node->sf_vnode == NULL); @@ -255,16 +220,16 @@ + if (node->sf_path) + free(node->sf_path, M_VBOXVFS); -- cbShFlShareName = offsetof (SHFLSTRING, String.utf8) + cbShare + 1; -- pShFlShareName = RTMemAllocZ(cbShFlShareName); -- if (!pShFlShareName) -- return VERR_NO_MEMORY; +- if (mp->mnt_flag & (MNT_UPDATE | MNT_ROOTFS)) +- return EOPNOTSUPP; + uma_zfree(vboxfs->sf_node_pool, node); +} -- pShFlShareName->u16Length = cbShare; -- pShFlShareName->u16Size = cbShare + 1; -- memcpy (pShFlShareName->String.utf8, pszShare, cbShare + 1); +- if (vfs_filteropt(mp->mnt_optnew, vboxvfs_opts)) +- { +- vfs_mount_error(mp, "%s", "Invalid option"); +- return EINVAL; +- } +static int +vboxfs_cmount(struct mntarg *ma, void *data, uint64_t flags) +{ @@ -271,14 +236,18 @@ + struct vboxfs_mount_info args; + int error = 0; -- rc = VbglR0SfMapFolder (&g_vboxSFClient, pShFlShareName, &pShFlGlobalInfo->map); -- RTMemFree(pShFlShareName); +- rc = vfs_getopt(mp->mnt_optnew, "from", (void **)&pszShare, &cbShare); +- if (rc || pszShare[cbShare-1] != '\0' || cbShare > 0xfffe) +- return EINVAL; + if (data == NULL) + return (EINVAL); + error = copyin(data, &args, sizeof(struct vboxfs_mount_info)); + if (error) + return (error); -+ + +- rc = vfs_getopt(mp->mnt_optnew, "gid", (void **)&gid, &cbOption); +- if ((rc != ENOENT) && (rc || cbOption != sizeof(gid))) +- return EINVAL; + ma = mount_argf(ma, "uid", "%d", args.uid); + ma = mount_argf(ma, "gid", "%d", args.gid); + ma = mount_argf(ma, "file_mode", "%d", args.fmode); @@ -285,17 +254,15 @@ + ma = mount_argf(ma, "dir_mode", "%d", args.dmode); + ma = mount_arg(ma, "from", args.name, -1); -- if (RT_FAILURE (rc)) -- { -- RTMemFree(pShFlGlobalInfo); -- printf("VbglR0SfMapFolder failed rc=%d\n", rc); -- return EPROTO; -- } +- rc = vfs_getopt(mp->mnt_optnew, "uid", (void **)&uid, &cbOption); +- if ((rc != ENOENT) && (rc || cbOption != sizeof(uid))) +- return EINVAL; + return (kernel_mount(ma, flags)); +} -- pShFlGlobalInfo->uid = uid; -- pShFlGlobalInfo->gid = gid; +- pShFlGlobalInfo = RTMemAllocZ(sizeof(struct sf_glob_info)); +- if (!pShFlGlobalInfo) +- return ENOMEM; +static const char *vboxfs_opts[] = { + "fstype", + "fspath", @@ -308,7 +275,10 @@ + NULL +}; -- mp->mnt_data = pShFlGlobalInfo; +- cbShFlShareName = offsetof (SHFLSTRING, String.utf8) + cbShare + 1; +- pShFlShareName = RTMemAllocZ(cbShFlShareName); +- if (!pShFlShareName) +- return VERR_NO_MEMORY; +#define VBOX_INTOPT(optname, val, base) do { \ + char *ep, *optarg = NULL; \ + if (vfs_getopt(opts, optname, (void **)&optarg, NULL) == 0) { \ @@ -328,66 +298,69 @@ + } \ +} while (0) -- /** @todo root vnode. */ +- pShFlShareName->u16Length = cbShare; +- pShFlShareName->u16Size = cbShare + 1; +- memcpy (pShFlShareName->String.utf8, pszShare, cbShare + 1); +static int +vboxfs_node_ctor(void *mem, int size, void *arg, int flags) +{ + struct vboxfs_node *node = (struct vboxfs_node *)mem; -- vfs_getnewfsid(mp); -- vfs_mountedfrom(mp, pszShare); +- rc = VbglR0SfMapFolder (&g_vboxSFClient, pShFlShareName, &pShFlGlobalInfo->map); +- RTMemFree(pShFlShareName); + node->sf_vnode = NULL; + node->sf_vpstate = 0; -- printf("%s: Leave rc=0\n", __FUNCTION__); +- if (RT_FAILURE (rc)) +- { +- RTMemFree(pShFlGlobalInfo); +- printf("VbglR0SfMapFolder failed rc=%d\n", rc); +- return EPROTO; +- } + return (0); +} -- return 0; +- pShFlGlobalInfo->uid = uid; +- pShFlGlobalInfo->gid = gid; +static void +vboxfs_node_dtor(void *mem, int size, void *arg) +{ + struct vboxfs_node *node = (struct vboxfs_node *)mem; + node->sf_type = VNON; - } ++} --static int vboxvfs_unmount(struct mount *mp, int mntflags, struct thread *td) +- mp->mnt_data = pShFlGlobalInfo; +static int +vboxfs_node_init(void *mem, int size, int flags) - { -- struct sf_glob_info *pShFlGlobalInfo = VFSMP2SFGLOBINFO(mp); -- int rc; -- int flags = 0; ++{ + struct vboxfs_node *node = (struct vboxfs_node *)mem; + node->sf_ino = 0; -- rc = VbglR0SfUnmapFolder(&g_vboxSFClient, &pShFlGlobalInfo->map); -- if (RT_FAILURE(rc)) -- printf("Failed to unmap shared folder\n"); +- /** @todo root vnode. */ + mtx_init(&node->sf_interlock, "tmpfs node interlock", NULL, MTX_DEF); -- if (mntflags & MNT_FORCE) -- flags |= FORCECLOSE; +- vfs_getnewfsid(mp); +- vfs_mountedfrom(mp, pszShare); + return (0); +} -- /* There is 1 extra root vnode reference (vnode_root). */ -- rc = vflush(mp, 1, flags, td); -- if (rc) -- return rc; +- printf("%s: Leave rc=0\n", __FUNCTION__); +static void +vboxfs_node_fini(void *mem, int size) +{ + struct vboxfs_node *node = (struct vboxfs_node *)mem; +- return 0; + mtx_destroy(&node->sf_interlock); -+} + } -- RTMemFree(pShFlGlobalInfo); -- mp->mnt_data = NULL; +-static int vboxvfs_unmount(struct mount *mp, int mntflags, struct thread *td) +static int +vboxfs_mount(struct mount *mp) -+{ + { +- struct sf_glob_info *pShFlGlobalInfo = VFSMP2SFGLOBINFO(mp); +- int rc; +- int flags = 0; + struct vboxfs_mnt *vboxfsmp = NULL; + struct vfsoptlist *opts = mp->mnt_optnew; + sfp_mount_t *handle = NULL; @@ -399,27 +372,38 @@ + uid_t uid = 0; + gid_t gid = 0; + struct vboxfs_node *root; -+ + +- rc = VbglR0SfUnmapFolder(&g_vboxSFClient, &pShFlGlobalInfo->map); +- if (RT_FAILURE(rc)) +- printf("Failed to unmap shared folder\n"); + if (mp->mnt_flag & (MNT_UPDATE | MNT_ROOTFS)) + return (EOPNOTSUPP); -+ + +- if (mntflags & MNT_FORCE) +- flags |= FORCECLOSE; + if (vfs_filteropt(opts, vboxfs_opts)) { + vfs_mount_error(mp, "%s", "Invalid option"); + return (EINVAL); + } -+ + +- /* There is 1 extra root vnode reference (vnode_root). */ +- rc = vflush(mp, 1, flags, td); +- if (rc) +- return rc; + VBOX_INTOPT("uid", uid, 10); + VBOX_INTOPT("gid", gid, 10); + VBOX_INTOPT("file_mode", file_mode, 8); + VBOX_INTOPT("dir_mode", dir_mode, 8); + VBOX_INTOPT("ro", readonly, 10); -+ + + error = vfs_getopt(opts, "from", (void **)&share_name, &share_len); + if (error != 0 || share_len == 0) { + vfs_mount_error(mp, "Invalid from"); + return (EINVAL); + } -+ + +- RTMemFree(pShFlGlobalInfo); +- mp->mnt_data = NULL; + vboxfsmp = malloc(sizeof(struct vboxfs_mnt), M_VBOXVFS, M_WAITOK | M_ZERO); + vboxfsmp->sf_uid = uid; + vboxfsmp->sf_gid = gid; @@ -427,7 +411,8 @@ + vboxfsmp->sf_dmode = dir_mode & (S_IRWXU | S_IRWXG | S_IRWXO); + vboxfsmp->sf_ino = 3; + vboxfsmp->sf_stat_ttl = 200; -+ + +- return 0; + /* Invoke Hypervisor mount interface before proceeding */ + error = sfprov_mount(share_name, &handle); + if (error) @@ -466,7 +451,6 @@ + + MNT_ILOCK(mp); + mp->mnt_data = vboxfsmp; -+ bzero(&mp->mnt_stat.f_fsid, sizeof(&mp->mnt_stat.f_fsid)); + /* f_fsid is int32_t but serial is uint32_t, convert */ + memcpy(&mp->mnt_stat.f_fsid, &fsinfo.serial, sizeof(mp->mnt_stat.f_fsid)); + mp->mnt_flag |= MNT_LOCAL; @@ -480,8 +464,7 @@ +#endif + MNT_IUNLOCK(mp); + vfs_mountedfrom(mp, share_name); - -- return 0; ++ + return (0); } @@ -502,55 +485,56 @@ + struct thread *td; + int error; + int flags; -+ + +- printf("%s: Enter\n", __FUNCTION__); + vboxfsmp = VFSTOVBOXFS(mp); + td = curthread; + flags = 0; + if (mntflags & MNT_FORCE) + flags |= FORCECLOSE; -+ + +- vp = pShFlGlobalInfo->vnode_root; +- VREF(vp); + error = vflush(mp, 0, flags, td); + if (error) + return (error); -+ + +- vn_lock(vp, flags | LK_RETRY, td); +- *vpp = vp; + /* Invoke Hypervisor unmount interface before proceeding */ + error = sfprov_unmount(vboxfsmp->sf_handle); + if (error != 0) { + /* TBD anything here? */ + } -+ + +- printf("%s: Leave\n", __FUNCTION__); + uma_zdestroy(vboxfsmp->sf_node_pool); -+ + +- return rc; + free(vboxfsmp, M_VBOXVFS); + MNT_ILOCK(mp); + mp->mnt_data = NULL; + mp->mnt_flag &= ~MNT_LOCAL; + MNT_IUNLOCK(mp); - -- printf("%s: Enter\n", __FUNCTION__); -- -- vp = pShFlGlobalInfo->vnode_root; -- VREF(vp); ++ + return (0); -+} + } -- vn_lock(vp, flags | LK_RETRY, td); -- *vpp = vp; +-static int vboxvfs_quotactl(struct mount *mp, int cmd, uid_t uid, void *arg, struct thread *td) +static int +vboxfs_root(struct mount *mp, int flags, struct vnode **vpp) -+{ + { +- return EOPNOTSUPP; + int error; + error = vboxfs_alloc_vp(mp, VFSTOVBOXFS(mp)->sf_root, flags, vpp); - -- printf("%s: Leave\n", __FUNCTION__); ++ + if (!error) + (*vpp)->v_vflag |= VV_ROOT; - -- return rc; ++ + return error; } --static int vboxvfs_quotactl(struct mount *mp, int cmd, uid_t uid, void *arg, struct thread *td) +-int vboxvfs_init(struct vfsconf *vfsp) +/* + * Do operation associated with quotas, not supported + */ @@ -557,26 +541,22 @@ +static int +vboxfs_quotactl(struct mount *mp, int cmd, uid_t uid, void *arg) { -- return EOPNOTSUPP; +- int rc; + return (EOPNOTSUPP); - } ++} --int vboxvfs_init(struct vfsconf *vfsp) +- /* Initialize the R0 guest library. */ +- rc = VbglR0SfInit(); +- if (RT_FAILURE(rc)) +- return ENXIO; +/* + * Initialize the filesystem globals. + */ +static int +vboxfs_init(struct vfsconf *vfsp) - { -- int rc; ++{ + int error; -- /* Initialize the R0 guest library. */ -- rc = VbglR0SfInit(); -- if (RT_FAILURE(rc)) -- return ENXIO; -+ DROP_GIANT(); - - /* Connect to the host service. */ - rc = VbglR0SfConnect(&g_vboxSFClient); - if (RT_FAILURE(rc)) @@ -585,28 +565,28 @@ - VbglR0SfTerm(); - return ENXIO; - } ++ DROP_GIANT(); + +- rc = VbglR0SfSetUtf8(&g_vboxSFClient); +- if (RT_FAILURE (rc)) +- { +- printf("VbglR0SfSetUtf8 failed, rc=%d\n", rc); +- VbglR0SfDisconnect(&g_vboxSFClient); +- VbglR0SfTerm(); +- return EPROTO; +- } + sfprov = sfprov_connect(SFPROV_VERSION); + if (sfprov == NULL) { + printf("%s: couldn't connect to sf provider", __func__); + return (ENODEV); + } -+ + +- printf("Successfully loaded shared folder module\n"); + error = sfprov_set_show_symlinks(); + if (error != 0) + printf("%s: host unable to show symlinks, error=%d\n", + __func__, error); -- rc = VbglR0SfSetUtf8(&g_vboxSFClient); -- if (RT_FAILURE (rc)) -- { -- printf("VbglR0SfSetUtf8 failed, rc=%d\n", rc); -- VbglR0SfDisconnect(&g_vboxSFClient); -- VbglR0SfTerm(); -- return EPROTO; -- } -- -- printf("Successfully loaded shared folder module\n"); -- - return 0; + PICKUP_GIANT(); + return (0); Index: emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vnops.c =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vnops.c (revision 501807) +++ emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vnops.c (working copy) @@ -1,5 +1,5 @@ ---- src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vnops.c.orig 2017-04-28 16:59:22.000000000 +0200 -+++ src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vnops.c 2017-07-14 14:22:09.045026515 +0200 +--- src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vnops.c.orig 2019-01-25 18:12:34 UTC ++++ src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vnops.c @@ -1,10 +1,6 @@ -/* $Id: vboxvfs_vnops.c $ */ -/** @file @@ -7,12 +7,12 @@ - */ - /* - * Copyright (C) 2008-2017 Oracle Corporation + * Copyright (C) 2008-2019 Oracle Corporation + * Copyright (C) 2017 Mahdi Mokhtari * * This file is part of VirtualBox Open Source Edition (OSE), as * available from http://www.virtualbox.org. This file is free software; -@@ -14,228 +9,1334 @@ +@@ -14,228 +10,1334 @@ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. */ @@ -45,9 +45,9 @@ -#include -#include +#include + ++#include "vboxvfs.h" + -+#include "vboxvfs.h" - /* * Prototypes for VBOXVFS vnode operations */ @@ -79,10 +79,37 @@ -static vop_inactive_t vboxvfs_inactive; -static vop_putpages_t vboxvfs_putpages; -static vop_reclaim_t vboxvfs_reclaim; -- ++static vop_create_t vboxfs_create; ++static vop_open_t vboxfs_open; ++static vop_close_t vboxfs_close; ++static vop_access_t vboxfs_access; ++static vop_getattr_t vboxfs_getattr; ++static vop_setattr_t vboxfs_setattr; ++static vop_read_t vboxfs_read; ++static vop_readlink_t vboxfs_readlink; ++static vop_write_t vboxfs_write; ++static vop_fsync_t vboxfs_fsync; ++static vop_remove_t vboxfs_remove; ++static vop_link_t vboxfs_link; ++static vop_cachedlookup_t vboxfs_lookup; ++static vop_rename_t vboxfs_rename; ++static vop_mkdir_t vboxfs_mkdir; ++static vop_rmdir_t vboxfs_rmdir; ++static vop_symlink_t vboxfs_symlink; ++static vop_readdir_t vboxfs_readdir; ++static vop_print_t vboxfs_print; ++static vop_pathconf_t vboxfs_pathconf; ++static vop_advlock_t vboxfs_advlock; ++static vop_ioctl_t vboxfs_ioctl; ++static vop_inactive_t vboxfs_inactive; ++static vop_reclaim_t vboxfs_reclaim; ++static vop_vptofh_t vboxfs_vptofh; + -struct vop_vector vboxvfs_vnodeops = { - .vop_default = &default_vnodeops, -- ++struct vop_vector vboxfs_vnodeops = { ++ .vop_default = &default_vnodeops, + - .vop_access = vboxvfs_access, - .vop_advlock = vboxvfs_advlock, - .vop_close = vboxvfs_close, @@ -111,35 +138,6 @@ - .vop_strategy = vboxvfs_strategy, - .vop_symlink = vboxvfs_symlink, - .vop_write = vboxvfs_write, -+static vop_create_t vboxfs_create; -+static vop_open_t vboxfs_open; -+static vop_close_t vboxfs_close; -+static vop_access_t vboxfs_access; -+static vop_getattr_t vboxfs_getattr; -+static vop_setattr_t vboxfs_setattr; -+static vop_read_t vboxfs_read; -+static vop_readlink_t vboxfs_readlink; -+static vop_write_t vboxfs_write; -+static vop_fsync_t vboxfs_fsync; -+static vop_remove_t vboxfs_remove; -+static vop_link_t vboxfs_link; -+static vop_cachedlookup_t vboxfs_lookup; -+static vop_rename_t vboxfs_rename; -+static vop_mkdir_t vboxfs_mkdir; -+static vop_rmdir_t vboxfs_rmdir; -+static vop_symlink_t vboxfs_symlink; -+static vop_readdir_t vboxfs_readdir; -+static vop_print_t vboxfs_print; -+static vop_pathconf_t vboxfs_pathconf; -+static vop_advlock_t vboxfs_advlock; -+static vop_ioctl_t vboxfs_ioctl; -+static vop_inactive_t vboxfs_inactive; -+static vop_reclaim_t vboxfs_reclaim; -+static vop_vptofh_t vboxfs_vptofh; -+ -+struct vop_vector vboxfs_vnodeops = { -+ .vop_default = &default_vnodeops, -+ + .vop_access = vboxfs_access, + .vop_advlock = VOP_EOPNOTSUPP, + .vop_close = vboxfs_close, @@ -176,22 +174,14 @@ +vsfnode_cur_time_usec(void) { - return 0; --} + struct timeval now; - --static int vboxvfs_open(struct vop_open_args *ap) --{ -- return 0; --} ++ + getmicrotime(&now); - --static int vboxvfs_close(struct vop_close_args *ap) --{ -- return 0; ++ + return (now.tv_sec*1000 + now.tv_usec); } --static int vboxvfs_getattr(struct vop_getattr_args *ap) +-static int vboxvfs_open(struct vop_open_args *ap) +static int +vsfnode_stat_cached(struct vboxfs_node *np) { @@ -200,18 +190,13 @@ + np->vboxfsmp->sf_stat_ttl * 1000UL; } --static int vboxvfs_setattr(struct vop_setattr_args *ap) +-static int vboxvfs_close(struct vop_close_args *ap) +static int +vsfnode_update_stat_cache(struct vboxfs_node *np) { - return 0; --} + int error; - --static int vboxvfs_read(struct vop_read_args *ap) --{ -- return 0; --} ++ + error = sfprov_get_attr(np->vboxfsmp->sf_handle, np->sf_path, + &np->sf_stat); +#if 0 @@ -220,14 +205,11 @@ +#endif + if (error == 0) + np->sf_stat_time = vsfnode_cur_time_usec(); - --static int vboxvfs_write(struct vop_write_args *ap) --{ -- return 0; ++ + return (error); } --static int vboxvfs_create(struct vop_create_args *ap) +-static int vboxvfs_getattr(struct vop_getattr_args *ap) +/* + * Need to clear v_object for insmntque failure. + */ @@ -235,11 +217,7 @@ +vboxfs_insmntque_dtr(struct vnode *vp, void *dtr_arg) { - return 0; --} - --static int vboxvfs_remove(struct vop_remove_args *ap) --{ -- return 0; ++ + // XXX: vboxfs_destroy_vobject(vp, vp->v_object); + vp->v_object = NULL; + vp->v_data = NULL; @@ -248,10 +226,7 @@ + vput(vp); } --static int vboxvfs_rename(struct vop_rename_args *ap) --{ -- return 0; --} +-static int vboxvfs_setattr(struct vop_setattr_args *ap) +/* + * Allocates a new vnode for the node node or returns a new reference to + * an existing one if the node had already a vnode referencing it. The @@ -262,7 +237,8 @@ +int +vboxfs_alloc_vp(struct mount *mp, struct vboxfs_node *node, int lkflag, + struct vnode **vpp) -+{ + { +- return 0; + struct vnode *vp; + int error; + @@ -406,14 +382,11 @@ + VBOXFS_NODE_UNLOCK(node); + } +#endif - --static int vboxvfs_link(struct vop_link_args *ap) --{ -- return EOPNOTSUPP; ++ + return error; } --static int vboxvfs_symlink(struct vop_symlink_args *ap) +-static int vboxvfs_read(struct vop_read_args *ap) +/* + * Destroys the association between the vnode vp and the node it + * references. @@ -421,19 +394,11 @@ +void +vboxfs_free_vp(struct vnode *vp) { -- return EOPNOTSUPP; --} +- return 0; + struct vboxfs_node *node; - --static int vboxvfs_mknod(struct vop_mknod_args *ap) --{ -- return EOPNOTSUPP; --} ++ + node = VP_TO_VBOXFS_NODE(vp); - --static int vboxvfs_mkdir(struct vop_mkdir_args *ap) --{ -- return 0; ++ + VBOXFS_NODE_ASSERT_LOCKED(node); + node->sf_vnode = NULL; + if ((node->sf_vpstate & VBOXFS_VNODE_WRECLAIM) != 0) @@ -442,7 +407,7 @@ + vp->v_data = NULL; } --static int vboxvfs_rmdir(struct vop_rmdir_args *ap) +-static int vboxvfs_write(struct vop_write_args *ap) +/* + * Allocate new vboxfs_node and vnode for given file + */ @@ -452,54 +417,34 @@ + int lkflag, struct vnode **vpp) { - return 0; --} + int error; + struct vboxfs_node *unode; - --static int vboxvfs_readdir(struct vop_readdir_args *ap) --{ -- return 0; --} ++ + error = vboxfs_alloc_node(vboxfsmp->sf_vfsp, vboxfsmp, fullpath, type, + vboxfsmp->sf_uid, vboxfsmp->sf_gid, mode, parent, &unode); - --static int vboxvfs_fsync(struct vop_fsync_args *ap) --{ -- return 0; --} ++ + if (error) + goto out; - --static int vboxvfs_print (struct vop_print_args *ap) --{ -- return 0; --} ++ + error = vboxfs_alloc_vp(vboxfsmp->sf_vfsp, unode, lkflag, vpp); + if (error) + vboxfs_free_node(vboxfsmp, unode); - --static int vboxvfs_pathconf (struct vop_pathconf_args *ap) --{ -- return 0; ++ +out: + return (error); } --static int vboxvfs_strategy (struct vop_strategy_args *ap) +-static int vboxvfs_create(struct vop_create_args *ap) +static int +vboxfs_vn_get_ino_alloc(struct mount *mp, void *arg, int lkflags, + struct vnode **rvp) { - return 0; --} - --static int vboxvfs_ioctl(struct vop_ioctl_args *ap) --{ -- return ENOTTY; ++ + return (vboxfs_alloc_vp(mp, arg, lkflags, rvp)); } --static int vboxvfs_getextattr(struct vop_getextattr_args *ap) +-static int vboxvfs_remove(struct vop_remove_args *ap) +/* + * Construct a new pathname given an sfnode plus an optional tail + * component of length len @@ -509,13 +454,8 @@ +sfnode_construct_path(struct vboxfs_node *node, char *tail, int len) { - return 0; --} + char *p; - --static int vboxvfs_advlock(struct vop_advlock_args *ap) --{ -- return 0; --} ++ + if (len <= 2 && tail[0] == '.' && (len == 1 || tail[1] == '.')) + panic("construct path for %s", tail); + p = malloc(strlen(node->sf_path) + 1 + len + 1, M_VBOXVFS, M_WAITOK); @@ -523,11 +463,13 @@ + strcat(p, "/"); + strcat(p, tail); + return (p); -+} -+ + } + +-static int vboxvfs_rename(struct vop_rename_args *ap) +static int +vboxfs_access(struct vop_access_args *ap) -+{ + { +- return 0; + struct vnode *vp = ap->a_vp; + accmode_t accmode = ap->a_accmode; + struct vboxfs_node *node; @@ -555,15 +497,12 @@ + else + error = vsfnode_update_stat_cache(node); + m = (error == 0) ? node->sf_stat.sf_mode : 0; - --static int vboxvfs_lookup(struct vop_lookup_args *ap) --{ -- return 0; ++ + return (vaccess(vp->v_type, m, node->vboxfsmp->sf_uid, + node->vboxfsmp->sf_gid, accmode, ap->a_cred, NULL)); } --static int vboxvfs_inactive(struct vop_inactive_args *ap) +-static int vboxvfs_link(struct vop_link_args *ap) +/* + * Clears the (cached) directory listing for the node. + */ @@ -570,17 +509,19 @@ +static void +vfsnode_clear_dir_list(struct vboxfs_node *np) { -- return 0; +- return EOPNOTSUPP; + while (np->sf_dir_list != NULL) { + sffs_dirents_t *next = np->sf_dir_list->sf_next; + free(np->sf_dir_list, M_VBOXVFS); + np->sf_dir_list = next; + } -+} -+ + } + +-static int vboxvfs_symlink(struct vop_symlink_args *ap) +static int +vboxfs_open(struct vop_open_args *ap) -+{ + { +- return EOPNOTSUPP; + struct vboxfs_node *np; + sfp_file_t *fp; + int error; @@ -599,17 +540,21 @@ + MPASS(VOP_ISLOCKED(vp)); + + return (error); -+} -+ + } + +-static int vboxvfs_mknod(struct vop_mknod_args *ap) +static void +vfsnode_invalidate_stat_cache(struct vboxfs_node *np) -+{ + { +- return EOPNOTSUPP; + np->sf_stat_time = 0; -+} -+ + } + +-static int vboxvfs_mkdir(struct vop_mkdir_args *ap) +static int +vboxfs_close(struct vop_close_args *ap) -+{ + { +- return 0; + struct vnode *vp = ap->a_vp; + struct vboxfs_node *np; + @@ -634,11 +579,13 @@ + } + + return (0); -+} -+ + } + +-static int vboxvfs_rmdir(struct vop_rmdir_args *ap) +static int +vboxfs_getattr(struct vop_getattr_args *ap) -+{ + { +- return 0; + struct vnode *vp = ap->a_vp; + struct vattr *vap = ap->a_vap; + struct vboxfs_node *np = VP_TO_VBOXFS_NODE(vp); @@ -713,11 +660,13 @@ + +done: + return (error); -+} -+ + } + +-static int vboxvfs_readdir(struct vop_readdir_args *ap) +static int +vboxfs_setattr(struct vop_setattr_args *ap) -+{ + { +- return 0; + struct vnode *vp = ap->a_vp; + struct vattr *vap = ap->a_vap; + struct vboxfs_node *np = VP_TO_VBOXFS_NODE(vp); @@ -775,13 +724,15 @@ + } + + return (error); -+} -+ + } + +-static int vboxvfs_fsync(struct vop_fsync_args *ap) +#define blkoff(vboxfsmp, loc) ((loc) & (vboxfsmp)->bmask) + +static int +vboxfs_read(struct vop_read_args *ap) -+{ + { +- return 0; + struct vnode *vp = ap->a_vp; + struct uio *uio = ap->a_uio; + struct vboxfs_node *np = VP_TO_VBOXFS_NODE(vp); @@ -829,11 +780,13 @@ + error = 0; + + return (error); -+} -+ + } + +-static int vboxvfs_print (struct vop_print_args *ap) +static int +vboxfs_write(struct vop_write_args *ap) -+{ + { +- return 0; + struct vnode *vp = ap->a_vp; + struct uio *uio = ap->a_uio; + struct vboxfs_node *np = VP_TO_VBOXFS_NODE(vp); @@ -888,11 +841,13 @@ + error = 0; + + return (error); -+} -+ + } + +-static int vboxvfs_pathconf (struct vop_pathconf_args *ap) +static int +vboxfs_create(struct vop_create_args *ap) -+{ + { +- return 0; + struct vnode *dvp = ap->a_dvp; + struct vnode **vpp = ap->a_vpp; + struct componentname *cnp = ap->a_cnp; @@ -926,11 +881,13 @@ + } + + return (error); -+} -+ + } + +-static int vboxvfs_strategy (struct vop_strategy_args *ap) +static int +vboxfs_remove(struct vop_remove_args *ap) -+{ + { +- return 0; + struct vnode *dvp = ap->a_dvp; + struct vnode *vp = ap->a_vp; + struct vboxfs_node *np, *dir; @@ -974,11 +931,13 @@ + +out: + return (error); -+} -+ + } + +-static int vboxvfs_ioctl(struct vop_ioctl_args *ap) +static int +vboxfs_rename(struct vop_rename_args *ap) -+{ + { +- return ENOTTY; + struct vnode *fvp; + struct vnode *fdvp; + struct vnode *tvp; @@ -1016,17 +975,21 @@ + vrele(fdvp); + vrele(fvp); + return (ret); -+} -+ + } + +-static int vboxvfs_getextattr(struct vop_getextattr_args *ap) +static int +vboxfs_link(struct vop_link_args *ap) -+{ + { +- return 0; + return (EOPNOTSUPP); -+} -+ + } + +-static int vboxvfs_advlock(struct vop_advlock_args *ap) +static int +vboxfs_symlink(struct vop_symlink_args *ap) -+{ + { +- return 0; + struct vnode *dvp = ap->a_dvp; + struct vnode **vpp = ap->a_vpp; + struct componentname *cnp = ap->a_cnp; @@ -1055,11 +1018,13 @@ + vfsnode_clear_dir_list(dir); + + return (error); -+} -+ + } + +-static int vboxvfs_lookup(struct vop_lookup_args *ap) +static int +vboxfs_mkdir(struct vop_mkdir_args *ap) -+{ + { +- return 0; + struct vnode *dvp = ap->a_dvp; + struct vnode **vpp = ap->a_vpp; + struct componentname *cnp = ap->a_cnp; @@ -1090,11 +1055,13 @@ + vfsnode_clear_dir_list(dir); + + return (error); -+} -+ + } + +-static int vboxvfs_inactive(struct vop_inactive_args *ap) +static int +vboxfs_rmdir(struct vop_rmdir_args *ap) -+{ + { +- return 0; + struct vnode *dvp = ap->a_dvp; + struct vnode *vp = ap->a_vp; + struct vboxfs_node *np, *dir; @@ -1137,11 +1104,13 @@ + +out: + return (error); -+} -+ + } + +-static int vboxvfs_reclaim(struct vop_reclaim_args *ap) +static int +vboxfs_readdir(struct vop_readdir_args *ap) -+{ + { +- return 0; + int *eofp = ap->a_eofflag; + struct vnode *vp = ap->a_vp; + struct uio *uio = ap->a_uio; @@ -1260,11 +1229,13 @@ + if (error != 0) + uio->uio_offset = orig_off; + return (error); -+} -+ + } + +-static int vboxvfs_getpages(struct vop_getpages_args *ap) +static int +vboxfs_readlink(struct vop_readlink_args *v) -+{ + { +- return 0; + struct vnode *vp = v->a_vp; + struct uio *uio = v->a_uio; + @@ -1292,11 +1263,13 @@ + if (tmpbuf) + contigfree(tmpbuf, MAXPATHLEN, M_DEVBUF); + return (error); -+} -+ + } + +-static int vboxvfs_putpages(struct vop_putpages_args *ap) +static int +vboxfs_fsync(struct vop_fsync_args *ap) -+{ + { +- return 0; + struct vnode *vp; + struct vboxfs_node *np; + int ret; @@ -1307,8 +1280,8 @@ + return (0); + ret = sfprov_fsync(np->sf_file); + return (ret); -+} -+ + } + +static int +vboxfs_print(struct vop_print_args *ap) +{ @@ -1349,22 +1322,17 @@ + break; + } + return (error); - } - --static int vboxvfs_reclaim(struct vop_reclaim_args *ap) ++} ++ +/* + * File specific ioctls. + */ +static int +vboxfs_ioctl(struct vop_ioctl_args *ap) - { -- return 0; ++{ + return (ENOTTY); - } - --static int vboxvfs_getpages(struct vop_getpages_args *ap) --{ -- return 0; ++} ++ +/* + * Lookup an entry in a directory and create a new vnode if found. + */ @@ -1495,14 +1463,11 @@ + MPASS(vp->v_data == NULL); + + return (0); - } - --static int vboxvfs_putpages(struct vop_putpages_args *ap) ++} ++ +static int +vboxfs_vptofh(struct vop_vptofh_args *ap) - { -- return 0; --} - ++{ ++ + return (EOPNOTSUPP); +} Index: emulators/virtualbox-ose/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA3d-ogl.cpp =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA3d-ogl.cpp (nonexistent) +++ emulators/virtualbox-ose/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA3d-ogl.cpp (working copy) @@ -0,0 +1,38 @@ +--- src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp.orig 2019-01-25 18:17:47 UTC ++++ src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp +@@ -1150,7 +1150,7 @@ int vmsvga3dTerminate(PVGASTATE pThis) + RTSemEventDestroy(pState->WndRequestSem); + #elif defined(RT_OS_DARWIN) + +-#elif defined(RT_OS_LINUX) ++#elif defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX) + /* signal to the thread that it is supposed to exit */ + pState->bTerminate = true; + /* wait for it to terminate */ +@@ -2850,7 +2850,7 @@ int vmsvga3dGenerateMipmaps(PVGASTATE pThis, uint32_t + } + + +-#ifdef RT_OS_LINUX ++#if defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX) + /** + * X11 event handling thread. + * +@@ -2880,7 +2880,7 @@ DECLCALLBACK(int) vmsvga3dXEventThread(RTTHREAD hThrea + } + return VINF_SUCCESS; + } +-#endif // RT_OS_LINUX ++#endif // RT_OS_FREEBSD || RT_OS_LINUX + + + /** +@@ -3206,7 +3206,7 @@ static int vmsvga3dContextDestroyOgl(PVGASTATE pThis, + AssertRC(rc); + #elif defined(RT_OS_DARWIN) + vmsvga3dCocoaDestroyViewAndContext(pContext->cocoaView, pContext->cocoaContext); +-#elif defined(RT_OS_LINUX) ++#elif defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX) + glXMakeCurrent(pState->display, None, NULL); + glXDestroyContext(pState->display, pContext->glxContext); + XDestroyWindow(pState->display, pContext->window); Property changes on: emulators/virtualbox-ose/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA3d-ogl.cpp ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: emulators/virtualbox-ose/files/patch-src_VBox_Devices_Makefile.kmk =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_Devices_Makefile.kmk (nonexistent) +++ emulators/virtualbox-ose/files/patch-src_VBox_Devices_Makefile.kmk (working copy) @@ -0,0 +1,20 @@ +--- src/VBox/Devices/Makefile.kmk.orig 2019-01-25 18:18:06 UTC ++++ src/VBox/Devices/Makefile.kmk +@@ -277,7 +277,7 @@ if !defined(VBOX_ONLY_EXTPACKS) # Goes on almo + VBoxDD_SOURCES += Graphics/DevVGA-SVGA.cpp + endif + ifdef VBOX_WITH_VMSVGA3D +- if1of ($(KBUILD_TARGET), linux win) ++ if1of ($(KBUILD_TARGET), freebsd linux win) + # Dynamically load 3D library (opengl32, libGL). + # This is a temporary solution. In future the 3D backend will be in a separate library. + VBOX_WITH_VMSVGA3D_DYNAMIC_LOAD = 1 +@@ -1484,6 +1484,8 @@ if defined(VBOX_WITH_VMSVGA3D) && !defined(VBOX_ONLY_E + VBoxSVGA3D_INCS = $(VBOX_GRAPHICS_INCS) + VBoxSVGA3D_INCS.win := \ + Graphics/shaderlib/libWineStub/include ++ VBoxSVGA3D_INCS.freebsd := \ ++ Graphics/shaderlib/wine/include + VBoxSVGA3D_INCS.linux := \ + Graphics/shaderlib/wine/include + VBoxSVGA3D_INCS.darwin := \ Property changes on: emulators/virtualbox-ose/files/patch-src_VBox_Devices_Makefile.kmk ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: emulators/virtualbox-ose/files/patch-src_VBox_Devices_Storage_DrvHostBase-freebsd.cpp =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_Devices_Storage_DrvHostBase-freebsd.cpp (revision 501807) +++ emulators/virtualbox-ose/files/patch-src_VBox_Devices_Storage_DrvHostBase-freebsd.cpp (nonexistent) @@ -1,10 +0,0 @@ ---- src/VBox/Devices/Storage/DrvHostBase-freebsd.cpp.orig 2017-10-18 07:11:48 UTC -+++ src/VBox/Devices/Storage/DrvHostBase-freebsd.cpp -@@ -24,6 +24,7 @@ - #include - #include - #include -+#include - #include - - /** Maximum buffer size supported by the CAM subsystem. */ Property changes on: emulators/virtualbox-ose/files/patch-src_VBox_Devices_Storage_DrvHostBase-freebsd.cpp ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: emulators/virtualbox-ose/files/patch-src_VBox_Frontends_VBoxManage_VBoxManageHelp.cpp =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_Frontends_VBoxManage_VBoxManageHelp.cpp (revision 501807) +++ emulators/virtualbox-ose/files/patch-src_VBox_Frontends_VBoxManage_VBoxManageHelp.cpp (working copy) @@ -1,6 +1,15 @@ ---- src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp.orig 2016-08-16 19:59:52 UTC +--- src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp.orig 2019-01-25 18:19:18 UTC +++ src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp -@@ -797,7 +797,7 @@ void printUsage(USAGECATEGORY fCategory, +@@ -610,7 +610,7 @@ void printUsage(USAGECATEGORY fCategory, uint32_t fSub + " file |\n" + " ]\n" + " [--uarttype<1-N> 16450|16550A|16750\n" +-#if defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS) ++#if defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS) + " [--lpt<1-N> off| ]\n" + " [--lptmode<1-N> ]\n" + #endif +@@ -624,7 +624,7 @@ void printUsage(USAGECATEGORY fCategory, uint32_t fSub RTStrmPrintf(pStrm, "|dsound"); #endif } @@ -9,10 +18,11 @@ { RTStrmPrintf(pStrm, "" #ifdef VBOX_WITH_AUDIO_OSS -@@ -811,22 +811,6 @@ void printUsage(USAGECATEGORY fCategory, +@@ -637,22 +637,6 @@ void printUsage(USAGECATEGORY fCategory, uint32_t fSub + "|pulse" #endif ); - } +- } - if (fFreeBSD) - { -#ifdef VBOX_WITH_AUDIO_OSS @@ -28,7 +38,6 @@ -#ifdef VBOX_WITH_AUDIO_PULSE - RTStrmPrintf(pStrm, "|pulse"); -#endif -- } + } if (fDarwin) { - RTStrmPrintf(pStrm, "|coreaudio"); Index: emulators/virtualbox-ose/files/patch-src_VBox_Frontends_VBoxManage_VBoxManageModifyVM.cpp =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_Frontends_VBoxManage_VBoxManageModifyVM.cpp (nonexistent) +++ emulators/virtualbox-ose/files/patch-src_VBox_Frontends_VBoxManage_VBoxManageModifyVM.cpp (working copy) @@ -0,0 +1,29 @@ +--- src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp.orig 2019-01-25 18:19:18.000000000 +0000 ++++ src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp 2019-02-01 06:06:37.701231000 +0000 +@@ -150,7 +150,7 @@ enum + MODIFYVM_UARTMODE, + MODIFYVM_UARTTYPE, + MODIFYVM_UART, +-#if defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS) ++#if defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS) + MODIFYVM_LPTMODE, + MODIFYVM_LPT, + #endif +@@ -341,7 +341,7 @@ static const RTGETOPTDEF g_aModifyVMOptions[] = + { "--uartmode", MODIFYVM_UARTMODE, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX }, + { "--uarttype", MODIFYVM_UARTTYPE, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX }, + { "--uart", MODIFYVM_UART, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX }, +-#if defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS) ++#if defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS) + { "--lptmode", MODIFYVM_LPTMODE, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX }, + { "--lpt", MODIFYVM_LPT, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX }, + #endif +@@ -2224,7 +2224,7 @@ RTEXITCODE handleModifyVM(HandlerArg *a) + break; + } + +-#if defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS) ++#if defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS) + case MODIFYVM_LPTMODE: + { + ComPtr lpt; Property changes on: emulators/virtualbox-ose/files/patch-src_VBox_Frontends_VBoxManage_VBoxManageModifyVM.cpp ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_Support_freebsd_SUPDrv-freebsd.c =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_Support_freebsd_SUPDrv-freebsd.c (revision 501807) +++ emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_Support_freebsd_SUPDrv-freebsd.c (working copy) @@ -1,4 +1,4 @@ ---- src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c.orig 2018-10-15 14:30:57 UTC +--- src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c.orig 2019-04-16 10:16:37 UTC +++ src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c @@ -46,6 +46,7 @@ #include @@ -47,31 +47,9 @@ /* * Configure character devices. Add symbolic links for compatibility. */ -@@ -311,7 +328,21 @@ static int VBoxDrvFreeBSDIOCtl(struct cdev *pDev, u_lo - PSUPDRVSESSION pSession; - devfs_get_cdevpriv((void **)&pSession); +@@ -324,6 +341,45 @@ static int VBoxDrvFreeBSDIOCtl(struct cdev *pDev, u_lo -+#ifdef VBOX_WITH_EFLAGS_AC_SET_IN_VBOXDRV - /* -+ * Refuse all I/O control calls if we've ever detected EFLAGS.AC being cleared. -+ * -+ * This isn't a problem, as there is absolutely nothing in the kernel context that -+ * depend on user context triggering cleanups. That would be pretty wild, right? -+ */ -+ if (RT_UNLIKELY(g_VBoxDrvFreeBSDDevExt.cBadContextCalls > 0)) -+ { -+ SUPR0Printf("VBoxDrvFreBSDIOCtl: EFLAGS.AC=0 detected %u times, refusing all I/O controls!\n", g_VBoxDrvFreeBSDDevExt.cBadContextCalls); -+ return ESPIPE; -+ } -+#endif -+ -+ /* - * Deal with the fast ioctl path first. - */ - if ( ( ulCmd == SUP_IOCTL_FAST_DO_RAW_RUN -@@ -325,6 +356,45 @@ static int VBoxDrvFreeBSDIOCtl(struct cdev *pDev, u_lo - /** + * Alternative Device I/O Control entry point on hosts with SMAP support. + * @@ -115,7 +93,7 @@ * Deal with the 'slow' I/O control requests. * * @returns 0 on success, appropriate errno on failure. -@@ -373,11 +443,10 @@ static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSes +@@ -372,11 +428,10 @@ static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSes */ SUPREQHDR Hdr; pvUser = *(void **)pvData; @@ -130,7 +108,7 @@ } if (RT_UNLIKELY((Hdr.fFlags & SUPREQHDR_FLAGS_MAGIC_MASK) != SUPREQHDR_FLAGS_MAGIC)) { -@@ -402,13 +471,12 @@ static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSes +@@ -401,13 +456,12 @@ static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSes OSDBGPRINT(("VBoxDrvFreeBSDIOCtlSlow: failed to allocate buffer of %d bytes; ulCmd=%#lx\n", cbReq, ulCmd)); return ENOMEM; } @@ -148,7 +126,7 @@ } if (Hdr.cbIn < cbReq) RT_BZERO((uint8_t *)pHdr + Hdr.cbIn, cbReq - Hdr.cbIn); -@@ -436,9 +504,8 @@ static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSes +@@ -435,9 +489,8 @@ static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSes OSDBGPRINT(("VBoxDrvFreeBSDIOCtlSlow: too much output! %#x > %#x; uCmd=%#lx!\n", cbOut, cbReq, ulCmd)); cbOut = cbReq; } @@ -160,7 +138,7 @@ Log(("VBoxDrvFreeBSDIOCtlSlow: returns %d / %d ulCmd=%lx\n", 0, pHdr->rc, ulCmd)); -@@ -541,8 +608,7 @@ bool VBOXCALL supdrvOSGetForcedAsyncTscMode(PSUPDRVDE +@@ -540,8 +593,7 @@ bool VBOXCALL supdrvOSGetForcedAsyncTscMode(PSUPDRVDE bool VBOXCALL supdrvOSAreCpusOfflinedOnSuspend(void) { @@ -170,7 +148,7 @@ } -@@ -616,11 +682,25 @@ int VBOXCALL supdrvOSMsrProberModify(RTCPUID idCpu, +@@ -624,11 +676,25 @@ int VBOXCALL supdrvOSMsrProberModify(RTCPUID idCpu, #endif /* SUPDRV_WITH_MSR_PROBER */ @@ -196,7 +174,7 @@ va_start(va, pszFormat); cch = RTStrPrintfV(szMsg, sizeof(szMsg), pszFormat, va); -@@ -628,12 +708,19 @@ SUPR0DECL(int) SUPR0Printf(const char *pszFormat, ...) +@@ -636,12 +702,19 @@ SUPR0DECL(int) SUPR0Printf(const char *pszFormat, ...) printf("%s", szMsg); Index: emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_VBoxNetAdp_freebsd_Makefile =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_VBoxNetAdp_freebsd_Makefile (nonexistent) +++ emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_VBoxNetAdp_freebsd_Makefile (working copy) @@ -0,0 +1,11 @@ +--- src/VBox/HostDrivers/VBoxNetAdp/freebsd/Makefile.orig 2019-05-13 13:33:07 UTC ++++ src/VBox/HostDrivers/VBoxNetAdp/freebsd/Makefile +@@ -26,7 +26,7 @@ + + KMOD = vboxnetadp + +-CFLAGS += -DRT_OS_FREEBSD -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX -Iinclude -I. -Ir0drv -w -DVBOX_WITH_HARDENING -DVIMAGE ++CFLAGS += -DRT_OS_FREEBSD -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX -DVBOX_WITH_HARDENING -DVBOX_WITH_64_BITS_GUESTS -DVIMAGE -Iinclude -I. -Ir0drv -w + + .if (${MACHINE_ARCH} == "i386") + CFLAGS += -DRT_ARCH_X86 Property changes on: emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_VBoxNetAdp_freebsd_Makefile ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_VBoxNetFlt_Makefile.kmk =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_VBoxNetFlt_Makefile.kmk (nonexistent) +++ emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_VBoxNetFlt_Makefile.kmk (working copy) @@ -0,0 +1,11 @@ +--- src/VBox/HostDrivers/VBoxNetFlt/Makefile.kmk.orig 2019-05-13 13:33:07 UTC ++++ src/VBox/HostDrivers/VBoxNetFlt/Makefile.kmk +@@ -565,7 +565,7 @@ $(PATH_OUT)/opt_netgraph.h: + $(QUIET)$(RM) -f -- $@ + $(QUIET)$(CP) -f $< $@ + ifndef VBOX_WITH_HARDENING +- $(QUIET)$(SED) -e "s;VBOX_WITH_HARDENING;;g" --output $@.tmp $@ ++ $(QUIET)$(SED) -e "s;-DVBOX_WITH_HARDENING;;g" --output $@.tmp $@ + ${QUIET}$(MV) -f $@.tmp $@ + endif + ifndef VBOX_WITH_NETFLT_VIMAGE Property changes on: emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_VBoxNetFlt_Makefile.kmk ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_VBoxNetFlt_freebsd_Makefile =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_VBoxNetFlt_freebsd_Makefile (nonexistent) +++ emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_VBoxNetFlt_freebsd_Makefile (working copy) @@ -0,0 +1,11 @@ +--- src/VBox/HostDrivers/VBoxNetFlt/freebsd/Makefile.orig 2019-05-13 13:33:07 UTC ++++ src/VBox/HostDrivers/VBoxNetFlt/freebsd/Makefile +@@ -26,7 +26,7 @@ + + KMOD = vboxnetflt + +-CFLAGS += -DRT_OS_FREEBSD -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX -Iinclude -I. -Ir0drv -w -DVBOX_WITH_HARDENING -DVIMAGE ++CFLAGS += -DRT_OS_FREEBSD -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX -DVBOX_WITH_HARDENING -DVBOX_WITH_64_BITS_GUESTS -DVIMAGE -Iinclude -I. -Ir0drv -w + + .if (${MACHINE_ARCH} == "i386") + CFLAGS += -DRT_ARCH_X86 Property changes on: emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_VBoxNetFlt_freebsd_Makefile ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: emulators/virtualbox-ose/files/patch-src_VBox_Main_include_USBProxyBackend.h =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_Main_include_USBProxyBackend.h (revision 501807) +++ emulators/virtualbox-ose/files/patch-src_VBox_Main_include_USBProxyBackend.h (nonexistent) @@ -1,17 +0,0 @@ ---- src/VBox/Main/include/USBProxyBackend.h.orig 2017-01-17 07:27:19 UTC -+++ src/VBox/Main/include/USBProxyBackend.h -@@ -359,13 +359,10 @@ public: - virtual int releaseDevice(HostUSBDevice *aDevice); - - protected: -- int initUsbfs(void); -- int initSysfs(void); - virtual int wait(RTMSINTERVAL aMillies); - virtual int interruptWait(void); - virtual PUSBDEVICE getDevices(void); -- int addDeviceToChain(PUSBDEVICE pDev, PUSBDEVICE *ppFirst, PUSBDEVICE **pppNext, int rc); -- virtual void deviceAdded(ComObjPtr &aDevice, SessionMachinesList &llOpenedMachines, PUSBDEVICE aUSBDevice); -+ virtual bool isFakeUpdateRequired(); - - private: - RTSEMEVENT mNotifyEventSem; Property changes on: emulators/virtualbox-ose/files/patch-src_VBox_Main_include_USBProxyBackend.h ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: emulators/virtualbox-ose/files/patch-src_VBox_Main_src-client_ConsoleImpl2.cpp =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_Main_src-client_ConsoleImpl2.cpp (revision 501807) +++ emulators/virtualbox-ose/files/patch-src_VBox_Main_src-client_ConsoleImpl2.cpp (nonexistent) @@ -1,20 +0,0 @@ ---- src/VBox/Main/src-client/ConsoleImpl2.cpp.orig 2017-10-18 07:12:56 UTC -+++ src/VBox/Main/src-client/ConsoleImpl2.cpp -@@ -5206,7 +5206,7 @@ int Console::i_configNetwork(const char *pszDevice, - { - switch (hrc) - { -- case VERR_ACCESS_DENIED: -+ case (HRESULT)VERR_ACCESS_DENIED: - return VMSetError(VMR3GetVM(mpUVM), VERR_HOSTIF_INIT_FAILED, RT_SRC_POS, N_( - "Failed to open '/dev/net/tun' for read/write access. Please check the " - "permissions of that node. Either run 'chmod 0666 /dev/net/tun' or " -@@ -5408,7 +5408,7 @@ int Console::i_configNetwork(const char *pszDevice, - { - switch (hrc) - { -- case VERR_ACCESS_DENIED: -+ case (HRESULT)VERR_ACCESS_DENIED: - return VMSetError(VMR3GetVM(mpUVM), VERR_HOSTIF_INIT_FAILED, RT_SRC_POS, N_( - "Failed to open '/dev/%s' for read/write access. Please check the " - "permissions of that node, and that the net.link.tap.user_open " Property changes on: emulators/virtualbox-ose/files/patch-src_VBox_Main_src-client_ConsoleImpl2.cpp ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: emulators/virtualbox-ose/files/patch-src_VBox_Main_src-server_freebsd_NetIf-freebsd.cpp =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_Main_src-server_freebsd_NetIf-freebsd.cpp (revision 501807) +++ emulators/virtualbox-ose/files/patch-src_VBox_Main_src-server_freebsd_NetIf-freebsd.cpp (nonexistent) @@ -1,19 +0,0 @@ ---- src/VBox/Main/src-server/freebsd/NetIf-freebsd.cpp.orig 2017-10-18 07:12:58 UTC -+++ src/VBox/Main/src-server/freebsd/NetIf-freebsd.cpp -@@ -43,6 +43,7 @@ - - #include - #include -+#include - - #include - #include -@@ -311,7 +312,7 @@ int NetIfList(std::list wireless = isWireless(pNew->szName); -+ pNew->fWireless = isWireless(pNew->szName); - - ComObjPtr IfObj; - IfObj.createObject(); Property changes on: emulators/virtualbox-ose/files/patch-src_VBox_Main_src-server_freebsd_NetIf-freebsd.cpp ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: emulators/virtualbox-ose/files/patch-src_VBox_Runtime_common_err_RTErrConvertFromErrno.cpp =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_Runtime_common_err_RTErrConvertFromErrno.cpp (revision 501807) +++ emulators/virtualbox-ose/files/patch-src_VBox_Runtime_common_err_RTErrConvertFromErrno.cpp (nonexistent) @@ -1,11 +0,0 @@ ---- src/VBox/Runtime/common/err/RTErrConvertFromErrno.cpp.orig 2018-01-15 14:56:07 UTC -+++ src/VBox/Runtime/common/err/RTErrConvertFromErrno.cpp -@@ -302,7 +302,7 @@ RTDECL(int) RTErrConvertFromErrno(unsigned uNativeCod - case EILSEQ: return VERR_NO_TRANSLATION; - #endif - #ifdef ERESTART -- case ERESTART: return VERR_INTERRUPTED;/** @todo fix duplicate error?*/ -+ case (unsigned)ERESTART: return VERR_INTERRUPTED;/** @todo fix duplicate error?*/ - #endif - #ifdef ESTRPIPE - //case ESTRPIPE 86 /* Streams pipe error */ Property changes on: emulators/virtualbox-ose/files/patch-src_VBox_Runtime_common_err_RTErrConvertFromErrno.cpp ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_memobj-r0drv-freebsd.c =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_memobj-r0drv-freebsd.c (revision 501807) +++ emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_memobj-r0drv-freebsd.c (working copy) @@ -1,6 +1,6 @@ ---- src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c.orig 2018-10-15 14:31:31 UTC +--- src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c.orig 2019-04-16 10:17:21 UTC +++ src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c -@@ -105,6 +105,7 @@ static vm_map_t rtR0MemObjFreeBSDGetMap(PRTR0MEMOBJINT +@@ -130,6 +130,7 @@ static vm_map_t rtR0MemObjFreeBSDGetMap(PRTR0MEMOBJINT DECLHIDDEN(int) rtR0MemObjNativeFree(RTR0MEMOBJ pMem) { @@ -8,7 +8,7 @@ PRTR0MEMOBJFREEBSD pMemFreeBSD = (PRTR0MEMOBJFREEBSD)pMem; int rc; -@@ -121,16 +122,15 @@ DECLHIDDEN(int) rtR0MemObjNativeFree(RTR0MEMOBJ pMem) +@@ -146,16 +147,15 @@ DECLHIDDEN(int) rtR0MemObjNativeFree(RTR0MEMOBJ pMem) case RTR0MEMOBJTYPE_LOCK: { @@ -30,7 +30,7 @@ break; } -@@ -194,6 +194,7 @@ DECLHIDDEN(int) rtR0MemObjNativeFree(RTR0MEMOBJ pMem) +@@ -211,6 +211,7 @@ DECLHIDDEN(int) rtR0MemObjNativeFree(RTR0MEMOBJ pMem) return VERR_INTERNAL_ERROR; } @@ -38,84 +38,8 @@ return VINF_SUCCESS; } -@@ -224,18 +225,23 @@ static vm_page_t rtR0MemObjFreeBSDContigPhysAllocHelpe - #else - VM_OBJECT_UNLOCK(pObject); - #endif -- if (pPages) -+ if (pPages || cTries >= 1) - break; -+#if __FreeBSD_version >= 1100092 -+ if (!vm_page_reclaim_contig(fFlags, cPages, 0, VmPhysAddrHigh, uAlignment, 0)) -+ break; -+#elif __FreeBSD_version >= 1000015 - vm_pageout_grow_cache(cTries, 0, VmPhysAddrHigh); -+#else -+ vm_contig_grow_cache(cTries, 0, VmPhysAddrHigh); -+#endif - cTries++; - } -- -- return pPages; - #else -- while (cTries <= 1) -+ while (1) - { - pPages = vm_phys_alloc_contig(cPages, 0, VmPhysAddrHigh, uAlignment, 0); -- if (pPages) -+ if (pPages || cTries >= 1) - break; - vm_contig_grow_cache(cTries, 0, VmPhysAddrHigh); - cTries++; -@@ -243,11 +249,8 @@ static vm_page_t rtR0MemObjFreeBSDContigPhysAllocHelpe - - if (!pPages) - return pPages; --#if __FreeBSD_version >= 1000030 -- VM_OBJECT_WLOCK(pObject); --#else -+ - VM_OBJECT_LOCK(pObject); --#endif - for (vm_pindex_t iPage = 0; iPage < cPages; iPage++) - { - vm_page_t pPage = pPages + iPage; -@@ -259,13 +262,9 @@ static vm_page_t rtR0MemObjFreeBSDContigPhysAllocHelpe - atomic_add_int(&cnt.v_wire_count, 1); - } - } --#if __FreeBSD_version >= 1000030 -- VM_OBJECT_WUNLOCK(pObject); --#else - VM_OBJECT_UNLOCK(pObject); - #endif - return pPages; --#endif +@@ -362,58 +363,77 @@ static int rtR0MemObjFreeBSDAllocHelper(PRTR0MEMOBJFRE } - - static int rtR0MemObjFreeBSDPhysAllocHelper(vm_object_t pObject, u_long cPages, -@@ -292,16 +291,17 @@ static int rtR0MemObjFreeBSDPhysAllocHelper(vm_object_ - #else - VM_OBJECT_LOCK(pObject); - #endif -+ - while (iPage-- > 0) - { - pPage = vm_page_lookup(pObject, iPage); --#if __FreeBSD_version < 1000000 -+#if __FreeBSD_version < 900000 - vm_page_lock_queues(); - #endif - if (fWire) - vm_page_unwire(pPage, 0); - vm_page_free(pPage); --#if __FreeBSD_version < 1000000 -+#if __FreeBSD_version < 900000 - vm_page_unlock_queues(); - #endif - } -@@ -364,58 +364,77 @@ static int rtR0MemObjFreeBSDAllocHelper(PRTR0MEMOBJFRE - } DECLHIDDEN(int) rtR0MemObjNativeAllocPage(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, bool fExecutable) { + IPRT_FREEBSD_SAVE_EFL_AC(); @@ -192,7 +116,7 @@ return rc; } -@@ -425,6 +444,7 @@ static int rtR0MemObjFreeBSDAllocPhysPages(PPRTR0MEMOB +@@ -423,6 +443,7 @@ static int rtR0MemObjFreeBSDAllocPhysPages(PPRTR0MEMOB RTHCPHYS PhysHighest, size_t uAlignment, bool fContiguous, int rcNoMem) { @@ -200,7 +124,7 @@ uint32_t cPages = atop(cb); vm_paddr_t VmPhysAddrHigh; -@@ -432,7 +452,10 @@ static int rtR0MemObjFreeBSDAllocPhysPages(PPRTR0MEMOB +@@ -430,7 +451,10 @@ static int rtR0MemObjFreeBSDAllocPhysPages(PPRTR0MEMOB PRTR0MEMOBJFREEBSD pMemFreeBSD = (PRTR0MEMOBJFREEBSD)rtR0MemObjNew(sizeof(*pMemFreeBSD), enmType, NULL, cb); if (!pMemFreeBSD) @@ -211,7 +135,7 @@ pMemFreeBSD->pObject = vm_object_allocate(OBJT_PHYS, atop(cb)); -@@ -470,6 +493,7 @@ static int rtR0MemObjFreeBSDAllocPhysPages(PPRTR0MEMOB +@@ -460,6 +484,7 @@ static int rtR0MemObjFreeBSDAllocPhysPages(PPRTR0MEMOB rtR0MemObjDelete(&pMemFreeBSD->Core); } @@ -219,7 +143,7 @@ return rc; } -@@ -489,17 +513,22 @@ DECLHIDDEN(int) rtR0MemObjNativeAllocPhysNC(PPRTR0MEMO +@@ -479,17 +504,22 @@ DECLHIDDEN(int) rtR0MemObjNativeAllocPhysNC(PPRTR0MEMO DECLHIDDEN(int) rtR0MemObjNativeEnterPhys(PPRTR0MEMOBJINTERNAL ppMem, RTHCPHYS Phys, size_t cb, uint32_t uCachePolicy) { AssertReturn(uCachePolicy == RTMEM_CACHE_POLICY_DONT_CARE, VERR_NOT_SUPPORTED); @@ -242,7 +166,7 @@ return VINF_SUCCESS; } -@@ -511,6 +540,7 @@ static int rtR0MemObjNativeLockInMap(PPRTR0MEMOBJINTER +@@ -501,6 +531,7 @@ static int rtR0MemObjNativeLockInMap(PPRTR0MEMOBJINTER vm_offset_t AddrStart, size_t cb, uint32_t fAccess, RTR0PROCESS R0Process, int fFlags) { @@ -250,7 +174,7 @@ int rc; NOREF(fAccess); -@@ -519,21 +549,28 @@ static int rtR0MemObjNativeLockInMap(PPRTR0MEMOBJINTER +@@ -509,21 +540,28 @@ static int rtR0MemObjNativeLockInMap(PPRTR0MEMOBJINTER if (!pMemFreeBSD) return VERR_NO_MEMORY; @@ -287,7 +211,7 @@ return VERR_NO_MEMORY;/** @todo fix mach -> vbox error conversion for freebsd. */ } -@@ -569,6 +606,7 @@ DECLHIDDEN(int) rtR0MemObjNativeLockKernel(PPRTR0MEMOB +@@ -559,6 +597,7 @@ DECLHIDDEN(int) rtR0MemObjNativeLockKernel(PPRTR0MEMOB */ static int rtR0MemObjNativeReserveInMap(PPRTR0MEMOBJINTERNAL ppMem, void *pvFixed, size_t cb, size_t uAlignment, RTR0PROCESS R0Process, vm_map_t pMap) { @@ -295,7 +219,7 @@ int rc; /* -@@ -626,11 +664,13 @@ static int rtR0MemObjNativeReserveInMap(PPRTR0MEMOBJIN +@@ -616,11 +655,13 @@ static int rtR0MemObjNativeReserveInMap(PPRTR0MEMOBJIN pMemFreeBSD->Core.pv = (void *)MapAddress; pMemFreeBSD->Core.u.ResVirt.R0Process = R0Process; *ppMem = &pMemFreeBSD->Core; @@ -309,7 +233,7 @@ return rc; } -@@ -652,6 +692,8 @@ DECLHIDDEN(int) rtR0MemObjNativeReserveUser(PPRTR0MEMO +@@ -642,6 +683,8 @@ DECLHIDDEN(int) rtR0MemObjNativeReserveUser(PPRTR0MEMO DECLHIDDEN(int) rtR0MemObjNativeMapKernel(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, void *pvFixed, size_t uAlignment, unsigned fProt, size_t offSub, size_t cbSub) { @@ -318,7 +242,7 @@ // AssertMsgReturn(!offSub && !cbSub, ("%#x %#x\n", offSub, cbSub), VERR_NOT_SUPPORTED); AssertMsgReturn(pvFixed == (void *)-1, ("%p\n", pvFixed), VERR_NOT_SUPPORTED); -@@ -707,6 +749,7 @@ DECLHIDDEN(int) rtR0MemObjNativeMapKernel(PPRTR0MEMOBJ +@@ -697,6 +740,7 @@ DECLHIDDEN(int) rtR0MemObjNativeMapKernel(PPRTR0MEMOBJ Assert((vm_offset_t)pMemFreeBSD->Core.pv == Addr); pMemFreeBSD->Core.u.Mapping.R0Process = NIL_RTR0PROCESS; *ppMem = &pMemFreeBSD->Core; @@ -326,7 +250,7 @@ return VINF_SUCCESS; } rc = vm_map_remove(kernel_map, Addr, Addr + cbSub); -@@ -715,6 +758,7 @@ DECLHIDDEN(int) rtR0MemObjNativeMapKernel(PPRTR0MEMOBJ +@@ -705,6 +749,7 @@ DECLHIDDEN(int) rtR0MemObjNativeMapKernel(PPRTR0MEMOBJ else vm_object_deallocate(pMemToMapFreeBSD->pObject); @@ -334,7 +258,7 @@ return VERR_NO_MEMORY; } -@@ -722,6 +766,8 @@ DECLHIDDEN(int) rtR0MemObjNativeMapKernel(PPRTR0MEMOBJ +@@ -712,6 +757,8 @@ DECLHIDDEN(int) rtR0MemObjNativeMapKernel(PPRTR0MEMOBJ DECLHIDDEN(int) rtR0MemObjNativeMapUser(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, RTR3PTR R3PtrFixed, size_t uAlignment, unsigned fProt, RTR0PROCESS R0Process) { @@ -343,21 +267,7 @@ /* * Check for unsupported stuff. */ -@@ -751,7 +797,12 @@ DECLHIDDEN(int) rtR0MemObjNativeMapUser(PPRTR0MEMOBJIN - { - /** @todo is this needed?. */ - PROC_LOCK(pProc); -- AddrR3 = round_page((vm_offset_t)pProc->p_vmspace->vm_daddr + lim_max(pProc, RLIMIT_DATA)); -+ AddrR3 = round_page((vm_offset_t)pProc->p_vmspace->vm_daddr + -+#if __FreeBSD_version >= 1100077 -+ lim_max_proc(pProc, RLIMIT_DATA)); -+#else -+ lim_max(pProc, RLIMIT_DATA)); -+#endif - PROC_UNLOCK(pProc); - } - else -@@ -793,6 +844,7 @@ DECLHIDDEN(int) rtR0MemObjNativeMapUser(PPRTR0MEMOBJIN +@@ -783,6 +830,7 @@ DECLHIDDEN(int) rtR0MemObjNativeMapUser(PPRTR0MEMOBJIN Assert((vm_offset_t)pMemFreeBSD->Core.pv == AddrR3); pMemFreeBSD->Core.u.Mapping.R0Process = R0Process; *ppMem = &pMemFreeBSD->Core; @@ -365,7 +275,7 @@ return VINF_SUCCESS; } -@@ -802,19 +854,25 @@ DECLHIDDEN(int) rtR0MemObjNativeMapUser(PPRTR0MEMOBJIN +@@ -792,19 +840,25 @@ DECLHIDDEN(int) rtR0MemObjNativeMapUser(PPRTR0MEMOBJIN else vm_object_deallocate(pMemToMapFreeBSD->pObject); @@ -391,7 +301,7 @@ if ((fProt & RTMEM_PROT_NONE) == RTMEM_PROT_NONE) ProtectionFlags = VM_PROT_NONE; -@@ -826,6 +884,7 @@ DECLHIDDEN(int) rtR0MemObjNativeProtect(PRTR0MEMOBJINT +@@ -816,6 +870,7 @@ DECLHIDDEN(int) rtR0MemObjNativeProtect(PRTR0MEMOBJINT ProtectionFlags |= VM_PROT_EXECUTE; int krc = vm_map_protect(pVmMap, AddrStart, AddrEnd, ProtectionFlags, FALSE); @@ -399,7 +309,7 @@ if (krc == KERN_SUCCESS) return VINF_SUCCESS; -@@ -850,11 +909,19 @@ DECLHIDDEN(RTHCPHYS) rtR0MemObjNativeGetPagePhysAddr(P +@@ -840,11 +895,19 @@ DECLHIDDEN(RTHCPHYS) rtR0MemObjNativeGetPagePhysAddr(P vm_offset_t pb = (vm_offset_t)pMemFreeBSD->Core.pv + ptoa(iPage); @@ -423,7 +333,7 @@ } case RTR0MEMOBJTYPE_MAPPING: -@@ -863,11 +930,15 @@ DECLHIDDEN(RTHCPHYS) rtR0MemObjNativeGetPagePhysAddr(P +@@ -853,11 +916,15 @@ DECLHIDDEN(RTHCPHYS) rtR0MemObjNativeGetPagePhysAddr(P if (pMemFreeBSD->Core.u.Mapping.R0Process != NIL_RTR0PROCESS) { @@ -440,18 +350,14 @@ } return vtophys(pb); } -@@ -877,6 +948,7 @@ DECLHIDDEN(RTHCPHYS) rtR0MemObjNativeGetPagePhysAddr(P - case RTR0MEMOBJTYPE_PHYS_NC: +@@ -868,9 +935,11 @@ DECLHIDDEN(RTHCPHYS) rtR0MemObjNativeGetPagePhysAddr(P { RTHCPHYS addr; + + IPRT_FREEBSD_SAVE_EFL_AC(); - #if __FreeBSD_version >= 1000030 VM_OBJECT_WLOCK(pMemFreeBSD->pObject); - #else -@@ -888,6 +960,7 @@ DECLHIDDEN(RTHCPHYS) rtR0MemObjNativeGetPagePhysAddr(P - #else - VM_OBJECT_UNLOCK(pMemFreeBSD->pObject); - #endif + addr = VM_PAGE_TO_PHYS(vm_page_lookup(pMemFreeBSD->pObject, iPage)); + VM_OBJECT_WUNLOCK(pMemFreeBSD->pObject); + IPRT_FREEBSD_RESTORE_EFL_AC(); return addr; } Index: emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_mp-r0drv-freebsd.c =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_mp-r0drv-freebsd.c (revision 501807) +++ emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_mp-r0drv-freebsd.c (working copy) @@ -1,22 +1,6 @@ ---- src/VBox/Runtime/r0drv/freebsd/mp-r0drv-freebsd.c.orig 2018-10-15 14:31:31 UTC +--- src/VBox/Runtime/r0drv/freebsd/mp-r0drv-freebsd.c.orig 2019-04-16 10:17:21 UTC +++ src/VBox/Runtime/r0drv/freebsd/mp-r0drv-freebsd.c -@@ -36,6 +36,15 @@ - #include - #include "r0drv/mp-r0drv.h" - -+#if __FreeBSD_version >= 700000 && __FreeBSD_version < 900000 -+#define cpuset_t cpumask_t -+#define all_cpus (~(cpumask_t)0) -+#define CPU_CLR(n, p) do { *(p) &= ~((cpumask_t)1 << (n)); } while (0) -+#define CPU_SETOF(n, p) do { *(p) = (cpumask_t)1 << (n); } while (0) -+#endif -+#if __FreeBSD_version < 1200028 -+#define smp_no_rendezvous_barrier smp_no_rendevous_barrier -+#endif - - RTDECL(RTCPUID) RTMpCpuId(void) - { -@@ -143,7 +152,9 @@ RTDECL(RTCPUID) RTMpGetOnlineCount(void) +@@ -147,7 +147,9 @@ RTDECL(RTCPUID) RTMpGetOnlineCount(void) static void rtmpOnAllFreeBSDWrapper(void *pvArg) { PRTMPARGS pArgs = (PRTMPARGS)pvArg; @@ -26,18 +10,17 @@ } -@@ -155,7 +166,9 @@ RTDECL(int) RTMpOnAll(PFNRTMPWORKER pfnWorker, void *p +@@ -159,7 +161,9 @@ RTDECL(int) RTMpOnAll(PFNRTMPWORKER pfnWorker, void *p Args.pvUser2 = pvUser2; Args.idCpu = NIL_RTCPUID; Args.cHits = 0; -- smp_rendezvous(NULL, rtmpOnAllFreeBSDWrapper, smp_no_rendevous_barrier, &Args); + IPRT_FREEBSD_SAVE_EFL_AC(); -+ smp_rendezvous(NULL, rtmpOnAllFreeBSDWrapper, smp_no_rendezvous_barrier, &Args); + smp_rendezvous(NULL, rtmpOnAllFreeBSDWrapper, smp_no_rendezvous_barrier, &Args); + IPRT_FREEBSD_RESTORE_EFL_AC(); return VINF_SUCCESS; } -@@ -171,7 +184,11 @@ static void rtmpOnOthersFreeBSDWrapper(void *pvArg) +@@ -175,7 +179,11 @@ static void rtmpOnOthersFreeBSDWrapper(void *pvArg) PRTMPARGS pArgs = (PRTMPARGS)pvArg; RTCPUID idCpu = curcpu; if (pArgs->idCpu != idCpu) @@ -49,35 +32,15 @@ } -@@ -180,10 +197,8 @@ RTDECL(int) RTMpOnOthers(PFNRTMPWORKER pfnWorker, void - /* Will panic if no rendezvousing cpus, so check up front. */ - if (RTMpGetOnlineCount() > 1) - { --#if __FreeBSD_version >= 900000 -- cpuset_t Mask; --#elif __FreeBSD_version >= 700000 -- cpumask_t Mask; -+#if __FreeBSD_version >= 700000 -+ cpuset_t Cpus; - #endif - RTMPARGS Args; - -@@ -192,17 +207,15 @@ RTDECL(int) RTMpOnOthers(PFNRTMPWORKER pfnWorker, void +@@ -196,6 +204,7 @@ RTDECL(int) RTMpOnOthers(PFNRTMPWORKER pfnWorker, void Args.pvUser2 = pvUser2; Args.idCpu = RTMpCpuId(); Args.cHits = 0; + IPRT_FREEBSD_SAVE_EFL_AC(); #if __FreeBSD_version >= 700000 --# if __FreeBSD_version >= 900000 -- Mask = all_cpus; -- CPU_CLR(curcpu, &Mask); --# else -- Mask = ~(cpumask_t)curcpu; --# endif -- smp_rendezvous_cpus(Mask, NULL, rtmpOnOthersFreeBSDWrapper, smp_no_rendevous_barrier, &Args); -+ Cpus = all_cpus; -+ CPU_CLR(curcpu, &Cpus); -+ smp_rendezvous_cpus(Cpus, NULL, rtmpOnOthersFreeBSDWrapper, smp_no_rendezvous_barrier, &Args); + # if __FreeBSD_version >= 900000 + Mask = all_cpus; +@@ -207,6 +216,7 @@ RTDECL(int) RTMpOnOthers(PFNRTMPWORKER pfnWorker, void #else smp_rendezvous(NULL, rtmpOnOthersFreeBSDWrapper, NULL, &Args); #endif @@ -85,7 +48,7 @@ } return VINF_SUCCESS; } -@@ -220,18 +233,18 @@ static void rtmpOnSpecificFreeBSDWrapper(void *pvArg) +@@ -224,8 +234,10 @@ static void rtmpOnSpecificFreeBSDWrapper(void *pvArg) RTCPUID idCpu = curcpu; if (pArgs->idCpu == idCpu) { @@ -96,32 +59,15 @@ } } - - RTDECL(int) RTMpOnSpecific(RTCPUID idCpu, PFNRTMPWORKER pfnWorker, void *pvUser1, void *pvUser2) - { --#if __FreeBSD_version >= 900000 -- cpuset_t Mask; --#elif __FreeBSD_version >= 700000 -- cpumask_t Mask; -+#if __FreeBSD_version >= 700000 -+ cpuset_t Cpus; - #endif - RTMPARGS Args; - -@@ -244,16 +257,14 @@ RTDECL(int) RTMpOnSpecific(RTCPUID idCpu, PFNRTMPWORKE +@@ -248,6 +260,7 @@ RTDECL(int) RTMpOnSpecific(RTCPUID idCpu, PFNRTMPWORKE Args.pvUser2 = pvUser2; Args.idCpu = idCpu; Args.cHits = 0; + IPRT_FREEBSD_SAVE_EFL_AC(); #if __FreeBSD_version >= 700000 --# if __FreeBSD_version >= 900000 -- CPU_SETOF(idCpu, &Mask); --# else -- Mask = (cpumask_t)1 << idCpu; --# endif -- smp_rendezvous_cpus(Mask, NULL, rtmpOnSpecificFreeBSDWrapper, smp_no_rendevous_barrier, &Args); -+ CPU_SETOF(idCpu, &Cpus); -+ smp_rendezvous_cpus(Cpus, NULL, rtmpOnSpecificFreeBSDWrapper, smp_no_rendezvous_barrier, &Args); + # if __FreeBSD_version >= 900000 + CPU_SETOF(idCpu, &Mask); +@@ -258,6 +271,7 @@ RTDECL(int) RTMpOnSpecific(RTCPUID idCpu, PFNRTMPWORKE #else smp_rendezvous(NULL, rtmpOnSpecificFreeBSDWrapper, NULL, &Args); #endif @@ -129,30 +75,17 @@ return Args.cHits == 1 ? VINF_SUCCESS : VERR_CPU_NOT_FOUND; -@@ -273,22 +284,16 @@ static void rtmpFreeBSDPokeCallback(void *pvArg) - - RTDECL(int) RTMpPokeCpu(RTCPUID idCpu) - { --#if __FreeBSD_version >= 900000 -- cpuset_t Mask; --#elif __FreeBSD_version >= 700000 -- cpumask_t Mask; --#endif -+ cpuset_t Cpus; - - /* Will panic if no rendezvousing cpus, so make sure the cpu is online. */ +@@ -287,12 +301,14 @@ RTDECL(int) RTMpPokeCpu(RTCPUID idCpu) if (!RTMpIsCpuOnline(idCpu)) return VERR_CPU_NOT_FOUND; --# if __FreeBSD_version >= 900000 -- CPU_SETOF(idCpu, &Mask); --# else -- Mask = (cpumask_t)1 << idCpu; --# endif -- smp_rendezvous_cpus(Mask, NULL, rtmpFreeBSDPokeCallback, smp_no_rendevous_barrier, NULL); + IPRT_FREEBSD_SAVE_EFL_AC(); -+ CPU_SETOF(idCpu, &Cpus); -+ smp_rendezvous_cpus(Cpus, NULL, rtmpFreeBSDPokeCallback, smp_no_rendezvous_barrier, NULL); + # if __FreeBSD_version >= 900000 + CPU_SETOF(idCpu, &Mask); + # else + Mask = (cpumask_t)1 << idCpu; + # endif + smp_rendezvous_cpus(Mask, NULL, rtmpFreeBSDPokeCallback, smp_no_rendezvous_barrier, NULL); + IPRT_FREEBSD_RESTORE_EFL_AC(); return VINF_SUCCESS; Index: emulators/virtualbox-ose/files/patch-src_VBox_VMM_VMMR0_GVMMR0.cpp =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_VMM_VMMR0_GVMMR0.cpp (revision 501807) +++ emulators/virtualbox-ose/files/patch-src_VBox_VMM_VMMR0_GVMMR0.cpp (nonexistent) @@ -1,11 +0,0 @@ ---- src/VBox/VMM/VMMR0/GVMMR0.cpp.orig 2018-01-15 14:56:33.000000000 +0000 -+++ src/VBox/VMM/VMMR0/GVMMR0.cpp 2018-01-17 01:13:24.832105000 +0000 -@@ -1243,7 +1243,7 @@ static void gvmmR0CleanupVM(PGVM pGVM) - - GMMR0CleanupVM(pGVM); - -- AssertCompile((uintptr_t)NIL_RTTHREADCTXHOOK == 0); /* Depends on zero initialized memory working for NIL at the moment. */ -+ AssertCompile(NIL_RTTHREADCTXHOOK == (RTTHREADCTXHOOK)0); /* Depends on zero initialized memory working for NIL at the moment. */ - for (VMCPUID idCpu = 0; idCpu < pGVM->cCpus; idCpu++) - { - /** @todo Can we busy wait here for all thread-context hooks to be Property changes on: emulators/virtualbox-ose/files/patch-src_VBox_VMM_VMMR0_GVMMR0.cpp ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: emulators/virtualbox-ose/files/patch-src_VBox_VMM_VMMR3_VMReq.cpp =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_VMM_VMMR3_VMReq.cpp (revision 501807) +++ emulators/virtualbox-ose/files/patch-src_VBox_VMM_VMMR3_VMReq.cpp (nonexistent) @@ -1,11 +0,0 @@ ---- src/VBox/VMM/VMMR3/VMReq.cpp.orig 2018-01-15 14:56:37 UTC -+++ src/VBox/VMM/VMMR3/VMReq.cpp -@@ -669,7 +669,7 @@ VMMR3DECL(int) VMR3ReqAlloc(PUVM pUVM, PVMREQ *ppReq, - Assert(pReq->enmType == VMREQTYPE_INVALID); - Assert(pReq->enmState == VMREQSTATE_FREE); - Assert(pReq->pUVM == pUVM); -- ASMAtomicXchgSize(&pReq->pNext, NULL); -+ ASMAtomicXchgSize(&pReq->pNext, (uintptr_t)NULL); - pReq->enmState = VMREQSTATE_ALLOCATED; - pReq->iStatus = VERR_VM_REQUEST_STATUS_STILL_PENDING; - pReq->fFlags = VMREQFLAGS_VBOX_STATUS; Property changes on: emulators/virtualbox-ose/files/patch-src_VBox_VMM_VMMR3_VMReq.cpp ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: emulators/virtualbox-ose/files/patch-src_libs_xpcom18a4_nsprpub_pr_src_pthreads_ptsynch.c =================================================================== --- emulators/virtualbox-ose/files/patch-src_libs_xpcom18a4_nsprpub_pr_src_pthreads_ptsynch.c (revision 501807) +++ emulators/virtualbox-ose/files/patch-src_libs_xpcom18a4_nsprpub_pr_src_pthreads_ptsynch.c (working copy) @@ -1,4 +1,4 @@ ---- src/libs/xpcom18a4/nsprpub/pr/src/pthreads/ptsynch.c.orig +--- src/libs/xpcom18a4/nsprpub/pr/src/pthreads/ptsynch.c.orig 2019-04-16 10:18:41 UTC +++ src/libs/xpcom18a4/nsprpub/pr/src/pthreads/ptsynch.c @@ -49,6 +49,9 @@ #include @@ -10,13 +10,11 @@ static pthread_mutexattr_t _pt_mattr; static pthread_condattr_t _pt_cvar_attr; -@@ -798,7 +801,8 @@ +@@ -798,6 +801,7 @@ PR_IMPLEMENT(PRStatus) PR_DeleteSemaphore(const char * * From the semctl(2) man page in glibc 2.0 */ #if (defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED)) \ -- || defined(FREEBSD) || defined(OPENBSD) || defined(BSDI) + || (defined(FREEBSD) && __FreeBSD_version < 1200059) \ -+ || defined(OPENBSD) || defined(BSDI) + || defined(OPENBSD) || defined(BSDI) /* union semun is defined by including */ #else - /* according to X/OPEN we have to define it ourselves */ Index: emulators/virtualbox-ose/pkg-plist =================================================================== --- emulators/virtualbox-ose/pkg-plist (revision 501807) +++ emulators/virtualbox-ose/pkg-plist (working copy) @@ -6,6 +6,7 @@ bin/VBoxManage %%X11%%bin/VBoxSDL bin/VBoxVRDP %%QT%%bin/VirtualBox +%%QT%%bin/VirtualBoxVM bin/vboxautostart bin/vboxballoonctrl bin/vboxbugreport @@ -14,6 +15,7 @@ bin/vboxmanage %%X11%%bin/vboxsdl %%WEBSERVICE%%bin/vboxwebsrv %%QT%%bin/virtualbox +%%QT%%bin/virtualboxvm include/virtualbox/VirtualBox_XPCOM.h include/virtualbox/ipcIClientObserver.h include/virtualbox/ipcIDConnectService.h @@ -385,6 +387,7 @@ lib/virtualbox/VBoxDDU.so lib/virtualbox/VBoxEFI32.fd lib/virtualbox/VBoxEFI64.fd lib/virtualbox/VBoxExtPackHelperApp +%%QT%%lib/virtualbox/VBoxGlobal.so lib/virtualbox/VBoxGuestControlSvc.so lib/virtualbox/VBoxGuestPropSvc.so @(root,%%VBOXGROUP%%,4510) lib/virtualbox/VBoxHeadless @@ -409,6 +412,7 @@ lib/virtualbox/VBoxRT.so %%X11%%@(root,%%VBOXGROUP%%,4510) lib/virtualbox/VBoxSDL %%X11%%lib/virtualbox/VBoxSDL.so lib/virtualbox/VBoxSVC +%%X11%%lib/virtualbox/VBoxSVGA3D.so %%X11%%lib/virtualbox/VBoxSharedClipboard.so %%X11%%lib/virtualbox/VBoxSharedCrOpenGL.so lib/virtualbox/VBoxSharedFolders.so @@ -420,8 +424,9 @@ lib/virtualbox/VBoxXPCOMC.so lib/virtualbox/VBoxXPCOMIPCD lib/virtualbox/VMMR0.r0 lib/virtualbox/VMMRC.rc -%%QT%%@(root,%%VBOXGROUP%%,4510) lib/virtualbox/VirtualBox -%%QT%%lib/virtualbox/VirtualBox.so +%%QT%%lib/virtualbox/VirtualBox +%%QT%%@(root,%%VBOXGROUP%%,4510) lib/virtualbox/VirtualBoxVM +%%QT%%lib/virtualbox/VirtualBoxVM.so %%SDK%%lib/virtualbox/sdk %%WEBSERVICE%%lib/virtualbox/vboxwebsrv %%WEBSERVICE%%lib/virtualbox/webtest Index: emulators/virtualbox-ose-additions/Makefile =================================================================== --- emulators/virtualbox-ose-additions/Makefile (revision 501807) +++ emulators/virtualbox-ose-additions/Makefile (working copy) @@ -2,7 +2,7 @@ # $FreeBSD$ PORTNAME= virtualbox-ose -PORTVERSION= 5.2.30 +PORTVERSION= 6.0.8 CATEGORIES= emulators MASTER_SITES= https://download.oracle.com/virtualbox/${PORTVERSION}/ PKGNAMESUFFIX?= -additions Index: emulators/virtualbox-ose-additions/distinfo =================================================================== --- emulators/virtualbox-ose-additions/distinfo (revision 501807) +++ emulators/virtualbox-ose-additions/distinfo (working copy) @@ -1,3 +1,3 @@ -TIMESTAMP = 1558040644 -SHA256 (VirtualBox-5.2.30.tar.bz2) = caf19d4a5310d63e31e564acb24cb63e412c8ce56193a804e38c7dcc8db35609 -SIZE (VirtualBox-5.2.30.tar.bz2) = 118462289 +TIMESTAMP = 1558045317 +SHA256 (VirtualBox-6.0.8.tar.bz2) = 1b5aa85118c62fb67867b95167b05e66aa154b2caf44c0a3dc932ea5bee85d87 +SIZE (VirtualBox-6.0.8.tar.bz2) = 155404889 Index: emulators/virtualbox-ose-kmod/Makefile =================================================================== --- emulators/virtualbox-ose-kmod/Makefile (revision 501807) +++ emulators/virtualbox-ose-kmod/Makefile (working copy) @@ -2,7 +2,7 @@ # $FreeBSD$ PORTNAME= virtualbox-ose -PORTVERSION= 5.2.30 +PORTVERSION= 6.0.8 CATEGORIES= emulators MASTER_SITES= https://download.oracle.com/virtualbox/${PORTVERSION}/ PKGNAMESUFFIX= -kmod Index: emulators/virtualbox-ose-kmod/distinfo =================================================================== --- emulators/virtualbox-ose-kmod/distinfo (revision 501807) +++ emulators/virtualbox-ose-kmod/distinfo (working copy) @@ -1,3 +1,3 @@ -TIMESTAMP = 1558040644 -SHA256 (VirtualBox-5.2.30.tar.bz2) = caf19d4a5310d63e31e564acb24cb63e412c8ce56193a804e38c7dcc8db35609 -SIZE (VirtualBox-5.2.30.tar.bz2) = 118462289 +TIMESTAMP = 1558045317 +SHA256 (VirtualBox-6.0.8.tar.bz2) = 1b5aa85118c62fb67867b95167b05e66aa154b2caf44c0a3dc932ea5bee85d87 +SIZE (VirtualBox-6.0.8.tar.bz2) = 155404889 Index: emulators/virtualbox-ose-nox11/Makefile =================================================================== --- emulators/virtualbox-ose-nox11/Makefile (revision 501807) +++ emulators/virtualbox-ose-nox11/Makefile (working copy) @@ -2,8 +2,8 @@ PKGNAMESUFFIX= -nox11 -OPTIONS_EXCLUDE= ALSA DBUS DEBUG GUESTADDITIONS MANUAL NLS PULSEAUDIO -OPTIONS_EXCLUDE+= QT5 VPX X11 +OPTIONS_EXCLUDE= ALSA DBUS DEBUG GUESTADDITIONS MANUAL NLS OPUS +OPTIONS_EXCLUDE+= PULSEAUDIO QT5 VPX X11 MASTERDIR= ${.CURDIR}/../virtualbox-ose