View | Details | Raw Unified | Return to bug 234878 | Differences between
and this patch

Collapse All | Expand All

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

Return to bug 234878