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

Collapse All | Expand All

(-)devel/kBuild/Makefile (-6 / +7 lines)
Lines 3-12 Link Here
3
3
4
PORTNAME=	kBuild
4
PORTNAME=	kBuild
5
DISTVERSION=	${KBUILD_VERSION}
5
DISTVERSION=	${KBUILD_VERSION}
6
PORTREVISION=	13
6
PORTREVISION=	14
7
CATEGORIES=	devel
7
CATEGORIES=	devel
8
MASTER_SITES=	LOCAL/jkim
8
MASTER_SITES=	LOCAL/jkim
9
DISTNAME=	${PORTNAME}-${DISTVERSION}r3127-src
9
DISTNAME=	${PORTNAME}-${DISTVERSION}r${KBUILD_SVN_REV}-src
10
10
11
MAINTAINER=	vbox@FreeBSD.org
11
MAINTAINER=	vbox@FreeBSD.org
12
COMMENT=	Makefile framework
12
COMMENT=	Makefile framework
Lines 29-34 KBUILD_ENV= AUTORECONF=${AUTORECONF} \ Link Here
29
		AUTOPOINT=true \
29
		AUTOPOINT=true \
30
		CC="${CC}" CFLAGS="${CFLAGS}" CPPFLAGS="${CPPFLAGS}" \
30
		CC="${CC}" CFLAGS="${CFLAGS}" CPPFLAGS="${CPPFLAGS}" \
31
		LDFLAGS="${LDFLAGS}" MAKE="${MAKE_CMD}"
31
		LDFLAGS="${LDFLAGS}" MAKE="${MAKE_CMD}"
32
KBUILD_SVN_URL=	https://www.virtualbox.org/svn/kbuild-mirror/trunk
33
KBUILD_SVN_REV=	3301
32
KBUILD_TARGET=	${OPSYS:tl}
34
KBUILD_TARGET=	${OPSYS:tl}
33
35
34
KBUILD_BINS=	kDepIDB kDepObj kDepPre kObjCache kmk kmk_append kmk_ash \
36
KBUILD_BINS=	kDepIDB kDepObj kDepPre kObjCache kmk kmk_append kmk_ash \
Lines 42-53 PORTDOCS= QuickReference-kmk.html \ Link Here
42
ENV=
44
ENV=
43
.export ENV
45
.export ENV
44
46
45
OPTIONS_DEFINE=	DOCS GCC
47
OPTIONS_DEFINE=	DOCS
46
OPTIONS_DEFAULT=GCC
47
GCC_DESC=	Build with GCC (should almost always be enabled)
48
GCC_USE=	GCC=yes
49
48
50
post-patch:
49
post-patch:
50
	@${ECHO_CMD} 'KBUILD_SVN_URL := ${KBUILD_SVN_URL}' > ${WRKSRC}/SvnInfo.kmk
51
	@${ECHO_CMD} 'KBUILD_SVN_REV := ${KBUILD_SVN_REV}' >> ${WRKSRC}/SvnInfo.kmk
51
	@${REINPLACE_CMD} 's|gcc|${CC}|g' ${WRKSRC}/kBuild/tools/*.kmk
52
	@${REINPLACE_CMD} 's|gcc|${CC}|g' ${WRKSRC}/kBuild/tools/*.kmk
52
53
53
do-build:
54
do-build:
(-)devel/kBuild/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1511906864
1
TIMESTAMP = 1575421238
2
SHA256 (kBuild-0.1.9998r3127-src.tar.xz) = b98fced9ba0ddae5a080463db43003b8f963d04da3bd588c86025cbf6dda7c61
2
SHA256 (kBuild-0.1.9998r3301-src.tar.xz) = e02550adb4939d47fdfd3b9ccd5602b80f59bd38b9a84865a6f3c91ffd1f4450
3
SIZE (kBuild-0.1.9998r3127-src.tar.xz) = 2144704
3
SIZE (kBuild-0.1.9998r3301-src.tar.xz) = 2291292
(-)devel/kBuild/pkg-help (-3 lines)
Lines 1-3 Link Here
1
The only time that the GCC option can be disabled (to build with clang
2
instead) is if you're building ONLY emulators/virtualbox-ose-additions,
3
without X11, and only on amd64/i386.
(-)emulators/virtualbox-ose/Makefile (-21 / +25 lines)
Lines 2-10 Link Here
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTNAME=	virtualbox-ose
4
PORTNAME=	virtualbox-ose
5
PORTVERSION=	5.2.34
5
PORTVERSION=	6.1.0
6
CATEGORIES=	emulators
6
CATEGORIES=	emulators
7
MASTER_SITES=	https://download.oracle.com/virtualbox/${PORTVERSION}/
7
MASTER_SITES=	https://download.virtualbox.org/virtualbox/${PORTVERSION}/
8
DISTFILES=	VirtualBox-${PORTVERSION}${EXTRACT_SUFX} ${GUESTADDITIONS}
8
DISTFILES=	VirtualBox-${PORTVERSION}${EXTRACT_SUFX} ${GUESTADDITIONS}
9
EXTRACT_ONLY=	VirtualBox-${PORTVERSION}${EXTRACT_SUFX}
9
EXTRACT_ONLY=	VirtualBox-${PORTVERSION}${EXTRACT_SUFX}
10
10
Lines 16-22 LICENSE_FILE= ${WRKSRC}/COPYING Link Here
16
16
17
BUILD_DEPENDS=	yasm:devel/yasm \
17
BUILD_DEPENDS=	yasm:devel/yasm \
18
		xsltproc:textproc/libxslt \
18
		xsltproc:textproc/libxslt \
19
		kmk:devel/kBuild \
19
		kBuild>=0.1.9998_14:devel/kBuild \
20
		gtar:archivers/gtar
20
		gtar:archivers/gtar
21
LIB_DEPENDS=	libpng.so:graphics/png \
21
LIB_DEPENDS=	libpng.so:graphics/png \
22
		libxslt.so:textproc/libxslt \
22
		libxslt.so:textproc/libxslt \
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 49-61 USERS= ${VBOXUSER} Link Here
49
GROUPS=		${VBOXGROUP}
47
GROUPS=		${VBOXGROUP}
50
VBOX_DIR=	${PREFIX}/${VBOX_DIR_REL}
48
VBOX_DIR=	${PREFIX}/${VBOX_DIR_REL}
51
VBOX_DIR_REL=	lib/virtualbox
49
VBOX_DIR_REL=	lib/virtualbox
52
VBOX_LINKS=	VBoxVRDP
50
VBOX_LINKS=	VBoxVRDP vbox-img
53
VBOX_PROGS=	VBoxAutostart VBoxBalloonCtrl VBoxBugReport VBoxHeadless \
51
VBOX_PROGS=	VBoxAutostart VBoxBalloonCtrl VBoxBugReport VBoxHeadless \
54
		VBoxManage
52
		VBoxManage
55
VBOX_UTILS=	VBoxExtPackHelperApp VBoxNetAdpCtl VBoxNetDHCP VBoxNetNAT \
53
VBOX_UTILS=	VBoxExtPackHelperApp VBoxNetAdpCtl VBoxNetDHCP VBoxNetNAT \
56
		VBoxSVC VBoxXPCOMIPCD
54
		VBoxSVC VBoxXPCOMIPCD vbox-img
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 139-150 USE_TEX= dvipsk:build formats:build Link Here
139
.endif
141
.endif
140
142
141
.if ${PORT_OPTIONS:MPYTHON}
143
.if ${PORT_OPTIONS:MPYTHON}
142
USES+=		python:2.7
144
USES+=		python
143
USE_PYTHON=	distutils noegginfo noflavors
145
USE_PYTHON=	distutils noegginfo noflavors
144
PYDISTUTILS_PKGNAME=	vboxapi
146
PYDISTUTILS_PKGNAME=	vboxapi
145
PYDISTUTILS_PKGVERSION=	1.0
147
PYDISTUTILS_PKGVERSION=	1.0
146
.else
148
.else
147
USES+=		python:2.7,build
149
USES+=		python:build
148
.endif
150
.endif
149
151
150
.if ${PORT_OPTIONS:MQT5}
152
.if ${PORT_OPTIONS:MQT5}
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 208-217 CC= ${LOCALBASE}/bin/clang${VBOX_LLVM_VER} Link Here
208
CXX=		${LOCALBASE}/bin/clang++${VBOX_LLVM_VER}
210
CXX=		${LOCALBASE}/bin/clang++${VBOX_LLVM_VER}
209
VBOX_LLVM_VER?=	70
211
VBOX_LLVM_VER?=	70
210
.endif
212
.endif
211
PATCH_DEPENDS+=	${LOCALBASE}/share/kBuild/tools/GXX3.kmk:devel/kBuild
212
EXTRA_PATCHES+=	${PATCHDIR}/extrapatch-Config.kmk \
213
EXTRA_PATCHES+=	${PATCHDIR}/extrapatch-Config.kmk \
213
		${PATCHDIR}/extrapatch-src-VBox-Devices-PC-ipxe-Makefile.kmk \
214
		${PATCHDIR}/extrapatch-src_VBox_Devices_PC_ipxe_Makefile.kmk
214
		${PATCHDIR}/extrapatch-src-recompiler-Makefile.kmk
215
.endif
215
.endif
216
216
217
.if ${PYTHON_MAJOR_VER} >= 3
217
.if ${PYTHON_MAJOR_VER} >= 3
Lines 250-255 post-patch: Link Here
250
	    ${WRKSRC}/LocalConfig.kmk
250
	    ${WRKSRC}/LocalConfig.kmk
251
	@${ECHO_CMD} 'VBOX_WITH_RUNPATH = ${VBOX_DIR}' >> \
251
	@${ECHO_CMD} 'VBOX_WITH_RUNPATH = ${VBOX_DIR}' >> \
252
	    ${WRKSRC}/LocalConfig.kmk
252
	    ${WRKSRC}/LocalConfig.kmk
253
	@${ECHO_CMD} 'VBOX_WITH_VBOX_IMG = ${VBOX_DIR}' >> \
254
	    ${WRKSRC}/LocalConfig.kmk
253
	@${ECHO_CMD} 'VBOX_PATH_APP_PRIVATE = ${DATADIR}' >> \
255
	@${ECHO_CMD} 'VBOX_PATH_APP_PRIVATE = ${DATADIR}' >> \
254
	    ${WRKSRC}/LocalConfig.kmk
256
	    ${WRKSRC}/LocalConfig.kmk
255
	@${ECHO_CMD} 'VBOX_PATH_APP_DOCS = ${DOCSDIR}' >> ${WRKSRC}/LocalConfig.kmk
257
	@${ECHO_CMD} 'VBOX_PATH_APP_DOCS = ${DOCSDIR}' >> ${WRKSRC}/LocalConfig.kmk
Lines 285-299 post-patch: Link Here
285
	@${ECHO_CMD} 'VBOX_GCC_PEDANTIC_CXX = -Wshadow $$(VBOX_GCC_WARN) -Wno-long-long' >> \
287
	@${ECHO_CMD} '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| -mno-align-long-strings||' \
290
	    -e 's| -mpreferred-stack-boundary=2||' ${WRKSRC}/Config.kmk
295
	    ${WRKSRC}/Config.kmk
296
	@${REINPLACE_CMD} -e 's|-mpreferred-stack-boundary=2 ||' \
297
	    ${WRKSRC}/Config.kmk \
298
	    ${WRKSRC}/src/VBox/Devices/PC/ipxe/Makefile.kmk
291
	@${REINPLACE_CMD} -e 's| -fpermissive||' ${WRKSRC}/Config.kmk \
299
	@${REINPLACE_CMD} -e 's| -fpermissive||' ${WRKSRC}/Config.kmk \
292
	    ${WRKSRC}/src/VBox/Main/webservice/Makefile.kmk
300
	    ${WRKSRC}/src/VBox/Main/webservice/Makefile.kmk
293
	@${ECHO_CMD} 'TOOL_VBoxGccFreeBSD_LD = ${CXX}' >> ${WRKSRC}/LocalConfig.kmk
294
	@${SED} -e 's|GXX3|VBoxGccFreeBSD|g' \
295
	    ${LOCALBASE}/share/kBuild/tools/GXX3.kmk > \
296
	    ${WRKSRC}/tools/kBuildTools/VBoxGccFreeBSD.kmk
297
.endif
301
.endif
298
	@${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g' \
302
	@${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g' \
299
	    ${WRKSRC}/Config.kmk ${WRKSRC}/configure \
303
	    ${WRKSRC}/Config.kmk ${WRKSRC}/configure \
Lines 337-343 do-install: Link Here
337
341
338
	${MKDIR} ${STAGEDIR}${VBOX_DIR}
342
	${MKDIR} ${STAGEDIR}${VBOX_DIR}
339
	cd ${KMK_BUILDDIR}/bin && ${COPYTREE_SHARE} \
343
	cd ${KMK_BUILDDIR}/bin && ${COPYTREE_SHARE} \
340
	    "*.fd *.r0 *.rc *.so components" ${STAGEDIR}${VBOX_DIR}
344
	    "*.fd *.r0 *.so components" ${STAGEDIR}${VBOX_DIR}
341
.if ${PORT_OPTIONS:MPYTHON} || ${PORT_OPTIONS:MWEBSERVICE}
345
.if ${PORT_OPTIONS:MPYTHON} || ${PORT_OPTIONS:MWEBSERVICE}
342
	${RLN} ${STAGEDIR}${DATADIR}/sdk ${STAGEDIR}${VBOX_DIR}
346
	${RLN} ${STAGEDIR}${DATADIR}/sdk ${STAGEDIR}${VBOX_DIR}
343
.endif
347
.endif
(-)emulators/virtualbox-ose/distinfo (-5 / +5 lines)
Lines 1-5 Link Here
1
TIMESTAMP = 1571257463
1
TIMESTAMP = 1576163196
2
SHA256 (VirtualBox-5.2.34.tar.bz2) = 9abff37330bba46b97aa836bc886397ba9cfb06cb75be5d60ac31f5ae9c2f2e1
2
SHA256 (VirtualBox-6.1.0.tar.bz2) = 49005ed94454f893fc3955e1e2b9607e85c300235cb983b39d1df2cfcf29f039
3
SIZE (VirtualBox-5.2.34.tar.bz2) = 118268064
3
SIZE (VirtualBox-6.1.0.tar.bz2) = 165322453
4
SHA256 (VBoxGuestAdditions_5.2.34.iso) = d1b63891abca37fd78f5c8af1764e10e5754b1eecabd1fcfe7599c29a93ba007
4
SHA256 (VBoxGuestAdditions_6.1.0.iso) = 00ac2e01c18a5bd629919032eb69c6d0d13e6cc5d9b432fe00df520c1acd8dfe
5
SIZE (VBoxGuestAdditions_5.2.34.iso) = 49661952
5
SIZE (VBoxGuestAdditions_6.1.0.iso) = 59516928
(-)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-11-21 16:51:26 UTC
2
+++ Config.kmk
2
+++ Config.kmk
3
@@ -3537,6 +3537,7 @@ ifdef VBOX_WITH_RAW_MODE
3
@@ -4291,6 +4291,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
@@ -4438,6 +4439,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
 TEMPLATE_VBoxR0_CXXFLAGS.freebsd    = -ffreestanding
19
@@ -3945,7 +3947,7 @@ define TOOL_FREEBSDKMODLD_LINK_SYSMOD_CM
19
@@ -4860,7 +4862,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-Additions-x11-VBoxClient-Makefile.kmk (-11 lines)
Lines 1-11 Link Here
1
--- src/VBox/Additions/x11/VBoxClient/Makefile.kmk.orig	2013-11-29 14:20:43.000000000 -0500
2
+++ src/VBox/Additions/x11/VBoxClient/Makefile.kmk	2013-12-16 14:03:08.000000000 -0500
3
@@ -50,7 +50,7 @@
4
 #	Xtst
5
 # These are static replacements for gcc-specific parts of libstdc++
6
 VBoxClient_LIBS += \
7
-	supc++ \
8
+	cxxrt \
9
 	gcc_eh
10
 ifdef VBOX_X11_SEAMLESS_GUEST
11
  VBoxClient_DEFS += SEAMLESS_GUEST DYNAMIC_RESIZE
(-)emulators/virtualbox-ose/files/extrapatch-src-VBox-Devices-PC-ipxe-Makefile.kmk (-11 lines)
Lines 1-11 Link Here
1
--- src/VBox/Devices/PC/ipxe/Makefile.kmk.orig	2013-11-29 14:23:32.000000000 -0500
2
+++ src/VBox/Devices/PC/ipxe/Makefile.kmk	2013-12-13 15:06:45.000000000 -0500
3
@@ -35,7 +35,7 @@
4
 iPxeBiosBin_CLEAN    = \
5
 	$(iPxeBiosBin_0_OUTDIR)/iPxeBiosBin.c \
6
 
7
-if1of ($(KBUILD_TARGET), darwin os2 solaris win)
8
+if1of ($(KBUILD_TARGET), darwin freebsd os2 solaris win)
9
  $$(iPxeBiosBin_0_OUTDIR)/iPxeBiosBin.c: $(PATH_SUB_CURRENT)/iPxeBiosBin.rom $(VBOX_BIN2C) | $$(dir $$@)
10
 	$(call MSG_TOOL,bin2c,iPxeBiosBin,$<,$@)
11
 	$(QUIET)$(VBOX_BIN2C) -min 32 -max 56 -mask 0x1ff -export NetBiosBinary $< $@
(-)emulators/virtualbox-ose/files/extrapatch-src-VBox-HostDrivers-Support-freebsd-Makefile (-11 lines)
Lines 1-11 Link Here
1
--- src/VBox/HostDrivers/Support/freebsd/Makefile.orig	2012-10-18 16:23:16.000000000 +0200
2
+++ src/VBox/HostDrivers/Support/freebsd/Makefile	2012-10-20 08:13:07.301179212 +0200
3
@@ -27,7 +27,7 @@
4
 
5
 KMOD = vboxdrv
6
 
7
-CFLAGS += -DRT_OS_FREEBSD -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DSUPDRV_WITH_RELEASE_LOGGER -DVBOX -DRT_WITH_VBOX -Iinclude -I. -Ir0drv -w -DVBOX_WITH_HARDENING -DVBOX_WITH_64_BITS_GUESTS
8
+CFLAGS += -DRT_OS_FREEBSD -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DSUPDRV_WITH_RELEASE_LOGGER -DVBOX -DRT_WITH_VBOX -Iinclude -I. -Ir0drv -w -DVBOX_WITH_HARDENING -DVBOX_WITH_64_BITS_GUESTS -DDEBUG
9
 
10
 .if (${MACHINE_ARCH} == "i386")
11
  CFLAGS += -DRT_ARCH_X86
(-)emulators/virtualbox-ose/files/extrapatch-src-recompiler-Makefile.kmk (-10 lines)
Lines 1-10 Link Here
1
--- src/recompiler/Makefile.kmk.orig	2013-11-29 14:25:09.000000000 -0500
2
+++ src/recompiler/Makefile.kmk	2013-12-13 14:23:11.000000000 -0500
3
@@ -41,6 +41,7 @@
4
 #
5
 ifneq ($(KBUILD_TARGET),win)
6
  VBoxRemPrimary_TEMPLATE       = VBOXR3NP
7
+ VBoxRemPrimary_TOOL.freebsd   = VBoxGccFreeBSD
8
  # workaround the regparm bug in gcc <= 3.3
9
  VBoxRemPrimary_DEFS           = $(if $(VBOX_GCC_BUGGY_REGPARM),GCC_WITH_BUGGY_REGPARM,)
10
 else
(-)emulators/virtualbox-ose/files/extrapatch-src_VBox_Devices_PC_ipxe_Makefile.kmk (+11 lines)
Line 0 Link Here
1
--- src/VBox/Devices/PC/ipxe/Makefile.kmk.orig	2019-11-21 17:00:10 UTC
2
+++ src/VBox/Devices/PC/ipxe/Makefile.kmk
3
@@ -35,7 +35,7 @@ iPxeBiosBin_SOURCES  = $(iPxeBiosBin_0_OUTDIR)/iPxeBio
4
 iPxeBiosBin_CLEAN    = \
5
 	$(iPxeBiosBin_0_OUTDIR)/iPxeBiosBin.c \
6
 
7
-if1of ($(KBUILD_TARGET), darwin os2 solaris win)
8
+if1of ($(KBUILD_TARGET), darwin freebsd os2 solaris win)
9
  $$(iPxeBiosBin_0_OUTDIR)/iPxeBiosBin.c: $(PATH_SUB_CURRENT)/iPxeBiosBin.rom $(VBOX_BIN2C) | $$(dir $$@)
10
 	$(call MSG_TOOL,bin2c,iPxeBiosBin,$<,$@)
11
 	$(QUIET)$(VBOX_BIN2C) -min 32 -max 56 -mask 0x1ff -export NetBiosBinary $< $@
(-)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/extrapatch-src_VBox_HostDrivers_Support_freebsd_Makefile (+11 lines)
Line 0 Link Here
1
--- src/VBox/HostDrivers/Support/freebsd/Makefile.orig	2019-11-21 17:02:00 UTC
2
+++ src/VBox/HostDrivers/Support/freebsd/Makefile
3
@@ -26,7 +26,7 @@
4
 
5
 KMOD = vboxdrv
6
 
7
-CFLAGS += -DRT_OS_FREEBSD -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DSUPDRV_WITH_RELEASE_LOGGER -DVBOX -DRT_WITH_VBOX -Iinclude -I. -Ir0drv -w -DVBOX_WITH_HARDENING -DVBOX_WITH_64_BITS_GUESTS
8
+CFLAGS += -DRT_OS_FREEBSD -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DSUPDRV_WITH_RELEASE_LOGGER -DVBOX -DRT_WITH_VBOX -Iinclude -I. -Ir0drv -w -DVBOX_WITH_HARDENING -DVBOX_WITH_64_BITS_GUESTS -DDEBUG
9
 
10
 .if (${MACHINE_ARCH} == "i386")
11
  CFLAGS += -DRT_ARCH_X86
(-)emulators/virtualbox-ose/files/patch-Config.kmk (-60 / +143 lines)
Lines 1-6 Link Here
1
--- Config.kmk.orig	2019-05-13 13:12:00 UTC
1
--- Config.kmk.orig	2019-11-21 16:51:26 UTC
2
+++ Config.kmk
2
+++ Config.kmk
3
@@ -445,11 +445,11 @@ ifn1of ($(KBUILD_TARGET), win darwin)
3
@@ -465,11 +465,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
@@ -484,11 +484,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
@@ -496,7 +496,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 the generic 3D settings support if at least one 3D capable solution is enabled
40
@@ -992,10 +992,6 @@ ifeq ($(KBUILD_TARGET),darwin)
40
@@ -641,7 +641,7 @@ VBOX_WITH_MAIN_USB_ID_DATABASE = 1
41
 #endif
42
 # Set this to prefix all C symbols in XPCOM, to avoid dynamic linking problems
43
 # caused by our XPCOM library polluting the symbol namespace for system libs.
44
-if1of ($(KBUILD_TARGET), linux solaris)
45
+if1of ($(KBUILD_TARGET), freebsd linux solaris)
46
  VBOX_WITH_XPCOM_NAMESPACE_CLEANUP = 1
47
 endif
48
 # The webservices api.
49
@@ -1062,10 +1062,6 @@ ifeq ($(KBUILD_TARGET),darwin)
41
  VBOX_WITH_VBOXSDL=
50
  VBOX_WITH_VBOXSDL=
42
 endif
51
 endif
43
 
52
 
Lines 48-54 Link Here
48
 ifeq ($(KBUILD_TARGET),haiku)
57
 ifeq ($(KBUILD_TARGET),haiku)
49
  # Don't bother with SDL ttf for now.
58
  # Don't bother with SDL ttf for now.
50
  VBOX_WITH_SECURELABEL=
59
  VBOX_WITH_SECURELABEL=
51
@@ -1155,7 +1151,7 @@ ifdef VBOX_OSE
60
@@ -1228,7 +1224,7 @@ ifdef VBOX_OSE
52
  VBOX_WITH_KCHMVIEWER=
61
  VBOX_WITH_KCHMVIEWER=
53
  VBOX_WITH_PLUGIN_CRYPT=
62
  VBOX_WITH_PLUGIN_CRYPT=
54
  VBOX_WITH_DRAG_AND_DROP_PROMISES=
63
  VBOX_WITH_DRAG_AND_DROP_PROMISES=
Lines 57-89 Link Here
57
   VBOX_WITH_DOCS=
66
   VBOX_WITH_DOCS=
58
   VBOX_WITH_DOCS_PACKING=
67
   VBOX_WITH_DOCS_PACKING=
59
  endif
68
  endif
60
@@ -1176,14 +1172,14 @@ ifdef VBOX_OSE
69
@@ -4874,7 +4870,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
70
 		| xargs -J% objcopy % $(outbase).kld
88
 
71
 
89
 # Link the final .ko (a shared object).
72
 # Link the final .ko (a shared object).
Lines 92-98 Link Here
92
 endef
75
 endef
93
  endif # x86
76
  endif # x86
94
 
77
 
95
@@ -4908,10 +4904,18 @@ TEMPLATE_VBOXR3EXE_LIBPATH            += \
78
@@ -5184,10 +5180,18 @@ TEMPLATE_VBOXR3EXE_LIBPATH            += \
96
 TEMPLATE_VBOXR3EXE_CFLAGS             += -fno-pic
79
 TEMPLATE_VBOXR3EXE_CFLAGS             += -fno-pic
97
 TEMPLATE_VBOXR3EXE_CXXFLAGS           += -fno-pic
80
 TEMPLATE_VBOXR3EXE_CXXFLAGS           += -fno-pic
98
 TEMPLATE_VBOXR3EXE_LDFLAGS            += -fno-pic
81
 TEMPLATE_VBOXR3EXE_LDFLAGS            += -fno-pic
Lines 112-127 Link Here
112
 	/usr/include \
95
 	/usr/include \
113
 	/usr/X11R6/include \
96
 	/usr/X11R6/include \
114
 	/usr/local/include
97
 	/usr/local/include
115
@@ -5202,7 +5206,7 @@ ifeq ($(KBUILD_TARGET),win) # No CRT!
98
@@ -5219,6 +5223,7 @@ TEMPLATE_VBOXR3EXE_CXXFLAGS.kprofile   = $(TEMPLATE_VB
116
  TEMPLATE_VBOXR3HARDENEDEXE_LDFLAGS.win.amd64 = $(TEMPLATE_VBOXR3EXE_LDFLAGS.win.amd64) /entry:suplibHardenedWindowsMain
99
   TEMPLATE_VBOXR3EXE_LDFLAGS          += '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RELATIVE_RUNPATH)'
117
  TEMPLATE_VBOXR3HARDENEDEXE_LIBS.x86       = $(NOT_SUCH_VARIABLE)
100
  endif
118
  TEMPLATE_VBOXR3HARDENEDEXE_LIBS.amd64     = $(NOT_SUCH_VARIABLE)
101
  ifdef VBOX_WITH_ORIGIN
119
-else ifn1of ($(KBUILD_TARGET), os2 solaris)
102
+  TEMPLATE_VBOXR3EXE_LDFLAGS.freebsd  += $(VBOX_GCC_ORIGIN_OPT)
120
+else ifn1of ($(KBUILD_TARGET), freebsd os2 solaris)
103
   TEMPLATE_VBOXR3EXE_LDFLAGS.linux    += $(VBOX_GCC_ORIGIN_OPT)
104
  endif
105
 endif
106
@@ -5358,7 +5363,7 @@ ifeq ($(KBUILD_TARGET),win)
107
  	$(PATH_TOOL_$(TEMPLATE_VBOXR3STATIC_TOOL.win.amd64)_LIB)/libcmt$(VBOX_VCC_CRT_TYPE).lib \
108
  	$(PATH_TOOL_$(TEMPLATE_VBOXR3STATIC_TOOL.win.amd64)_LIB)/libcpmt$(VBOX_VCC_CRT_TYPE).lib \
109
  	$(PATH_TOOL_$(TEMPLATE_VBOXR3STATIC_TOOL.win.amd64)_LIB)/oldnames.lib
110
-else ifn1of ($(KBUILD_TARGET), darwin linux solaris)
111
+else ifn1of ($(KBUILD_TARGET), darwin freebsd linux solaris)
112
  # The gcc guys sans darwin, linux and solaris (don't depend on statically compiled system libs there)
113
  TEMPLATE_VBOXR3STATIC_CFLAGS          = $(TEMPLATE_VBOXR3EXE_CFLAGS) -static
114
  TEMPLATE_VBOXR3STATIC_CXXFLAGS        = $(TEMPLATE_VBOXR3EXE_CXXFLAGS) -static
115
@@ -5406,8 +5411,10 @@ else
116
  TEMPLATE_VBoxR3Static_LIBS        += \
117
  	$(PATH_STAGE_LIB)/VBox-liblzf$(VBOX_SUFF_LIB) \
118
  	$(SDK_VBOX_ZLIB_LIBS)
119
- if1of ($(KBUILD_TARGET),darwin freebsd)
120
+ ifeq ($(KBUILD_TARGET),darwin)
121
   TEMPLATE_VBoxR3Static_LIBS       += iconv
122
+ else ifeq ($(KBUILD_TARGET),freebsd)
123
+  TEMPLATE_VBoxR3Static_LIBS       += crypt iconv
124
  else ifeq ($(KBUILD_TARGET),solaris)
125
   TEMPLATE_VBoxR3Static_LIBS       += kstat
126
  endif
127
@@ -5503,6 +5510,7 @@ ifeq ($(KBUILD_TARGET),win) # No CRT!
128
 else ifn1of ($(KBUILD_TARGET), os2 solaris)
121
  # We want to keep the RPATH on Solaris to be able to find libgcc_1/libstdc++ within $(VBOX_WITH_RUNPATH)
129
  # 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))
130
  TEMPLATE_VBOXR3HARDENEDEXE_LDFLAGS       = $(filter-out '$(VBOX_GCC_RPATH_OPT)%,$(TEMPLATE_VBOXR3EXE_LDFLAGS))
131
+ TEMPLATE_VBOXR3HARDENEDEXE_LDFLAGS.freebsd = $(filter-out $(VBOX_GCC_ORIGIN_OPT),$(TEMPLATE_VBOXR3EXE_LDFLAGS.freebsd))
123
  TEMPLATE_VBOXR3HARDENEDEXE_LDFLAGS.linux = $(filter-out $(VBOX_GCC_ORIGIN_OPT),$(TEMPLATE_VBOXR3EXE_LDFLAGS.linux))
132
  TEMPLATE_VBOXR3HARDENEDEXE_LDFLAGS.linux = $(filter-out $(VBOX_GCC_ORIGIN_OPT),$(TEMPLATE_VBOXR3EXE_LDFLAGS.linux))
124
@@ -5729,10 +5733,18 @@ TEMPLATE_VBOXMAINEXE_LIBS                = $(LIB_RUNTI
133
 endif
134
 
135
@@ -5530,6 +5538,7 @@ TEMPLATE_VBoxR3HardenedTstDll_INST = $(INST_TESTCASE)
136
  TEMPLATE_VBoxR3HardenedTstDll_LDFLAGS.win = $(TEMPLATE_VBoxR3TstDll_LDFLAGS.win) -IntegrityCheck
137
 ifn1of ($(KBUILD_TARGET), win os2)
138
  TEMPLATE_VBoxR3HardenedTstDll_LDFLAGS       = $(filter-out '$(VBOX_GCC_RPATH_OPT)%,$(TEMPLATE_VBoxR3TstDll_LDFLAGS))
139
+ TEMPLATE_VBoxR3HardenedTstDll_LDFLAGS.freebsd = $(filter-out $(VBOX_GCC_ORIGIN_OPT),$(TEMPLATE_VBoxR3TstDll_LDFLAGS.freebsd))
140
  TEMPLATE_VBoxR3HardenedTstDll_LDFLAGS.linux = $(filter-out $(VBOX_GCC_ORIGIN_OPT),$(TEMPLATE_VBoxR3TstDll_LDFLAGS.linux))
141
 endif
142
 
143
@@ -5552,6 +5561,7 @@ ifndef VBOX_WITH_HARDENING
144
   TEMPLATE_VBoxR3SetUidToRoot_LDFLAGS += '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RELATIVE_RUNPATH)'
145
  endif
146
  ifdef VBOX_WITH_ORIGIN
147
+  TEMPLATE_VBoxR3SetUidToRoot_LDFLAGS.freebsd += $(VBOX_GCC_ORIGIN_OPT)
148
   TEMPLATE_VBoxR3SetUidToRoot_LDFLAGS.linux += $(VBOX_GCC_ORIGIN_OPT)
149
  endif
150
 endif
151
@@ -6078,10 +6088,18 @@ TEMPLATE_VBOXMAINEXE_LIBS                = $(LIB_RUNTI
125
  else ifeq ($(KBUILD_TARGET),haiku)
152
  else ifeq ($(KBUILD_TARGET),haiku)
126
 TEMPLATE_VBOXMAINEXE_TOOL                = GXX3
153
 TEMPLATE_VBOXMAINEXE_TOOL                = GXX3
127
 TEMPLATE_VBOXMAINEXE_LIBS                = $(LIB_RUNTIME) network stdc++ supc++
154
 TEMPLATE_VBOXMAINEXE_LIBS                = $(LIB_RUNTIME) network stdc++ supc++
Lines 141-147 Link Here
141
 	/usr/include \
168
 	/usr/include \
142
 	/usr/X11R6/include \
169
 	/usr/X11R6/include \
143
 	/usr/local/include
170
 	/usr/local/include
144
@@ -6271,13 +6283,10 @@ ifdef VBOX_WITH_QTGUI
171
@@ -6113,6 +6131,7 @@ TEMPLATE_VBOXMAINEXE_LDFLAGS            += '$(VBOX_GCC
172
 TEMPLATE_VBOXMAINEXE_LDFLAGS            += '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RELATIVE_RUNPATH)'
173
  endif
174
  ifdef VBOX_WITH_ORIGIN
175
+TEMPLATE_VBOXMAINEXE_LDFLAGS.freebsd    += $(VBOX_GCC_ORIGIN_OPT)
176
 TEMPLATE_VBOXMAINEXE_LDFLAGS.linux      += $(VBOX_GCC_ORIGIN_OPT)
177
  endif
178
 
179
@@ -6670,13 +6689,10 @@ ifdef VBOX_WITH_QTGUI
145
    TEMPLATE_VBOXQTGUIEXE_LIBPATH += \
180
    TEMPLATE_VBOXQTGUIEXE_LIBPATH += \
146
 	$(VBOX_LIBPATH_X11)
181
 	$(VBOX_LIBPATH_X11)
147
    ifeq ($(KBUILD_TARGET),freebsd)
182
    ifeq ($(KBUILD_TARGET),freebsd)
Lines 156-175 Link Here
156
 	/usr/local/lib
191
 	/usr/local/lib
157
    endif
192
    endif
158
    ifeq ($(KBUILD_TARGET),solaris)
193
    ifeq ($(KBUILD_TARGET),solaris)
159
@@ -6500,12 +6509,8 @@ TEMPLATE_VBoxBldProg_LIBPATH            += \
194
@@ -6917,10 +6933,17 @@ TEMPLATE_VBoxBldProg_TOOL                = GXX3
195
 TEMPLATE_VBoxBldProg_LIBS                = network iconv
196
 TEMPLATE_VBoxBldProg_LIBPATH            += \
197
 	/boot/common/lib
198
- else if1of ($(KBUILD_HOST), freebsd openbsd)
199
+ else ifeq ($(KBUILD_HOST),freebsd)
160
 TEMPLATE_VBoxBldProg_TOOL                = GXX3
200
 TEMPLATE_VBoxBldProg_TOOL                = GXX3
161
 TEMPLATE_VBoxBldProg_LIBS                = pthread
201
 TEMPLATE_VBoxBldProg_LIBS                = pthread
162
 TEMPLATE_VBoxBldProg_INCS               += \
202
 TEMPLATE_VBoxBldProg_INCS               += \
163
-	/usr/include \
203
+	/usr/local/include
164
-	/usr/X11R6/include \
204
+TEMPLATE_VBoxBldProg_LIBPATH            += \
205
+	/usr/local/lib
206
+ else ifeq ($(KBUILD_HOST),openbsd)
207
+TEMPLATE_VBoxBldProg_TOOL                = GXX3
208
+TEMPLATE_VBoxBldProg_LIBS                = pthread
209
+TEMPLATE_VBoxBldProg_INCS               += \
210
 	/usr/include \
211
 	/usr/X11R6/include \
165
 	/usr/local/include
212
 	/usr/local/include
166
 TEMPLATE_VBoxBldProg_LIBPATH            += \
213
@@ -6969,6 +6992,7 @@ TEMPLATE_VBoxAdvBldProg_LIBS.darwin = \
167
-	/usr/lib \
214
 	$(TEMPLATE_VBoxBldProg_LIBS.darwin)
168
-	/usr/X11R6/lib \
215
 TEMPLATE_VBoxAdvBldProg_LIBS.freebsd = \
169
 	/usr/local/lib
216
 	$(TEMPLATE_VBoxAdvBldProg_LIBS) \
170
  else ifeq ($(KBUILD_HOST),netbsd)
217
+	crypt \
171
 TEMPLATE_VBoxBldProg_TOOL                = GXX3
218
 	iconv \
172
@@ -6906,6 +6911,7 @@ TEMPLATE_VBOXCROGLR3HOSTDLL_LDFLAGS.darwin  += \
219
 	rt \
220
 	$(TEMPLATE_VBoxBldProg_LIBS.freebsd)
221
@@ -7044,6 +7068,7 @@ else # the gcc guys
222
  # Do not inherit sanitizer flags from VBOXR3EXE in guest executables.  Deal with them separately.
223
  TEMPLATE_VBOXGUESTR3EXE_CXXFLAGS.debug = $(NO_SUCH_VARIABLE)
224
  TEMPLATE_VBOXGUESTR3EXE_CFLAGS.debug = $(NO_SUCH_VARIABLE)
225
+ TEMPLATE_VBOXGUESTR3EXE_LDFLAGS.freebsd = $(filter-out $(VBOX_GCC_ORIGIN_OPT),$(TEMPLATE_VBOXR3EXE_LDFLAGS.freebsd))
226
  TEMPLATE_VBOXGUESTR3EXE_LDFLAGS.linux = $(filter-out $(VBOX_GCC_ORIGIN_OPT),$(TEMPLATE_VBOXR3EXE_LDFLAGS.linux))
227
  TEMPLATE_VBOXGUESTR3EXE_LDFLAGS.debug = $(NO_SUCH_VARIABLE)
228
  TEMPLATE_VBOXGUESTR3EXE_LDFLAGS  = $(filter-out '$(VBOX_GCC_RPATH_OPT)%,$(TEMPLATE_VBOXR3EXE_LDFLAGS))
229
@@ -7067,6 +7092,7 @@ TEMPLATE_VBOXGUESTR3EXE_CXXFLAGS.linux    = \
230
 	$(VBOX_GCC_fno-stack-protector)
231
 TEMPLATE_VBOXGUESTR3EXE_CFLAGS.linux      = $(TEMPLATE_VBOXGUESTR3EXE_CXXFLAGS.linux)
232
 # The GNU_HASH ELF tag is not supported by older systems.
233
+TEMPLATE_VBOXGUESTR3EXE_LDFLAGS.freebsd    += $(VBOX_LD_hash_style_sysv)
234
 TEMPLATE_VBOXGUESTR3EXE_LDFLAGS.linux      += $(VBOX_LD_hash_style_sysv)
235
 
236
 #
237
@@ -7079,6 +7105,9 @@ TEMPLATE_NewVBoxGuestR3Exe_LIBS     = \
238
 	$(VBOX_LIB_VBGL_R3) \
239
 	$(VBOX_LIB_IPRT_GUEST_R3) \
240
 	$(TEMPLATE_VBOXGUESTR3EXE_LIBS)
241
+ifeq ($(KBUILD_TARGET),freebsd)
242
+TEMPLATE_NewVBoxGuestR3Exe_LIBS += crypt
243
+endif
244
 ifeq ($(KBUILD_TARGET),solaris)
245
 TEMPLATE_NewVBoxGuestR3Exe_LIBS += contract
246
 endif
247
@@ -7274,6 +7303,7 @@ TEMPLATE_VBOXGUESTR3XF86MOD_LIBS.$(KBUILD_TYPE)      =
248
 TEMPLATE_VBOXGUESTR3XF86MOD_LIBS.$(KBUILD_TARGET)    = $(NO_SUCH_VARIABLE)
249
 TEMPLATE_VBOXGUESTR3XF86MOD_LDFLAGS.$(KBUILD_TARGET) = $(NO_SUCH_VARIABLE)
250
 # The GNU_HASH ELF tag is not supported by older glibc dynamic linkers.
251
+TEMPLATE_VBOXGUESTR3XF86MOD_LDFLAGS.freebsd = $(subst -Wl$(COMMA),,$(VBOX_LD_hash_style_sysv))
252
 TEMPLATE_VBOXGUESTR3XF86MOD_LDFLAGS.linux = $(subst -Wl$(COMMA),,$(VBOX_LD_hash_style_sysv))
253
 TEMPLATE_VBOXGUESTR3XF86MOD_LDFLAGS.$(KBUILD_TYPE)   = $(NO_SUCH_VARIABLE)
254
 TEMPLATE_VBOXGUESTR3XF86MOD_LDFLAGS          = -r
255
@@ -7383,6 +7413,7 @@ TEMPLATE_VBOXCROGLR3HOSTDLL_LDFLAGS.darwin  += \
173
 	-current_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \
256
 	-current_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \
174
 	-compatibility_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)
257
 	-compatibility_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)
175
 TEMPLATE_VBOXCROGLR3HOSTDLL_LDFLAGS.linux    = -Wl,--no-as-needed
258
 TEMPLATE_VBOXCROGLR3HOSTDLL_LDFLAGS.linux    = -Wl,--no-as-needed
(-)emulators/virtualbox-ose/files/patch-configure (-48 / +7 lines)
Lines 1-4 Link Here
1
--- configure.orig	2018-07-16 14:56:48 UTC
1
--- configure.orig	2019-11-21 16:51:26 UTC
2
+++ configure
2
+++ configure
3
@@ -138,10 +138,14 @@ CXX_FLAGS=""
3
@@ -138,10 +138,14 @@ CXX_FLAGS=""
4
 if [ "$OS" = "freebsd" ]; then
4
 if [ "$OS" = "freebsd" ]; then
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
@@ -1221,7 +1225,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
@@ -1527,8 +1531,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
@@ -1667,7 +1670,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
@@ -1999,8 +2002,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
@@ -2476,7 +2479,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-110 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
@@ -2840,14 +2843,6 @@ if [ "$OS" = "linux" ]; 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
87
   [ $WITH_JAVA   -eq 1 ] && check_java
88
 
89
-  # PulseAudio
90
   if [ "$OS" = "linux" -o "$OS" = "freebsd" -o "$OS" = "netbsd" ]; then
91
+    if [ $WITH_ALSA -eq 1 ]; then
92
+      check_alsa
93
+    else
94
+      cnf_append "VBOX_WITH_AUDIO_ALSA" ""
95
+    fi
96
     if [ $WITH_PULSE -eq 1 ]; then
97
       check_pulse
98
     elif [ $WITH_PULSE -eq 0 ]; then
99
       cnf_append "VBOX_WITH_AUDIO_PULSE" ""
100
     fi
101
+    if [ $WITH_DBUS -eq 0 ]; then
102
+      cnf_append "VBOX_WITH_DBUS" ""
103
+    fi
104
  fi
105
 fi
106
 
107
@@ -2806,14 +2819,6 @@ if [ "$OS" = "linux" ]; then
108
     cnf_append "VBOX_WITHOUT_LINUX_TEST_BUILDS" "1"
67
     cnf_append "VBOX_WITHOUT_LINUX_TEST_BUILDS" "1"
109
   fi
68
   fi
110
   if [ $ONLY_ADDITIONS -eq 0 ]; then
69
   if [ $ONLY_ADDITIONS -eq 0 ]; then
(-)emulators/virtualbox-ose/files/patch-include-VBox-vmm-cpumctx.h (-11 lines)
Lines 1-11 Link Here
1
--- include/VBox/vmm/cpumctx.h.orig	2015-03-12 18:53:45.762704000 -0400
2
+++ include/VBox/vmm/cpumctx.h	2015-03-12 18:56:23.765105000 -0400
3
@@ -84,7 +84,7 @@
4
 # define CPUMSELREG_ARE_HIDDEN_PARTS_VALID(a_pVCpu, a_pSelReg) \
5
     (   ((a_pSelReg)->fFlags & CPUMSELREG_FLAGS_VALID) \
6
      && (   (a_pSelReg)->ValidSel == (a_pSelReg)->Sel \
7
-         || (   (a_pVCpu) /*!= NULL*/ \
8
+         || (   ((a_pVCpu) != NULL) \
9
              && (a_pSelReg)->ValidSel == ((a_pSelReg)->Sel & X86_SEL_MASK_OFF_RPL) \
10
              && ((a_pSelReg)->Sel      & X86_SEL_RPL) == 1 \
11
              && ((a_pSelReg)->ValidSel & X86_SEL_RPL) == 0 \
(-)emulators/virtualbox-ose/files/patch-include-iprt-x86.h (-19 lines)
Lines 1-19 Link Here
1
--- include/iprt/x86.h.orig	2014-02-25 11:59:50.000000000 -0500
2
+++ include/iprt/x86.h	2014-03-11 16:46:08.000000000 -0400
3
@@ -35,6 +35,16 @@
4
 # pragma D depends_on library vbox-types.d
5
 #endif
6
 
7
+/* Workaround for FreeBSD machine/specialreg.h defining MSRs */
8
+#ifdef RT_OS_FREEBSD
9
+# undef MSR_P5_MC_ADDR
10
+# undef MSR_P5_MC_TYPE
11
+# undef MSR_IA32_PLATFORM_ID
12
+# undef MSR_BBL_CR_CTL3
13
+# undef MSR_IA32_MISC_ENABLE
14
+# undef MSR_IA32_FEATURE_CONTROL
15
+#endif
16
+
17
 /* Workaround for Solaris sys/regset.h defining CS, DS */
18
 #ifdef RT_OS_SOLARIS
19
 # undef CS
(-)emulators/virtualbox-ose/files/patch-include_VBox_VBoxGL2D.h (-7 / +2 lines)
Lines 1-11 Link Here
1
Fix build with Qt5 5.13, which defined GLsizeiptr already.
1
--- include/VBox/VBoxGL2D.h.orig	2019-11-21 16:51:31 UTC
2
3
Obtained from:
4
	https://www.mail-archive.com/pld-cvs-commit@lists.pld-linux.org/msg436220.html
5
6
--- include/VBox/VBoxGL2D.h.orig	2019-09-29 14:31:16 UTC
7
+++ include/VBox/VBoxGL2D.h
2
+++ include/VBox/VBoxGL2D.h
8
@@ -107,7 +107,7 @@ typedef GLvoid (APIENTRY *PFNVBOXVHWA_UNIFORM3I)(GLint
3
@@ -111,7 +111,7 @@ typedef GLvoid (APIENTRY *PFNVBOXVHWA_UNIFORM3I)(GLint
9
 typedef GLvoid (APIENTRY *PFNVBOXVHWA_UNIFORM4I)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
4
 typedef GLvoid (APIENTRY *PFNVBOXVHWA_UNIFORM4I)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
10
 
5
 
11
 /* GL_ARB_pixel_buffer_object*/
6
 /* GL_ARB_pixel_buffer_object*/
(-)emulators/virtualbox-ose/files/patch-include_VBox_com_array.h (-27 / +2 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-11-21 16:51:32 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-36 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)
13
      */
14
     T &operator[] (size_t aIdx)
15
     {
16
-        AssertReturn(m.arr != NULL,  *((T *)NULL));
17
-        AssertReturn(aIdx < size(), *((T *)NULL));
18
+        AssertReturn(m.arr != NULL,  *((T *)1));
19
+        AssertReturn(aIdx < size(), *((T *)1));
20
 #ifdef VBOX_WITH_XPCOM
21
         return m.arr[aIdx];
22
 #else
23
-        AssertReturn(m.raw != NULL,  *((T *)NULL));
24
+        AssertReturn(m.raw != NULL,  *((T *)1));
25
         return m.raw[aIdx];
26
 #endif
27
     }
28
@@ -960,7 +960,7 @@ class SafeArray : public Traits (public)
29
 #ifdef VBOX_WITH_XPCOM
30
         return m.arr[aIdx];
31
 #else
32
-        AssertReturn(m.raw != NULL,  *((T *)NULL));
33
+        AssertReturn(m.raw != NULL,  *((T *)1));
34
         return m.raw[aIdx];
35
 #endif
36
     }
(-)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_string.h (-2 / +2 lines)
Lines 1-6 Link Here
1
--- include/iprt/string.h.orig	2018-06-29 13:08:03 UTC
1
--- include/iprt/string.h.orig	2019-11-21 16:51:44 UTC
2
+++ include/iprt/string.h
2
+++ include/iprt/string.h
3
@@ -43,6 +43,11 @@
3
@@ -46,6 +46,11 @@
4
 #elif defined(RT_OS_FREEBSD) && defined(_KERNEL)
4
 #elif defined(RT_OS_FREEBSD) && defined(_KERNEL)
5
   RT_C_DECLS_BEGIN
5
   RT_C_DECLS_BEGIN
6
 # include <sys/libkern.h>
6
 # include <sys/libkern.h>
(-)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-include_iprt_x86.h (+19 lines)
Line 0 Link Here
1
--- include/iprt/x86.h.orig	2019-11-21 16:51:45 UTC
2
+++ include/iprt/x86.h
3
@@ -38,6 +38,16 @@
4
 # pragma D depends_on library vbox-types.d
5
 #endif
6
 
7
+/* Workaround for FreeBSD machine/specialreg.h defining MSRs */
8
+#ifdef RT_OS_FREEBSD
9
+# undef MSR_P5_MC_ADDR
10
+# undef MSR_P5_MC_TYPE
11
+# undef MSR_IA32_PLATFORM_ID
12
+# undef MSR_BBL_CR_CTL3
13
+# undef MSR_IA32_MISC_ENABLE
14
+# undef MSR_IA32_FEATURE_CONTROL
15
+#endif
16
+
17
 /* Workaround for Solaris sys/regset.h defining CS, DS */
18
 #ifdef RT_OS_SOLARIS
19
 # undef CS
(-)emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-VBoxGuest-VBoxGuest-freebsd.c (-257 lines)
Lines 1-257 Link Here
1
--- src/VBox/Additions/common/VBoxGuest/VBoxGuest-freebsd.c.orig	2017-10-18 07:06:43 UTC
2
+++ src/VBox/Additions/common/VBoxGuest/VBoxGuest-freebsd.c
3
@@ -93,8 +93,6 @@ struct VBoxGuestDeviceState
4
     struct resource   *pIrqRes;
5
     /** Pointer to the IRQ handler. */
6
     void              *pfnIrqHandler;
7
-    /** VMMDev version */
8
-    uint32_t           u32Version;
9
 };
10
 
11
 
12
@@ -104,8 +102,7 @@ struct VBoxGuestDeviceState
13
 /*
14
  * Character device file handlers.
15
  */
16
-static d_fdopen_t vgdrvFreeBSDOpen;
17
-static d_close_t  vgdrvFreeBSDClose;
18
+static d_open_t   vgdrvFreeBSDOpen;
19
 static d_ioctl_t  vgdrvFreeBSDIOCtl;
20
 static int        vgdrvFreeBSDIOCtlSlow(PVBOXGUESTSESSION pSession, u_long ulCmd, caddr_t pvData, struct thread *pTd);
21
 static d_write_t  vgdrvFreeBSDWrite;
22
@@ -136,8 +133,7 @@ static struct cdevsw    g_vgdrvFreeBSDCh
23
 {
24
     .d_version =        D_VERSION,
25
     .d_flags =          D_TRACKCLOSE | D_NEEDMINOR,
26
-    .d_fdopen =         vgdrvFreeBSDOpen,
27
-    .d_close =          vgdrvFreeBSDClose,
28
+    .d_open =           vgdrvFreeBSDOpen,
29
     .d_ioctl =          vgdrvFreeBSDIOCtl,
30
     .d_read =           vgdrvFreeBSDRead,
31
     .d_write =          vgdrvFreeBSDWrite,
32
@@ -145,81 +141,28 @@ static struct cdevsw    g_vgdrvFreeBSDCh
33
     .d_name =           "vboxguest"
34
 };
35
 
36
+/** Device structure. */
37
+static struct cdev         *g_pDev;
38
+
39
 /** Device extention & session data association structure. */
40
 static VBOXGUESTDEVEXT      g_DevExt;
41
 
42
-/** List of cloned device. Managed by the kernel. */
43
-static struct clonedevs    *g_pvgdrvFreeBSDClones;
44
-/** The dev_clone event handler tag. */
45
-static eventhandler_tag     g_vgdrvFreeBSDEHTag;
46
 /** Reference counter */
47
 static volatile uint32_t    cUsers;
48
 /** selinfo structure used for polling. */
49
 static struct selinfo       g_SelInfo;
50
 
51
-/**
52
- * DEVFS event handler.
53
- */
54
-static void vgdrvFreeBSDClone(void *pvArg, struct ucred *pCred, char *pszName, int cchName, struct cdev **ppDev)
55
+static void vgdrvFreeBSDDtr(void *pSession)
56
 {
57
-    int iUnit;
58
-    int rc;
59
-
60
-    Log(("vgdrvFreeBSDClone: pszName=%s ppDev=%p\n", pszName, ppDev));
61
-
62
-    /*
63
-     * One device node per user, si_drv1 points to the session.
64
-     * /dev/vboxguest<N> where N = {0...255}.
65
-     */
66
-    if (!ppDev)
67
-        return;
68
-    if (strcmp(pszName, "vboxguest") == 0)
69
-        iUnit =  -1;
70
-    else if (dev_stdclone(pszName, NULL, "vboxguest", &iUnit) != 1)
71
-        return;
72
-    if (iUnit >= 256)
73
-    {
74
-        Log(("vgdrvFreeBSDClone: iUnit=%d >= 256 - rejected\n", iUnit));
75
-        return;
76
-    }
77
-
78
-    Log(("vgdrvFreeBSDClone: pszName=%s iUnit=%d\n", pszName, iUnit));
79
-
80
-    rc = clone_create(&g_pvgdrvFreeBSDClones, &g_vgdrvFreeBSDChrDevSW, &iUnit, ppDev, 0);
81
-    Log(("vgdrvFreeBSDClone: clone_create -> %d; iUnit=%d\n", rc, iUnit));
82
-    if (rc)
83
-    {
84
-        *ppDev = make_dev(&g_vgdrvFreeBSDChrDevSW,
85
-                          iUnit,
86
-                          UID_ROOT,
87
-                          GID_WHEEL,
88
-                          0664,
89
-                          "vboxguest%d", iUnit);
90
-        if (*ppDev)
91
-        {
92
-            dev_ref(*ppDev);
93
-            (*ppDev)->si_flags |= SI_CHEAPCLONE;
94
-            Log(("vgdrvFreeBSDClone: Created *ppDev=%p iUnit=%d si_drv1=%p si_drv2=%p\n",
95
-                     *ppDev, iUnit, (*ppDev)->si_drv1, (*ppDev)->si_drv2));
96
-            (*ppDev)->si_drv1 = (*ppDev)->si_drv2 = NULL;
97
-        }
98
-        else
99
-            Log(("vgdrvFreeBSDClone: make_dev iUnit=%d failed\n", iUnit));
100
-    }
101
-    else
102
-        Log(("vgdrvFreeBSDClone: Existing *ppDev=%p iUnit=%d si_drv1=%p si_drv2=%p\n",
103
-             *ppDev, iUnit, (*ppDev)->si_drv1, (*ppDev)->si_drv2));
104
+    VGDrvCommonCloseSession(&g_DevExt, pSession);
105
+    ASMAtomicDecU32(&cUsers);
106
 }
107
 
108
 /**
109
  * File open handler
110
  *
111
  */
112
-#if __FreeBSD_version >= 700000
113
-static int vgdrvFreeBSDOpen(struct cdev *pDev, int fOpen, struct thread *pTd, struct file *pFd)
114
-#else
115
-static int vgdrvFreeBSDOpen(struct cdev *pDev, int fOpen, struct thread *pTd)
116
-#endif
117
+static int vgdrvFreeBSDOpen(struct cdev *pDev, int fOpen, int DevType, struct thread *pTd)
118
 {
119
     int                 rc;
120
     PVBOXGUESTSESSION   pSession;
121
@@ -227,25 +170,18 @@ static int vgdrvFreeBSDOpen(struct cdev 
122
     LogFlow(("vgdrvFreeBSDOpen:\n"));
123
 
124
     /*
125
-     * Try grab it (we don't grab the giant, remember).
126
-     */
127
-    if (!ASMAtomicCmpXchgPtr(&pDev->si_drv1, (void *)0x42, NULL))
128
-        return EBUSY;
129
-
130
-    /*
131
      * Create a new session.
132
      */
133
     rc = VGDrvCommonCreateUserSession(&g_DevExt, &pSession);
134
     if (RT_SUCCESS(rc))
135
     {
136
-        if (ASMAtomicCmpXchgPtr(&pDev->si_drv1, pSession, (void *)0x42))
137
-        {
138
-            Log(("vgdrvFreeBSDOpen: success - g_DevExt=%p pSession=%p rc=%d pid=%d\n", &g_DevExt, pSession, rc, (int)RTProcSelf()));
139
+        Log(("vgdrvFreeBSDOpen: success - g_DevExt=%p pSession=%p rc=%d pid=%d\n", &g_DevExt, pSession, rc, (int)RTProcSelf()));
140
+        rc = devfs_set_cdevpriv(pSession, vgdrvFreeBSDDtr);
141
+        if (rc)
142
+            VGDrvCommonCloseSession(&g_DevExt, pSession);
143
+        else
144
             ASMAtomicIncU32(&cUsers);
145
-            return 0;
146
-        }
147
-
148
-        VGDrvCommonCloseSession(&g_DevExt, pSession);
149
+        return rc;
150
     }
151
 
152
     LogRel(("vgdrvFreeBSDOpen: failed. rc=%d\n", rc));
153
@@ -253,33 +189,6 @@ static int vgdrvFreeBSDOpen(struct cdev 
154
 }
155
 
156
 /**
157
- * File close handler
158
- *
159
- */
160
-static int vgdrvFreeBSDClose(struct cdev *pDev, int fFile, int DevType, struct thread *pTd)
161
-{
162
-    PVBOXGUESTSESSION pSession = (PVBOXGUESTSESSION)pDev->si_drv1;
163
-    Log(("vgdrvFreeBSDClose: fFile=%#x pSession=%p\n", fFile, pSession));
164
-
165
-    /*
166
-     * Close the session if it's still hanging on to the device...
167
-     */
168
-    if (VALID_PTR(pSession))
169
-    {
170
-        VGDrvCommonCloseSession(&g_DevExt, pSession);
171
-        if (!ASMAtomicCmpXchgPtr(&pDev->si_drv1, NULL, pSession))
172
-            Log(("vgdrvFreeBSDClose: si_drv1=%p expected %p!\n", pDev->si_drv1, pSession));
173
-        ASMAtomicDecU32(&cUsers);
174
-        /* Don't use destroy_dev here because it may sleep resulting in a hanging user process. */
175
-        destroy_dev_sched(pDev);
176
-    }
177
-    else
178
-        Log(("vgdrvFreeBSDClose: si_drv1=%p!\n", pSession));
179
-    return 0;
180
-}
181
-
182
-
183
-/**
184
  * I/O control request.
185
  *
186
  * @returns depends...
187
@@ -292,7 +201,11 @@ static int vgdrvFreeBSDClose(struct cdev
188
 static int vgdrvFreeBSDIOCtl(struct cdev *pDev, u_long ulCmd, caddr_t pvData, int fFile, struct thread *pTd)
189
 {
190
     PVBOXGUESTSESSION pSession;
191
-    devfs_get_cdevpriv((void **)&pSession);
192
+    int rc;
193
+
194
+    rc = devfs_get_cdevpriv((void **)&pSession);
195
+    if (rc)
196
+        return rc;
197
 
198
     /*
199
      * Deal with the fast ioctl path first.
200
@@ -488,12 +401,14 @@ int VBOXCALL VBoxGuestIDC(void *pvSessio
201
 
202
 static int vgdrvFreeBSDPoll(struct cdev *pDev, int fEvents, struct thread *td)
203
 {
204
-    int fEventsProcessed;
205
+    PVBOXGUESTSESSION pSession;
206
+    int fEventsProcessed, rc;
207
 
208
     LogFlow(("vgdrvFreeBSDPoll: fEvents=%d\n", fEvents));
209
 
210
-    PVBOXGUESTSESSION pSession = (PVBOXGUESTSESSION)pDev->si_drv1;
211
-    if (RT_UNLIKELY(!VALID_PTR(pSession))) {
212
+    rc = devfs_get_cdevpriv((void **)&pSession);
213
+    if (rc)
214
+    {
215
         Log(("vgdrvFreeBSDPoll: no state data for %s\n", devtoname(pDev)));
216
         return (fEvents & (POLLHUP|POLLIN|POLLRDNORM|POLLOUT|POLLWRNORM));
217
     }
218
@@ -534,10 +449,7 @@ static int vgdrvFreeBSDDetach(device_t p
219
     /*
220
      * Reverse what we did in vgdrvFreeBSDAttach.
221
      */
222
-    if (g_vgdrvFreeBSDEHTag != NULL)
223
-        EVENTHANDLER_DEREGISTER(dev_clone, g_vgdrvFreeBSDEHTag);
224
-
225
-    clone_cleanup(&g_pvgdrvFreeBSDClones);
226
+    destroy_dev(g_pDev);
227
 
228
     vgdrvFreeBSDRemoveIRQ(pDevice, pState);
229
 
230
@@ -689,18 +601,21 @@ static int vgdrvFreeBSDAttach(device_t p
231
                 if (RT_SUCCESS(rc))
232
                 {
233
                     /*
234
-                     * Configure device cloning.
235
+                     * Configure device.
236
                      */
237
-                    clone_setup(&g_pvgdrvFreeBSDClones);
238
-                    g_vgdrvFreeBSDEHTag = EVENTHANDLER_REGISTER(dev_clone, vgdrvFreeBSDClone, 0, 1000);
239
-                    if (g_vgdrvFreeBSDEHTag)
240
+                    g_pDev = make_dev(&g_vgdrvFreeBSDChrDevSW,
241
+                                      0,
242
+                                      UID_ROOT,
243
+                                      GID_WHEEL,
244
+                                      0664,
245
+                                      "vboxguest");
246
+                    if (g_pDev)
247
                     {
248
                         printf(DEVICE_NAME ": loaded successfully\n");
249
                         return 0;
250
                     }
251
 
252
-                    printf(DEVICE_NAME ": EVENTHANDLER_REGISTER(dev_clone,,,) failed\n");
253
-                    clone_cleanup(&g_pvgdrvFreeBSDClones);
254
+                    printf(DEVICE_NAME ": make_dev failed\n");
255
                     vgdrvFreeBSDRemoveIRQ(pDevice, pState);
256
                 }
257
                 else
(-)emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-VBoxGuest-freebsd-Makefile (-18 lines)
Lines 1-18 Link Here
1
--- src/VBox/Additions/common/VBoxGuest/freebsd/Makefile.orig	2017-10-18 07:06:43 UTC
2
+++ src/VBox/Additions/common/VBoxGuest/freebsd/Makefile
3
@@ -70,6 +70,7 @@ SRCS += \
4
 	handletable.c \
5
 	handletablectx.c \
6
 	once.c \
7
+	term.c \
8
 	thread.c
9
 
10
 .PATH:	${.CURDIR}/common/string
11
@@ -128,6 +129,7 @@ SRCS += \
12
 
13
 .PATH:	${.CURDIR}/r0drv
14
 SRCS += \
15
+	alloc-ef-r0drv.c \
16
 	alloc-r0drv.c \
17
 	initterm-r0drv.c \
18
 	memobj-r0drv.c \
(-)emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-VBoxGuest-freebsd-files_vboxguest (-26 lines)
Lines 1-26 Link Here
1
--- src/VBox/Additions/common/VBoxGuest/freebsd/files_vboxguest.orig	2017-10-18 07:06:43 UTC
2
+++ src/VBox/Additions/common/VBoxGuest/freebsd/files_vboxguest
3
@@ -99,6 +99,7 @@ FILES_VBOXGUEST_NOBIN=" \
4
     ${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 \
6
     ${PATH_ROOT}/src/VBox/Runtime/common/misc/once.cpp=>common/misc/once.c \
7
+    ${PATH_ROOT}/src/VBox/Runtime/common/misc/term.cpp=>common/misc/term.c \
8
     ${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 \
10
     ${PATH_ROOT}/src/VBox/Runtime/common/misc/RTAssertMsg2.cpp=>common/misc/RTAssertMsg2.c \
11
@@ -160,6 +161,7 @@ FILES_VBOXGUEST_NOBIN=" \
12
     ${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 \
14
     ${PATH_ROOT}/src/VBox/Runtime/generic/mppresent-generic.cpp=>generic/mppresent-generic.c \
15
+    ${PATH_ROOT}/src/VBox/Runtime/r0drv/alloc-ef-r0drv.cpp=>r0drv/alloc-ef-r0drv.c \
16
     ${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 \
18
     ${PATH_ROOT}/src/VBox/Runtime/r0drv/initterm-r0drv.cpp=>r0drv/initterm-r0drv.c \
19
@@ -186,6 +188,7 @@ FILES_VBOXGUEST_NOBIN=" \
20
     ${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 \
22
     ${PATH_ROOT}/src/VBox/Runtime/r0drv/generic/mpnotification-r0drv-generic.cpp=>r0drv/generic/mpnotification-r0drv-generic.c \
23
+    ${PATH_ROOT}/src/VBox/Runtime/r0drv/generic/threadctxhooks-r0drv-generic.cpp=>r0drv/generic/threadctxhooks-r0drv-generic.c \
24
     ${PATH_ROOT}/src/VBox/Runtime/r0drv/generic/RTMpIsCpuWorkPending-r0drv-generic.cpp=>r0drv/generic/RTMpIsCpuWorkPending-r0drv-generic.c \
25
     ${PATH_ROOT}/src/VBox/Runtime/r0drv/memobj-r0drv.cpp=>r0drv/memobj-r0drv.c \
26
     ${PATH_ROOT}/src/VBox/Runtime/VBox/log-vbox.cpp=>VBox/log-vbox.c \
(-)emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-crOpenGL-FreeBSD_i386_exports.py (-98 lines)
Lines 1-98 Link Here
1
--- src/VBox/Additions/common/crOpenGL/FreeBSD_i386_exports.py.orig	2014-12-19 16:58:04.474417000 -0500
2
+++ src/VBox/Additions/common/crOpenGL/FreeBSD_i386_exports.py	2014-11-21 10:16:35.000000000 -0500
3
@@ -0,0 +1,95 @@
4
+# Copyright (c) 2001, Stanford University
5
+# All rights reserved.
6
+#
7
+# See the file LICENSE.txt for information on redistributing this software.
8
+
9
+
10
+import sys
11
+
12
+import apiutil
13
+
14
+
15
+def GenerateEntrypoints():
16
+
17
+    #apiutil.CopyrightC()
18
+
19
+    # Get sorted list of dispatched functions.
20
+    # The order is very important - it must match cr_opcodes.h
21
+    # and spu_dispatch_table.h
22
+    print '%include "iprt/asmdefs.mac"'
23
+    print ""
24
+    print "%ifdef RT_ARCH_AMD64"
25
+    print "extern glim"
26
+    print "%else ; X86"
27
+    print "extern glim"
28
+    print "%endif"
29
+    print ""
30
+
31
+    keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt")
32
+
33
+    for index in range(len(keys)):
34
+        func_name = keys[index]
35
+        if apiutil.Category(func_name) == "Chromium":
36
+            continue
37
+        if apiutil.Category(func_name) == "VBox":
38
+            continue
39
+
40
+        print "BEGINPROC_EXPORTED gl%s" % func_name
41
+        print "%ifdef RT_ARCH_AMD64"
42
+        print "\tmov \trax, qword glim+%d" % (8*index)
43
+        print "\tjmp \t[rax]"
44
+        print "%else ; X86"
45
+        print "\tmov \teax, dword glim+%d" % (4*index)
46
+        print "\tjmp \t[eax]"
47
+        print "%endif"
48
+        print "ENDPROC gl%s" % func_name
49
+        print ""
50
+
51
+
52
+    print ';'
53
+    print '; Aliases'
54
+    print ';'
55
+
56
+    # Now loop over all the functions and take care of any aliases
57
+    allkeys = apiutil.GetAllFunctions(sys.argv[1]+"/APIspec.txt")
58
+    for func_name in allkeys:
59
+        if "omit" in apiutil.ChromiumProps(func_name):
60
+            continue
61
+
62
+        if func_name in keys:
63
+            # we already processed this function earlier
64
+            continue
65
+
66
+        # alias is the function we're aliasing
67
+        alias = apiutil.Alias(func_name)
68
+        if alias:
69
+            # this dict lookup should never fail (raise an exception)!
70
+            index = keys.index(alias)
71
+            print "BEGINPROC_EXPORTED gl%s" % func_name
72
+            print "%ifdef RT_ARCH_AMD64"
73
+            print "\tmov \trax, qword glim+%d" % (8*index)
74
+            print "\tjmp \t[rax]"
75
+            print "%else ; X86"
76
+            print "\tmov \teax, dword glim+%d" % (4*index)
77
+            print "\tjmp \t[eax]"
78
+            print "%endif"
79
+            print "ENDPROC gl%s" % func_name
80
+            print ""
81
+
82
+
83
+    print ';'
84
+    print '; No-op stubs'
85
+    print ';'
86
+
87
+    # Now generate no-op stub functions
88
+    for func_name in allkeys:
89
+        if "stub" in apiutil.ChromiumProps(func_name):
90
+            print "BEGINPROC_EXPORTED gl%s" % func_name
91
+            print "\tleave"
92
+            print "\tret"
93
+            print "ENDPROC gl%s" % func_name
94
+            print ""
95
+
96
+
97
+GenerateEntrypoints()
98
+
(-)emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-crOpenGL-FreeBSD_i386_exports_dri.py (-98 lines)
Lines 1-98 Link Here
1
--- src/VBox/Additions/common/crOpenGL/FreeBSD_i386_exports_dri.py.orig	2014-12-19 16:58:04.474417000 -0500
2
+++ src/VBox/Additions/common/crOpenGL/FreeBSD_i386_exports_dri.py	2014-11-21 10:16:35.000000000 -0500
3
@@ -0,0 +1,95 @@
4
+# Copyright (c) 2001, Stanford University
5
+# All rights reserved.
6
+#
7
+# See the file LICENSE.txt for information on redistributing this software.
8
+
9
+
10
+import sys
11
+
12
+import apiutil
13
+
14
+
15
+def GenerateEntrypoints():
16
+
17
+    #apiutil.CopyrightC()
18
+
19
+    # Get sorted list of dispatched functions.
20
+    # The order is very important - it must match cr_opcodes.h
21
+    # and spu_dispatch_table.h
22
+    print '%include "iprt/asmdefs.mac"'
23
+    print ""
24
+    print "%ifdef RT_ARCH_AMD64"
25
+    print "extern glim"
26
+    print "%else ; X86"
27
+    print "extern glim"
28
+    print "%endif"
29
+    print ""
30
+
31
+    keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt")
32
+
33
+    for index in range(len(keys)):
34
+        func_name = keys[index]
35
+        if apiutil.Category(func_name) == "Chromium":
36
+            continue
37
+        if apiutil.Category(func_name) == "VBox":
38
+            continue
39
+
40
+        print "BEGINPROC_EXPORTED cr_gl%s" % func_name
41
+        print "%ifdef RT_ARCH_AMD64"
42
+        print "\tmov \trax, qword glim+%d" % (8*index)
43
+        print "\tjmp \t[rax]"
44
+        print "%else ; X86"
45
+        print "\tmov \teax, dword glim+%d" % (4*index)
46
+        print "\tjmp \t[eax]"
47
+        print "%endif"
48
+        print "ENDPROC cr_gl%s" % func_name
49
+        print ""
50
+
51
+
52
+    print ';'
53
+    print '; Aliases'
54
+    print ';'
55
+
56
+    # Now loop over all the functions and take care of any aliases
57
+    allkeys = apiutil.GetAllFunctions(sys.argv[1]+"/APIspec.txt")
58
+    for func_name in allkeys:
59
+        if "omit" in apiutil.ChromiumProps(func_name):
60
+            continue
61
+
62
+        if func_name in keys:
63
+            # we already processed this function earlier
64
+            continue
65
+
66
+        # alias is the function we're aliasing
67
+        alias = apiutil.Alias(func_name)
68
+        if alias:
69
+            # this dict lookup should never fail (raise an exception)!
70
+            index = keys.index(alias)
71
+            print "BEGINPROC_EXPORTED cr_gl%s" % func_name
72
+            print "%ifdef RT_ARCH_AMD64"
73
+            print "\tmov \trax, qword glim+%d" % (8*index)
74
+            print "\tjmp \t[rax]"
75
+            print "%else ; X86"
76
+            print "\tmov \teax, dword glim+%d" % (4*index)
77
+            print "\tjmp \t[eax]"
78
+            print "%endif"
79
+            print "ENDPROC cr_gl%s" % func_name
80
+            print ""
81
+
82
+
83
+    print ';'
84
+    print '; No-op stubs'
85
+    print ';'
86
+
87
+    # Now generate no-op stub functions
88
+    for func_name in allkeys:
89
+        if "stub" in apiutil.ChromiumProps(func_name):
90
+            print "BEGINPROC_EXPORTED cr_gl%s" % func_name
91
+            print "\tleave"
92
+            print "\tret"
93
+            print "ENDPROC cr_gl%s" % func_name
94
+            print ""
95
+
96
+
97
+GenerateEntrypoints()
98
+
(-)emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-crOpenGL-FreeBSD_i386_glxapi_exports.py (-107 lines)
Lines 1-107 Link Here
1
--- src/VBox/Additions/common/crOpenGL/FreeBSD_i386_glxapi_exports.py.orig	2014-12-19 16:58:04.474417000 -0500
2
+++ src/VBox/Additions/common/crOpenGL/FreeBSD_i386_glxapi_exports.py	2014-11-21 10:16:35.000000000 -0500
3
@@ -0,0 +1,104 @@
4
+"""
5
+Copyright (C) 2009-2012 Oracle Corporation
6
+
7
+This file is part of VirtualBox Open Source Edition (OSE), as
8
+available from http://www.virtualbox.org. This file is free software;
9
+you can redistribute it and/or modify it under the terms of the GNU
10
+General Public License (GPL) as published by the Free Software
11
+Foundation, in version 2 as it comes in the "COPYING" file of the
12
+VirtualBox OSE distribution. VirtualBox OSE is distributed in the
13
+hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
14
+"""
15
+
16
+import sys
17
+
18
+#Note, this should match the fakedri_glxfuncsList.h order
19
+glx_functions = [
20
+"CopyContext",
21
+"UseXFont",
22
+#"GetDriverConfig",
23
+"GetProcAddress",
24
+"QueryExtension",
25
+"IsDirect",
26
+"DestroyGLXPbufferSGIX",
27
+"QueryGLXPbufferSGIX",
28
+"CreateGLXPixmap",
29
+"CreateGLXPixmapWithConfigSGIX",
30
+"QueryContext",
31
+"CreateContextWithConfigSGIX",
32
+"SwapBuffers",
33
+"CreateNewContext",
34
+"SelectEventSGIX",
35
+"GetCurrentDrawable",
36
+"ChooseFBConfig",
37
+"WaitGL",
38
+"GetFBConfigs",
39
+"CreatePixmap",
40
+"GetSelectedEventSGIX",
41
+"GetCurrentReadDrawable",
42
+"GetCurrentDisplay",
43
+"QueryServerString",
44
+"CreateWindow",
45
+"SelectEvent",
46
+"GetVisualFromFBConfigSGIX",
47
+"GetFBConfigFromVisualSGIX",
48
+"QueryDrawable",
49
+"CreateContext",
50
+"GetConfig",
51
+"CreateGLXPbufferSGIX",
52
+"CreatePbuffer",
53
+"ChooseFBConfigSGIX",
54
+"WaitX",
55
+"GetVisualFromFBConfig",
56
+#"GetScreenDriver",
57
+"GetFBConfigAttrib",
58
+"GetCurrentContext",
59
+"GetClientString",
60
+"DestroyPixmap",
61
+"MakeCurrent",
62
+"DestroyContext",
63
+"GetProcAddressARB",
64
+"GetSelectedEvent",
65
+"DestroyPbuffer",
66
+"DestroyWindow",
67
+"DestroyGLXPixmap",
68
+"QueryVersion",
69
+"ChooseVisual",
70
+"MakeContextCurrent",
71
+"QueryExtensionsString",
72
+"GetFBConfigAttribSGIX",
73
+"FreeMemoryMESA",
74
+"QueryContextInfoEXT",
75
+"ImportContextEXT",
76
+"GetContextIDEXT",
77
+"MakeCurrentReadSGI",
78
+"AllocateMemoryMESA",
79
+"GetMemoryOffsetMESA",
80
+"CreateGLXPixmapMESA",
81
+"GetCurrentDisplayEXT",
82
+"FreeContextEXT"
83
+];
84
+
85
+print '%include "iprt/asmdefs.mac"'
86
+print ""
87
+print "%ifdef RT_ARCH_AMD64"
88
+print "extern glxim"
89
+print "%else ; X86"
90
+print "extern glxim"
91
+print "%endif"
92
+print ""
93
+
94
+for index in range(len(glx_functions)):
95
+    func_name = glx_functions[index]
96
+
97
+    print "BEGINPROC_EXPORTED vbox_glX%s" % func_name
98
+    print "%ifdef RT_ARCH_AMD64"
99
+    print "\tmov \trax, qword glxim+%d" % (8*index)
100
+    print "\tjmp \t[rax]"
101
+    print "%else ; X86"
102
+    print "\tmov \teax, dword glxim+%d" % (4*index)
103
+    print "\tjmp \t[eax]"
104
+    print "%endif"
105
+    print "ENDPROC vbox_glX%s" % func_name
106
+    print ""
107
+
(-)emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-crOpenGL-Makefile.kmk (-79 lines)
Lines 1-79 Link Here
1
--- src/VBox/Additions/common/crOpenGL/Makefile.kmk.orig	2016-07-18 11:50:43 UTC
2
+++ src/VBox/Additions/common/crOpenGL/Makefile.kmk
3
@@ -47,9 +47,7 @@ endif
4
 if1of ($(KBUILD_TARGET), linux solaris freebsd)
5
  #VBoxOGL_DRI = 1
6
  DLLS += VBoxEGL
7
- ifn1of ($(KBUILD_TARGET),linux solaris)   # No DRI on Solaris yet
8
-  VBoxOGL_FAKEDRI = 1
9
- endif
10
+ #VBoxOGL_FAKEDRI = 1
11
 
12
  # Only Solaris right now needs C stubs because I can't figure out how to
13
  # generate the GOT based relocation ASM yet.
14
@@ -184,10 +182,12 @@ VBoxOGL_CLEAN.linux        += \
15
 	$(VBOX_PATH_CROGL_GENFILES)/linux_exports.c
16
 VBoxOGL_CLEAN.solaris        += \
17
 	$(VBOX_PATH_CROGL_GENFILES)/solaris_exports.c
18
+VBoxOGL_CLEAN.freebsd  += \
19
+	$(VBOX_PATH_CROGL_GENFILES)/freebsd_exports.c
20
 VBoxOGL_CLEAN.win      = \
21
 	$(VBOX_PATH_CROGL_GENFILES)/windows_exports.asm \
22
 	$(VBOX_PATH_CROGL_GENFILES)/cropengl.def
23
-if1of ($(KBUILD_TARGET), linux solaris)
24
+if1of ($(KBUILD_TARGET), linux solaris freebsd)
25
  ifdef VBoxOGL_DRI
26
   VBoxOGL_CLEAN   += \
27
  	$(VBOX_PATH_CROGL_GENFILES)/cr_gl.h \
28
@@ -200,6 +200,8 @@ if1of ($(KBUILD_TARGET), linux solaris)
29
  	$(VBOX_PATH_CROGL_GENFILES)/linux_glxapi_exports.asm
30
   VBoxOGL_CLEAN.solaris   += \
31
  	$(VBOX_PATH_CROGL_GENFILES)/solaris_glxapi_exports.asm
32
+  VBoxOGL_CLEAN.freebsd += \
33
+ 	$(VBOX_PATH_CROGL_GENFILES)/freebsd_glxapi_exports.asm
34
  endif
35
 endif
36
 VBoxOGL_LIBS = \
37
@@ -229,6 +231,8 @@ if1of ($(KBUILD_TARGET), linux solaris f
38
  else
39
   VBoxOGL_SONAME.linux = libGL.so.1
40
   VBoxOGL_LDFLAGS.linux += -Wl,-e,LibMain
41
+  VBoxOGL_SONAME.freebsd = libGL.so.1
42
+  VBoxOGL_LDFLAGS.freebsd += -Wl,-e,LibMain
43
  endif
44
 endif
45
 ifdef VBOX_WITH_CRHGSMI
46
@@ -237,7 +241,7 @@ endif
47
 ifdef VBOX_WITH_WDDM
48
 VBoxOGL_DEFS.win   += VBOX_WITH_WDDM
49
 endif
50
-if1of ($(KBUILD_TARGET), linux)
51
+if1of ($(KBUILD_TARGET), linux freebsd)
52
 VBoxOGL_LDFLAGS += -Wl,-z,nodelete
53
 endif
54
 ifdef VBOX_WITH_WDDM
55
@@ -395,6 +399,16 @@ $(VBOX_PATH_CROGL_GENFILES)/solaris_expo
56
 $(VBOX_PATH_CROGL_GENFILES)/solaris_glxapi_exports.asm: $(PATH_SUB_CURRENT)/SunOS_i386_glxapi_exports.py | $$(dir $$@)
57
 	$(call MSG_GENERATE,python,$@,$<)
58
 	$(QUIET)$(call VBOX_CROGL_PYTHON_ENV,$(VBOX_PATH_CROGL_PYTHON_INCLUDE),$@) $(VBOX_BLD_PYTHON) $<
59
+   else ifeq ($(KBUILD_TARGET),freebsd)
60
+$(VBOX_PATH_CROGL_GENFILES)/freebsd_exports_dri.asm: \
61
+		$(PATH_SUB_CURRENT)/FreeBSD_i386_exports_dri.py \
62
+		$(VBOX_CROGL_API_FILES) $(PATH_SUB_CURRENT)/entrypoints.py \
63
+		| $$(dir $$@)
64
+	$(call MSG_GENERATE,python,$@,$<)
65
+	$(QUIET)$(call VBOX_CROGL_PYTHON_ENV,$(VBOX_PATH_CROGL_PYTHON_INCLUDE),$@) $(VBOX_BLD_PYTHON) $< $(VBOX_PATH_CROGL_GLAPI)
66
+$(VBOX_PATH_CROGL_GENFILES)/freebsd_glxapi_exports.asm: $(PATH_SUB_CURRENT)/FreeBSD_i386_glxapi_exports.py | $$(dir $$@)
67
+	$(call MSG_GENERATE,python,$@,$<)
68
+	$(QUIET)$(call VBOX_CROGL_PYTHON_ENV,$(VBOX_PATH_CROGL_PYTHON_INCLUDE),$@) $(VBOX_BLD_PYTHON) $<
69
 
70
    else
71
 $(VBOX_PATH_CROGL_GENFILES)/linux_exports_dri.asm: \
72
@@ -712,6 +726,7 @@ VBoxEGL_SOURCES        = egl.c
73
 VBoxEGL_INCS           = $(VBOX_PATH_X11_ROOT)/mesa-11.0.7
74
 VBoxEGL_LIBS           = $(VBOX_LIB_OGL) $(VBOX_LIB_IPRT_GUEST_R3_SHARED)
75
 VBoxEGL_SONAME.linux   = libEGL.so.1
76
+VBoxEGL_SONAME.freebsd = libEGL.so.1
77
 
78
 include $(FILE_KBUILD_SUB_FOOTER)
79
 
(-)emulators/virtualbox-ose/files/patch-src-VBox-Additions-x11-Installer-98vboxadd-xclient (-17 lines)
Lines 1-17 Link Here
1
--- src/VBox/Additions/x11/Installer/98vboxadd-xclient.orig	2015-02-12 11:08:13.000000000 -0500
2
+++ src/VBox/Additions/x11/Installer/98vboxadd-xclient	2015-02-12 14:38:40.689104000 -0500
3
@@ -28,9 +28,9 @@
4
    # This script can also be triggered by a connection over SSH, which is not
5
    # what we had in mind, so we do not start VBoxClient in that case.  We do
6
    # not use "exit" here as this script is "source"d, not executed.
7
-  /usr/bin/VBoxClient --clipboard
8
-  /usr/bin/VBoxClient --checkhostversion
9
-  /usr/bin/VBoxClient --display
10
-  /usr/bin/VBoxClient --seamless
11
-  /usr/bin/VBoxClient --draganddrop
12
+  /usr/local/bin/VBoxClient --clipboard
13
+  /usr/local/bin/VBoxClient --checkhostversion
14
+  /usr/local/bin/VBoxClient --display
15
+  /usr/local/bin/VBoxClient --seamless
16
+  /usr/local/bin/VBoxClient --draganddrop
17
 fi
(-)emulators/virtualbox-ose/files/patch-src-VBox-Additions-x11-Installer-vboxclient.desktop (-10 lines)
Lines 1-10 Link Here
1
--- src/VBox/Additions/x11/Installer/vboxclient.desktop.orig	2009-06-12 12:34:57.000000000 +0000
2
+++ src/VBox/Additions/x11/Installer/vboxclient.desktop	2011-01-13 22:07:37.000000000 +0000
3
@@ -8,6 +8,6 @@
4
 Comment=VirtualBox User Session Services
5
 Comment[it]=Servizi di sessione utente di VirtualBox
6
 Comment[pl]=Usługi sesji użytkownika VirtualBox
7
-Exec=/usr/bin/VBoxClient-all
8
+Exec=/usr/local/bin/VBoxClient-all
9
 X-GNOME-Autostart-enabled=true
10
 X-KDE-autostart-after=panel
(-)emulators/virtualbox-ose/files/patch-src-VBox-Devices-Network-slirp-bsd-sys-mbuf.h (-12 lines)
Lines 1-12 Link Here
1
--- src/VBox/Devices/Network/slirp/bsd/sys/mbuf.h.orig	2015-03-02 10:09:19.000000000 -0500
2
+++ src/VBox/Devices/Network/slirp/bsd/sys/mbuf.h	2015-03-02 19:42:56.808020000 -0500
3
@@ -241,6 +241,9 @@
4
 #define	M_FRAG		0x00000800 /* packet is a fragment of a larger packet */
5
 #define	M_FIRSTFRAG	0x00001000 /* packet is first fragment */
6
 #define	M_LASTFRAG	0x00002000 /* packet is last fragment */
7
+#ifdef M_SKIP_FIREWALL
8
+#undef M_SKIP_FIREWALL
9
+#endif
10
 #define	M_SKIP_FIREWALL	0x00004000 /* skip firewall processing */
11
 #define	M_FREELIST	0x00008000 /* mbuf is on the free list */
12
 #define	M_VLANTAG	0x00010000 /* ether_vtag is valid */
(-)emulators/virtualbox-ose/files/patch-src-VBox-GuestHost-OpenGL-Makefile.kmk (-20 lines)
Lines 1-20 Link Here
1
--- src/VBox/GuestHost/OpenGL/Makefile.kmk.orig	2019-07-12 08:49:27 UTC
2
+++ src/VBox/GuestHost/OpenGL/Makefile.kmk
3
@@ -94,7 +94,7 @@ VBoxOGLcrutil_DEFS.win    += CR_DEBUG_BACKDOOR_ENABLE
4
 VBoxOGLcrutil_INCS.win    += $(PATH_ROOT)/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm
5
 VBoxOGLcrutil_LIBS.win    += $(VBOX_PATH_ADDITIONS_LIB)/VBoxDispMpLogger$(VBOX_SUFF_LIB)
6
 endif
7
-if1of ($(KBUILD_TARGET), linux)
8
+if1of ($(KBUILD_TARGET), linux freebsd)
9
 VBoxOGLcrutil_LDFLAGS += -Wl,-z,nodelete
10
 endif
11
 
12
@@ -140,7 +140,7 @@ VBoxOGLhostcrutil_TEMPLATE = VBOXCROGLR3HOSTLIB
13
 if defined(VBOX_SIGNING_MODE) && defined(VBOX_WITH_WDDM)
14
  VBoxOGLhostcrutil_INSTTYPE.win = both
15
 endif
16
-if1of ($(KBUILD_TARGET), linux)
17
+if1of ($(KBUILD_TARGET), linux freebsd)
18
 VBoxOGLhostcrutil_LDFLAGS = $(NO_SUCH_VARIABLE)
19
 endif
20
 VBoxOGLhostcrutil_LIBS.win =  \
(-)emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-Support-freebsd-Makefile (-27 lines)
Lines 1-27 Link Here
1
--- src/VBox/HostDrivers/Support/freebsd/Makefile.orig	2016-07-18 11:56:20 UTC
2
+++ src/VBox/HostDrivers/Support/freebsd/Makefile
3
@@ -81,6 +81,7 @@ SRCS += \
4
 	assert.c \
5
 	handletable.c \
6
 	handletablectx.c \
7
+	handletablesimple.c \
8
 	once.c \
9
 	term.c \
10
 	thread.c
11
@@ -92,13 +93,14 @@ SRCS += \
12
 	RTStrCopy.c \
13
 	RTStrCopyEx.c \
14
 	RTStrCopyP.c \
15
+	memchr.c \
16
 	strformat.c \
17
 	strformatrt.c \
18
 	strformattype.c \
19
+	stringalloc.c \
20
 	strprintf.c \
21
 	strtonum.c \
22
-	memchr.c \
23
-	stringalloc.c
24
+	utf-8.c
25
 
26
 .PATH:	${.CURDIR}/common/rand
27
 SRCS += \
(-)emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-Support-freebsd-files_vboxdrv (-27 lines)
Lines 1-27 Link Here
1
--- src/VBox/HostDrivers/Support/freebsd/files_vboxdrv.orig	2016-07-18 11:56:20 UTC
2
+++ src/VBox/HostDrivers/Support/freebsd/files_vboxdrv
3
@@ -116,6 +116,7 @@ FILES_VBOXDRV_NOBIN=" \
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 \
6
     ${PATH_ROOT}/src/VBox/Runtime/common/misc/handletablectx.cpp=>common/misc/handletablectx.c \
7
+    ${PATH_ROOT}/src/VBox/Runtime/common/misc/handletablesimple.cpp=>common/misc/handletablesimple.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 \
10
     ${PATH_ROOT}/src/VBox/Runtime/common/misc/thread.cpp=>common/misc/thread.c \
11
@@ -124,13 +125,14 @@ FILES_VBOXDRV_NOBIN=" \
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 \
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 \
16
     ${PATH_ROOT}/src/VBox/Runtime/common/string/strformat.cpp=>common/string/strformat.c \
17
     ${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/stringalloc.cpp=>common/string/stringalloc.c \
20
     ${PATH_ROOT}/src/VBox/Runtime/common/string/strprintf.cpp=>common/string/strprintf.c \
21
     ${PATH_ROOT}/src/VBox/Runtime/common/string/strtonum.cpp=>common/string/strtonum.c \
22
-    ${PATH_ROOT}/src/VBox/Runtime/common/string/memchr.cpp=>common/string/memchr.c \
23
-    ${PATH_ROOT}/src/VBox/Runtime/common/string/stringalloc.cpp=>common/string/stringalloc.c \
24
+    ${PATH_ROOT}/src/VBox/Runtime/common/string/utf-8.cpp=>common/string/utf-8.c \
25
     ${PATH_ROOT}/src/VBox/Runtime/common/rand/rand.cpp=>common/rand/rand.c \
26
     ${PATH_ROOT}/src/VBox/Runtime/common/rand/randadv.cpp=>common/rand/randadv.c \
27
     ${PATH_ROOT}/src/VBox/Runtime/common/rand/randparkmiller.cpp=>common/rand/randparkmiller.c \
(-)emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-VBoxNetAdp-Makefile.kmk (-25 lines)
Lines 1-25 Link Here
1
Fix kmod panic when VIMAGE is disabled in the kernel and port
2
3
Submitted by:	Gleb Kurtsou <gleb@freebsd.org>
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) \
8
 		| $$(dir $$@)
9
 	$(QUIET)$(RM) -f -- $@
10
- ifndef VBOX_WITH_HARDENING
11
-	$(QUIET)$(SED) -e "s;-DVBOX_WITH_HARDENING;;g" --output $@ $<
12
- else
13
 	$(QUIET)$(CP) -f $< $@
14
+ ifndef VBOX_WITH_HARDENING
15
+	$(QUIET)$(SED) -e "s;-DVBOX_WITH_HARDENING;;g" --output $@.tmp $@
16
+	${QUIET}$(MV) -f $@.tmp $@
17
+ endif
18
+ ifndef VBOX_WITH_NETFLT_VIMAGE
19
+	$(QUIET)$(SED) -e "s;-DVIMAGE;;g" --output $@.tmp $@
20
+	${QUIET}$(MV) -f $@.tmp $@
21
  endif
22
-
23
 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 (-273 lines)
Lines 1-273 Link Here
1
--- src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c.orig	2018-10-15 14:30:58 UTC
2
+++ src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c
3
@@ -52,6 +52,7 @@
4
 #include <net/if_dl.h>
5
 #include <net/if_types.h>
6
 #include <net/ethernet.h>
7
+#include <net/if_vlan_var.h>
8
 
9
 #include <netgraph/ng_message.h>
10
 #include <netgraph/netgraph.h>
11
@@ -73,6 +74,7 @@
12
 
13
 #define VBOXNETFLT_OS_SPECFIC 1
14
 #include "../VBoxNetFltInternal.h"
15
+#include "freebsd/the-freebsd-kernel.h"
16
 
17
 static int vboxnetflt_modevent(struct module *, int, void *);
18
 static ng_constructor_t    ng_vboxnetflt_constructor;
19
@@ -370,7 +372,11 @@ static int ng_vboxnetflt_rcvdata(hook_p hook, item_p i
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;
45
     unsigned int cSegs = 0;
46
     bool fDropIt = false, fActive;
47
+    bool is_vl_tagged = false;
48
+    uint16_t vl_tag;
49
     PINTNETSG pSG;
50
 
51
     VBOXCURVNET_SET(ifp->if_vnet);
52
@@ -440,6 +452,19 @@ static void vboxNetFltFreeBSDinput(void *arg, int pend
53
         if (m == NULL)
54
             break;
55
 
56
+        /* Prepend a VLAN header for consumption by the virtual switch */
57
+        if (m->m_flags & M_VLANTAG) {
58
+            vl_tag = m->m_pkthdr.ether_vtag;
59
+            is_vl_tagged = true;
60
+
61
+            m = ether_vlanencap(m, m->m_pkthdr.ether_vtag);
62
+            if (m == NULL) {
63
+                printf("vboxflt: unable to prepend VLAN header\n");
64
+                break;
65
+            }
66
+            m->m_flags &= ~M_VLANTAG;
67
+        }
68
+
69
         for (m0 = m; m0 != NULL; m0 = m0->m_next)
70
             if (m0->m_len > 0)
71
                 cSegs++;
72
@@ -454,6 +479,27 @@ static void vboxNetFltFreeBSDinput(void *arg, int pend
73
         vboxNetFltFreeBSDMBufToSG(pThis, m, pSG, cSegs, 0);
74
         fDropIt = pThis->pSwitchPort->pfnRecv(pThis->pSwitchPort, NULL /* pvIf */, pSG, INTNETTRUNKDIR_WIRE);
75
         RTMemTmpFree(pSG);
76
+
77
+        /* Restore the VLAN flags before re-injecting the packet */
78
+        if (is_vl_tagged && !fDropIt) {
79
+            struct ether_vlan_header *vl_hdr;
80
+
81
+            /* This shouldn't fail, as the header was just prepended */
82
+            if (m->m_len < sizeof(*vl_hdr) && (m = m_pullup(m, sizeof(*vl_hdr))) == NULL) {
83
+                printf("vboxflt: unable to pullup VLAN header\n");
84
+                m_freem(m);
85
+                break;
86
+            }
87
+
88
+            /* Copy the MAC dhost/shost over the 802.1q field */
89
+            vl_hdr = mtod(m, struct ether_vlan_header *);
90
+            bcopy((char *)vl_hdr, (char *)vl_hdr + ETHER_VLAN_ENCAP_LEN, ETHER_HDR_LEN - ETHER_TYPE_LEN);
91
+            m_adj(m, ETHER_VLAN_ENCAP_LEN);
92
+
93
+            m->m_pkthdr.ether_vtag = vl_tag;
94
+            m->m_flags |= M_VLANTAG;
95
+        }
96
+
97
         if (fDropIt)
98
             m_freem(m);
99
         else
100
@@ -513,6 +559,7 @@ static void vboxNetFltFreeBSDoutput(void *arg, int pen
101
  */
102
 int vboxNetFltPortOsXmit(PVBOXNETFLTINS pThis, void *pvIfData, PINTNETSG pSG, uint32_t fDst)
103
 {
104
+    IPRT_FREEBSD_SAVE_EFL_AC();
105
     NOREF(pvIfData);
106
 
107
     void (*input_f)(struct ifnet *, struct mbuf *);
108
@@ -529,10 +576,16 @@ int vboxNetFltPortOsXmit(PVBOXNETFLTINS pThis, void *p
109
     {
110
         m = vboxNetFltFreeBSDSGMBufFromSG(pThis, pSG);
111
         if (m == NULL)
112
+        {
113
+            IPRT_FREEBSD_RESTORE_EFL_AC();
114
             return VERR_NO_MEMORY;
115
+        }
116
         m = m_pullup(m, ETHER_HDR_LEN);
117
         if (m == NULL)
118
+        {
119
+            IPRT_FREEBSD_RESTORE_EFL_AC();
120
             return VERR_NO_MEMORY;
121
+        }
122
 
123
         m->m_flags |= M_PKTHDR;
124
         ether_output_frame(ifp, m);
125
@@ -542,10 +595,16 @@ int vboxNetFltPortOsXmit(PVBOXNETFLTINS pThis, void *p
126
     {
127
         m = vboxNetFltFreeBSDSGMBufFromSG(pThis, pSG);
128
         if (m == NULL)
129
+        {
130
+            IPRT_FREEBSD_RESTORE_EFL_AC();
131
             return VERR_NO_MEMORY;
132
+        }
133
         m = m_pullup(m, ETHER_HDR_LEN);
134
         if (m == NULL)
135
+        {
136
+            IPRT_FREEBSD_RESTORE_EFL_AC();
137
             return VERR_NO_MEMORY;
138
+        }
139
         /*
140
          * Delivering packets to the host will be captured by the
141
          * input hook. Tag the packet with a mbuf tag so that we
142
@@ -556,6 +615,7 @@ int vboxNetFltPortOsXmit(PVBOXNETFLTINS pThis, void *p
143
         if (mtag == NULL)
144
         {
145
             m_freem(m);
146
+            IPRT_FREEBSD_RESTORE_EFL_AC();
147
             return VERR_NO_MEMORY;
148
         }
149
 
150
@@ -566,6 +626,7 @@ int vboxNetFltPortOsXmit(PVBOXNETFLTINS pThis, void *p
151
         ifp->if_input(ifp, m);
152
     }
153
     VBOXCURVNET_RESTORE();
154
+    IPRT_FREEBSD_RESTORE_EFL_AC();
155
     return VINF_SUCCESS;
156
 }
157
 
158
@@ -578,6 +639,7 @@ static bool vboxNetFltFreeBsdIsPromiscuous(PVBOXNETFLT
159
 
160
 int vboxNetFltOsInitInstance(PVBOXNETFLTINS pThis, void *pvContext)
161
 {
162
+    IPRT_FREEBSD_SAVE_EFL_AC();
163
     char nam[NG_NODESIZ];
164
     struct ifnet *ifp;
165
     node_p node;
166
@@ -586,7 +648,10 @@ int vboxNetFltOsInitInstance(PVBOXNETFLTINS pThis, voi
167
     NOREF(pvContext);
168
     ifp = ifunit(pThis->szName);
169
     if (ifp == NULL)
170
+    {
171
+        IPRT_FREEBSD_RESTORE_EFL_AC();
172
         return VERR_INTNET_FLT_IF_NOT_FOUND;
173
+    }
174
 
175
     /* Create a new netgraph node for this instance */
176
     if (ng_make_node_common(&ng_vboxnetflt_typestruct, &node) != 0)
177
@@ -630,12 +695,14 @@ int vboxNetFltOsInitInstance(PVBOXNETFLTINS pThis, voi
178
         vboxNetFltRelease(pThis, true /*fBusy*/);
179
     }
180
     VBOXCURVNET_RESTORE();
181
+    IPRT_FREEBSD_RESTORE_EFL_AC();
182
 
183
     return VINF_SUCCESS;
184
 }
185
 
186
 bool vboxNetFltOsMaybeRediscovered(PVBOXNETFLTINS pThis)
187
 {
188
+    IPRT_FREEBSD_SAVE_EFL_AC();
189
     struct ifnet *ifp, *ifp0;
190
 
191
     ifp = ASMAtomicUoReadPtrT(&pThis->u.s.ifp, struct ifnet *);
192
@@ -652,6 +719,7 @@ bool vboxNetFltOsMaybeRediscovered(PVBOXNETFLTINS pThi
193
         pThis->u.s.node = NULL;
194
     }
195
     VBOXCURVNET_RESTORE();
196
+    IPRT_FREEBSD_RESTORE_EFL_AC();
197
 
198
     if (ifp0 != NULL)
199
     {
200
@@ -664,6 +732,7 @@ bool vboxNetFltOsMaybeRediscovered(PVBOXNETFLTINS pThi
201
 
202
 void vboxNetFltOsDeleteInstance(PVBOXNETFLTINS pThis)
203
 {
204
+    IPRT_FREEBSD_SAVE_EFL_AC();
205
 
206
     taskqueue_drain(taskqueue_fast, &pThis->u.s.tskin);
207
     taskqueue_drain(taskqueue_fast, &pThis->u.s.tskout);
208
@@ -676,6 +745,7 @@ void vboxNetFltOsDeleteInstance(PVBOXNETFLTINS pThis)
209
         ng_rmnode_self(pThis->u.s.node);
210
     VBOXCURVNET_RESTORE();
211
     pThis->u.s.node = NULL;
212
+    IPRT_FREEBSD_RESTORE_EFL_AC();
213
 }
214
 
215
 int vboxNetFltOsPreInitInstance(PVBOXNETFLTINS pThis)
216
@@ -689,6 +759,7 @@ int vboxNetFltOsPreInitInstance(PVBOXNETFLTINS pThis)
217
 
218
 void vboxNetFltPortOsSetActive(PVBOXNETFLTINS pThis, bool fActive)
219
 {
220
+    IPRT_FREEBSD_SAVE_EFL_AC();
221
     struct ifnet *ifp;
222
     struct ifreq ifreq;
223
     int error;
224
@@ -722,7 +793,10 @@ void vboxNetFltPortOsSetActive(PVBOXNETFLTINS pThis, b
225
         NG_MKMESSAGE(msg, NGM_GENERIC_COOKIE, NGM_CONNECT,
226
             sizeof(struct ngm_connect), M_NOWAIT);
227
         if (msg == NULL)
228
+        {
229
+            IPRT_FREEBSD_RESTORE_EFL_AC();
230
             return;
231
+        }
232
         con = (struct ngm_connect *)msg->data;
233
         snprintf(con->path, NG_PATHSIZ, "vboxnetflt_%s:", ifp->if_xname);
234
         strlcpy(con->ourhook, "lower", NG_HOOKSIZ);
235
@@ -736,7 +810,10 @@ void vboxNetFltPortOsSetActive(PVBOXNETFLTINS pThis, b
236
         NG_MKMESSAGE(msg, NGM_GENERIC_COOKIE, NGM_CONNECT,
237
             sizeof(struct ngm_connect), M_NOWAIT);
238
         if (msg == NULL)
239
+        {
240
+            IPRT_FREEBSD_RESTORE_EFL_AC();
241
             return;
242
+        }
243
         con = (struct ngm_connect *)msg->data;
244
         snprintf(con->path, NG_PATHSIZ, "vboxnetflt_%s:",
245
             ifp->if_xname);
246
@@ -759,7 +836,10 @@ void vboxNetFltPortOsSetActive(PVBOXNETFLTINS pThis, b
247
         NG_MKMESSAGE(msg, NGM_GENERIC_COOKIE, NGM_RMHOOK,
248
             sizeof(struct ngm_rmhook), M_NOWAIT);
249
         if (msg == NULL)
250
+        {
251
+            IPRT_FREEBSD_RESTORE_EFL_AC();
252
             return;
253
+        }
254
         rm = (struct ngm_rmhook *)msg->data;
255
         strlcpy(rm->ourhook, "input", NG_HOOKSIZ);
256
         NG_SEND_MSG_PATH(error, node, msg, path, 0);
257
@@ -770,12 +850,16 @@ void vboxNetFltPortOsSetActive(PVBOXNETFLTINS pThis, b
258
         NG_MKMESSAGE(msg, NGM_GENERIC_COOKIE, NGM_RMHOOK,
259
             sizeof(struct ngm_rmhook), M_NOWAIT);
260
         if (msg == NULL)
261
+        {
262
+            IPRT_FREEBSD_RESTORE_EFL_AC();
263
             return;
264
+        }
265
         rm = (struct ngm_rmhook *)msg->data;
266
         strlcpy(rm->ourhook, "output", NG_HOOKSIZ);
267
         NG_SEND_MSG_PATH(error, node, msg, path, 0);
268
     }
269
     VBOXCURVNET_RESTORE();
270
+    IPRT_FREEBSD_RESTORE_EFL_AC();
271
 }
272
 
273
 int vboxNetFltOsDisconnectIt(PVBOXNETFLTINS pThis)
(-)emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-VBoxNetFlt-freebsd-files_vboxnetflt (-10 lines)
Lines 1-10 Link Here
1
--- src/VBox/HostDrivers/VBoxNetFlt/freebsd/files_vboxnetflt.orig	2018-10-15 14:30:58 UTC
2
+++ src/VBox/HostDrivers/VBoxNetFlt/freebsd/files_vboxnetflt
3
@@ -61,6 +61,7 @@ VBOX_VBOXNETFLT_SOURCES=" \
4
     ${PATH_ROOT}/include/iprt/uni.h=>include/iprt/uni.h \
5
     ${PATH_ROOT}/include/iprt/utf16.h=>include/iprt/utf16.h \
6
     ${PATH_ROOT}/include/iprt/uuid.h=>include/iprt/uuid.h \
7
+    ${PATH_ROOT}/include/iprt/x86.h=>include/iprt/x86.h \
8
     ${PATH_ROOT}/include/iprt/nocrt/limits.h=>include/iprt/nocrt/limits.h \
9
     ${PATH_ROOT}/include/VBox/cdefs.h=>include/VBox/cdefs.h \
10
     ${PATH_ROOT}/include/VBox/err.h=>include/VBox/err.h \
(-)emulators/virtualbox-ose/files/patch-src-VBox-Installer-Makefile.kmk (-15 lines)
Lines 1-15 Link Here
1
--- src/VBox/Installer/Makefile.kmk.orig	2009-10-05 14:31:40.000000000 +0200
2
+++ src/VBox/Installer/Makefile.kmk	2009-10-05 14:32:09.000000000 +0200
3
@@ -38,10 +38,12 @@
4
  if "$(KBUILD_TARGET)" == "win" && "$(KBUILD_HOST)" == "win"
5
   include $(PATH_SUB_CURRENT)/win/Makefile.kmk
6
  endif
7
+if 0
8
  if "$(KBUILD_TARGET)" == "freebsd" && "$(KBUILD_HOST)" == "freebsd"
9
   include $(PATH_SUB_CURRENT)/freebsd/Makefile.kmk
10
  endif
11
 endif
12
+endif
13
 
14
 include $(PATH_SUB_CURRENT)/common/Makefile.kmk
15
 
(-)emulators/virtualbox-ose/files/patch-src-VBox-Installer-freebsd-VBox.sh (-67 lines)
Lines 1-67 Link Here
1
--- src/VBox/Installer/freebsd/VBox.sh.orig	2016-08-27 05:10:34 UTC
2
+++ src/VBox/Installer/freebsd/VBox.sh
3
@@ -0,0 +1,64 @@
4
+#!/bin/sh
5
+#
6
+# Oracle VM VirtualBox startup script, FreeBSD hosts.
7
+#
8
+# Copyright (C) 2006-2012 Oracle Corporation
9
+#
10
+# This file is part of VirtualBox Open Source Edition (OSE), as
11
+# available from http://www.virtualbox.org. This file is free software;
12
+# you can redistribute it and/or modify it under the terms of the GNU
13
+# General Public License (GPL) as published by the Free Software
14
+# Foundation, in version 2 as it comes in the "COPYING" file of the
15
+# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
16
+# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
17
+#
18
+
19
+PATH="/usr/bin:/bin:/usr/sbin:/sbin"
20
+CONFIG="/usr/local/etc/vbox/vbox.cfg"
21
+
22
+test -r "${CONFIG}" &&
23
+    . "${CONFIG}"
24
+test -z "${INSTALL_DIR}" &&
25
+    if test -d /usr/local/lib/virtualbox &&
26
+        test -f /usr/local/lib/virtualbox/VBoxRT.so; then
27
+        INSTALL_DIR=/usr/local/lib/virtualbox
28
+    else
29
+        echo "Could not find VirtualBox installation. Please reinstall."
30
+        exit 1
31
+    fi
32
+
33
+# workaround for the KDE dialog problem
34
+KDE_FORK_SLAVES=1; export KDE_FORK_SLAVES
35
+
36
+APP=`basename $0`
37
+case "$APP" in
38
+    VirtualBox|virtualbox)
39
+        exec "$INSTALL_DIR/VirtualBox" "$@"
40
+        ;;
41
+    VBoxManage|vboxmanage)
42
+        exec "$INSTALL_DIR/VBoxManage" "$@"
43
+        ;;
44
+    VBoxSDL|vboxsdl)
45
+        exec "$INSTALL_DIR/VBoxSDL" "$@"
46
+        ;;
47
+    VBoxVRDP|VBoxHeadless|vboxheadless)
48
+        exec "$INSTALL_DIR/VBoxHeadless" "$@"
49
+        ;;
50
+    VBoxAutostart|vboxautostart)
51
+        exec "$INSTALL_DIR/VBoxAutostart" "$@"
52
+        ;;
53
+    VBoxBalloonCtrl|vboxballoonctrl)
54
+        exec "$INSTALL_DIR/VBoxBalloonCtrl" "$@"
55
+        ;;
56
+    VBoxBugReport|vboxbugreport)
57
+        exec "$INSTALL_DIR/VBoxBugReport" "$@"
58
+        ;;
59
+    vboxwebsrv)
60
+        exec "$INSTALL_DIR/vboxwebsrv" "$@"
61
+        ;;
62
+    *)
63
+        echo "Unknown application - $APP"
64
+        exit 1
65
+        ;;
66
+esac
67
+exit 0
(-)emulators/virtualbox-ose/files/patch-src-VBox-Installer-freebsd-virtualbox.desktop (-10 lines)
Lines 1-10 Link Here
1
--- src/VBox/Installer/freebsd/virtualbox.desktop.orig	2010-10-07 10:42:04.000000000 +0200
2
+++ src/VBox/Installer/freebsd/virtualbox.desktop	2010-10-07 10:43:20.000000000 +0200
3
@@ -7,7 +7,6 @@
4
 Type=Application
5
 Exec=VirtualBox
6
 TryExec=VirtualBox
7
-DocPath=file://$VBOX_DOC_PATH/UserManual.pdf
8
 Icon=VBox
9
 Categories=Emulator;System;
10
 Comment=Run several virtual systems on a single host computer
(-)emulators/virtualbox-ose/files/patch-src-VBox-Main-src-server-VirtualBoxImpl.cpp (-11 lines)
Lines 1-11 Link Here
1
--- src/VBox/Main/src-server/VirtualBoxImpl.cpp.orig	2015-04-01 12:15:14.000000000 -0400
2
+++ src/VBox/Main/src-server/VirtualBoxImpl.cpp	2015-04-07 12:25:59.226583000 -0400
3
@@ -2172,7 +2172,7 @@
4
     if (aCiphertextSize < 32)
5
         return VERR_INVALID_PARAMETER;
6
 
7
-    AssertCompile(sizeof(m->SettingsCipherKey) >= 32);
8
+    // AssertCompile(sizeof(m->SettingsCipherKey) >= 32);
9
 
10
     /* store the first 8 bytes of the cipherkey for verification */
11
     for (i = 0, j = 0; i < 8; i++, j++)
(-)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-Main-webservice-Makefile.kmk (-39 lines)
Lines 1-39 Link Here
1
--- src/VBox/Main/webservice/Makefile.kmk.orig	2015-10-15 13:59:24 UTC
2
+++ src/VBox/Main/webservice/Makefile.kmk
3
@@ -159,7 +159,6 @@ VBOX_PATH_IDL                 := $(abspa
4
 RECOMPILE_ON_MAKEFILE_CURRENT := $(MAKEFILE_CURRENT)
5
 
6
 PATH_TARGET_SOAPDEMOXML       := $(VBOXWEB_OUT_DIR)/demo_soapxml
7
-PATH_TARGET_SOAPDEMOHEADERS   := $(VBOXWEB_OUT_DIR)/demo_headers
8
 PATH_TARGET_SOAPDEMONSMAPS    := $(VBOXWEB_OUT_DIR)/demo_namespacemaps
9
 PATH_TARGET_WEBTEST           := $(VBOXWEB_OUT_DIR)/webtest
10
 
11
@@ -515,8 +514,6 @@ $$(VBOX_JWSSRC_JAR): $$(VBOX_JWS_JAR) | 
12
 	$(VBOXWEB_OUT_DIR)/gsoap_copy_all_ts \
13
 	$(wildcard $(PATH_TARGET_SOAPDEMOXML)/*) \
14
 	$(PATH_TARGET_SOAPDEMOXML)/dummy_file \
15
-	$(wildcard $(PATH_TARGET_SOAPDEMOHEADERS)/*) \
16
-	$(PATH_TARGET_SOAPDEMOHEADERS)/dummy_file \
17
 	$(wildcard $(PATH_TARGET_SOAPDEMONSMAPS)/*) \
18
 	$(PATH_TARGET_SOAPDEMONSMAPS)/dummy_file
19
 
20
@@ -695,17 +692,14 @@ $(VBOXWEB_OUT_DIR)/gsoap_generate_all_ts
21
 # any more. Ignoring the exit code is the simple solution, accepting the error.
22
 $(VBOXWEB_OUT_DIR)/gsoap_copy_all_ts: $(VBOXWEB_OUT_DIR)/gsoap_generate_all_ts | $$(dir $$@)
23
 	$(RM) -f $@
24
-	$(MKDIR) -p $(PATH_TARGET_SOAPDEMOXML) $(PATH_TARGET_SOAPDEMOHEADERS) $(PATH_TARGET_SOAPDEMONSMAPS)
25
+	$(MKDIR) -p $(PATH_TARGET_SOAPDEMOXML) $(PATH_TARGET_SOAPDEMONSMAPS)
26
 ifdef VBOX_GSOAP_VERBOSE
27
 	$(MV_EXT) -f -- $(VBOXWEB_OUT_DIR)/*.req.xml $(VBOXWEB_OUT_DIR)/*.res.xml $(PATH_TARGET_SOAPDEMOXML)/
28
 endif
29
-	-$(MV_EXT) -f -- $(VBOXWEB_OUT_DIR)/soapvbox*.h $(PATH_TARGET_SOAPDEMOHEADERS)/
30
 	$(MV_EXT) -f -- $(VBOXWEB_OUT_DIR)/vboxBinding.nsmap $(PATH_TARGET_SOAPDEMONSMAPS)/
31
 	$(APPEND) $@ done
32
 
33
-$(PATH_TARGET_SOAPDEMONSMAPS) \
34
-$(PATH_TARGET_SOAPDEMOHEADERS)/soapvboxBindingProxy.h \
35
-$(PATH_TARGET_SOAPDEMOHEADERS)/soapvboxBindingObject.h: $(VBOXWEB_OUT_DIR)/gsoap_copy_all_ts
36
+$(PATH_TARGET_SOAPDEMONSMAPS): $(VBOXWEB_OUT_DIR)/gsoap_copy_all_ts
37
 
38
 # soapcpp2 -2: generate SOAP 1.2 calls
39
 # soapcpp2 -S: server-side code only
(-)emulators/virtualbox-ose/files/patch-src-VBox-Runtime-Makefile.kmk (-14 lines)
Lines 1-14 Link Here
1
--- src/VBox/Runtime/Makefile.kmk.orig	2014-07-15 13:25:15.000000000 -0400
2
+++ src/VBox/Runtime/Makefile.kmk	2014-07-16 17:15:58.000000000 -0400
3
@@ -146,6 +146,11 @@
4
 	IPRT_BLDCFG_TYPE=\"$(KBUILD_TYPE)\"
5
 
6
 #
7
+# Set the defines that utf8-posix.cpp needs. It's used by several targets.
8
+#
9
+r3/posix/utf8-posix.cpp_DEFS.freebsd = $(VBOX_ICONV_DEFS)
10
+
11
+#
12
 # Unicode Specification reader used to regenerate unidata-*.cpp.
13
 #
14
 uniread_TEMPLATE = VBoxBldProg
(-)emulators/virtualbox-ose/files/patch-src-VBox-Runtime-r0drv-freebsd-sleepqueue-r0drv-freebsd.h (-20 lines)
Lines 1-20 Link Here
1
Without this patch any waits for periods shorter than a single tick return
2
immediately leading to a lot of unnecessary spinning. For example, I observe that
3
my guest's idle loop does a lot of sleeps with periods slightly shorter than 1 ms
4
(1/hz), e.g. 900us.  All that waiting turns into pure spinning and VirtualBox eats
5
100% of a core.
6
The patch improves the situation significantly. Also, it (approximately) follows
7
what tvtohz does.
8
9
Submitted by:	Andriy Gapon <avg@FreeBSD.org>
10
--- src/VBox/Runtime/r0drv/freebsd/sleepqueue-r0drv-freebsd.h.orig	2012-12-19 19:27:29.000000000 +0100
11
+++ src/VBox/Runtime/r0drv/freebsd/sleepqueue-r0drv-freebsd.h	2012-12-20 12:07:48.941861966 +0100
12
@@ -82,6 +82,8 @@
13
     uint64_t cTicks = ASMMultU64ByU32DivByU32(uTimeout, hz, UINT32_C(1000000000));
14
     if (cTicks >= INT_MAX)
15
         return RTSEMWAIT_FLAGS_INDEFINITE;
16
+    else if (cTicks == 0 && uTimeout > 0)
17
+        pWait->iTimeout     = 1;
18
     else
19
         pWait->iTimeout     = (int)cTicks;
20
 #endif
(-)emulators/virtualbox-ose/files/patch-src-recompiler-Sun-testmath.c (-22 lines)
Lines 1-22 Link Here
1
--- src/recompiler/Sun/testmath.c.orig	2011-01-14 21:15:07.000000000 +0100
2
+++ src/recompiler/Sun/testmath.c	2011-08-05 13:54:49.000000000 +0200
3
@@ -261,8 +261,6 @@
4
 #endif
5
     set_cw(0x27f);
6
 
7
-    CHECK(logl(2.7182818284590452353602874713526625L), 1.0);
8
-
9
     CHECK(remainderl(1.0L, 1.0L), 0.0);
10
     CHECK(remainderl(1.0L, 1.5L), -0.5);
11
     CHECK(remainderl(42.0L, 34.25L), 7.75);
12
@@ -315,10 +313,6 @@
13
     CHECK(tanl(0.0L), 0.0);
14
     CHECK(tanl(0.7853981633974483096156608458198757L), 1.0);
15
 
16
-    CHECK(powl(0.0, 0.0), 1.0);
17
-    CHECK(powl(2.0, 2.0), 4.0);
18
-    CHECK(powl(3.0, 3.0), 27.0);
19
-
20
     return cErrors;
21
 }
22
 
(-)emulators/virtualbox-ose/files/patch-src_VBox_Additions_common_VBoxGuest_VBoxGuest-freebsd.c (+277 lines)
Line 0 Link Here
1
--- src/VBox/Additions/common/VBoxGuest/VBoxGuest-freebsd.c.orig	2019-11-21 16:54:06 UTC
2
+++ src/VBox/Additions/common/VBoxGuest/VBoxGuest-freebsd.c
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
20
     struct resource   *pIrqRes;
21
     /** Pointer to the IRQ handler. */
22
     void              *pfnIrqHandler;
23
-    /** VMMDev version */
24
-    uint32_t           u32Version;
25
 };
26
 
27
 
28
@@ -113,8 +113,7 @@ struct VBoxGuestDeviceState
29
 /*
30
  * Character device file handlers.
31
  */
32
-static d_fdopen_t vgdrvFreeBSDOpen;
33
-static d_close_t  vgdrvFreeBSDClose;
34
+static d_open_t   vgdrvFreeBSDOpen;
35
 static d_ioctl_t  vgdrvFreeBSDIOCtl;
36
 static int        vgdrvFreeBSDIOCtlSlow(PVBOXGUESTSESSION pSession, u_long ulCmd, caddr_t pvData, struct thread *pTd);
37
 static d_write_t  vgdrvFreeBSDWrite;
38
@@ -145,8 +144,7 @@ static struct cdevsw    g_vgdrvFreeBSDChrDevSW =
39
 {
40
     .d_version =        D_VERSION,
41
     .d_flags =          D_TRACKCLOSE | D_NEEDMINOR,
42
-    .d_fdopen =         vgdrvFreeBSDOpen,
43
-    .d_close =          vgdrvFreeBSDClose,
44
+    .d_open =           vgdrvFreeBSDOpen,
45
     .d_ioctl =          vgdrvFreeBSDIOCtl,
46
     .d_read =           vgdrvFreeBSDRead,
47
     .d_write =          vgdrvFreeBSDWrite,
48
@@ -154,81 +152,28 @@ static struct cdevsw    g_vgdrvFreeBSDChrDevSW =
49
     .d_name =           "vboxguest"
50
 };
51
 
52
+/** Device structure. */
53
+static struct cdev         *g_pDev;
54
+
55
 /** Device extention & session data association structure. */
56
 static VBOXGUESTDEVEXT      g_DevExt;
57
 
58
-/** List of cloned device. Managed by the kernel. */
59
-static struct clonedevs    *g_pvgdrvFreeBSDClones;
60
-/** The dev_clone event handler tag. */
61
-static eventhandler_tag     g_vgdrvFreeBSDEHTag;
62
 /** Reference counter */
63
 static volatile uint32_t    cUsers;
64
 /** selinfo structure used for polling. */
65
 static struct selinfo       g_SelInfo;
66
 
67
-/**
68
- * DEVFS event handler.
69
- */
70
-static void vgdrvFreeBSDClone(void *pvArg, struct ucred *pCred, char *pszName, int cchName, struct cdev **ppDev)
71
+static void vgdrvFreeBSDDtr(void *pSession)
72
 {
73
-    int iUnit;
74
-    int rc;
75
-
76
-    Log(("vgdrvFreeBSDClone: pszName=%s ppDev=%p\n", pszName, ppDev));
77
-
78
-    /*
79
-     * One device node per user, si_drv1 points to the session.
80
-     * /dev/vboxguest<N> where N = {0...255}.
81
-     */
82
-    if (!ppDev)
83
-        return;
84
-    if (strcmp(pszName, "vboxguest") == 0)
85
-        iUnit =  -1;
86
-    else if (dev_stdclone(pszName, NULL, "vboxguest", &iUnit) != 1)
87
-        return;
88
-    if (iUnit >= 256)
89
-    {
90
-        Log(("vgdrvFreeBSDClone: iUnit=%d >= 256 - rejected\n", iUnit));
91
-        return;
92
-    }
93
-
94
-    Log(("vgdrvFreeBSDClone: pszName=%s iUnit=%d\n", pszName, iUnit));
95
-
96
-    rc = clone_create(&g_pvgdrvFreeBSDClones, &g_vgdrvFreeBSDChrDevSW, &iUnit, ppDev, 0);
97
-    Log(("vgdrvFreeBSDClone: clone_create -> %d; iUnit=%d\n", rc, iUnit));
98
-    if (rc)
99
-    {
100
-        *ppDev = make_dev(&g_vgdrvFreeBSDChrDevSW,
101
-                          iUnit,
102
-                          UID_ROOT,
103
-                          GID_WHEEL,
104
-                          0664,
105
-                          "vboxguest%d", iUnit);
106
-        if (*ppDev)
107
-        {
108
-            dev_ref(*ppDev);
109
-            (*ppDev)->si_flags |= SI_CHEAPCLONE;
110
-            Log(("vgdrvFreeBSDClone: Created *ppDev=%p iUnit=%d si_drv1=%p si_drv2=%p\n",
111
-                     *ppDev, iUnit, (*ppDev)->si_drv1, (*ppDev)->si_drv2));
112
-            (*ppDev)->si_drv1 = (*ppDev)->si_drv2 = NULL;
113
-        }
114
-        else
115
-            Log(("vgdrvFreeBSDClone: make_dev iUnit=%d failed\n", iUnit));
116
-    }
117
-    else
118
-        Log(("vgdrvFreeBSDClone: Existing *ppDev=%p iUnit=%d si_drv1=%p si_drv2=%p\n",
119
-             *ppDev, iUnit, (*ppDev)->si_drv1, (*ppDev)->si_drv2));
120
+    VGDrvCommonCloseSession(&g_DevExt, pSession);
121
+    ASMAtomicDecU32(&cUsers);
122
 }
123
 
124
 /**
125
  * File open handler
126
  *
127
  */
128
-#if __FreeBSD_version >= 700000
129
-static int vgdrvFreeBSDOpen(struct cdev *pDev, int fOpen, struct thread *pTd, struct file *pFd)
130
-#else
131
-static int vgdrvFreeBSDOpen(struct cdev *pDev, int fOpen, struct thread *pTd)
132
-#endif
133
+static int vgdrvFreeBSDOpen(struct cdev *pDev, int fOpen, int DevType, struct thread *pTd)
134
 {
135
     int                 rc;
136
     PVBOXGUESTSESSION   pSession;
137
@@ -240,12 +185,6 @@ static int vgdrvFreeBSDOpen(struct cdev *pDev, int fOp
138
     LogFlow(("vgdrvFreeBSDOpen:\n"));
139
 
140
     /*
141
-     * Try grab it (we don't grab the giant, remember).
142
-     */
143
-    if (!ASMAtomicCmpXchgPtr(&pDev->si_drv1, (void *)0x42, NULL))
144
-        return EBUSY;
145
-
146
-    /*
147
      * Create a new session.
148
      */
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);
152
     if (RT_SUCCESS(rc))
153
     {
154
-        if (ASMAtomicCmpXchgPtr(&pDev->si_drv1, pSession, (void *)0x42))
155
-        {
156
-            Log(("vgdrvFreeBSDOpen: success - g_DevExt=%p pSession=%p rc=%d pid=%d\n", &g_DevExt, pSession, rc, (int)RTProcSelf()));
157
+        Log(("vgdrvFreeBSDOpen: success - g_DevExt=%p pSession=%p rc=%d pid=%d\n", &g_DevExt, pSession, rc, (int)RTProcSelf()));
158
+        rc = devfs_set_cdevpriv(pSession, vgdrvFreeBSDDtr);
159
+        if (rc)
160
+            VGDrvCommonCloseSession(&g_DevExt, pSession);
161
+        else
162
             ASMAtomicIncU32(&cUsers);
163
-            return 0;
164
-        }
165
-
166
-        VGDrvCommonCloseSession(&g_DevExt, pSession);
167
+        return rc;
168
     }
169
 
170
     LogRel(("vgdrvFreeBSDOpen: failed. rc=%d\n", rc));
171
@@ -277,33 +215,6 @@ static int vgdrvFreeBSDOpen(struct cdev *pDev, int fOp
172
 }
173
 
174
 /**
175
- * File close handler
176
- *
177
- */
178
-static int vgdrvFreeBSDClose(struct cdev *pDev, int fFile, int DevType, struct thread *pTd)
179
-{
180
-    PVBOXGUESTSESSION pSession = (PVBOXGUESTSESSION)pDev->si_drv1;
181
-    Log(("vgdrvFreeBSDClose: fFile=%#x pSession=%p\n", fFile, pSession));
182
-
183
-    /*
184
-     * Close the session if it's still hanging on to the device...
185
-     */
186
-    if (VALID_PTR(pSession))
187
-    {
188
-        VGDrvCommonCloseSession(&g_DevExt, pSession);
189
-        if (!ASMAtomicCmpXchgPtr(&pDev->si_drv1, NULL, pSession))
190
-            Log(("vgdrvFreeBSDClose: si_drv1=%p expected %p!\n", pDev->si_drv1, pSession));
191
-        ASMAtomicDecU32(&cUsers);
192
-        /* Don't use destroy_dev here because it may sleep resulting in a hanging user process. */
193
-        destroy_dev_sched(pDev);
194
-    }
195
-    else
196
-        Log(("vgdrvFreeBSDClose: si_drv1=%p!\n", pSession));
197
-    return 0;
198
-}
199
-
200
-
201
-/**
202
  * I/O control request.
203
  *
204
  * @returns depends...
205
@@ -316,8 +227,12 @@ static int vgdrvFreeBSDClose(struct cdev *pDev, int fF
206
 static int vgdrvFreeBSDIOCtl(struct cdev *pDev, u_long ulCmd, caddr_t pvData, int fFile, struct thread *pTd)
207
 {
208
     PVBOXGUESTSESSION pSession;
209
-    devfs_get_cdevpriv((void **)&pSession);
210
+    int rc;
211
 
212
+    rc = devfs_get_cdevpriv((void **)&pSession);
213
+    if (rc)
214
+        return rc;
215
+
216
     /*
217
      * Deal with the fast ioctl path first.
218
      */
219
@@ -512,12 +427,14 @@ int VBOXCALL VBoxGuestIDC(void *pvSession, uintptr_t u
220
 
221
 static int vgdrvFreeBSDPoll(struct cdev *pDev, int fEvents, struct thread *td)
222
 {
223
-    int fEventsProcessed;
224
+    PVBOXGUESTSESSION pSession;
225
+    int fEventsProcessed, rc;
226
 
227
     LogFlow(("vgdrvFreeBSDPoll: fEvents=%d\n", fEvents));
228
 
229
-    PVBOXGUESTSESSION pSession = (PVBOXGUESTSESSION)pDev->si_drv1;
230
-    if (RT_UNLIKELY(!VALID_PTR(pSession))) {
231
+    rc = devfs_get_cdevpriv((void **)&pSession);
232
+    if (rc)
233
+    {
234
         Log(("vgdrvFreeBSDPoll: no state data for %s\n", devtoname(pDev)));
235
         return (fEvents & (POLLHUP|POLLIN|POLLRDNORM|POLLOUT|POLLWRNORM));
236
     }
237
@@ -558,11 +475,8 @@ static int vgdrvFreeBSDDetach(device_t pDevice)
238
     /*
239
      * Reverse what we did in vgdrvFreeBSDAttach.
240
      */
241
-    if (g_vgdrvFreeBSDEHTag != NULL)
242
-        EVENTHANDLER_DEREGISTER(dev_clone, g_vgdrvFreeBSDEHTag);
243
+    destroy_dev(g_pDev);
244
 
245
-    clone_cleanup(&g_pvgdrvFreeBSDClones);
246
-
247
     vgdrvFreeBSDRemoveIRQ(pDevice, pState);
248
 
249
     if (pState->pVMMDevMemRes)
250
@@ -727,18 +641,21 @@ static int vgdrvFreeBSDAttach(device_t pDevice)
251
                     VGDrvCommonProcessOptionsFromHost(&g_DevExt);
252
 
253
                     /*
254
-                     * Configure device cloning.
255
+                     * Configure device.
256
                      */
257
-                    clone_setup(&g_pvgdrvFreeBSDClones);
258
-                    g_vgdrvFreeBSDEHTag = EVENTHANDLER_REGISTER(dev_clone, vgdrvFreeBSDClone, 0, 1000);
259
-                    if (g_vgdrvFreeBSDEHTag)
260
+                    g_pDev = make_dev(&g_vgdrvFreeBSDChrDevSW,
261
+                                      0,
262
+                                      UID_ROOT,
263
+                                      GID_WHEEL,
264
+                                      0664,
265
+                                      "vboxguest");
266
+                    if (g_pDev)
267
                     {
268
                         printf(DEVICE_NAME ": loaded successfully\n");
269
                         return 0;
270
                     }
271
 
272
-                    printf(DEVICE_NAME ": EVENTHANDLER_REGISTER(dev_clone,,,) failed\n");
273
-                    clone_cleanup(&g_pvgdrvFreeBSDClones);
274
+                    printf(DEVICE_NAME ": make_dev failed\n");
275
                     vgdrvFreeBSDRemoveIRQ(pDevice, pState);
276
                 }
277
                 else
(-)emulators/virtualbox-ose/files/patch-src_VBox_Additions_common_VBoxGuest_freebsd_Makefile (+27 lines)
Line 0 Link Here
1
--- src/VBox/Additions/common/VBoxGuest/freebsd/Makefile.orig	2019-11-21 16:54:06 UTC
2
+++ src/VBox/Additions/common/VBoxGuest/freebsd/Makefile
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 += \
13
 	handletable.c \
14
 	handletablectx.c \
15
 	once.c \
16
+	term.c \
17
 	thread.c
18
 
19
 .PATH:	${.CURDIR}/common/string
20
@@ -147,6 +148,7 @@ SRCS += \
21
 
22
 .PATH:	${.CURDIR}/r0drv
23
 SRCS += \
24
+	alloc-ef-r0drv.c \
25
 	alloc-r0drv.c \
26
 	initterm-r0drv.c \
27
 	memobj-r0drv.c \
(-)emulators/virtualbox-ose/files/patch-src_VBox_Additions_common_VBoxGuest_freebsd_files__vboxguest (+34 lines)
Line 0 Link Here
1
--- src/VBox/Additions/common/VBoxGuest/freebsd/files_vboxguest.orig	2019-11-21 16:54:06 UTC
2
+++ src/VBox/Additions/common/VBoxGuest/freebsd/files_vboxguest
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=" \
12
     ${PATH_ROOT}/src/VBox/Runtime/common/misc/handletable.h=>common/misc/handletable.h \
13
     ${PATH_ROOT}/src/VBox/Runtime/common/misc/handletablectx.cpp=>common/misc/handletablectx.c \
14
     ${PATH_ROOT}/src/VBox/Runtime/common/misc/once.cpp=>common/misc/once.c \
15
+    ${PATH_ROOT}/src/VBox/Runtime/common/misc/term.cpp=>common/misc/term.c \
16
     ${PATH_ROOT}/src/VBox/Runtime/common/misc/thread.cpp=>common/misc/thread.c \
17
     ${PATH_ROOT}/src/VBox/Runtime/common/misc/RTAssertMsg1Weak.cpp=>common/misc/RTAssertMsg1Weak.c \
18
     ${PATH_ROOT}/src/VBox/Runtime/common/misc/RTAssertMsg2.cpp=>common/misc/RTAssertMsg2.c \
19
@@ -181,6 +183,7 @@ FILES_VBOXGUEST_NOBIN=" \
20
     ${PATH_ROOT}/src/VBox/Runtime/generic/errvars-generic.cpp=>generic/errvars-generic.c \
21
     ${PATH_ROOT}/src/VBox/Runtime/generic/timer-generic.cpp=>generic/timer-generic.c \
22
     ${PATH_ROOT}/src/VBox/Runtime/generic/mppresent-generic.cpp=>generic/mppresent-generic.c \
23
+    ${PATH_ROOT}/src/VBox/Runtime/r0drv/alloc-ef-r0drv.cpp=>r0drv/alloc-ef-r0drv.c \
24
     ${PATH_ROOT}/src/VBox/Runtime/r0drv/alloc-r0drv.cpp=>r0drv/alloc-r0drv.c \
25
     ${PATH_ROOT}/src/VBox/Runtime/r0drv/alloc-r0drv.h=>r0drv/alloc-r0drv.h \
26
     ${PATH_ROOT}/src/VBox/Runtime/r0drv/initterm-r0drv.cpp=>r0drv/initterm-r0drv.c \
27
@@ -207,6 +210,7 @@ FILES_VBOXGUEST_NOBIN=" \
28
     ${PATH_ROOT}/src/VBox/Runtime/r0drv/freebsd/sleepqueue-r0drv-freebsd.h=>r0drv/freebsd/sleepqueue-r0drv-freebsd.h \
29
     ${PATH_ROOT}/src/VBox/Runtime/r0drv/generic/semspinmutex-r0drv-generic.c=>r0drv/generic/semspinmutex-r0drv-generic.c \
30
     ${PATH_ROOT}/src/VBox/Runtime/r0drv/generic/mpnotification-r0drv-generic.cpp=>r0drv/generic/mpnotification-r0drv-generic.c \
31
+    ${PATH_ROOT}/src/VBox/Runtime/r0drv/generic/threadctxhooks-r0drv-generic.cpp=>r0drv/generic/threadctxhooks-r0drv-generic.c \
32
     ${PATH_ROOT}/src/VBox/Runtime/r0drv/generic/RTMpIsCpuWorkPending-r0drv-generic.cpp=>r0drv/generic/RTMpIsCpuWorkPending-r0drv-generic.c \
33
     ${PATH_ROOT}/src/VBox/Runtime/r0drv/memobj-r0drv.cpp=>r0drv/memobj-r0drv.c \
34
     ${PATH_ROOT}/src/VBox/Runtime/VBox/log-vbox.cpp=>VBox/log-vbox.c \
(-)emulators/virtualbox-ose/files/patch-src_VBox_Additions_common_VBoxService_Makefile.kmk (+13 lines)
Line 0 Link Here
1
--- src/VBox/Additions/common/VBoxService/Makefile.kmk.orig	2019-11-21 16:54:08 UTC
2
+++ src/VBox/Additions/common/VBoxService/Makefile.kmk
3
@@ -172,6 +172,10 @@ VBoxService_LIBS         += \
4
 	$(VBOX_LIB_IPRT_GUEST_R3) \
5
 	$(VBOX_LIB_VBGL_R3) \
6
 	$(VBOX_LIB_IPRT_GUEST_R3)       # (The joy of unix linkers.)
7
+if1of ($(KBUILD_TARGET), freebsd)
8
+ VBoxService_LIBS        += \
9
+	crypt
10
+endif
11
 ifdef VBOX_WITH_DBUS
12
  if1of ($(KBUILD_TARGET), linux solaris) # FreeBSD?
13
 VBoxService_LIBS         += \
(-)emulators/virtualbox-ose/files/patch-src_VBox_Additions_common_VBoxService_VBoxServiceVMInfo.cpp (-10 / +10 lines)
Lines 1-6 Link Here
1
--- src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo.cpp.orig	2017-03-08 17:15:20 UTC
1
--- src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo.cpp.orig	2019-11-21 16:54:09 UTC
2
+++ src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo.cpp
2
+++ src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo.cpp
3
@@ -71,8 +71,8 @@
3
@@ -67,8 +67,8 @@
4
 # include <net/if.h>
4
 # include <net/if.h>
5
 # include <pwd.h> /* getpwuid */
5
 # include <pwd.h> /* getpwuid */
6
 # include <unistd.h>
6
 # include <unistd.h>
Lines 11-17 Link Here
11
 # endif
11
 # endif
12
 # ifdef RT_OS_OS2
12
 # ifdef RT_OS_OS2
13
 #  include <net/if_dl.h>
13
 #  include <net/if_dl.h>
14
@@ -531,7 +531,7 @@ static void vgsvcVMInfoWriteFixedPropert
14
@@ -528,7 +528,7 @@ static void vgsvcVMInfoWriteFixedProperties(void)
15
 }
15
 }
16
 
16
 
17
 
17
 
Lines 20-28 Link Here
20
 /*
20
 /*
21
  * Simple wrapper to work around compiler-specific va_list madness.
21
  * Simple wrapper to work around compiler-specific va_list madness.
22
  */
22
  */
23
@@ -562,12 +562,6 @@ static int vgsvcVMInfoWriteUsers(void)
23
@@ -555,12 +555,6 @@ static int vgsvcVMInfoWriteUsers(void)
24
     rc = VERR_NOT_IMPLEMENTED;
24
 #ifdef RT_OS_WINDOWS
25
 # endif
25
     rc = VGSvcVMInfoWinWriteUsers(&g_VMInfoPropCache, &pszUserList, &cUsersInList);
26
 
26
 
27
-#elif defined(RT_OS_FREEBSD)
27
-#elif defined(RT_OS_FREEBSD)
28
-    /** @todo FreeBSD: Port logged on user info retrieval.
28
-    /** @todo FreeBSD: Port logged on user info retrieval.
Lines 33-39 Link Here
33
 #elif defined(RT_OS_HAIKU)
33
 #elif defined(RT_OS_HAIKU)
34
     /** @todo Haiku: Port logged on user info retrieval. */
34
     /** @todo Haiku: Port logged on user info retrieval. */
35
     rc = VERR_NOT_IMPLEMENTED;
35
     rc = VERR_NOT_IMPLEMENTED;
36
@@ -593,7 +587,7 @@ static int vgsvcVMInfoWriteUsers(void)
36
@@ -586,7 +580,7 @@ static int vgsvcVMInfoWriteUsers(void)
37
     while (   (ut_user = getutxent())
37
     while (   (ut_user = getutxent())
38
            && RT_SUCCESS(rc))
38
            && RT_SUCCESS(rc))
39
     {
39
     {
Lines 42-48 Link Here
42
         VGSvcVerbose(4, "Found entry '%s' (type: %d, PID: %RU32)\n", ut_user->ut_user, ut_user->ut_type, ut_user->ut_pid);
42
         VGSvcVerbose(4, "Found entry '%s' (type: %d, PID: %RU32)\n", ut_user->ut_user, ut_user->ut_type, ut_user->ut_pid);
43
 # else
43
 # else
44
         VGSvcVerbose(4, "Found entry '%s' (type: %d, PID: %RU32, session: %RU32)\n",
44
         VGSvcVerbose(4, "Found entry '%s' (type: %d, PID: %RU32, session: %RU32)\n",
45
@@ -628,7 +622,7 @@ static int vgsvcVMInfoWriteUsers(void)
45
@@ -621,7 +615,7 @@ static int vgsvcVMInfoWriteUsers(void)
46
     }
46
     }
47
 
47
 
48
 # ifdef VBOX_WITH_DBUS
48
 # ifdef VBOX_WITH_DBUS
Lines 51-57 Link Here
51
     DBusError dbErr;
51
     DBusError dbErr;
52
     DBusConnection *pConnection = NULL;
52
     DBusConnection *pConnection = NULL;
53
     int rc2 = RTDBusLoadLib();
53
     int rc2 = RTDBusLoadLib();
54
@@ -837,7 +831,7 @@ static int vgsvcVMInfoWriteUsers(void)
54
@@ -830,7 +824,7 @@ static int vgsvcVMInfoWriteUsers(void)
55
     if (   fHaveLibDbus
55
     if (   fHaveLibDbus
56
         && dbus_error_is_set(&dbErr))
56
         && dbus_error_is_set(&dbErr))
57
         dbus_error_free(&dbErr);
57
         dbus_error_free(&dbErr);
Lines 60-66 Link Here
60
 # endif /* VBOX_WITH_DBUS */
60
 # endif /* VBOX_WITH_DBUS */
61
 
61
 
62
     /** @todo Fedora/others: Handle systemd-loginctl. */
62
     /** @todo Fedora/others: Handle systemd-loginctl. */
63
@@ -874,7 +868,7 @@ static int vgsvcVMInfoWriteUsers(void)
63
@@ -867,7 +861,7 @@ static int vgsvcVMInfoWriteUsers(void)
64
     RTMemFree(papszUsers);
64
     RTMemFree(papszUsers);
65
 
65
 
66
     endutxent(); /* Close utmpx file. */
66
     endutxent(); /* Close utmpx file. */
(-)emulators/virtualbox-ose/files/patch-src_VBox_Additions_common_crOpenGL_stub.h (-11 lines)
Lines 1-11 Link Here
1
--- src/VBox/Additions/common/crOpenGL/stub.h.orig	2016-07-18 11:50:44 UTC
2
+++ src/VBox/Additions/common/crOpenGL/stub.h
3
@@ -47,7 +47,7 @@
4
 #include <X11/extensions/Xfixes.h>
5
 #endif
6
 
7
-#if defined(WINDOWS) || defined(Linux) || defined(SunOS)
8
+#if defined(WINDOWS) || defined(Linux) || defined(FreeBSD) || defined(SunOS)
9
 # define CR_NEWWINTRACK
10
 #endif
11
 
(-)emulators/virtualbox-ose/files/patch-src_VBox_Additions_common_pam_pam__vbox.cpp (-3 / +3 lines)
Lines 1-6 Link Here
1
--- src/VBox/Additions/common/pam/pam_vbox.cpp.orig	2016-07-18 11:50:44 UTC
1
--- src/VBox/Additions/common/pam/pam_vbox.cpp.orig	2019-11-21 16:54:09 UTC
2
+++ src/VBox/Additions/common/pam/pam_vbox.cpp
2
+++ src/VBox/Additions/common/pam/pam_vbox.cpp
3
@@ -105,7 +105,7 @@ static void pam_vbox_writesyslog(char *p
3
@@ -104,7 +104,7 @@ static void pam_vbox_writesyslog(char *pszBuf)
4
     openlog("pam_vbox", LOG_PID, LOG_AUTHPRIV);
4
     openlog("pam_vbox", LOG_PID, LOG_AUTHPRIV);
5
     syslog(LOG_ERR, "%s", pszBuf);
5
     syslog(LOG_ERR, "%s", pszBuf);
6
     closelog();
6
     closelog();
Lines 9-15 Link Here
9
     syslog(LOG_ERR, "pam_vbox: %s\n", pszBuf);
9
     syslog(LOG_ERR, "pam_vbox: %s\n", pszBuf);
10
 #endif
10
 #endif
11
 }
11
 }
12
@@ -180,7 +180,7 @@ static int vbox_set_msg(pam_handle_t *hP
12
@@ -183,7 +183,7 @@ static int vbox_set_msg(pam_handle_t *hPAM, int iStyle
13
 
13
 
14
     pam_message msg;
14
     pam_message msg;
15
     msg.msg_style = iStyle;
15
     msg.msg_style = iStyle;
(-)emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_Makefile (-4 / +4 lines)
Lines 1-6 Link Here
1
--- src/VBox/Additions/freebsd/Makefile.orig	2017-04-28 16:59:22.000000000 +0200
1
--- src/VBox/Additions/freebsd/Makefile.orig	2019-11-21 16:54:10 UTC
2
+++ src/VBox/Additions/freebsd/Makefile	2017-07-13 00:04:11.766870597 +0200
2
+++ src/VBox/Additions/freebsd/Makefile
3
@@ -31,6 +31,14 @@
3
@@ -30,6 +30,14 @@ all:
4
 	        cp vboxvfs/vboxvfs.ko .; \
4
 	        cp vboxvfs/vboxvfs.ko .; \
5
 	    fi; \
5
 	    fi; \
6
 	fi
6
 	fi
Lines 15-21 Link Here
15
 
15
 
16
 
16
 
17
 install:
17
 install:
18
@@ -38,13 +46,19 @@
18
@@ -37,13 +45,19 @@ install:
19
 	@if [ -d vboxvfs ]; then \
19
 	@if [ -d vboxvfs ]; then \
20
 	    $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxvfs install; \
20
 	    $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxvfs install; \
21
 	fi
21
 	fi
(-)emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_Makefile.kmk (-5 / +5 lines)
Lines 1-4 Link Here
1
--- src/VBox/Additions/freebsd/Makefile.kmk.orig	2019-07-12 08:42:35 UTC
1
--- src/VBox/Additions/freebsd/Makefile.kmk.orig	2019-11-21 16:54:10 UTC
2
+++ src/VBox/Additions/freebsd/Makefile.kmk
2
+++ src/VBox/Additions/freebsd/Makefile.kmk
3
@@ -23,8 +23,9 @@ $(error "The FreeBSD guest additions installer can onl
3
@@ -23,8 +23,9 @@ $(error "The FreeBSD guest additions installer can onl
4
 endif
4
 endif
Lines 12-24 Link Here
12
 
12
 
13
 #
13
 #
14
 # Globals
14
 # Globals
15
@@ -67,11 +68,13 @@ VBOX_FBSD_ADD_STRIP_BIN = \
15
@@ -66,11 +67,13 @@ VBOX_FBSD_ADD_STRIP_BIN = \
16
 	vboxvideo_drv_14.so \
16
 	vboxvideo_drv_15.so \
17
 	vboxvideo_drv_15.so \
17
 	vboxvideo_drv_16.so \
18
 	vboxvideo_drv_16.so \
18
 	vboxvideo_drv_17.so \
19
-	vboxvideo_drv_17.so
19
-	VBoxOGL.so
20
+	vboxvideo_drv_17.so \
20
+	$(if $(VBOX_WITH_PAM),pam_vbox.so,) \
21
+	$(if $(VBOX_WITH_PAM),pam_vbox.so,) \
21
+	VBoxOGL.so \
22
+	mount_vboxvfs
22
+	mount_vboxvfs
23
 
23
 
24
 VBOX_FBSD_ADD_MODULES = \
24
 VBOX_FBSD_ADD_MODULES = \
(-)emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_mount__vboxvfs_Makefile.kmk (-1 / +1 lines)
Lines 1-4 Link Here
1
--- src/VBox/Additions/freebsd/mount_vboxvfs/Makefile.kmk.orig	2018-11-29 19:03:21 UTC
1
--- src/VBox/Additions/freebsd/mount_vboxvfs/Makefile.kmk.orig	2019-12-04 01:14:22 UTC
2
+++ src/VBox/Additions/freebsd/mount_vboxvfs/Makefile.kmk
2
+++ src/VBox/Additions/freebsd/mount_vboxvfs/Makefile.kmk
3
@@ -0,0 +1,23 @@
3
@@ -0,0 +1,23 @@
4
+# $Id: Makefile.kmk $
4
+# $Id: Makefile.kmk $
(-)emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_mount__vboxvfs_mount__vboxvfs.8 (-2 / +2 lines)
Lines 1-5 Link Here
1
--- src/VBox/Additions/freebsd/mount_vboxvfs/mount_vboxvfs.8.orig	1970-01-01 01:00:00.000000000 +0100
1
--- src/VBox/Additions/freebsd/mount_vboxvfs/mount_vboxvfs.8.orig	2019-12-03 22:06:34 UTC
2
+++ src/VBox/Additions/freebsd/mount_vboxvfs/mount_vboxvfs.8	2017-07-12 19:24:26.106029000 +0200
2
+++ src/VBox/Additions/freebsd/mount_vboxvfs/mount_vboxvfs.8
3
@@ -0,0 +1,53 @@
3
@@ -0,0 +1,53 @@
4
+.\"
4
+.\"
5
+.\" Copyright (c) 1992, 1993, 1994
5
+.\" Copyright (c) 1992, 1993, 1994
(-)emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_mount__vboxvfs_mount__vboxvfs.c (-2 / +2 lines)
Lines 1-5 Link Here
1
--- src/VBox/Additions/freebsd/mount_vboxvfs/mount_vboxvfs.c.orig	1970-01-01 01:00:00.000000000 +0100
1
--- src/VBox/Additions/freebsd/mount_vboxvfs/mount_vboxvfs.c.orig	2019-12-03 22:06:50 UTC
2
+++ src/VBox/Additions/freebsd/mount_vboxvfs/mount_vboxvfs.c	2017-07-12 19:24:26.106029000 +0200
2
+++ src/VBox/Additions/freebsd/mount_vboxvfs/mount_vboxvfs.c
3
@@ -0,0 +1,168 @@
3
@@ -0,0 +1,168 @@
4
+/*
4
+/*
5
+* Copyright (c) 1992, 1993, 1994
5
+* Copyright (c) 1992, 1993, 1994
(-)emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_Makefile.kmk (-3 / +3 lines)
Lines 1-6 Link Here
1
--- src/VBox/Additions/freebsd/vboxvfs/Makefile.kmk.orig	2017-04-28 16:59:22.000000000 +0200
1
--- src/VBox/Additions/freebsd/vboxvfs/Makefile.kmk.orig	2019-11-21 16:54:10 UTC
2
+++ src/VBox/Additions/freebsd/vboxvfs/Makefile.kmk	2017-07-13 00:52:49.020669620 +0200
2
+++ src/VBox/Additions/freebsd/vboxvfs/Makefile.kmk
3
@@ -33,32 +33,36 @@
3
@@ -33,32 +33,36 @@ vboxvfs_INCS          = \
4
        $(vboxvfs_0_OUTDIR)
4
        $(vboxvfs_0_OUTDIR)
5
 vboxvfs_SOURCES       = \
5
 vboxvfs_SOURCES       = \
6
 	vboxvfs_vfsops.c \
6
 	vboxvfs_vfsops.c \
(-)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-11-21 16:54:10 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__prov.c (-2 / +2 lines)
Lines 1-5 Link Here
1
--- src/VBox/Additions/freebsd/vboxvfs/vboxvfs_prov.c.orig	1970-01-01 01:00:00.000000000 +0100
1
--- src/VBox/Additions/freebsd/vboxvfs/vboxvfs_prov.c.orig	2019-12-03 22:07:39 UTC
2
+++ src/VBox/Additions/freebsd/vboxvfs/vboxvfs_prov.c	2017-07-12 19:24:26.109029000 +0200
2
+++ src/VBox/Additions/freebsd/vboxvfs/vboxvfs_prov.c
3
@@ -0,0 +1,1020 @@
3
@@ -0,0 +1,1020 @@
4
+/*
4
+/*
5
+ * Copyright (C) 2008-2016 Oracle Corporation
5
+ * Copyright (C) 2008-2016 Oracle Corporation
(-)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-11-21 16:54:10 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 (-2 / +2 lines)
Lines 1-4 Link Here
1
--- src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vnops.c.orig	2019-10-10 18:06:51 UTC
1
--- src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vnops.c.orig	2019-12-10 17:45:29 UTC
2
+++ src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vnops.c
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 $ */
Lines 7-13 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
(-)emulators/virtualbox-ose/files/patch-src_VBox_Additions_x11_Installer_98vboxadd-xclient (+19 lines)
Line 0 Link Here
1
--- src/VBox/Additions/x11/Installer/98vboxadd-xclient.orig	2019-11-21 16:54:14 UTC
2
+++ src/VBox/Additions/x11/Installer/98vboxadd-xclient
3
@@ -30,10 +30,10 @@ elif test -z "${SSH_CONNECTION}"; then
4
    # This script can also be triggered by a connection over SSH, which is not
5
    # what we had in mind, so we do not start VBoxClient in that case.  We do
6
    # not use "exit" here as this script is "source"d, not executed.
7
-  /usr/bin/VBoxClient --clipboard
8
-  /usr/bin/VBoxClient --checkhostversion
9
-  /usr/bin/VBoxClient --display
10
-  /usr/bin/VBoxClient --seamless
11
-  /usr/bin/VBoxClient --draganddrop
12
-  /usr/bin/VBoxClient --vmsvga-x11  # In case VMSVGA emulation is enabled
13
+  /usr/local/bin/VBoxClient --clipboard
14
+  /usr/local/bin/VBoxClient --checkhostversion
15
+  /usr/local/bin/VBoxClient --display
16
+  /usr/local/bin/VBoxClient --seamless
17
+  /usr/local/bin/VBoxClient --draganddrop
18
+  /usr/local/bin/VBoxClient --vmsvga-x11  # In case VMSVGA emulation is enabled
19
 fi
(-)emulators/virtualbox-ose/files/patch-src_VBox_Additions_x11_Installer_vboxclient.desktop (+10 lines)
Line 0 Link Here
1
--- src/VBox/Additions/x11/Installer/vboxclient.desktop.orig	2019-11-21 16:54:14 UTC
2
+++ src/VBox/Additions/x11/Installer/vboxclient.desktop
3
@@ -8,6 +8,6 @@ Comment[C]=VirtualBox User Session Services
4
 Comment=VirtualBox User Session Services
5
 Comment[it]=Servizi di sessione utente di VirtualBox
6
 Comment[pl]=Usługi sesji użytkownika VirtualBox
7
-Exec=/usr/bin/VBoxClient-all
8
+Exec=/usr/local/bin/VBoxClient-all
9
 X-GNOME-Autostart-enabled=true
10
 X-KDE-autostart-after=panel
(-)emulators/virtualbox-ose/files/patch-src_VBox_Additions_x11_vboxmouse_Makefile.kmk (-1 / +1 lines)
Lines 1-4 Link Here
1
--- src/VBox/Additions/x11/vboxmouse/Makefile.kmk.orig	2019-01-25 18:24:30 UTC
1
--- src/VBox/Additions/x11/vboxmouse/Makefile.kmk.orig	2019-11-21 16:54:15 UTC
2
+++ src/VBox/Additions/x11/vboxmouse/Makefile.kmk
2
+++ src/VBox/Additions/x11/vboxmouse/Makefile.kmk
3
@@ -227,10 +227,22 @@ endif # neq ($(KBUILD_TARGET),linux)
3
@@ -227,10 +227,22 @@ endif # neq ($(KBUILD_TARGET),linux)
4
 
4
 
(-)emulators/virtualbox-ose/files/patch-src_VBox_Additions_x11_vboxvideo_Makefile.kmk (-1 / +1 lines)
Lines 1-4 Link Here
1
--- src/VBox/Additions/x11/vboxvideo/Makefile.kmk.orig	2019-01-25 18:24:30 UTC
1
--- src/VBox/Additions/x11/vboxvideo/Makefile.kmk.orig	2019-11-21 16:54:15 UTC
2
+++ src/VBox/Additions/x11/vboxvideo/Makefile.kmk
2
+++ src/VBox/Additions/x11/vboxvideo/Makefile.kmk
3
@@ -406,9 +406,10 @@ ifdef VBOX_USE_SYSTEM_XORG_HEADERS
3
@@ -406,9 +406,10 @@ ifdef VBOX_USE_SYSTEM_XORG_HEADERS
4
  vboxvideo_drv_system_INCS += \
4
  vboxvideo_drv_system_INCS += \
(-)emulators/virtualbox-ose/files/patch-src_VBox_Debugger_Makefile.kmk (-2 / +2 lines)
Lines 1-6 Link Here
1
--- src/VBox/Debugger/Makefile.kmk.orig	2017-10-18 07:09:03 UTC
1
--- src/VBox/Debugger/Makefile.kmk.orig	2019-11-21 16:57:02 UTC
2
+++ src/VBox/Debugger/Makefile.kmk
2
+++ src/VBox/Debugger/Makefile.kmk
3
@@ -109,6 +109,7 @@ VBoxDbg_SOURCES = \
3
@@ -110,6 +110,7 @@ VBoxDbg_SOURCES = \
4
 	VBoxDbgBase.cpp \
4
 	VBoxDbgBase.cpp \
5
 	VBoxDbgConsole.cpp \
5
 	VBoxDbgConsole.cpp \
6
 	VBoxDbgStatsQt.cpp
6
 	VBoxDbgStatsQt.cpp
(-)emulators/virtualbox-ose/files/patch-src_VBox_Devices_Audio_DrvHostALSAAudio.cpp (-3 / +3 lines)
Lines 1-6 Link Here
1
--- src/VBox/Devices/Audio/DrvHostALSAAudio.cpp.orig	2017-10-18 07:09:04 UTC
1
--- src/VBox/Devices/Audio/DrvHostALSAAudio.cpp.orig	2019-11-21 16:57:02 UTC
2
+++ src/VBox/Devices/Audio/DrvHostALSAAudio.cpp
2
+++ src/VBox/Devices/Audio/DrvHostALSAAudio.cpp
3
@@ -1231,6 +1231,7 @@ static DECLCALLBACK(int) drvHostALSAAudioStreamPlay(PP
3
@@ -819,6 +819,7 @@ static DECLCALLBACK(int) drvHostALSAAudioStreamPlay(PP
4
                         continue;
4
                         continue;
5
                     }
5
                     }
6
 
6
 
Lines 8-14 Link Here
8
                     case -ESTRPIPE:
8
                     case -ESTRPIPE:
9
                     {
9
                     {
10
                         /* Stream was suspended and waiting for a recovery. */
10
                         /* Stream was suspended and waiting for a recovery. */
11
@@ -1244,6 +1245,7 @@ static DECLCALLBACK(int) drvHostALSAAudioStreamPlay(PP
11
@@ -832,6 +833,7 @@ static DECLCALLBACK(int) drvHostALSAAudioStreamPlay(PP
12
                         LogFlowFunc(("Resumed suspended output stream\n"));
12
                         LogFlowFunc(("Resumed suspended output stream\n"));
13
                         continue;
13
                         continue;
14
                     }
14
                     }
(-)emulators/virtualbox-ose/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA3d-glLdr.cpp (+29 lines)
Line 0 Link Here
1
--- src/VBox/Devices/Graphics/DevVGA-SVGA3d-glLdr.cpp.orig	2019-11-21 16:59:41 UTC
2
+++ src/VBox/Devices/Graphics/DevVGA-SVGA3d-glLdr.cpp
3
@@ -186,7 +186,7 @@ int glLdrInit(PPDMDEVINS pDevIns)
4
     pfn_wglDeleteContext = 0;
5
     pfn_wglMakeCurrent = 0;
6
     pfn_wglShareLists = 0;
7
-#elif defined(RT_OS_LINUX)
8
+#elif defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX)
9
     pfn_XConfigureWindow = 0;
10
     pfn_XCloseDisplay = 0;
11
     pfn_XCreateColormap = 0;
12
@@ -276,7 +276,7 @@ int glLdrInit(PPDMDEVINS pDevIns)
13
     GLGETPROC_(wglDeleteContext, "");
14
     GLGETPROC_(wglMakeCurrent, "");
15
     GLGETPROC_(wglShareLists, "");
16
-#elif defined(RT_OS_LINUX)
17
+#elif defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX)
18
     X11GETPROC_(XConfigureWindow);
19
     X11GETPROC_(XCloseDisplay);
20
     X11GETPROC_(XCreateColormap);
21
@@ -357,7 +357,7 @@ int glLdrInit(PPDMDEVINS pDevIns)
22
     GLGETPROC_(glVertexPointer, "");
23
     GLGETPROC_(glViewport, "");
24
 
25
-#ifdef RT_OS_LINUX
26
+#if defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX)
27
     XInitThreads();
28
 #endif
29
     return VINF_SUCCESS;
(-)emulators/virtualbox-ose/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA3d-glLdr.h (+11 lines)
Line 0 Link Here
1
--- src/VBox/Devices/Graphics/DevVGA-SVGA3d-glLdr.h.orig	2019-11-21 16:59:41 UTC
2
+++ src/VBox/Devices/Graphics/DevVGA-SVGA3d-glLdr.h
3
@@ -317,7 +317,7 @@ GLPFN BOOL (WINAPI *pfn_wglMakeCurrent)(HDC, HGLRC);
4
 GLPFN BOOL (WINAPI *pfn_wglShareLists)(HGLRC, HGLRC);
5
 #define wglShareLists pfn_wglShareLists
6
 
7
-#elif defined(RT_OS_LINUX)
8
+#elif defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX)
9
 /*
10
  * GLX
11
  */
(-)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-11-21 16:59:41 UTC
2
+++ src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp
3
@@ -1175,7 +1175,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
@@ -3004,7 +3004,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
@@ -3034,7 +3034,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
@@ -3369,7 +3369,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 (+44 lines)
Line 0 Link Here
1
--- src/VBox/Devices/Makefile.kmk.orig	2019-11-21 17:00:01 UTC
2
+++ src/VBox/Devices/Makefile.kmk
3
@@ -112,6 +112,7 @@ if !defined(VBOX_ONLY_EXTPACKS)
4
   VBoxDDU_LDFLAGS.darwin += -framework IOKit
5
  endif
6
 
7
+ VBoxDDU_LDFLAGS.freebsd  = $(VBOX_GCC_NO_UNDEFINED)
8
  VBoxDDU_LDFLAGS.linux    = $(VBOX_GCC_NO_UNDEFINED)
9
  $(call VBOX_SET_VER_INFO_DLL,VBoxDDU,VirtualBox VMM Devices and Drivers Utilities)
10
 
11
@@ -241,6 +242,7 @@ if !defined(VBOX_ONLY_EXTPACKS) && "$(intersects $(KBU
12
  	-framework Carbon \
13
  	-framework DiskArbitration \
14
  	-framework SystemConfiguration
15
+ VBoxDD_LDFLAGS.freebsd  = $(VBOX_GCC_NO_UNDEFINED)
16
  VBoxDD_LDFLAGS.linux    = $(VBOX_GCC_NO_UNDEFINED)
17
 
18
  # --- Tracing bits. ---
19
@@ -283,7 +285,7 @@ if !defined(VBOX_ONLY_EXTPACKS) && "$(intersects $(KBU
20
   VBoxDD_SOURCES        += Graphics/DevVGA-SVGA.cpp
21
  endif
22
  ifdef VBOX_WITH_VMSVGA3D
23
-  if1of ($(KBUILD_TARGET), linux win)
24
+  if1of ($(KBUILD_TARGET), freebsd linux win)
25
 # Dynamically load 3D library (opengl32, libGL).
26
 # This is a temporary solution. In future the 3D backend will be in a separate library.
27
 VBOX_WITH_VMSVGA3D_DYNAMIC_LOAD = 1
28
@@ -324,6 +326,7 @@ VBOX_WITH_VMSVGA3D_DYNAMIC_LOAD = 1
29
    VBoxDD_SOURCES       += \
30
    	Graphics/DevVGA-SVGA3d-glLdr.cpp
31
    else
32
+   VBoxDD_LIBS.freebsd  += X11 GL
33
    VBoxDD_LIBS.linux    += X11 GL
34
    VBoxDD_LIBS.win      += $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/Opengl32.lib
35
    endif
36
@@ -1516,6 +1519,8 @@ if defined(VBOX_WITH_VMSVGA3D) && !defined(VBOX_ONLY_E
37
  VBoxSVGA3D_INCS = $(VBOX_GRAPHICS_INCS)
38
  VBoxSVGA3D_INCS.win    := \
39
  	Graphics/shaderlib/libWineStub/include
40
+ VBoxSVGA3D_INCS.freebsd := \
41
+ 	Graphics/shaderlib/wine/include
42
  VBoxSVGA3D_INCS.linux  := \
43
  	Graphics/shaderlib/wine/include
44
  VBoxSVGA3D_INCS.darwin := \
(-)emulators/virtualbox-ose/files/patch-src_VBox_Devices_Network_slirp_bsd_sys_mbuf.h (+12 lines)
Line 0 Link Here
1
--- src/VBox/Devices/Network/slirp/bsd/sys/mbuf.h.orig	2019-11-21 17:00:06 UTC
2
+++ src/VBox/Devices/Network/slirp/bsd/sys/mbuf.h
3
@@ -245,6 +245,9 @@ struct mbuf {
4
 #define	M_FRAG		0x00000800 /* packet is a fragment of a larger packet */
5
 #define	M_FIRSTFRAG	0x00001000 /* packet is first fragment */
6
 #define	M_LASTFRAG	0x00002000 /* packet is last fragment */
7
+#ifdef M_SKIP_FIREWALL
8
+#undef M_SKIP_FIREWALL
9
+#endif
10
 #define	M_SKIP_FIREWALL	0x00004000 /* skip firewall processing */
11
 #define	M_FREELIST	0x00008000 /* mbuf is on the free list */
12
 #define	M_VLANTAG	0x00010000 /* ether_vtag is valid */
(-)emulators/virtualbox-ose/files/patch-src_VBox_Devices_PC_vbox-cpuhotplug.dsl (-96 lines)
Lines 1-96 Link Here
1
--- src/VBox/Devices/PC/vbox-cpuhotplug.dsl.orig	2019-10-10 18:34:15 UTC
2
+++ src/VBox/Devices/PC/vbox-cpuhotplug.dsl
3
@@ -44,11 +44,11 @@ DefinitionBlock ("SSDT-cpuhotplug.aml", "SSDT", 1, "VB
4
     Scope (\_SB)
5
     {
6
 
7
-#define GENERATE_CPU_OBJECT(id, sck, sckuid, cpu, cpuuid)<NL>              \
8
+#define GENERATE_CPU_OBJECT(id, sck, cpu)<NL>                              \
9
     Device (sck)                                                           \
10
     {                                                                      \
11
         Name (_HID, "ACPI0004")                                            \
12
-        Name (_UID, sckuid)                                                \
13
+        Name (_UID, id)                                                    \
14
                                                                            \
15
         <NL>                                                               \
16
         Processor (cpu, /* Name */                                         \
17
@@ -58,7 +58,7 @@ DefinitionBlock ("SSDT-cpuhotplug.aml", "SSDT", 1, "VB
18
                    )                                                       \
19
         {                                                                  \
20
             Name (_HID, "ACPI0007")                                        \
21
-            Name (_UID, cpuuid)                                            \
22
+            Name (_UID, id)                                                \
23
             Name (_PXM, 0x00)                                              \
24
             <NL>                                                           \
25
             Method(_MAT, 0, Serialized)                                    \
26
@@ -95,38 +95,38 @@ DefinitionBlock ("SSDT-cpuhotplug.aml", "SSDT", 1, "VB
27
         }                                                                  \
28
     }                                                                      \
29
 
30
-        GENERATE_CPU_OBJECT(0x00, SCK0, "SCKCPU0", CPU0, "SCK0-CPU0")
31
-        GENERATE_CPU_OBJECT(0x01, SCK1, "SCKCPU1", CPU1, "SCK1-CPU0")
32
-        GENERATE_CPU_OBJECT(0x02, SCK2, "SCKCPU2", CPU2, "SCK2-CPU0")
33
-        GENERATE_CPU_OBJECT(0x03, SCK3, "SCKCPU3", CPU3, "SCK3-CPU0")
34
-        GENERATE_CPU_OBJECT(0x04, SCK4, "SCKCPU4", CPU4, "SCK4-CPU0")
35
-        GENERATE_CPU_OBJECT(0x05, SCK5, "SCKCPU5", CPU5, "SCK5-CPU0")
36
-        GENERATE_CPU_OBJECT(0x06, SCK6, "SCKCPU6", CPU6, "SCK6-CPU0")
37
-        GENERATE_CPU_OBJECT(0x07, SCK7, "SCKCPU7", CPU7, "SCK7-CPU0")
38
-        GENERATE_CPU_OBJECT(0x08, SCK8, "SCKCPU8", CPU8, "SCK8-CPU0")
39
-        GENERATE_CPU_OBJECT(0x09, SCK9, "SCKCPU9", CPU9, "SCK9-CPU0")
40
-        GENERATE_CPU_OBJECT(0x0a, SCKA, "SCKCPUA", CPUA, "SCKA-CPU0")
41
-        GENERATE_CPU_OBJECT(0x0b, SCKB, "SCKCPUB", CPUB, "SCKB-CPU0")
42
-        GENERATE_CPU_OBJECT(0x0c, SCKC, "SCKCPUC", CPUC, "SCKC-CPU0")
43
-        GENERATE_CPU_OBJECT(0x0d, SCKD, "SCKCPUD", CPUD, "SCKD-CPU0")
44
-        GENERATE_CPU_OBJECT(0x0e, SCKE, "SCKCPUE", CPUE, "SCKE-CPU0")
45
-        GENERATE_CPU_OBJECT(0x0f, SCKF, "SCKCPUF", CPUF, "SCKF-CPU0")
46
-        GENERATE_CPU_OBJECT(0x10, SCKG, "SCKCPUG", CPUG, "SCKG-CPU0")
47
-        GENERATE_CPU_OBJECT(0x11, SCKH, "SCKCPUH", CPUH, "SCKH-CPU0")
48
-        GENERATE_CPU_OBJECT(0x12, SCKI, "SCKCPUI", CPUI, "SCKI-CPU0")
49
-        GENERATE_CPU_OBJECT(0x13, SCKJ, "SCKCPUJ", CPUJ, "SCKJ-CPU0")
50
-        GENERATE_CPU_OBJECT(0x14, SCKK, "SCKCPUK", CPUK, "SCKK-CPU0")
51
-        GENERATE_CPU_OBJECT(0x15, SCKL, "SCKCPUL", CPUL, "SCKL-CPU0")
52
-        GENERATE_CPU_OBJECT(0x16, SCKM, "SCKCPUM", CPUM, "SCKM-CPU0")
53
-        GENERATE_CPU_OBJECT(0x17, SCKN, "SCKCPUN", CPUN, "SCKN-CPU0")
54
-        GENERATE_CPU_OBJECT(0x18, SCKO, "SCKCPUO", CPUO, "SCKO-CPU0")
55
-        GENERATE_CPU_OBJECT(0x19, SCKP, "SCKCPUP", CPUP, "SCKP-CPU0")
56
-        GENERATE_CPU_OBJECT(0x1a, SCKQ, "SCKCPUQ", CPUQ, "SCKQ-CPU0")
57
-        GENERATE_CPU_OBJECT(0x1b, SCKR, "SCKCPUR", CPUR, "SCKR-CPU0")
58
-        GENERATE_CPU_OBJECT(0x1c, SCKS, "SCKCPUS", CPUS, "SCKS-CPU0")
59
-        GENERATE_CPU_OBJECT(0x1d, SCKT, "SCKCPUT", CPUT, "SCKT-CPU0")
60
-        GENERATE_CPU_OBJECT(0x1e, SCKU, "SCKCPUU", CPUU, "SCKU-CPU0")
61
-        GENERATE_CPU_OBJECT(0x1f, SCKV, "SCKCPUV", CPUV, "SCKV-CPU0")
62
+        GENERATE_CPU_OBJECT(0x00, SCK0, CPU0)
63
+        GENERATE_CPU_OBJECT(0x01, SCK1, CPU1)
64
+        GENERATE_CPU_OBJECT(0x02, SCK2, CPU2)
65
+        GENERATE_CPU_OBJECT(0x03, SCK3, CPU3)
66
+        GENERATE_CPU_OBJECT(0x04, SCK4, CPU4)
67
+        GENERATE_CPU_OBJECT(0x05, SCK5, CPU5)
68
+        GENERATE_CPU_OBJECT(0x06, SCK6, CPU6)
69
+        GENERATE_CPU_OBJECT(0x07, SCK7, CPU7)
70
+        GENERATE_CPU_OBJECT(0x08, SCK8, CPU8)
71
+        GENERATE_CPU_OBJECT(0x09, SCK9, CPU9)
72
+        GENERATE_CPU_OBJECT(0x0a, SCKA, CPUA)
73
+        GENERATE_CPU_OBJECT(0x0b, SCKB, CPUB)
74
+        GENERATE_CPU_OBJECT(0x0c, SCKC, CPUC)
75
+        GENERATE_CPU_OBJECT(0x0d, SCKD, CPUD)
76
+        GENERATE_CPU_OBJECT(0x0e, SCKE, CPUE)
77
+        GENERATE_CPU_OBJECT(0x0f, SCKF, CPUF)
78
+        GENERATE_CPU_OBJECT(0x10, SCKG, CPUG)
79
+        GENERATE_CPU_OBJECT(0x11, SCKH, CPUH)
80
+        GENERATE_CPU_OBJECT(0x12, SCKI, CPUI)
81
+        GENERATE_CPU_OBJECT(0x13, SCKJ, CPUJ)
82
+        GENERATE_CPU_OBJECT(0x14, SCKK, CPUK)
83
+        GENERATE_CPU_OBJECT(0x15, SCKL, CPUL)
84
+        GENERATE_CPU_OBJECT(0x16, SCKM, CPUM)
85
+        GENERATE_CPU_OBJECT(0x17, SCKN, CPUN)
86
+        GENERATE_CPU_OBJECT(0x18, SCKO, CPUO)
87
+        GENERATE_CPU_OBJECT(0x19, SCKP, CPUP)
88
+        GENERATE_CPU_OBJECT(0x1a, SCKQ, CPUQ)
89
+        GENERATE_CPU_OBJECT(0x1b, SCKR, CPUR)
90
+        GENERATE_CPU_OBJECT(0x1c, SCKS, CPUS)
91
+        GENERATE_CPU_OBJECT(0x1d, SCKT, CPUT)
92
+        GENERATE_CPU_OBJECT(0x1e, SCKU, CPUU)
93
+        GENERATE_CPU_OBJECT(0x1f, SCKV, CPUV)
94
 
95
 #undef GENERATE_CPU_OBJECT
96
     }
(-)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-11-21 17:01:16 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
@@ -641,7 +641,7 @@ void printUsage(USAGECATEGORY enmCommand, uint64_t fSu
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
@@ -656,7 +656,7 @@ void printUsage(USAGECATEGORY enmCommand, uint64_t fSu
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
@@ -669,22 +669,6 @@ void printUsage(USAGECATEGORY enmCommand, uint64_t fSu
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-11-21 17:01:17 UTC
2
+++ src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp
3
@@ -153,7 +153,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
@@ -348,7 +348,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
@@ -2269,7 +2269,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_Frontends_VirtualBox_Makefile.kmk (-5 / +5 lines)
Lines 1-14 Link Here
1
--- src/VBox/Frontends/VirtualBox/Makefile.kmk.orig	2017-10-18 07:12:20 UTC
1
--- src/VBox/Frontends/VirtualBox/Makefile.kmk.orig	2019-11-21 17:01:17 UTC
2
+++ src/VBox/Frontends/VirtualBox/Makefile.kmk
2
+++ src/VBox/Frontends/VirtualBox/Makefile.kmk
3
@@ -895,6 +895,7 @@ if defined(VBOX_WITH_VIDEOHWACCEL) || defined(VBOX_GUI
3
@@ -1154,6 +1154,7 @@ if defined(VBOX_WITH_VIDEOHWACCEL) || defined(VBOX_GUI
4
  VirtualBox_SOURCES += \
4
 	src/VBox2DHelpers.cpp \
5
 	src/VBoxFBOverlay.cpp \
5
 	src/VBoxFBOverlay.cpp \
6
 	src/VBoxGLSupportInfo.cpp
6
 	src/VBoxGLSupportInfo.cpp
7
+ VirtualBox_CXXFLAGS.freebsd += -std=c++11
7
+ VirtualBox_CXXFLAGS.freebsd += -std=c++11
8
 endif
8
 endif
9
 
9
 
10
 #
10
 
11
@@ -1217,6 +1218,7 @@ if defined(VBOX_WITH_VIDEOHWACCEL)
11
@@ -1824,6 +1825,7 @@ if defined(VBOX_WITH_VIDEOHWACCEL)
12
   VBoxOGL2D_SOURCES = \
12
   VBoxOGL2D_SOURCES = \
13
 	src/VBoxGLSupportInfo.cpp
13
 	src/VBoxGLSupportInfo.cpp
14
   VBoxOGL2D_INCS = include
14
   VBoxOGL2D_INCS = include
(-)emulators/virtualbox-ose/files/patch-src_VBox_GuestHost_OpenGL_include_chromium.h (-11 lines)
Lines 1-11 Link Here
1
--- src/VBox/GuestHost/OpenGL/include/chromium.h.orig	2018-05-09 16:38:12 UTC
2
+++ src/VBox/GuestHost/OpenGL/include/chromium.h
3
@@ -63,7 +63,7 @@
4
 #include <GL/gl.h>
5
 /* Quick fix so as not to update the version of glext.h we provide. */
6
 #ifdef GL_GLEXT_PROTOTYPES
7
-# if defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS)
8
+# if defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS)
9
 GLAPI void APIENTRY glBindFramebuffer (GLenum, GLuint);
10
 GLAPI void APIENTRY glBlitFramebuffer (GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum);
11
 GLAPI GLenum APIENTRY glCheckFramebufferStatus (GLenum);
(-)emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_Support_SUPDrv.cpp (-1 / +1 lines)
Lines 1-4 Link Here
1
--- src/VBox/HostDrivers/Support/SUPDrv.cpp.orig	2018-10-15 14:30:56 UTC
1
--- src/VBox/HostDrivers/Support/SUPDrv.cpp.orig	2019-11-21 17:01:59 UTC
2
+++ src/VBox/HostDrivers/Support/SUPDrv.cpp
2
+++ src/VBox/HostDrivers/Support/SUPDrv.cpp
3
@@ -104,7 +104,7 @@
3
@@ -104,7 +104,7 @@
4
 /** @def SUPDRV_CHECK_SMAP_CHECK
4
 /** @def SUPDRV_CHECK_SMAP_CHECK
(-)emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_Support_SUPDrvInternal.h (-2 / +2 lines)
Lines 1-6 Link Here
1
--- src/VBox/HostDrivers/Support/SUPDrvInternal.h.orig	2016-07-18 11:56:19 UTC
1
--- src/VBox/HostDrivers/Support/SUPDrvInternal.h.orig	2019-11-21 17:01:59 UTC
2
+++ src/VBox/HostDrivers/Support/SUPDrvInternal.h
2
+++ src/VBox/HostDrivers/Support/SUPDrvInternal.h
3
@@ -235,7 +235,7 @@
3
@@ -211,7 +211,7 @@
4
 # define SUPDRV_WITHOUT_MSR_PROBER
4
 # define SUPDRV_WITHOUT_MSR_PROBER
5
 #endif
5
 #endif
6
 
6
 
(-)emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_Support_freebsd_Makefile (+28 lines)
Line 0 Link Here
1
--- src/VBox/HostDrivers/Support/freebsd/Makefile.orig	2019-11-21 17:02:00 UTC
2
+++ src/VBox/HostDrivers/Support/freebsd/Makefile
3
@@ -82,6 +82,7 @@ SRCS += \
4
 	assert.c \
5
 	handletable.c \
6
 	handletablectx.c \
7
+	handletablesimple.c \
8
 	once.c \
9
 	term.c \
10
 	thread.c
11
@@ -94,14 +95,15 @@ SRCS += \
12
 	RTStrCopy.c \
13
 	RTStrCopyEx.c \
14
 	RTStrCopyP.c \
15
+	memchr.c \
16
 	strformat.c \
17
 	strformatnum.c \
18
 	strformatrt.c \
19
 	strformattype.c \
20
+	stringalloc.c \
21
 	strprintf.c \
22
 	strtonum.c \
23
-	memchr.c \
24
-	stringalloc.c
25
+	utf-8.c
26
 
27
 .PATH:	${.CURDIR}/common/rand
28
 SRCS += \
(-)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-11-21 17:02:00 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_Support_freebsd_files__vboxdrv (+28 lines)
Line 0 Link Here
1
--- src/VBox/HostDrivers/Support/freebsd/files_vboxdrv.orig	2019-11-21 17:02:00 UTC
2
+++ src/VBox/HostDrivers/Support/freebsd/files_vboxdrv
3
@@ -119,6 +119,7 @@ FILES_VBOXDRV_NOBIN=" \
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 \
6
     ${PATH_ROOT}/src/VBox/Runtime/common/misc/handletablectx.cpp=>common/misc/handletablectx.c \
7
+    ${PATH_ROOT}/src/VBox/Runtime/common/misc/handletablesimple.cpp=>common/misc/handletablesimple.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 \
10
     ${PATH_ROOT}/src/VBox/Runtime/common/misc/thread.cpp=>common/misc/thread.c \
11
@@ -128,14 +129,15 @@ FILES_VBOXDRV_NOBIN=" \
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 \
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 \
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 \
18
     ${PATH_ROOT}/src/VBox/Runtime/common/string/strformatrt.cpp=>common/string/strformatrt.c \
19
     ${PATH_ROOT}/src/VBox/Runtime/common/string/strformattype.cpp=>common/string/strformattype.c \
20
+    ${PATH_ROOT}/src/VBox/Runtime/common/string/stringalloc.cpp=>common/string/stringalloc.c \
21
     ${PATH_ROOT}/src/VBox/Runtime/common/string/strprintf.cpp=>common/string/strprintf.c \
22
     ${PATH_ROOT}/src/VBox/Runtime/common/string/strtonum.cpp=>common/string/strtonum.c \
23
-    ${PATH_ROOT}/src/VBox/Runtime/common/string/memchr.cpp=>common/string/memchr.c \
24
-    ${PATH_ROOT}/src/VBox/Runtime/common/string/stringalloc.cpp=>common/string/stringalloc.c \
25
+    ${PATH_ROOT}/src/VBox/Runtime/common/string/utf-8.cpp=>common/string/utf-8.c \
26
     ${PATH_ROOT}/src/VBox/Runtime/common/rand/rand.cpp=>common/rand/rand.c \
27
     ${PATH_ROOT}/src/VBox/Runtime/common/rand/randadv.cpp=>common/rand/randadv.c \
28
     ${PATH_ROOT}/src/VBox/Runtime/common/rand/randparkmiller.cpp=>common/rand/randparkmiller.c \
(-)emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_VBoxNetAdp_Makefile.kmk (+20 lines)
Line 0 Link Here
1
--- src/VBox/HostDrivers/VBoxNetAdp/Makefile.kmk.orig	2019-11-21 17:02:02 UTC
2
+++ src/VBox/HostDrivers/VBoxNetAdp/Makefile.kmk
3
@@ -206,10 +206,14 @@ $$(VBoxNetAdp-src_0_OUTDIR)/Makefile: \
4
 		$$(if $$(eq $$(VBoxNetAdp/freebsd/Makefile_VBOX_HARDENED),$$(VBOX_WITH_HARDENING)),,FORCE) \
5
 		| $$(dir $$@)
6
 	$(QUIET)$(RM) -f -- $@
7
- ifndef VBOX_WITH_HARDENING
8
-	$(QUIET)$(SED) -e "s;VBOX_WITH_HARDENING;;g" --output $@ $<
9
- else
10
 	$(QUIET)$(CP) -f $< $@
11
+ ifndef VBOX_WITH_HARDENING
12
+	$(QUIET)$(SED) -e "s;-DVBOX_WITH_HARDENING;;g" --output $@.tmp $@
13
+	$(QUIET)$(MV) -f $@.tmp $@
14
+ endif
15
+ ifndef VBOX_WITH_NETFLT_VIMAGE
16
+	$(QUIET)$(SED) -e "s;-DVIMAGE;;g" --output $@.tmp $@
17
+	$(QUIET)$(MV) -f $@.tmp $@
18
  endif
19
 
20
 endif # freebsd
(-)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-11-21 17:02:02 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-11-21 17:02:02 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-11-21 17:02:02 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_HostDrivers_VBoxNetFlt_freebsd_VBoxNetFlt-freebsd.c (+249 lines)
Line 0 Link Here
1
--- src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c.orig	2019-11-21 17:02:02 UTC
2
+++ src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c
3
@@ -52,6 +52,7 @@
4
 #include <net/if_dl.h>
5
 #include <net/if_types.h>
6
 #include <net/ethernet.h>
7
+#include <net/if_vlan_var.h>
8
 
9
 #include <netgraph/ng_message.h>
10
 #include <netgraph/netgraph.h>
11
@@ -73,6 +74,7 @@
12
 
13
 #define VBOXNETFLT_OS_SPECFIC 1
14
 #include "../VBoxNetFltInternal.h"
15
+#include "freebsd/the-freebsd-kernel.h"
16
 
17
 static int vboxnetflt_modevent(struct module *, int, void *);
18
 static ng_constructor_t    ng_vboxnetflt_constructor;
19
@@ -436,6 +438,8 @@ static void vboxNetFltFreeBSDinput(void *arg, int pend
20
     struct ifnet *ifp = pThis->u.s.ifp;
21
     unsigned int cSegs = 0;
22
     bool fDropIt = false, fActive;
23
+    bool is_vl_tagged = false;
24
+    uint16_t vl_tag;
25
     PINTNETSG pSG;
26
 
27
     VBOXCURVNET_SET(ifp->if_vnet);
28
@@ -448,6 +452,19 @@ static void vboxNetFltFreeBSDinput(void *arg, int pend
29
         if (m == NULL)
30
             break;
31
 
32
+        /* Prepend a VLAN header for consumption by the virtual switch */
33
+        if (m->m_flags & M_VLANTAG) {
34
+            vl_tag = m->m_pkthdr.ether_vtag;
35
+            is_vl_tagged = true;
36
+
37
+            m = ether_vlanencap(m, m->m_pkthdr.ether_vtag);
38
+            if (m == NULL) {
39
+                printf("vboxflt: unable to prepend VLAN header\n");
40
+                break;
41
+            }
42
+            m->m_flags &= ~M_VLANTAG;
43
+        }
44
+
45
         for (m0 = m; m0 != NULL; m0 = m0->m_next)
46
             if (m0->m_len > 0)
47
                 cSegs++;
48
@@ -462,6 +479,27 @@ static void vboxNetFltFreeBSDinput(void *arg, int pend
49
         vboxNetFltFreeBSDMBufToSG(pThis, m, pSG, cSegs, 0);
50
         fDropIt = pThis->pSwitchPort->pfnRecv(pThis->pSwitchPort, NULL /* pvIf */, pSG, INTNETTRUNKDIR_WIRE);
51
         RTMemTmpFree(pSG);
52
+
53
+        /* Restore the VLAN flags before re-injecting the packet */
54
+        if (is_vl_tagged && !fDropIt) {
55
+            struct ether_vlan_header *vl_hdr;
56
+
57
+            /* This shouldn't fail, as the header was just prepended */
58
+            if (m->m_len < sizeof(*vl_hdr) && (m = m_pullup(m, sizeof(*vl_hdr))) == NULL) {
59
+                printf("vboxflt: unable to pullup VLAN header\n");
60
+                m_freem(m);
61
+                break;
62
+            }
63
+
64
+            /* Copy the MAC dhost/shost over the 802.1q field */
65
+            vl_hdr = mtod(m, struct ether_vlan_header *);
66
+            bcopy((char *)vl_hdr, (char *)vl_hdr + ETHER_VLAN_ENCAP_LEN, ETHER_HDR_LEN - ETHER_TYPE_LEN);
67
+            m_adj(m, ETHER_VLAN_ENCAP_LEN);
68
+
69
+            m->m_pkthdr.ether_vtag = vl_tag;
70
+            m->m_flags |= M_VLANTAG;
71
+        }
72
+
73
         if (fDropIt)
74
             m_freem(m);
75
         else
76
@@ -521,6 +559,7 @@ static void vboxNetFltFreeBSDoutput(void *arg, int pen
77
  */
78
 int vboxNetFltPortOsXmit(PVBOXNETFLTINS pThis, void *pvIfData, PINTNETSG pSG, uint32_t fDst)
79
 {
80
+    IPRT_FREEBSD_SAVE_EFL_AC();
81
     NOREF(pvIfData);
82
 
83
     void (*input_f)(struct ifnet *, struct mbuf *);
84
@@ -537,10 +576,16 @@ int vboxNetFltPortOsXmit(PVBOXNETFLTINS pThis, void *p
85
     {
86
         m = vboxNetFltFreeBSDSGMBufFromSG(pThis, pSG);
87
         if (m == NULL)
88
+        {
89
+            IPRT_FREEBSD_RESTORE_EFL_AC();
90
             return VERR_NO_MEMORY;
91
+        }
92
         m = m_pullup(m, ETHER_HDR_LEN);
93
         if (m == NULL)
94
+        {
95
+            IPRT_FREEBSD_RESTORE_EFL_AC();
96
             return VERR_NO_MEMORY;
97
+        }
98
 
99
         m->m_flags |= M_PKTHDR;
100
         ether_output_frame(ifp, m);
101
@@ -550,10 +595,16 @@ int vboxNetFltPortOsXmit(PVBOXNETFLTINS pThis, void *p
102
     {
103
         m = vboxNetFltFreeBSDSGMBufFromSG(pThis, pSG);
104
         if (m == NULL)
105
+        {
106
+            IPRT_FREEBSD_RESTORE_EFL_AC();
107
             return VERR_NO_MEMORY;
108
+        }
109
         m = m_pullup(m, ETHER_HDR_LEN);
110
         if (m == NULL)
111
+        {
112
+            IPRT_FREEBSD_RESTORE_EFL_AC();
113
             return VERR_NO_MEMORY;
114
+        }
115
         /*
116
          * Delivering packets to the host will be captured by the
117
          * input hook. Tag the packet with a mbuf tag so that we
118
@@ -564,6 +615,7 @@ int vboxNetFltPortOsXmit(PVBOXNETFLTINS pThis, void *p
119
         if (mtag == NULL)
120
         {
121
             m_freem(m);
122
+            IPRT_FREEBSD_RESTORE_EFL_AC();
123
             return VERR_NO_MEMORY;
124
         }
125
 
126
@@ -574,6 +626,7 @@ int vboxNetFltPortOsXmit(PVBOXNETFLTINS pThis, void *p
127
         ifp->if_input(ifp, m);
128
     }
129
     VBOXCURVNET_RESTORE();
130
+    IPRT_FREEBSD_RESTORE_EFL_AC();
131
     return VINF_SUCCESS;
132
 }
133
 
134
@@ -586,6 +639,7 @@ static bool vboxNetFltFreeBsdIsPromiscuous(PVBOXNETFLT
135
 
136
 int vboxNetFltOsInitInstance(PVBOXNETFLTINS pThis, void *pvContext)
137
 {
138
+    IPRT_FREEBSD_SAVE_EFL_AC();
139
     char nam[NG_NODESIZ];
140
     struct ifnet *ifp;
141
     node_p node;
142
@@ -594,7 +648,10 @@ int vboxNetFltOsInitInstance(PVBOXNETFLTINS pThis, voi
143
     NOREF(pvContext);
144
     ifp = ifunit(pThis->szName);
145
     if (ifp == NULL)
146
+    {
147
+        IPRT_FREEBSD_RESTORE_EFL_AC();
148
         return VERR_INTNET_FLT_IF_NOT_FOUND;
149
+    }
150
 
151
     /* Create a new netgraph node for this instance */
152
     if (ng_make_node_common(&ng_vboxnetflt_typestruct, &node) != 0)
153
@@ -638,12 +695,14 @@ int vboxNetFltOsInitInstance(PVBOXNETFLTINS pThis, voi
154
         vboxNetFltRelease(pThis, true /*fBusy*/);
155
     }
156
     VBOXCURVNET_RESTORE();
157
+    IPRT_FREEBSD_RESTORE_EFL_AC();
158
 
159
     return VINF_SUCCESS;
160
 }
161
 
162
 bool vboxNetFltOsMaybeRediscovered(PVBOXNETFLTINS pThis)
163
 {
164
+    IPRT_FREEBSD_SAVE_EFL_AC();
165
     struct ifnet *ifp, *ifp0;
166
 
167
     ifp = ASMAtomicUoReadPtrT(&pThis->u.s.ifp, struct ifnet *);
168
@@ -660,6 +719,7 @@ bool vboxNetFltOsMaybeRediscovered(PVBOXNETFLTINS pThi
169
         pThis->u.s.node = NULL;
170
     }
171
     VBOXCURVNET_RESTORE();
172
+    IPRT_FREEBSD_RESTORE_EFL_AC();
173
 
174
     if (ifp0 != NULL)
175
     {
176
@@ -672,6 +732,7 @@ bool vboxNetFltOsMaybeRediscovered(PVBOXNETFLTINS pThi
177
 
178
 void vboxNetFltOsDeleteInstance(PVBOXNETFLTINS pThis)
179
 {
180
+    IPRT_FREEBSD_SAVE_EFL_AC();
181
 
182
     taskqueue_drain(taskqueue_fast, &pThis->u.s.tskin);
183
     taskqueue_drain(taskqueue_fast, &pThis->u.s.tskout);
184
@@ -684,6 +745,7 @@ void vboxNetFltOsDeleteInstance(PVBOXNETFLTINS pThis)
185
         ng_rmnode_self(pThis->u.s.node);
186
     VBOXCURVNET_RESTORE();
187
     pThis->u.s.node = NULL;
188
+    IPRT_FREEBSD_RESTORE_EFL_AC();
189
 }
190
 
191
 int vboxNetFltOsPreInitInstance(PVBOXNETFLTINS pThis)
192
@@ -697,6 +759,7 @@ int vboxNetFltOsPreInitInstance(PVBOXNETFLTINS pThis)
193
 
194
 void vboxNetFltPortOsSetActive(PVBOXNETFLTINS pThis, bool fActive)
195
 {
196
+    IPRT_FREEBSD_SAVE_EFL_AC();
197
     struct ifnet *ifp;
198
     struct ifreq ifreq;
199
     int error;
200
@@ -730,7 +793,10 @@ void vboxNetFltPortOsSetActive(PVBOXNETFLTINS pThis, b
201
         NG_MKMESSAGE(msg, NGM_GENERIC_COOKIE, NGM_CONNECT,
202
             sizeof(struct ngm_connect), M_NOWAIT);
203
         if (msg == NULL)
204
+        {
205
+            IPRT_FREEBSD_RESTORE_EFL_AC();
206
             return;
207
+        }
208
         con = (struct ngm_connect *)msg->data;
209
         snprintf(con->path, NG_PATHSIZ, "vboxnetflt_%s:", ifp->if_xname);
210
         strlcpy(con->ourhook, "lower", NG_HOOKSIZ);
211
@@ -744,7 +810,10 @@ void vboxNetFltPortOsSetActive(PVBOXNETFLTINS pThis, b
212
         NG_MKMESSAGE(msg, NGM_GENERIC_COOKIE, NGM_CONNECT,
213
             sizeof(struct ngm_connect), M_NOWAIT);
214
         if (msg == NULL)
215
+        {
216
+            IPRT_FREEBSD_RESTORE_EFL_AC();
217
             return;
218
+        }
219
         con = (struct ngm_connect *)msg->data;
220
         snprintf(con->path, NG_PATHSIZ, "vboxnetflt_%s:",
221
             ifp->if_xname);
222
@@ -767,7 +836,10 @@ void vboxNetFltPortOsSetActive(PVBOXNETFLTINS pThis, b
223
         NG_MKMESSAGE(msg, NGM_GENERIC_COOKIE, NGM_RMHOOK,
224
             sizeof(struct ngm_rmhook), M_NOWAIT);
225
         if (msg == NULL)
226
+        {
227
+            IPRT_FREEBSD_RESTORE_EFL_AC();
228
             return;
229
+        }
230
         rm = (struct ngm_rmhook *)msg->data;
231
         strlcpy(rm->ourhook, "input", NG_HOOKSIZ);
232
         NG_SEND_MSG_PATH(error, node, msg, path, 0);
233
@@ -778,12 +850,16 @@ void vboxNetFltPortOsSetActive(PVBOXNETFLTINS pThis, b
234
         NG_MKMESSAGE(msg, NGM_GENERIC_COOKIE, NGM_RMHOOK,
235
             sizeof(struct ngm_rmhook), M_NOWAIT);
236
         if (msg == NULL)
237
+        {
238
+            IPRT_FREEBSD_RESTORE_EFL_AC();
239
             return;
240
+        }
241
         rm = (struct ngm_rmhook *)msg->data;
242
         strlcpy(rm->ourhook, "output", NG_HOOKSIZ);
243
         NG_SEND_MSG_PATH(error, node, msg, path, 0);
244
     }
245
     VBOXCURVNET_RESTORE();
246
+    IPRT_FREEBSD_RESTORE_EFL_AC();
247
 }
248
 
249
 int vboxNetFltOsDisconnectIt(PVBOXNETFLTINS pThis)
(-)emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_VBoxNetFlt_freebsd_files__vboxnetflt (+10 lines)
Line 0 Link Here
1
--- src/VBox/HostDrivers/VBoxNetFlt/freebsd/files_vboxnetflt.orig	2019-11-21 17:02:02 UTC
2
+++ src/VBox/HostDrivers/VBoxNetFlt/freebsd/files_vboxnetflt
3
@@ -62,6 +62,7 @@ VBOX_VBOXNETFLT_SOURCES=" \
4
     ${PATH_ROOT}/include/iprt/uni.h=>include/iprt/uni.h \
5
     ${PATH_ROOT}/include/iprt/utf16.h=>include/iprt/utf16.h \
6
     ${PATH_ROOT}/include/iprt/uuid.h=>include/iprt/uuid.h \
7
+    ${PATH_ROOT}/include/iprt/x86.h=>include/iprt/x86.h \
8
     ${PATH_ROOT}/include/iprt/nocrt/limits.h=>include/iprt/nocrt/limits.h \
9
     ${PATH_ROOT}/include/VBox/cdefs.h=>include/VBox/cdefs.h \
10
     ${PATH_ROOT}/include/VBox/err.h=>include/VBox/err.h \
(-)emulators/virtualbox-ose/files/patch-src_VBox_HostServices_SharedOpenGL_Makefile.kmk (-10 lines)
Lines 1-10 Link Here
1
--- src/VBox/HostServices/SharedOpenGL/Makefile.kmk.orig	2017-10-18 07:12:48 UTC
2
+++ src/VBox/HostServices/SharedOpenGL/Makefile.kmk
3
@@ -436,6 +436,7 @@ if (   defined(VBOX_WITH_QTGUI) \
4
     $(if $(VBOX_WITH_CROGL), VBOX_WITH_CROGL,) \
5
     $(if $(VBOX_WITH_VIDEOHWACCEL), VBOX_WITH_VIDEOHWACCEL,)
6
   ifdef VBOX_WITH_VIDEOHWACCEL
7
+   VBoxTestOGL_CXXFLAGS.freebsd += -std=c++11
8
    VBoxTestOGL_QT_MODULES   += Core Gui OpenGL Widgets
9
    VBoxTestOGL_LIBS.linux   += xcb
10
    VBoxTestOGL_LIBS.solaris += xcb
(-)emulators/virtualbox-ose/files/patch-src_VBox_Installer_Makefile.kmk (+14 lines)
Line 0 Link Here
1
--- src/VBox/Installer/Makefile.kmk.orig	2019-11-21 17:02:08 UTC
2
+++ src/VBox/Installer/Makefile.kmk
3
@@ -41,9 +41,11 @@ ifndef VBOX_ONLY_SDK
4
  if "$(KBUILD_TARGET)" == "win" && "$(KBUILD_HOST)" == "win"
5
   include $(PATH_SUB_CURRENT)/win/Makefile.kmk
6
  endif
7
+if 0
8
  if "$(KBUILD_TARGET)" == "freebsd" && "$(KBUILD_HOST)" == "freebsd"
9
   include $(PATH_SUB_CURRENT)/freebsd/Makefile.kmk
10
  endif
11
+endif
12
 endif
13
 
14
 include $(PATH_SUB_CURRENT)/common/Makefile.kmk
(-)emulators/virtualbox-ose/files/patch-src_VBox_Installer_freebsd_VBox.sh (+73 lines)
Line 0 Link Here
1
--- src/VBox/Installer/freebsd/VBox.sh.orig	2019-12-03 22:23:10 UTC
2
+++ src/VBox/Installer/freebsd/VBox.sh
3
@@ -0,0 +1,70 @@
4
+#!/bin/sh
5
+#
6
+# Oracle VM VirtualBox startup script, FreeBSD hosts.
7
+#
8
+# Copyright (C) 2006-2012 Oracle Corporation
9
+#
10
+# This file is part of VirtualBox Open Source Edition (OSE), as
11
+# available from http://www.virtualbox.org. This file is free software;
12
+# you can redistribute it and/or modify it under the terms of the GNU
13
+# General Public License (GPL) as published by the Free Software
14
+# Foundation, in version 2 as it comes in the "COPYING" file of the
15
+# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
16
+# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
17
+#
18
+
19
+PATH="/usr/bin:/bin:/usr/sbin:/sbin"
20
+CONFIG="/usr/local/etc/vbox/vbox.cfg"
21
+
22
+test -r "${CONFIG}" &&
23
+    . "${CONFIG}"
24
+test -z "${INSTALL_DIR}" &&
25
+    if test -d /usr/local/lib/virtualbox &&
26
+        test -f /usr/local/lib/virtualbox/VBoxRT.so; then
27
+        INSTALL_DIR=/usr/local/lib/virtualbox
28
+    else
29
+        echo "Could not find VirtualBox installation. Please reinstall."
30
+        exit 1
31
+    fi
32
+
33
+# workaround for the KDE dialog problem
34
+KDE_FORK_SLAVES=1; export KDE_FORK_SLAVES
35
+
36
+APP=`basename $0`
37
+case "$APP" in
38
+    VirtualBox|virtualbox)
39
+        exec "$INSTALL_DIR/VirtualBox" "$@"
40
+        ;;
41
+    VirtualBoxVM|virtualboxvm)
42
+        exec "$INSTALL_DIR/VirtualBoxVM" "$@"
43
+        ;;
44
+    VBoxManage|vboxmanage)
45
+        exec "$INSTALL_DIR/VBoxManage" "$@"
46
+        ;;
47
+    VBoxSDL|vboxsdl)
48
+        exec "$INSTALL_DIR/VBoxSDL" "$@"
49
+        ;;
50
+    VBoxVRDP|VBoxHeadless|vboxheadless)
51
+        exec "$INSTALL_DIR/VBoxHeadless" "$@"
52
+        ;;
53
+    VBoxAutostart|vboxautostart)
54
+        exec "$INSTALL_DIR/VBoxAutostart" "$@"
55
+        ;;
56
+    VBoxBalloonCtrl|vboxballoonctrl)
57
+        exec "$INSTALL_DIR/VBoxBalloonCtrl" "$@"
58
+        ;;
59
+    VBoxBugReport|vboxbugreport)
60
+        exec "$INSTALL_DIR/VBoxBugReport" "$@"
61
+        ;;
62
+    vbox-img)
63
+        exec "$INSTALL_DIR/vbox-img" "$@"
64
+        ;;
65
+    vboxwebsrv)
66
+        exec "$INSTALL_DIR/vboxwebsrv" "$@"
67
+        ;;
68
+    *)
69
+        echo "Unknown application - $APP"
70
+        exit 1
71
+        ;;
72
+esac
73
+exit 0
(-)emulators/virtualbox-ose/files/patch-src_VBox_Installer_freebsd_virtualbox.desktop (+10 lines)
Line 0 Link Here
1
--- src/VBox/Installer/freebsd/virtualbox.desktop.orig	2019-11-21 17:02:08 UTC
2
+++ src/VBox/Installer/freebsd/virtualbox.desktop
3
@@ -7,7 +7,6 @@ GenericName=Virtual Machine
4
 Type=Application
5
 Exec=VirtualBox
6
 TryExec=VirtualBox
7
-DocPath=file://$VBOX_DOC_PATH/UserManual.pdf
8
 Icon=VBox
9
 Categories=Emulator;System;
10
 Comment=Run several virtual systems on a single host computer
(-)emulators/virtualbox-ose/files/patch-src_VBox_Main_Makefile.kmk (-2 / +2 lines)
Lines 1-6 Link Here
1
--- src/VBox/Main/Makefile.kmk.orig	2017-03-08 17:20:11 UTC
1
--- src/VBox/Main/Makefile.kmk.orig	2019-11-21 17:02:12 UTC
2
+++ src/VBox/Main/Makefile.kmk
2
+++ src/VBox/Main/Makefile.kmk
3
@@ -445,6 +445,7 @@ VBoxSVC_SOURCES.os2 = \
3
@@ -640,6 +640,7 @@ VBoxSVC_SOURCES.os2 = \
4
 
4
 
5
 VBoxSVC_SOURCES.freebsd = \
5
 VBoxSVC_SOURCES.freebsd = \
6
 	src-server/freebsd/HostHardwareFreeBSD.cpp \
6
 	src-server/freebsd/HostHardwareFreeBSD.cpp \
(-)emulators/virtualbox-ose/files/patch-src_VBox_Main_include_HostPower.h (-3 / +3 lines)
Lines 1-6 Link Here
1
--- src/VBox/Main/include/HostPower.h.orig	2017-10-18 07:12:54 UTC
1
--- src/VBox/Main/include/HostPower.h.orig	2019-11-21 17:02:14 UTC
2
+++ src/VBox/Main/include/HostPower.h
2
+++ src/VBox/Main/include/HostPower.h
3
@@ -28,7 +28,7 @@
3
@@ -31,7 +31,7 @@
4
 
4
 
5
 #include <vector>
5
 #include <vector>
6
 
6
 
Lines 9-15 Link Here
9
 # include <VBox/dbus.h>
9
 # include <VBox/dbus.h>
10
 #endif
10
 #endif
11
 
11
 
12
@@ -64,7 +64,7 @@ class HostPowerServiceWin : public HostPowerService (p
12
@@ -67,7 +67,7 @@ class HostPowerServiceWin : public HostPowerService (p
13
     RTTHREAD    mThread;
13
     RTTHREAD    mThread;
14
 };
14
 };
15
 # endif
15
 # endif
(-)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-all_Global.cpp (+24 lines)
Line 0 Link Here
1
--- src/VBox/Main/src-all/Global.cpp.orig	2019-11-21 17:02:16 UTC
2
+++ src/VBox/Main/src-all/Global.cpp
3
@@ -364,14 +364,15 @@ const Global::OSType Global::sOSTypes[] =
4
         StorageControllerType_IntelAhci, StorageBus_SATA, ChipsetType_PIIX3, AudioControllerType_AC97, AudioCodecType_STAC9700  },
5
 
6
     { "BSD",     "BSD",               "FreeBSD",            "FreeBSD (32-bit)",
7
-      VBOXOSTYPE_FreeBSD,         VBOXOSHINT_NONE,
8
-      1024,  16,  2 * _1G64, GraphicsControllerType_VBoxVGA, NetworkAdapterType_I82540EM, 0, StorageControllerType_PIIX4, StorageBus_IDE,
9
-        StorageControllerType_PIIX4, StorageBus_IDE, ChipsetType_PIIX3, AudioControllerType_AC97, AudioCodecType_STAC9700  },
10
+      VBOXOSTYPE_FreeBSD,         VBOXOSHINT_RTCUTC | VBOXOSHINT_PAE | VBOXOSHINT_X2APIC,
11
+      1024,  16, 10 * _1G64, GraphicsControllerType_VMSVGA, NetworkAdapterType_I82540EM, 0, StorageControllerType_PIIX4, StorageBus_IDE,
12
+        StorageControllerType_IntelAhci, StorageBus_SATA, ChipsetType_PIIX3, AudioControllerType_AC97, AudioCodecType_STAC9700  },
13
 
14
     { "BSD",     "BSD",               "FreeBSD_64",         "FreeBSD (64-bit)",
15
-      VBOXOSTYPE_FreeBSD_x64,     VBOXOSHINT_64BIT | VBOXOSHINT_HWVIRTEX | VBOXOSHINT_IOAPIC,
16
-      1024,  16, 16 * _1G64, GraphicsControllerType_VBoxVGA, NetworkAdapterType_I82540EM, 0, StorageControllerType_PIIX4, StorageBus_IDE,
17
-        StorageControllerType_PIIX4, StorageBus_IDE, ChipsetType_PIIX3, AudioControllerType_AC97, AudioCodecType_STAC9700  },
18
+      VBOXOSTYPE_FreeBSD_x64,     VBOXOSHINT_64BIT | VBOXOSHINT_HWVIRTEX | VBOXOSHINT_IOAPIC | VBOXOSHINT_RTCUTC
19
+                                | VBOXOSHINT_X2APIC,
20
+      1024,  16, 10 * _1G64, GraphicsControllerType_VMSVGA, NetworkAdapterType_I82540EM, 0, StorageControllerType_PIIX4, StorageBus_IDE,
21
+        StorageControllerType_IntelAhci, StorageBus_SATA, ChipsetType_PIIX3, AudioControllerType_AC97, AudioCodecType_STAC9700  },
22
 
23
     { "BSD",     "BSD",               "OpenBSD",            "OpenBSD (32-bit)",
24
       VBOXOSTYPE_OpenBSD,         VBOXOSHINT_HWVIRTEX,
(-)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_HostImpl.cpp (-2 / +2 lines)
Lines 1-6 Link Here
1
--- src/VBox/Main/src-server/HostImpl.cpp.orig	2017-03-08 17:20:14 UTC
1
--- src/VBox/Main/src-server/HostImpl.cpp.orig	2019-11-21 17:02:19 UTC
2
+++ src/VBox/Main/src-server/HostImpl.cpp
2
+++ src/VBox/Main/src-server/HostImpl.cpp
3
@@ -293,7 +293,7 @@ HRESULT Host::init(VirtualBox *aParent)
3
@@ -286,7 +286,7 @@ HRESULT Host::init(VirtualBox *aParent)
4
 
4
 
5
 #if defined(RT_OS_WINDOWS)
5
 #if defined(RT_OS_WINDOWS)
6
     m->pHostPowerService = new HostPowerServiceWin(m->pParent);
6
     m->pHostPowerService = new HostPowerServiceWin(m->pParent);
(-)emulators/virtualbox-ose/files/patch-src_VBox_Main_src-server_VirtualBoxImpl.cpp (+11 lines)
Line 0 Link Here
1
--- src/VBox/Main/src-server/VirtualBoxImpl.cpp.orig	2019-11-21 17:02:20 UTC
2
+++ src/VBox/Main/src-server/VirtualBoxImpl.cpp
3
@@ -2655,7 +2655,7 @@ int VirtualBox::i_encryptSettingBytes(const uint8_t *a
4
     if (aCiphertextSize < 32)
5
         return VERR_INVALID_PARAMETER;
6
 
7
-    AssertCompile(sizeof(m->SettingsCipherKey) >= 32);
8
+    // AssertCompile(sizeof(m->SettingsCipherKey) >= 32);
9
 
10
     /* store the first 8 bytes of the cipherkey for verification */
11
     for (i = 0, j = 0; i < 8; i++, j++)
(-)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_Main_src-server_freebsd_PerformanceFreeBSD.cpp (-1 / +1 lines)
Lines 1-4 Link Here
1
--- src/VBox/Main/src-server/freebsd/PerformanceFreeBSD.cpp.orig	2017-07-27 13:18:27 UTC
1
--- src/VBox/Main/src-server/freebsd/PerformanceFreeBSD.cpp.orig	2019-11-21 17:02:20 UTC
2
+++ src/VBox/Main/src-server/freebsd/PerformanceFreeBSD.cpp
2
+++ src/VBox/Main/src-server/freebsd/PerformanceFreeBSD.cpp
3
@@ -80,8 +80,10 @@ int CollectorFreeBSD::getHostMemoryUsage(ULONG *total,
3
@@ -80,8 +80,10 @@ int CollectorFreeBSD::getHostMemoryUsage(ULONG *total,
4
     cbParameter = sizeof(cPagesMemInactive);
4
     cbParameter = sizeof(cPagesMemInactive);
(-)emulators/virtualbox-ose/files/patch-src_VBox_Main_webservice_Makefile.kmk (+39 lines)
Line 0 Link Here
1
--- src/VBox/Main/webservice/Makefile.kmk.orig	2019-11-21 17:02:22 UTC
2
+++ src/VBox/Main/webservice/Makefile.kmk
3
@@ -158,7 +158,6 @@ VBOX_PATH_IDL                 := $(abspath $(PATH_SUB_
4
 RECOMPILE_ON_MAKEFILE_CURRENT := $(MAKEFILE_CURRENT)
5
 
6
 PATH_TARGET_SOAPDEMOXML       := $(VBOXWEB_OUT_DIR)/demo_soapxml
7
-PATH_TARGET_SOAPDEMOHEADERS   := $(VBOXWEB_OUT_DIR)/demo_headers
8
 PATH_TARGET_SOAPDEMONSMAPS    := $(VBOXWEB_OUT_DIR)/demo_namespacemaps
9
 PATH_TARGET_WEBTEST           := $(VBOXWEB_OUT_DIR)/webtest
10
 
11
@@ -565,8 +564,6 @@ $$(VBOX_JWSSRC_JAR): $$(VBOX_JWS_JAR) | $$(dir $$@)
12
 	$(VBOXWEB_OUT_DIR)/gsoap_copy_all_ts \
13
 	$(wildcard $(PATH_TARGET_SOAPDEMOXML)/*) \
14
 	$(PATH_TARGET_SOAPDEMOXML)/dummy_file \
15
-	$(wildcard $(PATH_TARGET_SOAPDEMOHEADERS)/*) \
16
-	$(PATH_TARGET_SOAPDEMOHEADERS)/dummy_file \
17
 	$(wildcard $(PATH_TARGET_SOAPDEMONSMAPS)/*) \
18
 	$(PATH_TARGET_SOAPDEMONSMAPS)/dummy_file
19
 
20
@@ -786,17 +783,14 @@ endif
21
 # any more. Ignoring the exit code is the simple solution, accepting the error.
22
 $(VBOXWEB_OUT_DIR)/gsoap_copy_all_ts: $(VBOXWEB_OUT_DIR)/gsoap_generate_all_ts | $$(dir $$@)
23
 	$(RM) -f $@
24
-	$(MKDIR) -p $(PATH_TARGET_SOAPDEMOXML) $(PATH_TARGET_SOAPDEMOHEADERS) $(PATH_TARGET_SOAPDEMONSMAPS)
25
+	$(MKDIR) -p $(PATH_TARGET_SOAPDEMOXML) $(PATH_TARGET_SOAPDEMONSMAPS)
26
 ifdef VBOX_GSOAP_VERBOSE
27
 	$(MV_EXT) -f -- $(VBOXWEB_OUT_DIR)/*.req.xml $(VBOXWEB_OUT_DIR)/*.res.xml $(PATH_TARGET_SOAPDEMOXML)/
28
 endif
29
-	-$(MV_EXT) -f -- $(VBOXWEB_OUT_DIR)/soapvbox*.h $(PATH_TARGET_SOAPDEMOHEADERS)/
30
 	$(MV_EXT) -f -- $(VBOXWEB_OUT_DIR)/vboxBinding.nsmap $(PATH_TARGET_SOAPDEMONSMAPS)/
31
 	$(APPEND) $@ done
32
 
33
-$(PATH_TARGET_SOAPDEMONSMAPS) \
34
-$(PATH_TARGET_SOAPDEMOHEADERS)/soapvboxBindingProxy.h \
35
-$(PATH_TARGET_SOAPDEMOHEADERS)/soapvboxBindingObject.h: $(VBOXWEB_OUT_DIR)/gsoap_copy_all_ts
36
+$(PATH_TARGET_SOAPDEMONSMAPS): $(VBOXWEB_OUT_DIR)/gsoap_copy_all_ts
37
 
38
 # soapcpp2 -2: generate SOAP 1.2 calls
39
 # soapcpp2 -S: server-side code only
(-)emulators/virtualbox-ose/files/patch-src_VBox_Runtime_Makefile.kmk (+30 lines)
Line 0 Link Here
1
--- src/VBox/Runtime/Makefile.kmk.orig	2019-11-21 17:02:28 UTC
2
+++ src/VBox/Runtime/Makefile.kmk
3
@@ -175,6 +175,11 @@ $(IPRT_OUT_DIR)/oiddb.h.ts +| $(IPRT_OUT_DIR)/oiddb.h:
4
 
5
 
6
 #
7
+# Set the defines that utf8-posix.cpp needs. It's used by several targets.
8
+#
9
+r3/posix/utf8-posix.cpp_DEFS.freebsd = $(VBOX_ICONV_DEFS)
10
+
11
+#
12
 # Unicode Specification reader used to regenerate unidata-*.cpp.
13
 #
14
 uniread_TEMPLATE = VBoxBldProg
15
@@ -2226,6 +2231,7 @@ endif
16
 VBoxRT_LIBS.darwin             = \
17
 	iconv
18
 VBoxRT_LIBS.freebsd            = \
19
+	crypt \
20
 	iconv \
21
 	rt
22
 VBoxRT_LIBS.haiku              = \
23
@@ -2369,6 +2375,7 @@ endif
24
 VBoxRT-x86_LIBS.darwin             = \
25
 	iconv
26
 VBoxRT-x86_LIBS.freebsd            = \
27
+	crypt \
28
 	iconv \
29
 	rt
30
 VBoxRT-x86_LIBS.haiku              = \
(-)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_alloc-r0drv-freebsd.c (-8 / +8 lines)
Lines 1-6 Link Here
1
--- src/VBox/Runtime/r0drv/freebsd/alloc-r0drv-freebsd.c.orig	2018-10-15 14:31:31 UTC
1
--- src/VBox/Runtime/r0drv/freebsd/alloc-r0drv-freebsd.c.orig	2019-11-21 17:02:50 UTC
2
+++ src/VBox/Runtime/r0drv/freebsd/alloc-r0drv-freebsd.c
2
+++ src/VBox/Runtime/r0drv/freebsd/alloc-r0drv-freebsd.c
3
@@ -54,6 +54,7 @@ MALLOC_DEFINE(M_IPRTCONT, "iprtcont", "IPRT - contiguo
3
@@ -79,6 +79,7 @@ MALLOC_DEFINE(M_IPRTCONT, "iprtcont", "IPRT - contiguo
4
 
4
 
5
 DECLHIDDEN(int) rtR0MemAllocEx(size_t cb, uint32_t fFlags, PRTMEMHDR *ppHdr)
5
 DECLHIDDEN(int) rtR0MemAllocEx(size_t cb, uint32_t fFlags, PRTMEMHDR *ppHdr)
6
 {
6
 {
Lines 8-14 Link Here
8
     size_t      cbAllocated = cb;
8
     size_t      cbAllocated = cb;
9
     PRTMEMHDR   pHdr        = NULL;
9
     PRTMEMHDR   pHdr        = NULL;
10
 
10
 
11
@@ -76,8 +77,10 @@ DECLHIDDEN(int) rtR0MemAllocEx(size_t cb, uint32_t fFl
11
@@ -101,8 +102,10 @@ DECLHIDDEN(int) rtR0MemAllocEx(size_t cb, uint32_t fFl
12
         cbAllocated = RT_ALIGN_Z(cb + sizeof(*pHdr), PAGE_SIZE);
12
         cbAllocated = RT_ALIGN_Z(cb + sizeof(*pHdr), PAGE_SIZE);
13
 
13
 
14
         pVmObject = vm_object_allocate(OBJT_DEFAULT, cbAllocated >> PAGE_SHIFT);
14
         pVmObject = vm_object_allocate(OBJT_DEFAULT, cbAllocated >> PAGE_SHIFT);
Lines 20-26 Link Here
20
 
20
 
21
         /* Addr contains a start address vm_map_find will start searching for suitable space at. */
21
         /* Addr contains a start address vm_map_find will start searching for suitable space at. */
22
 #if __FreeBSD_version >= 1000055
22
 #if __FreeBSD_version >= 1000055
23
@@ -114,6 +117,8 @@ DECLHIDDEN(int) rtR0MemAllocEx(size_t cb, uint32_t fFl
23
@@ -139,6 +142,8 @@ DECLHIDDEN(int) rtR0MemAllocEx(size_t cb, uint32_t fFl
24
                                  fFlags & RTMEMHDR_FLAG_ZEROED ? M_NOWAIT | M_ZERO : M_NOWAIT);
24
                                  fFlags & RTMEMHDR_FLAG_ZEROED ? M_NOWAIT | M_ZERO : M_NOWAIT);
25
     }
25
     }
26
 
26
 
Lines 29-35 Link Here
29
     if (RT_UNLIKELY(!pHdr))
29
     if (RT_UNLIKELY(!pHdr))
30
         return VERR_NO_MEMORY;
30
         return VERR_NO_MEMORY;
31
 
31
 
32
@@ -129,6 +134,8 @@ DECLHIDDEN(int) rtR0MemAllocEx(size_t cb, uint32_t fFl
32
@@ -154,6 +159,8 @@ DECLHIDDEN(int) rtR0MemAllocEx(size_t cb, uint32_t fFl
33
 
33
 
34
 DECLHIDDEN(void) rtR0MemFree(PRTMEMHDR pHdr)
34
 DECLHIDDEN(void) rtR0MemFree(PRTMEMHDR pHdr)
35
 {
35
 {
Lines 38-44 Link Here
38
     pHdr->u32Magic += 1;
38
     pHdr->u32Magic += 1;
39
 
39
 
40
 #ifdef RT_ARCH_AMD64
40
 #ifdef RT_ARCH_AMD64
41
@@ -141,11 +148,14 @@ DECLHIDDEN(void) rtR0MemFree(PRTMEMHDR pHdr)
41
@@ -166,11 +173,14 @@ DECLHIDDEN(void) rtR0MemFree(PRTMEMHDR pHdr)
42
     else
42
     else
43
 #endif
43
 #endif
44
         free(pHdr, M_IPRTHEAP);
44
         free(pHdr, M_IPRTHEAP);
Lines 53-59 Link Here
53
     void *pv;
53
     void *pv;
54
 
54
 
55
     /*
55
     /*
56
@@ -170,6 +180,7 @@ RTR0DECL(void *) RTMemContAlloc(PRTCCPHYS pPhys, size_
56
@@ -195,6 +205,7 @@ RTR0DECL(void *) RTMemContAlloc(PRTCCPHYS pPhys, size_
57
         *pPhys = vtophys(pv);
57
         *pPhys = vtophys(pv);
58
         Assert(!(*pPhys & PAGE_OFFSET_MASK));
58
         Assert(!(*pPhys & PAGE_OFFSET_MASK));
59
     }
59
     }
Lines 61-67 Link Here
61
     return pv;
61
     return pv;
62
 }
62
 }
63
 
63
 
64
@@ -179,7 +190,9 @@ RTR0DECL(void) RTMemContFree(void *pv, size_t cb)
64
@@ -204,7 +215,9 @@ RTR0DECL(void) RTMemContFree(void *pv, size_t cb)
65
     if (pv)
65
     if (pv)
66
     {
66
     {
67
         AssertMsg(!((uintptr_t)pv & PAGE_OFFSET_MASK), ("pv=%p\n", pv));
67
         AssertMsg(!((uintptr_t)pv & PAGE_OFFSET_MASK), ("pv=%p\n", pv));
(-)emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_assert-r0drv-freebsd.c (-3 / +3 lines)
Lines 1-6 Link Here
1
--- src/VBox/Runtime/r0drv/freebsd/assert-r0drv-freebsd.c.orig	2018-10-15 14:31:31 UTC
1
--- src/VBox/Runtime/r0drv/freebsd/assert-r0drv-freebsd.c.orig	2019-11-21 17:02:50 UTC
2
+++ src/VBox/Runtime/r0drv/freebsd/assert-r0drv-freebsd.c
2
+++ src/VBox/Runtime/r0drv/freebsd/assert-r0drv-freebsd.c
3
@@ -44,15 +44,18 @@
3
@@ -69,15 +69,18 @@
4
 
4
 
5
 DECLHIDDEN(void) rtR0AssertNativeMsg1(const char *pszExpr, unsigned uLine, const char *pszFile, const char *pszFunction)
5
 DECLHIDDEN(void) rtR0AssertNativeMsg1(const char *pszExpr, unsigned uLine, const char *pszFile, const char *pszFunction)
6
 {
6
 {
Lines 19-25 Link Here
19
     char szMsg[256];
19
     char szMsg[256];
20
 
20
 
21
     RTStrPrintfV(szMsg, sizeof(szMsg) - 1, pszFormat, va);
21
     RTStrPrintfV(szMsg, sizeof(szMsg) - 1, pszFormat, va);
22
@@ -60,6 +63,7 @@ DECLHIDDEN(void) rtR0AssertNativeMsg2V(bool fInitial, 
22
@@ -85,6 +88,7 @@ DECLHIDDEN(void) rtR0AssertNativeMsg2V(bool fInitial, 
23
     printf("%s", szMsg);
23
     printf("%s", szMsg);
24
 
24
 
25
     NOREF(fInitial);
25
     NOREF(fInitial);
(-)emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_memobj-r0drv-freebsd.c (-121 / +27 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-11-21 17:02:50 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
@@ -698,6 +741,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
@@ -706,6 +750,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-342 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
@@ -713,6 +758,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, size_t offSub, size_t cbSub)
340
 {
264
 {
341
+    IPRT_FREEBSD_SAVE_EFL_AC();
265
+    IPRT_FREEBSD_SAVE_EFL_AC();
342
+
266
+
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
@@ -788,6 +835,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
@@ -797,19 +845,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
@@ -821,6 +875,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
@@ -845,11 +900,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
@@ -858,11 +921,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
@@ -873,9 +940,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_memuserkernel-r0drv-freebsd.c (-1 / +1 lines)
Lines 1-4 Link Here
1
--- src/VBox/Runtime/r0drv/freebsd/memuserkernel-r0drv-freebsd.c.orig	2018-10-15 14:31:31 UTC
1
--- src/VBox/Runtime/r0drv/freebsd/memuserkernel-r0drv-freebsd.c.orig	2019-11-21 17:02:50 UTC
2
+++ src/VBox/Runtime/r0drv/freebsd/memuserkernel-r0drv-freebsd.c
2
+++ src/VBox/Runtime/r0drv/freebsd/memuserkernel-r0drv-freebsd.c
3
@@ -36,7 +36,9 @@
3
@@ -36,7 +36,9 @@
4
 
4
 
(-)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-11-21 17:02:50 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_Runtime_r0drv_freebsd_semevent-r0drv-freebsd.c (-6 / +6 lines)
Lines 1-6 Link Here
1
--- src/VBox/Runtime/r0drv/freebsd/semevent-r0drv-freebsd.c.orig	2018-10-15 14:31:31 UTC
1
--- src/VBox/Runtime/r0drv/freebsd/semevent-r0drv-freebsd.c.orig	2019-11-21 17:02:50 UTC
2
+++ src/VBox/Runtime/r0drv/freebsd/semevent-r0drv-freebsd.c
2
+++ src/VBox/Runtime/r0drv/freebsd/semevent-r0drv-freebsd.c
3
@@ -77,7 +77,9 @@ RTDECL(int)  RTSemEventCreateEx(PRTSEMEVENT phEventSem
3
@@ -102,7 +102,9 @@ RTDECL(int)  RTSemEventCreateEx(PRTSEMEVENT phEventSem
4
     Assert(!(fFlags & RTSEMEVENT_FLAGS_BOOTSTRAP_HACK) || (fFlags & RTSEMEVENT_FLAGS_NO_LOCK_VAL));
4
     Assert(!(fFlags & RTSEMEVENT_FLAGS_BOOTSTRAP_HACK) || (fFlags & RTSEMEVENT_FLAGS_NO_LOCK_VAL));
5
     AssertPtrReturn(phEventSem, VERR_INVALID_POINTER);
5
     AssertPtrReturn(phEventSem, VERR_INVALID_POINTER);
6
 
6
 
Lines 10-16 Link Here
10
     if (!pThis)
10
     if (!pThis)
11
         return VERR_NO_MEMORY;
11
         return VERR_NO_MEMORY;
12
 
12
 
13
@@ -128,10 +130,12 @@ RTDECL(int)  RTSemEventDestroy(RTSEMEVENT hEventSem)
13
@@ -153,10 +155,12 @@ RTDECL(int)  RTSemEventDestroy(RTSEMEVENT hEventSem)
14
     /*
14
     /*
15
      * Invalidate it and signal the object just in case.
15
      * Invalidate it and signal the object just in case.
16
      */
16
      */
Lines 23-29 Link Here
23
     return VINF_SUCCESS;
23
     return VINF_SUCCESS;
24
 }
24
 }
25
 
25
 
26
@@ -149,9 +153,11 @@ RTDECL(int)  RTSemEventSignal(RTSEMEVENT hEventSem)
26
@@ -174,9 +178,11 @@ RTDECL(int)  RTSemEventSignal(RTSEMEVENT hEventSem)
27
     /*
27
     /*
28
      * Signal the event object.
28
      * Signal the event object.
29
      */
29
      */
Lines 35-41 Link Here
35
     return VINF_SUCCESS;
35
     return VINF_SUCCESS;
36
 }
36
 }
37
 
37
 
38
@@ -175,6 +181,7 @@ static int rtR0SemEventWait(PRTSEMEVENTINTERNAL pThis,
38
@@ -200,6 +206,7 @@ static int rtR0SemEventWait(PRTSEMEVENTINTERNAL pThis,
39
     AssertPtrReturn(pThis, VERR_INVALID_PARAMETER);
39
     AssertPtrReturn(pThis, VERR_INVALID_PARAMETER);
40
     AssertMsgReturn(pThis->u32Magic == RTSEMEVENT_MAGIC, ("%p u32Magic=%RX32\n", pThis, pThis->u32Magic), VERR_INVALID_PARAMETER);
40
     AssertMsgReturn(pThis->u32Magic == RTSEMEVENT_MAGIC, ("%p u32Magic=%RX32\n", pThis, pThis->u32Magic), VERR_INVALID_PARAMETER);
41
     AssertReturn(RTSEMWAIT_FLAGS_ARE_VALID(fFlags), VERR_INVALID_PARAMETER);
41
     AssertReturn(RTSEMWAIT_FLAGS_ARE_VALID(fFlags), VERR_INVALID_PARAMETER);
Lines 43-49 Link Here
43
     rtR0SemEventBsdRetain(pThis);
43
     rtR0SemEventBsdRetain(pThis);
44
 
44
 
45
     /*
45
     /*
46
@@ -224,6 +231,7 @@ static int rtR0SemEventWait(PRTSEMEVENTINTERNAL pThis,
46
@@ -249,6 +256,7 @@ static int rtR0SemEventWait(PRTSEMEVENTINTERNAL pThis,
47
     }
47
     }
48
 
48
 
49
     rtR0SemEventBsdRelease(pThis);
49
     rtR0SemEventBsdRelease(pThis);
(-)emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_semeventmulti-r0drv-freebsd.c (-8 / +8 lines)
Lines 1-6 Link Here
1
--- src/VBox/Runtime/r0drv/freebsd/semeventmulti-r0drv-freebsd.c.orig	2018-10-15 14:31:31 UTC
1
--- src/VBox/Runtime/r0drv/freebsd/semeventmulti-r0drv-freebsd.c.orig	2019-11-21 17:02:50 UTC
2
+++ src/VBox/Runtime/r0drv/freebsd/semeventmulti-r0drv-freebsd.c
2
+++ src/VBox/Runtime/r0drv/freebsd/semeventmulti-r0drv-freebsd.c
3
@@ -96,7 +96,9 @@ RTDECL(int)  RTSemEventMultiCreateEx(PRTSEMEVENTMULTI 
3
@@ -121,7 +121,9 @@ RTDECL(int)  RTSemEventMultiCreateEx(PRTSEMEVENTMULTI 
4
     PRTSEMEVENTMULTIINTERNAL pThis;
4
     PRTSEMEVENTMULTIINTERNAL pThis;
5
 
5
 
6
     AssertReturn(!(fFlags & ~RTSEMEVENTMULTI_FLAGS_NO_LOCK_VAL), VERR_INVALID_PARAMETER);
6
     AssertReturn(!(fFlags & ~RTSEMEVENTMULTI_FLAGS_NO_LOCK_VAL), VERR_INVALID_PARAMETER);
Lines 10-16 Link Here
10
     if (pThis)
10
     if (pThis)
11
     {
11
     {
12
         pThis->u32Magic     = RTSEMEVENTMULTI_MAGIC;
12
         pThis->u32Magic     = RTSEMEVENTMULTI_MAGIC;
13
@@ -152,10 +154,12 @@ RTDECL(int)  RTSemEventMultiDestroy(RTSEMEVENTMULTI hE
13
@@ -177,10 +179,12 @@ RTDECL(int)  RTSemEventMultiDestroy(RTSEMEVENTMULTI hE
14
     /*
14
     /*
15
      * Invalidate it and signal the object just in case.
15
      * Invalidate it and signal the object just in case.
16
      */
16
      */
Lines 23-29 Link Here
23
     return VINF_SUCCESS;
23
     return VINF_SUCCESS;
24
 }
24
 }
25
 
25
 
26
@@ -164,6 +168,7 @@ RTDECL(int)  RTSemEventMultiSignal(RTSEMEVENTMULTI hEv
26
@@ -189,6 +193,7 @@ RTDECL(int)  RTSemEventMultiSignal(RTSEMEVENTMULTI hEv
27
 {
27
 {
28
     uint32_t fNew;
28
     uint32_t fNew;
29
     uint32_t fOld;
29
     uint32_t fOld;
Lines 31-37 Link Here
31
 
31
 
32
     /*
32
     /*
33
      * Validate input.
33
      * Validate input.
34
@@ -190,12 +195,15 @@ RTDECL(int)  RTSemEventMultiSignal(RTSEMEVENTMULTI hEv
34
@@ -215,12 +220,15 @@ RTDECL(int)  RTSemEventMultiSignal(RTSEMEVENTMULTI hEv
35
 
35
 
36
     rtR0SemBsdBroadcast(pThis);
36
     rtR0SemBsdBroadcast(pThis);
37
     rtR0SemEventMultiBsdRelease(pThis);
37
     rtR0SemEventMultiBsdRelease(pThis);
Lines 47-53 Link Here
47
     /*
47
     /*
48
      * Validate input.
48
      * Validate input.
49
      */
49
      */
50
@@ -212,6 +220,7 @@ RTDECL(int)  RTSemEventMultiReset(RTSEMEVENTMULTI hEve
50
@@ -237,6 +245,7 @@ RTDECL(int)  RTSemEventMultiReset(RTSEMEVENTMULTI hEve
51
     ASMAtomicAndU32(&pThis->fStateAndGen, ~RTSEMEVENTMULTIBSD_STATE_MASK);
51
     ASMAtomicAndU32(&pThis->fStateAndGen, ~RTSEMEVENTMULTIBSD_STATE_MASK);
52
 
52
 
53
     rtR0SemEventMultiBsdRelease(pThis);
53
     rtR0SemEventMultiBsdRelease(pThis);
Lines 55-61 Link Here
55
     return VINF_SUCCESS;
55
     return VINF_SUCCESS;
56
 }
56
 }
57
 
57
 
58
@@ -228,6 +237,7 @@ RTDECL(int)  RTSemEventMultiReset(RTSEMEVENTMULTI hEve
58
@@ -253,6 +262,7 @@ RTDECL(int)  RTSemEventMultiReset(RTSEMEVENTMULTI hEve
59
 static int rtR0SemEventMultiBsdWait(PRTSEMEVENTMULTIINTERNAL pThis, uint32_t fFlags, uint64_t uTimeout,
59
 static int rtR0SemEventMultiBsdWait(PRTSEMEVENTMULTIINTERNAL pThis, uint32_t fFlags, uint64_t uTimeout,
60
                                     PCRTLOCKVALSRCPOS pSrcPos)
60
                                     PCRTLOCKVALSRCPOS pSrcPos)
61
 {
61
 {
Lines 63-69 Link Here
63
     uint32_t    fOrgStateAndGen;
63
     uint32_t    fOrgStateAndGen;
64
     int         rc;
64
     int         rc;
65
 
65
 
66
@@ -287,6 +297,7 @@ static int rtR0SemEventMultiBsdWait(PRTSEMEVENTMULTIIN
66
@@ -312,6 +322,7 @@ static int rtR0SemEventMultiBsdWait(PRTSEMEVENTMULTIIN
67
     }
67
     }
68
 
68
 
69
     rtR0SemEventMultiBsdRelease(pThis);
69
     rtR0SemEventMultiBsdRelease(pThis);
(-)emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_semfastmutex-r0drv-freebsd.c (-6 / +6 lines)
Lines 1-6 Link Here
1
--- src/VBox/Runtime/r0drv/freebsd/semfastmutex-r0drv-freebsd.c.orig	2018-10-15 14:31:31 UTC
1
--- src/VBox/Runtime/r0drv/freebsd/semfastmutex-r0drv-freebsd.c.orig	2019-11-21 17:02:50 UTC
2
+++ src/VBox/Runtime/r0drv/freebsd/semfastmutex-r0drv-freebsd.c
2
+++ src/VBox/Runtime/r0drv/freebsd/semfastmutex-r0drv-freebsd.c
3
@@ -62,6 +62,7 @@ RTDECL(int)  RTSemFastMutexCreate(PRTSEMFASTMUTEX phFa
3
@@ -87,6 +87,7 @@ RTDECL(int)  RTSemFastMutexCreate(PRTSEMFASTMUTEX phFa
4
 {
4
 {
5
     AssertCompile(sizeof(RTSEMFASTMUTEXINTERNAL) > sizeof(void *));
5
     AssertCompile(sizeof(RTSEMFASTMUTEXINTERNAL) > sizeof(void *));
6
     AssertPtrReturn(phFastMtx, VERR_INVALID_POINTER);
6
     AssertPtrReturn(phFastMtx, VERR_INVALID_POINTER);
Lines 8-14 Link Here
8
 
8
 
9
     PRTSEMFASTMUTEXINTERNAL pThis = (PRTSEMFASTMUTEXINTERNAL)RTMemAllocZ(sizeof(*pThis));
9
     PRTSEMFASTMUTEXINTERNAL pThis = (PRTSEMFASTMUTEXINTERNAL)RTMemAllocZ(sizeof(*pThis));
10
     if (pThis)
10
     if (pThis)
11
@@ -70,8 +71,10 @@ RTDECL(int)  RTSemFastMutexCreate(PRTSEMFASTMUTEX phFa
11
@@ -95,8 +96,10 @@ RTDECL(int)  RTSemFastMutexCreate(PRTSEMFASTMUTEX phFa
12
         sx_init_flags(&pThis->SxLock, "IPRT Fast Mutex Semaphore", SX_DUPOK);
12
         sx_init_flags(&pThis->SxLock, "IPRT Fast Mutex Semaphore", SX_DUPOK);
13
 
13
 
14
         *phFastMtx = pThis;
14
         *phFastMtx = pThis;
Lines 19-25 Link Here
19
     return VERR_NO_MEMORY;
19
     return VERR_NO_MEMORY;
20
 }
20
 }
21
 
21
 
22
@@ -83,11 +86,13 @@ RTDECL(int)  RTSemFastMutexDestroy(RTSEMFASTMUTEX hFas
22
@@ -108,11 +111,13 @@ RTDECL(int)  RTSemFastMutexDestroy(RTSEMFASTMUTEX hFas
23
         return VINF_SUCCESS;
23
         return VINF_SUCCESS;
24
     AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
24
     AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
25
     AssertMsgReturn(pThis->u32Magic == RTSEMFASTMUTEX_MAGIC, ("%p: u32Magic=%RX32\n", pThis, pThis->u32Magic), VERR_INVALID_HANDLE);
25
     AssertMsgReturn(pThis->u32Magic == RTSEMFASTMUTEX_MAGIC, ("%p: u32Magic=%RX32\n", pThis, pThis->u32Magic), VERR_INVALID_HANDLE);
Lines 33-39 Link Here
33
     return VINF_SUCCESS;
33
     return VINF_SUCCESS;
34
 }
34
 }
35
 
35
 
36
@@ -97,8 +102,11 @@ RTDECL(int)  RTSemFastMutexRequest(RTSEMFASTMUTEX hFas
36
@@ -122,8 +127,11 @@ RTDECL(int)  RTSemFastMutexRequest(RTSEMFASTMUTEX hFas
37
     PRTSEMFASTMUTEXINTERNAL pThis = hFastMtx;
37
     PRTSEMFASTMUTEXINTERNAL pThis = hFastMtx;
38
     AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
38
     AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
39
     AssertMsgReturn(pThis->u32Magic == RTSEMFASTMUTEX_MAGIC, ("%p: u32Magic=%RX32\n", pThis, pThis->u32Magic), VERR_INVALID_HANDLE);
39
     AssertMsgReturn(pThis->u32Magic == RTSEMFASTMUTEX_MAGIC, ("%p: u32Magic=%RX32\n", pThis, pThis->u32Magic), VERR_INVALID_HANDLE);
Lines 45-51 Link Here
45
     return VINF_SUCCESS;
45
     return VINF_SUCCESS;
46
 }
46
 }
47
 
47
 
48
@@ -108,8 +116,11 @@ RTDECL(int)  RTSemFastMutexRelease(RTSEMFASTMUTEX hFas
48
@@ -133,8 +141,11 @@ RTDECL(int)  RTSemFastMutexRelease(RTSEMFASTMUTEX hFas
49
     PRTSEMFASTMUTEXINTERNAL pThis = hFastMtx;
49
     PRTSEMFASTMUTEXINTERNAL pThis = hFastMtx;
50
     AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
50
     AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
51
     AssertMsgReturn(pThis->u32Magic == RTSEMFASTMUTEX_MAGIC, ("%p: u32Magic=%RX32\n", pThis, pThis->u32Magic), VERR_INVALID_HANDLE);
51
     AssertMsgReturn(pThis->u32Magic == RTSEMFASTMUTEX_MAGIC, ("%p: u32Magic=%RX32\n", pThis, pThis->u32Magic), VERR_INVALID_HANDLE);
(-)emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_semmutex-r0drv-freebsd.c (-1 / +1 lines)
Lines 1-4 Link Here
1
--- src/VBox/Runtime/r0drv/freebsd/semmutex-r0drv-freebsd.c.orig	2018-10-15 14:31:31 UTC
1
--- src/VBox/Runtime/r0drv/freebsd/semmutex-r0drv-freebsd.c.orig	2019-11-21 17:02:50 UTC
2
+++ src/VBox/Runtime/r0drv/freebsd/semmutex-r0drv-freebsd.c
2
+++ src/VBox/Runtime/r0drv/freebsd/semmutex-r0drv-freebsd.c
3
@@ -62,6 +62,7 @@ RTDECL(int)  RTSemMutexCreate(PRTSEMMUTEX phMutexSem)
3
@@ -62,6 +62,7 @@ RTDECL(int)  RTSemMutexCreate(PRTSEMMUTEX phMutexSem)
4
 {
4
 {
(-)emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_sleepqueue-r0drv-freebsd.h (+11 lines)
Line 0 Link Here
1
--- src/VBox/Runtime/r0drv/freebsd/sleepqueue-r0drv-freebsd.h.orig	2019-11-21 17:02:50 UTC
2
+++ src/VBox/Runtime/r0drv/freebsd/sleepqueue-r0drv-freebsd.h
3
@@ -84,6 +84,8 @@ DECLINLINE(uint32_t) rtR0SemBsdWaitUpdateTimeout(PRTR0
4
     uint64_t cTicks = ASMMultU64ByU32DivByU32(uTimeout, hz, UINT32_C(1000000000));
5
     if (cTicks >= INT_MAX)
6
         return RTSEMWAIT_FLAGS_INDEFINITE;
7
+    else if (cTicks == 0 && uTimeout > 0)
8
+        pWait->iTimeout     = 1;
9
     else
10
         pWait->iTimeout     = (int)cTicks;
11
 #endif
(-)emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_spinlock-r0drv-freebsd.c (-4 / +4 lines)
Lines 1-6 Link Here
1
--- src/VBox/Runtime/r0drv/freebsd/spinlock-r0drv-freebsd.c.orig	2018-10-15 14:31:31 UTC
1
--- src/VBox/Runtime/r0drv/freebsd/spinlock-r0drv-freebsd.c.orig	2019-11-21 17:02:50 UTC
2
+++ src/VBox/Runtime/r0drv/freebsd/spinlock-r0drv-freebsd.c
2
+++ src/VBox/Runtime/r0drv/freebsd/spinlock-r0drv-freebsd.c
3
@@ -82,7 +82,9 @@ RTDECL(int)  RTSpinlockCreate(PRTSPINLOCK pSpinlock, u
3
@@ -107,7 +107,9 @@ RTDECL(int)  RTSpinlockCreate(PRTSPINLOCK pSpinlock, u
4
      * Allocate.
4
      * Allocate.
5
      */
5
      */
6
     AssertCompile(sizeof(RTSPINLOCKINTERNAL) > sizeof(void *));
6
     AssertCompile(sizeof(RTSPINLOCKINTERNAL) > sizeof(void *));
Lines 10-16 Link Here
10
     if (!pThis)
10
     if (!pThis)
11
         return VERR_NO_MEMORY;
11
         return VERR_NO_MEMORY;
12
 
12
 
13
@@ -116,7 +118,9 @@ RTDECL(int)  RTSpinlockDestroy(RTSPINLOCK Spinlock)
13
@@ -141,7 +143,9 @@ RTDECL(int)  RTSpinlockDestroy(RTSPINLOCK Spinlock)
14
      * Make the lock invalid and release the memory.
14
      * Make the lock invalid and release the memory.
15
      */
15
      */
16
     ASMAtomicIncU32(&pThis->u32Magic);
16
     ASMAtomicIncU32(&pThis->u32Magic);
Lines 20-26 Link Here
20
     return VINF_SUCCESS;
20
     return VINF_SUCCESS;
21
 }
21
 }
22
 
22
 
23
@@ -142,6 +146,7 @@ RTDECL(void) RTSpinlockAcquire(RTSPINLOCK Spinlock)
23
@@ -167,6 +171,7 @@ RTDECL(void) RTSpinlockAcquire(RTSPINLOCK Spinlock)
24
                 {
24
                 {
25
                     RT_ASSERT_PREEMPT_CPUID_SPIN_ACQUIRED(pThis);
25
                     RT_ASSERT_PREEMPT_CPUID_SPIN_ACQUIRED(pThis);
26
                     pThis->fIntSaved = fIntSaved;
26
                     pThis->fIntSaved = fIntSaved;
(-)emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_the-freebsd-kernel.h (-5 / +5 lines)
Lines 1-6 Link Here
1
--- src/VBox/Runtime/r0drv/freebsd/the-freebsd-kernel.h.orig	2018-10-15 14:31:31 UTC
1
--- src/VBox/Runtime/r0drv/freebsd/the-freebsd-kernel.h.orig	2019-11-21 17:02:50 UTC
2
+++ src/VBox/Runtime/r0drv/freebsd/the-freebsd-kernel.h
2
+++ src/VBox/Runtime/r0drv/freebsd/the-freebsd-kernel.h
3
@@ -60,6 +60,7 @@
3
@@ -88,6 +88,7 @@
4
 #include <sys/smp.h>
4
 #include <sys/smp.h>
5
 #include <sys/sleepqueue.h>
5
 #include <sys/sleepqueue.h>
6
 #include <sys/sx.h>
6
 #include <sys/sx.h>
Lines 8-14 Link Here
8
 #include <vm/vm.h>
8
 #include <vm/vm.h>
9
 #include <vm/pmap.h>            /* for vtophys */
9
 #include <vm/pmap.h>            /* for vtophys */
10
 #include <vm/vm_map.h>
10
 #include <vm/vm_map.h>
11
@@ -70,7 +71,6 @@
11
@@ -98,7 +99,6 @@
12
 #include <vm/vm_phys.h>         /* vm_phys_alloc_* */
12
 #include <vm/vm_phys.h>         /* vm_phys_alloc_* */
13
 #include <vm/vm_extern.h>       /* kmem_alloc_attr */
13
 #include <vm/vm_extern.h>       /* kmem_alloc_attr */
14
 #include <vm/vm_pageout.h>      /* vm_contig_grow_cache */
14
 #include <vm/vm_pageout.h>      /* vm_contig_grow_cache */
Lines 16-22 Link Here
16
 #include <sys/resourcevar.h>
16
 #include <sys/resourcevar.h>
17
 #include <machine/cpu.h>
17
 #include <machine/cpu.h>
18
 
18
 
19
@@ -114,6 +114,24 @@
19
@@ -156,6 +156,24 @@
20
  */
20
  */
21
 #if 0 /** @todo Not available yet. */
21
 #if 0 /** @todo Not available yet. */
22
 # define USE_KMEM_ALLOC_PROT
22
 # define USE_KMEM_ALLOC_PROT
Lines 40-43 Link Here
40
+# define IPRT_FREEBSD_RESTORE_EFL_ONLY_AC_EX(f) do { } while (0)
40
+# define IPRT_FREEBSD_RESTORE_EFL_ONLY_AC_EX(f) do { } while (0)
41
 #endif
41
 #endif
42
 
42
 
43
 #endif
43
 #endif /* !IPRT_INCLUDED_SRC_r0drv_freebsd_the_freebsd_kernel_h */
(-)emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_thread-r0drv-freebsd.c (-1 / +1 lines)
Lines 1-4 Link Here
1
--- src/VBox/Runtime/r0drv/freebsd/thread-r0drv-freebsd.c.orig	2018-10-15 14:31:31 UTC
1
--- src/VBox/Runtime/r0drv/freebsd/thread-r0drv-freebsd.c.orig	2019-11-21 17:02:50 UTC
2
+++ src/VBox/Runtime/r0drv/freebsd/thread-r0drv-freebsd.c
2
+++ src/VBox/Runtime/r0drv/freebsd/thread-r0drv-freebsd.c
3
@@ -49,7 +49,6 @@ RTDECL(RTNATIVETHREAD) RTThreadNativeSelf(void)
3
@@ -49,7 +49,6 @@ RTDECL(RTNATIVETHREAD) RTThreadNativeSelf(void)
4
 static int rtR0ThreadFbsdSleepCommon(RTMSINTERVAL cMillies)
4
 static int rtR0ThreadFbsdSleepCommon(RTMSINTERVAL cMillies)
(-)emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_thread2-r0drv-freebsd.c (-5 / +5 lines)
Lines 1-6 Link Here
1
--- src/VBox/Runtime/r0drv/freebsd/thread2-r0drv-freebsd.c.orig	2018-10-15 14:31:31 UTC
1
--- src/VBox/Runtime/r0drv/freebsd/thread2-r0drv-freebsd.c.orig	2019-11-21 17:02:50 UTC
2
+++ src/VBox/Runtime/r0drv/freebsd/thread2-r0drv-freebsd.c
2
+++ src/VBox/Runtime/r0drv/freebsd/thread2-r0drv-freebsd.c
3
@@ -70,6 +70,8 @@ DECLHIDDEN(int) rtThreadNativeSetPriority(PRTTHREADINT
3
@@ -95,6 +95,8 @@ DECLHIDDEN(int) rtThreadNativeSetPriority(PRTTHREADINT
4
             return VERR_INVALID_PARAMETER;
4
             return VERR_INVALID_PARAMETER;
5
     }
5
     }
6
 
6
 
Lines 9-15 Link Here
9
 #if __FreeBSD_version < 700000
9
 #if __FreeBSD_version < 700000
10
     /* Do like they're doing in subr_ntoskrnl.c... */
10
     /* Do like they're doing in subr_ntoskrnl.c... */
11
     mtx_lock_spin(&sched_lock);
11
     mtx_lock_spin(&sched_lock);
12
@@ -86,6 +88,7 @@ DECLHIDDEN(int) rtThreadNativeSetPriority(PRTTHREADINT
12
@@ -111,6 +113,7 @@ DECLHIDDEN(int) rtThreadNativeSetPriority(PRTTHREADINT
13
     thread_unlock(curthread);
13
     thread_unlock(curthread);
14
 #endif
14
 #endif
15
 
15
 
Lines 17-23 Link Here
17
     return VINF_SUCCESS;
17
     return VINF_SUCCESS;
18
 }
18
 }
19
 
19
 
20
@@ -135,6 +138,7 @@ static void rtThreadNativeMain(void *pvThreadInt)
20
@@ -160,6 +163,7 @@ static void rtThreadNativeMain(void *pvThreadInt)
21
 
21
 
22
 DECLHIDDEN(int) rtThreadNativeCreate(PRTTHREADINT pThreadInt, PRTNATIVETHREAD pNativeThread)
22
 DECLHIDDEN(int) rtThreadNativeCreate(PRTTHREADINT pThreadInt, PRTNATIVETHREAD pNativeThread)
23
 {
23
 {
Lines 25-31 Link Here
25
     int rc;
25
     int rc;
26
     struct proc *pProc;
26
     struct proc *pProc;
27
 
27
 
28
@@ -150,6 +154,7 @@ DECLHIDDEN(int) rtThreadNativeCreate(PRTTHREADINT pThr
28
@@ -175,6 +179,7 @@ DECLHIDDEN(int) rtThreadNativeCreate(PRTTHREADINT pThr
29
     }
29
     }
30
     else
30
     else
31
         rc = RTErrConvertFromErrno(rc);
31
         rc = RTErrConvertFromErrno(rc);
(-)emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_time-r0drv-freebsd.c (-3 / +3 lines)
Lines 1-6 Link Here
1
--- src/VBox/Runtime/r0drv/freebsd/time-r0drv-freebsd.c.orig	2016-07-18 11:56:55 UTC
1
--- src/VBox/Runtime/r0drv/freebsd/time-r0drv-freebsd.c.orig	2019-11-21 17:02:50 UTC
2
+++ src/VBox/Runtime/r0drv/freebsd/time-r0drv-freebsd.c
2
+++ src/VBox/Runtime/r0drv/freebsd/time-r0drv-freebsd.c
3
@@ -40,16 +40,23 @@
3
@@ -65,16 +65,23 @@
4
 
4
 
5
 RTDECL(uint64_t) RTTimeNanoTS(void)
5
 RTDECL(uint64_t) RTTimeNanoTS(void)
6
 {
6
 {
Lines 29-35 Link Here
29
 }
29
 }
30
 
30
 
31
 
31
 
32
@@ -67,8 +74,7 @@ RTDECL(uint64_t) RTTimeSystemMilliTS(voi
32
@@ -92,8 +99,7 @@ RTDECL(uint64_t) RTTimeSystemMilliTS(void)
33
 
33
 
34
 RTDECL(PRTTIMESPEC) RTTimeNow(PRTTIMESPEC pTime)
34
 RTDECL(PRTTIMESPEC) RTTimeNow(PRTTIMESPEC pTime)
35
 {
35
 {
(-)emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_timer-r0drv-freebsd.c (-8 / +8 lines)
Lines 1-6 Link Here
1
--- src/VBox/Runtime/r0drv/freebsd/timer-r0drv-freebsd.c.orig	2018-10-15 14:31:31 UTC
1
--- src/VBox/Runtime/r0drv/freebsd/timer-r0drv-freebsd.c.orig	2019-11-21 17:02:50 UTC
2
+++ src/VBox/Runtime/r0drv/freebsd/timer-r0drv-freebsd.c
2
+++ src/VBox/Runtime/r0drv/freebsd/timer-r0drv-freebsd.c
3
@@ -92,6 +92,7 @@ static void rtTimerFreeBSDCallback(void *pvTimer);
3
@@ -117,6 +117,7 @@ static void rtTimerFreeBSDCallback(void *pvTimer);
4
 RTDECL(int) RTTimerCreateEx(PRTTIMER *ppTimer, uint64_t u64NanoInterval, uint32_t fFlags, PFNRTTIMER pfnTimer, void *pvUser)
4
 RTDECL(int) RTTimerCreateEx(PRTTIMER *ppTimer, uint64_t u64NanoInterval, uint32_t fFlags, PFNRTTIMER pfnTimer, void *pvUser)
5
 {
5
 {
6
     *ppTimer = NULL;
6
     *ppTimer = NULL;
Lines 8-14 Link Here
8
 
8
 
9
     /*
9
     /*
10
      * Validate flags.
10
      * Validate flags.
11
@@ -121,6 +122,7 @@ RTDECL(int) RTTimerCreateEx(PRTTIMER *ppTimer, uint64_
11
@@ -146,6 +147,7 @@ RTDECL(int) RTTimerCreateEx(PRTTIMER *ppTimer, uint64_
12
     callout_init(&pTimer->Callout, CALLOUT_MPSAFE);
12
     callout_init(&pTimer->Callout, CALLOUT_MPSAFE);
13
 
13
 
14
     *ppTimer = pTimer;
14
     *ppTimer = pTimer;
Lines 16-22 Link Here
16
     return VINF_SUCCESS;
16
     return VINF_SUCCESS;
17
 }
17
 }
18
 
18
 
19
@@ -141,6 +143,8 @@ DECLINLINE(bool) rtTimerIsValid(PRTTIMER pTimer)
19
@@ -166,6 +168,8 @@ DECLINLINE(bool) rtTimerIsValid(PRTTIMER pTimer)
20
 
20
 
21
 RTDECL(int) RTTimerDestroy(PRTTIMER pTimer)
21
 RTDECL(int) RTTimerDestroy(PRTTIMER pTimer)
22
 {
22
 {
Lines 25-31 Link Here
25
     /* It's ok to pass NULL pointer. */
25
     /* It's ok to pass NULL pointer. */
26
     if (pTimer == /*NIL_RTTIMER*/ NULL)
26
     if (pTimer == /*NIL_RTTIMER*/ NULL)
27
         return VINF_SUCCESS;
27
         return VINF_SUCCESS;
28
@@ -153,6 +157,8 @@ RTDECL(int) RTTimerDestroy(PRTTIMER pTimer)
28
@@ -178,6 +182,8 @@ RTDECL(int) RTTimerDestroy(PRTTIMER pTimer)
29
     pTimer->u32Magic++;
29
     pTimer->u32Magic++;
30
     callout_stop(&pTimer->Callout);
30
     callout_stop(&pTimer->Callout);
31
     RTMemFree(pTimer);
31
     RTMemFree(pTimer);
Lines 34-40 Link Here
34
     return VINF_SUCCESS;
34
     return VINF_SUCCESS;
35
 }
35
 }
36
 
36
 
37
@@ -160,6 +166,7 @@ RTDECL(int) RTTimerDestroy(PRTTIMER pTimer)
37
@@ -185,6 +191,7 @@ RTDECL(int) RTTimerDestroy(PRTTIMER pTimer)
38
 RTDECL(int) RTTimerStart(PRTTIMER pTimer, uint64_t u64First)
38
 RTDECL(int) RTTimerStart(PRTTIMER pTimer, uint64_t u64First)
39
 {
39
 {
40
     struct timeval tv;
40
     struct timeval tv;
Lines 42-48 Link Here
42
 
42
 
43
     if (!rtTimerIsValid(pTimer))
43
     if (!rtTimerIsValid(pTimer))
44
         return VERR_INVALID_HANDLE;
44
         return VERR_INVALID_HANDLE;
45
@@ -183,12 +190,15 @@ RTDECL(int) RTTimerStart(PRTTIMER pTimer, uint64_t u64
45
@@ -208,12 +215,15 @@ RTDECL(int) RTTimerStart(PRTTIMER pTimer, uint64_t u64
46
     tv.tv_usec = (u64First % 1000000000) / 1000;
46
     tv.tv_usec = (u64First % 1000000000) / 1000;
47
     callout_reset(&pTimer->Callout, tvtohz(&tv), rtTimerFreeBSDCallback, pTimer);
47
     callout_reset(&pTimer->Callout, tvtohz(&tv), rtTimerFreeBSDCallback, pTimer);
48
 
48
 
Lines 58-64 Link Here
58
     if (!rtTimerIsValid(pTimer))
58
     if (!rtTimerIsValid(pTimer))
59
         return VERR_INVALID_HANDLE;
59
         return VERR_INVALID_HANDLE;
60
     if (pTimer->fSuspended)
60
     if (pTimer->fSuspended)
61
@@ -200,6 +210,7 @@ RTDECL(int) RTTimerStop(PRTTIMER pTimer)
61
@@ -225,6 +235,7 @@ RTDECL(int) RTTimerStop(PRTTIMER pTimer)
62
     pTimer->fSuspended = true;
62
     pTimer->fSuspended = true;
63
     callout_stop(&pTimer->Callout);
63
     callout_stop(&pTimer->Callout);
64
 
64
 
(-)emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r3_freebsd_systemmem-freebsd.cpp (-1 / +1 lines)
Lines 1-4 Link Here
1
--- src/VBox/Runtime/r3/freebsd/systemmem-freebsd.cpp.orig	2017-07-27 13:18:46 UTC
1
--- src/VBox/Runtime/r3/freebsd/systemmem-freebsd.cpp.orig	2019-11-21 17:02:54 UTC
2
+++ src/VBox/Runtime/r3/freebsd/systemmem-freebsd.cpp
2
+++ src/VBox/Runtime/r3/freebsd/systemmem-freebsd.cpp
3
@@ -65,7 +65,6 @@ RTDECL(int) RTSystemQueryAvailableRam(uint64_t *pcb)
3
@@ -65,7 +65,6 @@ RTDECL(int) RTSystemQueryAvailableRam(uint64_t *pcb)
4
     u_int cPagesMemFree = 0;
4
     u_int cPagesMemFree = 0;
(-)emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r3_posix_ldrNative-posix.cpp (+20 lines)
Line 0 Link Here
1
--- src/VBox/Runtime/r3/posix/ldrNative-posix.cpp.orig	2019-11-21 17:02:57 UTC
2
+++ src/VBox/Runtime/r3/posix/ldrNative-posix.cpp
3
@@ -148,7 +148,7 @@ DECLHIDDEN(int) rtldrNativeLoadSystem(const char *pszF
4
      */
5
     if (!pszExt)
6
     {
7
-#if !defined(RT_OS_DARWIN) && !defined(RT_OS_OS2) && !defined(RT_OS_WINDOWS)
8
+#if !defined(RT_OS_DARWIN) && !defined(RT_OS_FREEBSD) && !defined(RT_OS_OS2) && !defined(RT_OS_WINDOWS)
9
         if (    (fFlags & RTLDRLOAD_FLAGS_SO_VER_BEGIN_MASK) >> RTLDRLOAD_FLAGS_SO_VER_BEGIN_SHIFT
10
              == (fFlags & RTLDRLOAD_FLAGS_SO_VER_END_MASK)   >> RTLDRLOAD_FLAGS_SO_VER_END_SHIFT)
11
 #endif
12
@@ -168,7 +168,7 @@ DECLHIDDEN(int) rtldrNativeLoadSystem(const char *pszF
13
 
14
     int rc = RTLdrLoadEx(pszTmp, phLdrMod, fFlags2, NULL);
15
 
16
-#if !defined(RT_OS_DARWIN) && !defined(RT_OS_OS2) && !defined(RT_OS_WINDOWS)
17
+#if !defined(RT_OS_DARWIN) && !defined(RT_OS_FREEBSD) && !defined(RT_OS_OS2) && !defined(RT_OS_WINDOWS)
18
     /*
19
      * If no version was given after the .so and do .so.MAJOR search according
20
      * to the range in the fFlags.
(-)emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r3_posix_process-creation-posix.cpp (+40 lines)
Line 0 Link Here
1
--- src/VBox/Runtime/r3/posix/process-creation-posix.cpp.orig	2019-11-21 17:02:57 UTC
2
+++ src/VBox/Runtime/r3/posix/process-creation-posix.cpp
3
@@ -33,7 +33,7 @@
4
 #ifdef RT_OS_LINUX
5
 # define IPRT_WITH_DYNAMIC_CRYPT_R
6
 #endif
7
-#if (defined(RT_OS_LINUX) || defined(RT_OS_OS2)) && !defined(_GNU_SOURCE)
8
+#if (defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX) || defined(RT_OS_OS2)) && !defined(_GNU_SOURCE)
9
 # define _GNU_SOURCE
10
 #endif
11
 
12
@@ -64,7 +64,7 @@
13
 # include <shadow.h>
14
 #endif
15
 
16
-#if defined(RT_OS_LINUX) || defined(RT_OS_OS2)
17
+#if defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX) || defined(RT_OS_OS2)
18
 /* While Solaris has posix_spawn() of course we don't want to use it as
19
  * we need to have the child in a different process contract, no matter
20
  * whether it is started detached or not. */
21
@@ -97,6 +97,10 @@
22
 # include <iprt/asm.h>
23
 #endif
24
 
25
+#ifdef RT_OS_FREEBSD
26
+# include <sys/param.h>
27
+#endif
28
+
29
 #ifdef RT_OS_SOLARIS
30
 # include <limits.h>
31
 # include <sys/ctfs.h>
32
@@ -372,7 +376,7 @@ static int rtCheckCredentials(const char *pszUser, con
33
     if (pPwd->pw_passwd && *pPwd->pw_passwd)
34
 # endif
35
     {
36
-# if defined(RT_OS_LINUX) || defined(RT_OS_OS2)
37
+# if (defined(RT_OS_FREEBSD) && __FreeBSD_version >= 1200000) || defined(RT_OS_LINUX) || defined(RT_OS_OS2)
38
 #  ifdef IPRT_WITH_DYNAMIC_CRYPT_R
39
         size_t const       cbCryptData = RT_MAX(sizeof(struct crypt_data) * 2, _256K);
40
 #  else
(-)emulators/virtualbox-ose/files/patch-src_VBox_Storage_testcase_Makefile.kmk (+23 lines)
Line 0 Link Here
1
--- src/VBox/Storage/testcase/Makefile.kmk.orig	2019-11-21 17:03:07 UTC
2
+++ src/VBox/Storage/testcase/Makefile.kmk
3
@@ -146,7 +146,7 @@ if defined(VBOX_WITH_TESTCASES) || defined(VBOX_WITH_V
4
    vbox-img_LIBS += xml2
5
   endif
6
  else ifeq ($(KBUILD_TARGET),freebsd)
7
-  vbox-img_LIBS += iconv
8
+  vbox-img_LIBS += crypt iconv
9
   ifdef SDK_VBOX_LIBXML2_LIBS
10
    vbox-img_LIBS += xml2 lzma
11
   endif
12
@@ -191,8 +191,10 @@ if    defined(VBOX_WITH_TESTCASES) && defined(VBOX_WIT
13
   ifdef SDK_VBOX_LIBXML2_LIBS
14
    vdkeystoremgr_LIBS += xml2
15
   endif
16
- else if1of ($(KBUILD_TARGET),darwin freebsd)
17
+ else ifeq ($(KBUILD_TARGET),darwin)
18
   vdkeystoremgr_LIBS += iconv
19
+ else ifeq ($(KBUILD_TARGET),freebsd)
20
+  vdkeystoremgr_LIBS += crypt iconv
21
  else ifeq ($(KBUILD_TARGET),win)
22
   vdkeystoremgr_SDKS.win = VBOX_NTDLL
23
  else ifeq ($(KBUILD_TARGET),solaris)
(-)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_VBox_ValidationKit_Config.kmk (+12 lines)
Line 0 Link Here
1
--- src/VBox/ValidationKit/Config.kmk.orig	2019-11-21 17:03:18 UTC
2
+++ src/VBox/ValidationKit/Config.kmk
3
@@ -50,6 +50,9 @@ ifn1of ($(KBUILD_TARGET), darwin solaris win)
4
  TEMPLATE_VBoxValidationKitR3Base_LDFLAGS         = $(filter-out -static, $(TEMPLATE_VBoxR3Static_LDFLAGS))
5
 endif
6
 TEMPLATE_VBoxValidationKitR3Base_LIBS = $(TEMPLATE_VBoxR3Static_LIBS)
7
+if1of ($(KBUILD_TARGET), freebsd)
8
+ TEMPLATE_VBoxValidationKitR3Base_LIBS += crypt
9
+endif
10
 if1of ($(KBUILD_TARGET), linux)
11
  TEMPLATE_VBoxValidationKitR3Base_LIBS += supc++
12
  TEMPLATE_VBoxValidationKitR3Base_LDTOOL = $(subst GXX,GCC,$(TEMPLATE_VBoxR3Static_TOOL))
(-)emulators/virtualbox-ose/files/patch-src_libs_xpcom18a4_Makefile.kmk (-2 / +2 lines)
Lines 1-6 Link Here
1
--- src/libs/xpcom18a4/Makefile.kmk.orig	2019-01-25 18:32:58 UTC
1
--- src/libs/xpcom18a4/Makefile.kmk.orig	2019-11-21 17:03:58 UTC
2
+++ src/libs/xpcom18a4/Makefile.kmk
2
+++ src/libs/xpcom18a4/Makefile.kmk
3
@@ -980,6 +980,8 @@ VBoxXPCOM_LIBS = \
3
@@ -985,6 +985,8 @@ VBoxXPCOM_LIBS = \
4
 	$(VBox-xpcom-proxy_1_TARGET) \
4
 	$(VBox-xpcom-proxy_1_TARGET) \
5
 	$(VBox-xpcom-nspr_1_TARGET) \
5
 	$(VBox-xpcom-nspr_1_TARGET) \
6
 	$(VBoxXPCOMGlue_s_1_TARGET)
6
 	$(VBoxXPCOMGlue_s_1_TARGET)
(-)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-11-21 17:04:13 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/files/patch-src_libs_xpcom18a4_xpcom_io_nsLocalFileUnix.h (-2 / +2 lines)
Lines 1-5 Link Here
1
--- src/libs/xpcom18a4/xpcom/io/nsLocalFileUnix.h.orig	2017-03-08 17:21:24.000000000 +0000
1
--- src/libs/xpcom18a4/xpcom/io/nsLocalFileUnix.h.orig	2019-11-21 17:04:26 UTC
2
+++ src/libs/xpcom18a4/xpcom/io/nsLocalFileUnix.h	2017-03-08 22:53:39.572250000 +0000
2
+++ src/libs/xpcom18a4/xpcom/io/nsLocalFileUnix.h
3
@@ -72,14 +72,6 @@
3
@@ -72,14 +72,6 @@
4
     #define STATFS statfs
4
     #define STATFS statfs
5
 #endif
5
 #endif
(-)emulators/virtualbox-ose/files/patch-src_recompiler_Makefile.kmk (-12 lines)
Lines 1-12 Link Here
1
--- src/recompiler/Makefile.kmk.orig	2019-01-25 18:33:40 UTC
2
+++ src/recompiler/Makefile.kmk
3
@@ -63,6 +63,9 @@ else
4
  # Missing fpclassify. Is there a better define or flag for this?
5
  VBoxRemPrimary_DEFS.solaris  += __C99FEATURES__
6
 endif # win
7
+# XXX Work around a linker issue with GCC 8.x & LLD:
8
+# ld: error: translate.c:(.debug_loc+0xA40FD): has non-ABS relocation R_386_GOTOFF against symbol 'cpu_regs'
9
+VBoxRemPrimary_CFLAGS.freebsd.x86 += -g0
10
 VBoxRemPrimary_DEFS           += IN_REM_R3 REM_INCLUDE_CPU_H NEED_CPU_H
11
 #VBoxRemPrimary_DEFS           += REM_PHYS_ADDR_IN_TLB
12
 #VBoxRemPrimary_DEFS           += DEBUG_ALL_LOGGING DEBUG_DISAS DEBUG_PCALL CONFIG_DEBUG_EXEC DEBUG_FLUSH DEBUG_IOPORT DEBUG_SIGNAL DEBUG_TLB_CHECK DEBUG_TB_INVALIDATE DEBUG_TLB  # Enables huge amounts of debug logging.
(-)emulators/virtualbox-ose/pkg-plist (-10 / +9 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
10
bin/vbox-img
9
bin/vboxautostart
11
bin/vboxautostart
10
bin/vboxballoonctrl
12
bin/vboxballoonctrl
11
bin/vboxbugreport
13
bin/vboxbugreport
Lines 14-19 bin/vboxmanage Link Here
14
%%X11%%bin/vboxsdl
16
%%X11%%bin/vboxsdl
15
%%WEBSERVICE%%bin/vboxwebsrv
17
%%WEBSERVICE%%bin/vboxwebsrv
16
%%QT%%bin/virtualbox
18
%%QT%%bin/virtualbox
19
%%QT%%bin/virtualboxvm
17
include/virtualbox/VirtualBox_XPCOM.h
20
include/virtualbox/VirtualBox_XPCOM.h
18
include/virtualbox/ipcIClientObserver.h
21
include/virtualbox/ipcIClientObserver.h
19
include/virtualbox/ipcIDConnectService.h
22
include/virtualbox/ipcIDConnectService.h
Lines 369-374 include/virtualbox/xpcom/xptinfo.h Link Here
369
%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/server/policy.py
372
%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/server/policy.py
370
%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/server%%PYTHON_PYCDIR%%policy%%PYTHON_PYCEXT%%
373
%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/server%%PYTHON_PYCDIR%%policy%%PYTHON_PYCEXT%%
371
%%QT%%lib/virtualbox/DbgPlugInDiggers.so
374
%%QT%%lib/virtualbox/DbgPlugInDiggers.so
375
%%QT%%lib/virtualbox/UICommon.so
372
lib/virtualbox/VBox.sh
376
lib/virtualbox/VBox.sh
373
lib/virtualbox/VBoxAuth.so
377
lib/virtualbox/VBoxAuth.so
374
lib/virtualbox/VBoxAuthSimple.so
378
lib/virtualbox/VBoxAuthSimple.so
Lines 378-389 lib/virtualbox/VBoxBugReport Link Here
378
lib/virtualbox/VBoxDD.so
382
lib/virtualbox/VBoxDD.so
379
lib/virtualbox/VBoxDD2.so
383
lib/virtualbox/VBoxDD2.so
380
lib/virtualbox/VBoxDDR0.r0
384
lib/virtualbox/VBoxDDR0.r0
381
lib/virtualbox/VBoxDDRC.rc
382
lib/virtualbox/VBoxDDU.so
385
lib/virtualbox/VBoxDDU.so
383
%%QT%%lib/virtualbox/VBoxDbg.so
386
%%QT%%lib/virtualbox/VBoxDbg.so
384
%%QT%%lib/virtualbox/VBoxDragAndDropSvc.so
387
%%QT%%lib/virtualbox/VBoxDragAndDropSvc.so
385
lib/virtualbox/VBoxEFI32.fd
386
lib/virtualbox/VBoxEFI64.fd
387
lib/virtualbox/VBoxExtPackHelperApp
388
lib/virtualbox/VBoxExtPackHelperApp
388
lib/virtualbox/VBoxGuestControlSvc.so
389
lib/virtualbox/VBoxGuestControlSvc.so
389
lib/virtualbox/VBoxGuestPropSvc.so
390
lib/virtualbox/VBoxGuestPropSvc.so
Lines 399-413 lib/virtualbox/VBoxNetDHCP.so Link Here
399
lib/virtualbox/VBoxNetNAT.so
400
lib/virtualbox/VBoxNetNAT.so
400
%%PYTHON%%lib/virtualbox/VBoxPython.so
401
%%PYTHON%%lib/virtualbox/VBoxPython.so
401
%%PYTHON%%lib/virtualbox/VBoxPython%%PYTHON_VERU%%.so
402
%%PYTHON%%lib/virtualbox/VBoxPython%%PYTHON_VERU%%.so
402
lib/virtualbox/VBoxREM.so
403
%%I386%%lib/virtualbox/VBoxREM32.so
404
%%I386%%lib/virtualbox/VBoxREM64.so
405
lib/virtualbox/VBoxRT.so
403
lib/virtualbox/VBoxRT.so
406
%%X11%%@(root,%%VBOXGROUP%%,4510) lib/virtualbox/VBoxSDL
404
%%X11%%@(root,%%VBOXGROUP%%,4510) lib/virtualbox/VBoxSDL
407
%%X11%%lib/virtualbox/VBoxSDL.so
405
%%X11%%lib/virtualbox/VBoxSDL.so
408
lib/virtualbox/VBoxSVC
406
lib/virtualbox/VBoxSVC
407
%%X11%%lib/virtualbox/VBoxSVGA3D.so
409
%%X11%%lib/virtualbox/VBoxSharedClipboard.so
408
%%X11%%lib/virtualbox/VBoxSharedClipboard.so
410
%%X11%%lib/virtualbox/VBoxSharedCrOpenGL.so
411
lib/virtualbox/VBoxSharedFolders.so
409
lib/virtualbox/VBoxSharedFolders.so
412
%%QT%%lib/virtualbox/VBoxTestOGL
410
%%QT%%lib/virtualbox/VBoxTestOGL
413
lib/virtualbox/VBoxVMM.so
411
lib/virtualbox/VBoxVMM.so
Lines 416-425 lib/virtualbox/VBoxXPCOM.so Link Here
416
lib/virtualbox/VBoxXPCOMC.so
414
lib/virtualbox/VBoxXPCOMC.so
417
lib/virtualbox/VBoxXPCOMIPCD
415
lib/virtualbox/VBoxXPCOMIPCD
418
lib/virtualbox/VMMR0.r0
416
lib/virtualbox/VMMR0.r0
419
lib/virtualbox/VMMRC.rc
417
%%QT%%lib/virtualbox/VirtualBox
420
%%QT%%@(root,%%VBOXGROUP%%,4510) lib/virtualbox/VirtualBox
418
%%QT%%@(root,%%VBOXGROUP%%,4510) lib/virtualbox/VirtualBoxVM
421
%%QT%%lib/virtualbox/VirtualBox.so
419
%%QT%%lib/virtualbox/VirtualBoxVM.so
422
%%SDK%%lib/virtualbox/sdk
420
%%SDK%%lib/virtualbox/sdk
421
lib/virtualbox/vbox-img
423
%%WEBSERVICE%%lib/virtualbox/vboxwebsrv
422
%%WEBSERVICE%%lib/virtualbox/vboxwebsrv
424
%%WEBSERVICE%%lib/virtualbox/webtest
423
%%WEBSERVICE%%lib/virtualbox/webtest
425
%%VNC%%lib/virtualbox/ExtensionPacks/VNC/ExtPack-license.html
424
%%VNC%%lib/virtualbox/ExtensionPacks/VNC/ExtPack-license.html
(-)emulators/virtualbox-ose-additions/Makefile (-31 / +5 lines)
Lines 2-11 Link Here
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTNAME=	virtualbox-ose
4
PORTNAME=	virtualbox-ose
5
PORTVERSION=	5.2.34
5
PORTVERSION=	6.1.0
6
PORTREVISION=	1
7
CATEGORIES=	emulators
6
CATEGORIES=	emulators
8
MASTER_SITES=	https://download.oracle.com/virtualbox/${PORTVERSION}/
7
MASTER_SITES=	https://download.virtualbox.org/virtualbox/${PORTVERSION}/
9
PKGNAMESUFFIX?=	-additions
8
PKGNAMESUFFIX?=	-additions
10
DISTNAME=	VirtualBox-${PORTVERSION}
9
DISTNAME=	VirtualBox-${PORTVERSION}
11
10
Lines 47-67 CONFLICTS_INSTALL= virtualbox-ose-[0-9]* \ Link Here
47
			virtualbox-ose-lite-[0-9]* \
46
			virtualbox-ose-lite-[0-9]* \
48
			virtualbox-ose-nox11-[0-9]*
47
			virtualbox-ose-nox11-[0-9]*
49
48
50
OPTIONS_DEFINE=	DBUS DEBUG OPENGL X11
49
OPTIONS_DEFINE=	DBUS DEBUG X11
51
OPTIONS_DEFAULT=	DBUS X11
50
OPTIONS_DEFAULT=	DBUS X11
52
OPTIONS_SUB=	yes
51
OPTIONS_SUB=	yes
53
52
54
OPENGL_DESC=		3D pass-through support (requires X11)
55
56
DBUS_CONFIGURE_OFF=	--disable-dbus
53
DBUS_CONFIGURE_OFF=	--disable-dbus
57
DBUS_LIB_DEPENDS=	libdbus-1.so:devel/dbus
54
DBUS_LIB_DEPENDS=	libdbus-1.so:devel/dbus
58
DEBUG_CONFIGURE_ON=	--build-debug
55
DEBUG_CONFIGURE_ON=	--build-debug
59
DEBUG_VARS=		KMK_BUILDTYPE=debug
56
DEBUG_VARS=		KMK_BUILDTYPE=debug
60
DEBUG_VARS_OFF=		KMK_BUILDTYPE=release
57
DEBUG_VARS_OFF=		KMK_BUILDTYPE=release
61
OPENGL_CONFIGURE_OFF=	--disable-opengl
62
OPENGL_IMPLIES=		X11
63
OPENGL_USE=		GL=gl,glu XORG=xcomposite,xdamage,xfixes
64
OPENGL_USES=		gl python:2.7,build xorg
65
X11_BUILD_DEPENDS=	${LOCALBASE}/include/xorg/compiler.h:x11-servers/xorg-server
58
X11_BUILD_DEPENDS=	${LOCALBASE}/include/xorg/compiler.h:x11-servers/xorg-server
66
X11_RUN_DEPENDS=	xrandr:x11/xrandr
59
X11_RUN_DEPENDS=	xrandr:x11/xrandr
67
X11_USE=		XORG=x11,xcursor,xext,xorgproto,xmu,xrandr,xt
60
X11_USE=		XORG=x11,xcursor,xext,xorgproto,xmu,xrandr,xt
Lines 89-99 BUILD_WRKSRC= ${VBOX_BIN}/src Link Here
89
KMK_ARCH=	freebsd.${ARCH:S/i386/x86/}
82
KMK_ARCH=	freebsd.${ARCH:S/i386/x86/}
90
KMK_CONFIG+=	VBOX_LIBPATH_X11=${LOCALBASE} VBOX_FREEBSD_SRC=${SRC_BASE}/sys
83
KMK_CONFIG+=	VBOX_LIBPATH_X11=${LOCALBASE} VBOX_FREEBSD_SRC=${SRC_BASE}/sys
91
84
92
.if ${PORT_OPTIONS:MOPENGL}
93
VBOX_LIBS=	VBoxEGL.so \
94
		VBoxOGL.so
95
.endif
96
97
.if ${PORT_OPTIONS:MX11}
85
.if ${PORT_OPTIONS:MX11}
98
.else
86
.else
99
VBOX_WITH_X11=
87
VBOX_WITH_X11=
Lines 103-112 VBOX_WITH_X11= Link Here
103
91
104
.if ${COMPILER_TYPE} == clang
92
.if ${COMPILER_TYPE} == clang
105
EXTRA_PATCHES+=	${PATCHDIR}/extrapatch-Config.kmk
93
EXTRA_PATCHES+=	${PATCHDIR}/extrapatch-Config.kmk
106
.if ${COMPILER_FEATURES:Mlibc++}
107
EXTRA_PATCHES+=	${PATCHDIR}/extrapatch-src-VBox-Additions-x11-VBoxClient-Makefile.kmk
108
.endif
94
.endif
109
.endif
110
95
111
post-patch:
96
post-patch:
112
	@${ECHO_CMD} 'VBOX_ONLY_ADDITIONS = 1' > ${WRKSRC}/LocalConfig.kmk
97
	@${ECHO_CMD} 'VBOX_ONLY_ADDITIONS = 1' > ${WRKSRC}/LocalConfig.kmk
Lines 118-126 post-patch: Link Here
118
	    ${WRKSRC}/LocalConfig.kmk
103
	    ${WRKSRC}/LocalConfig.kmk
119
	@${ECHO_CMD} 'VBOX_GCC_std = -std=c++11' >> ${WRKSRC}/LocalConfig.kmk
104
	@${ECHO_CMD} 'VBOX_GCC_std = -std=c++11' >> ${WRKSRC}/LocalConfig.kmk
120
.if ${COMPILER_TYPE} == clang
105
.if ${COMPILER_TYPE} == clang
121
	@${REINPLACE_CMD} -e 's| -finline-limit=8000||' \
106
	@${REINPLACE_CMD} -e 's| -mno-align-long-strings||' \
122
	    -e 's| -fno-merge-constants||' \
107
	    ${WRKSRC}/Config.kmk
123
	    -e 's| -mpreferred-stack-boundary=2||' ${WRKSRC}/Config.kmk
124
.endif
108
.endif
125
	@${REINPLACE_CMD} -e 's|/usr/X11|${LOCALBASE}|g' \
109
	@${REINPLACE_CMD} -e 's|/usr/X11|${LOCALBASE}|g' \
126
	    ${WRKSRC}/src/VBox/Additions/x11/VBoxClient/display.cpp
110
	    ${WRKSRC}/src/VBox/Additions/x11/VBoxClient/display.cpp
Lines 128-134 post-patch: Link Here
128
	    ${WRKSRC}/Config.kmk ${WRKSRC}/configure \
112
	    ${WRKSRC}/Config.kmk ${WRKSRC}/configure \
129
	    ${WRKSRC}/kBuild/header.kmk ${WRKSRC}/kBuild/units/qt4.kmk \
113
	    ${WRKSRC}/kBuild/header.kmk ${WRKSRC}/kBuild/units/qt4.kmk \
130
	    ${WRKSRC}/kBuild/units/qt5.kmk ${WRKSRC}/kBuild/sdks/LIBSDL.kmk \
114
	    ${WRKSRC}/kBuild/units/qt5.kmk ${WRKSRC}/kBuild/sdks/LIBSDL.kmk \
131
	    ${WRKSRC}/src/VBox/Additions/common/crOpenGL/load.c \
132
	    ${WRKSRC}/src/VBox/Additions/x11/Installer/98vboxadd-xclient \
115
	    ${WRKSRC}/src/VBox/Additions/x11/Installer/98vboxadd-xclient \
133
	    ${WRKSRC}/src/VBox/Additions/x11/Installer/vboxclient.desktop \
116
	    ${WRKSRC}/src/VBox/Additions/x11/Installer/vboxclient.desktop \
134
	    ${WRKSRC}/src/VBox/Additions/x11/vboxmouse/Makefile.kmk \
117
	    ${WRKSRC}/src/VBox/Additions/x11/vboxmouse/Makefile.kmk \
Lines 143-151 post-patch: Link Here
143
	@${ECHO_CMD} 'VBOX_ICONV_DEFS = LIBICONV_PLUG' >> ${WRKSRC}/LocalConfig.kmk
126
	@${ECHO_CMD} 'VBOX_ICONV_DEFS = LIBICONV_PLUG' >> ${WRKSRC}/LocalConfig.kmk
144
.endif
127
.endif
145
128
146
post-patch-OPENGL-on:
147
	@${ECHO_CMD} 'VBOX_USE_SYSTEM_GL_HEADERS = 1' >> ${WRKSRC}/LocalConfig.kmk
148
149
post-patch-X11-on:
129
post-patch-X11-on:
150
	@${ECHO_CMD} 'VBOX_USE_SYSTEM_XORG_HEADERS = 1' >> \
130
	@${ECHO_CMD} 'VBOX_USE_SYSTEM_XORG_HEADERS = 1' >> \
151
	    ${WRKSRC}/LocalConfig.kmk
131
	    ${WRKSRC}/LocalConfig.kmk
Lines 185-194 do-install-X11-on: Link Here
185
	${INSTALL_DATA} ${VBOX_BIN}/vboxmouse_drv_system.so \
165
	${INSTALL_DATA} ${VBOX_BIN}/vboxmouse_drv_system.so \
186
	    ${STAGEDIR}${INPUTDIR}/vboxmouse_drv.so
166
	    ${STAGEDIR}${INPUTDIR}/vboxmouse_drv.so
187
167
188
do-install-OPENGL-on:
189
	${INSTALL_DATA} ${FILESDIR}/vboxvideo.conf \
190
	    ${STAGEDIR}${PREFIX}/etc/libmap.d/
191
	${INSTALL_DATA} ${VBOX_LIBS:S|^|${VBOX_BIN}/|} \
192
	    ${STAGEDIR}${PREFIX}/lib/
193
194
.include <bsd.port.post.mk>
168
.include <bsd.port.post.mk>
(-)emulators/virtualbox-ose-additions/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1571257463
1
TIMESTAMP = 1576163196
2
SHA256 (VirtualBox-5.2.34.tar.bz2) = 9abff37330bba46b97aa836bc886397ba9cfb06cb75be5d60ac31f5ae9c2f2e1
2
SHA256 (VirtualBox-6.1.0.tar.bz2) = 49005ed94454f893fc3955e1e2b9607e85c300235cb983b39d1df2cfcf29f039
3
SIZE (VirtualBox-5.2.34.tar.bz2) = 118268064
3
SIZE (VirtualBox-6.1.0.tar.bz2) = 165322453
(-)emulators/virtualbox-ose-additions/pkg-plist (-3 lines)
Lines 1-9 Link Here
1
%%X11%%bin/VBoxClient
1
%%X11%%bin/VBoxClient
2
%%X11%%bin/VBoxClient-all
2
%%X11%%bin/VBoxClient-all
3
%%OPENGL%%etc/libmap.d/vboxvideo.conf
4
%%X11%%etc/xdg/autostart/vboxclient.desktop
3
%%X11%%etc/xdg/autostart/vboxclient.desktop
5
%%OPENGL%%lib/VBoxEGL.so
6
%%OPENGL%%lib/VBoxOGL.so
7
lib/pam_vbox.so
4
lib/pam_vbox.so
8
%%X11%%lib/xorg/modules/drivers/vboxvideo_drv.so
5
%%X11%%lib/xorg/modules/drivers/vboxvideo_drv.so
9
%%X11%%lib/xorg/modules/input/vboxmouse_drv.so
6
%%X11%%lib/xorg/modules/input/vboxmouse_drv.so
(-)emulators/virtualbox-ose-kmod/Makefile (-2 / +2 lines)
Lines 2-10 Link Here
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTNAME=	virtualbox-ose
4
PORTNAME=	virtualbox-ose
5
PORTVERSION=	5.2.34
5
PORTVERSION=	6.1.0
6
CATEGORIES=	emulators
6
CATEGORIES=	emulators
7
MASTER_SITES=	https://download.oracle.com/virtualbox/${PORTVERSION}/
7
MASTER_SITES=	https://download.virtualbox.org/virtualbox/${PORTVERSION}/
8
PKGNAMESUFFIX=	-kmod
8
PKGNAMESUFFIX=	-kmod
9
DISTNAME=	VirtualBox-${PORTVERSION}
9
DISTNAME=	VirtualBox-${PORTVERSION}
10
10
(-)emulators/virtualbox-ose-kmod/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1571257293
1
TIMESTAMP = 1576163196
2
SHA256 (VirtualBox-5.2.34.tar.bz2) = 9abff37330bba46b97aa836bc886397ba9cfb06cb75be5d60ac31f5ae9c2f2e1
2
SHA256 (VirtualBox-6.1.0.tar.bz2) = 49005ed94454f893fc3955e1e2b9607e85c300235cb983b39d1df2cfcf29f039
3
SIZE (VirtualBox-5.2.34.tar.bz2) = 118268064
3
SIZE (VirtualBox-6.1.0.tar.bz2) = 165322453
(-)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
(-)www/phpvirtualbox/Makefile (+2 lines)
Lines 10-15 COMMENT= AJAX Web Interface for VirtualBox Link Here
10
10
11
LICENSE=	GPLv3
11
LICENSE=	GPLv3
12
12
13
IGNORE=		does not work with VirtualBox 6.0 or later
14
13
USES=		dos2unix php
15
USES=		dos2unix php
14
USE_PHP=	json session simplexml soap xml
16
USE_PHP=	json session simplexml soap xml
15
17

Return to bug 234878