diff --git a/emulators/virtualbox-ose-additions/Makefile b/emulators/virtualbox-ose-additions/Makefile index b335cda7154e..c4501b06a5a8 100644 --- a/emulators/virtualbox-ose-additions/Makefile +++ b/emulators/virtualbox-ose-additions/Makefile @@ -1,164 +1,163 @@ # Created by: Bernhard Froehlich PORTNAME= virtualbox-ose -PORTVERSION= 6.1.18 -PORTREVISION= 1 +PORTVERSION= 6.1.20 CATEGORIES= emulators MASTER_SITES= https://download.virtualbox.org/virtualbox/${PORTVERSION}/ PKGNAMESUFFIX?= -additions DISTNAME= VirtualBox-${PORTVERSION} MAINTAINER= vbox@FreeBSD.org COMMENT= VirtualBox additions for FreeBSD guests LICENSE= GPLv2 LICENSE_FILE= ${WRKSRC}/COPYING ONLY_FOR_ARCHS= amd64 USES= compiler:c++11-lang cpe iconv kmod tar:bzip2 USE_RC_SUBR= vboxguest vboxservice BUILD_DEPENDS= yasm:devel/yasm \ kmk:devel/kBuild \ xsltproc:textproc/libxslt CPE_VENDOR= oracle CPE_PRODUCT= vm_virtualbox PATCHDIR= ${.CURDIR}/../${PORTNAME}/files WRKSRC= ${WRKDIR}/VirtualBox-${PORTVERSION} MAKE_JOBS_UNSAFE= yes HAS_CONFIGURE= yes CONFIGURE_ARGS+= --disable-alsa \ --disable-docs \ --disable-libvpx \ --disable-opengl \ --disable-pulse \ --disable-python \ --disable-sdl-ttf \ --disable-xpcom CONFIGURE_ARGS+= --nofatal --with-gcc="${CC}" --with-g++="${CXX}" CONFLICTS_INSTALL= virtualbox-ose-[0-9]* \ virtualbox-ose-additions-devel-[0-9]* \ virtualbox-ose-devel-[0-9]* \ virtualbox-ose-legacy-[0-9]* \ virtualbox-ose-lite-[0-9]* \ virtualbox-ose-nox11-[0-9]* OPTIONS_DEFINE= DBUS DEBUG X11 OPTIONS_DEFAULT= DBUS X11 OPTIONS_SUB= yes DBUS_CONFIGURE_OFF= --disable-dbus DBUS_LIB_DEPENDS= libdbus-1.so:devel/dbus DEBUG_CONFIGURE_ON= --build-debug DEBUG_VARS= KMK_BUILDTYPE=debug DEBUG_VARS_OFF= KMK_BUILDTYPE=release X11_BUILD_DEPENDS= ${LOCALBASE}/include/xorg/compiler.h:x11-servers/xorg-server X11_RUN_DEPENDS= xrandr:x11/xrandr X11_USE= XORG=x11,xcursor,xext,xorgproto,xmu,xrandr,xt X11_USES= pkgconfig xorg X11_VARS= VBOX_WITH_X11=1 .include .if ${SLAVE_PORT} == no CONFLICTS_INSTALL+= virtualbox-ose-additions-nox11-[0-9]* .else CONFLICTS_INSTALL+= virtualbox-ose-additions-[0-9]* .endif VIDEODIR= ${PREFIX}/lib/xorg/modules/drivers INPUTDIR= ${PREFIX}/lib/xorg/modules/input VBOX_BIN= ${WRKSRC}/out/${KMK_ARCH}/${KMK_BUILDTYPE}/bin/additions VBOX_SBINS= VBoxControl \ VBoxService \ mount_vboxvfs BUILD_WRKSRC= ${VBOX_BIN}/src KMK_ARCH= freebsd.${ARCH:S/i386/x86/} KMK_CONFIG+= VBOX_LIBPATH_X11=${LOCALBASE} VBOX_FREEBSD_SRC=${SRC_BASE}/sys .if ${PORT_OPTIONS:MX11} .else VBOX_WITH_X11= .endif .include post-patch: @${ECHO_CMD} 'VBOX_ONLY_ADDITIONS = 1' > ${WRKSRC}/LocalConfig.kmk @${ECHO_CMD} 'VBOX_WITH_DRAG_AND_DROP = ${VBOX_WITH_X11}' >> \ ${WRKSRC}/LocalConfig.kmk @${ECHO_CMD} 'VBOX_WITH_DRAG_AND_DROP_GH = ${VBOX_WITH_X11}' >> \ ${WRKSRC}/LocalConfig.kmk @${ECHO_CMD} 'VBOX_WITH_X11_ADDITIONS = ${VBOX_WITH_X11}' >> \ ${WRKSRC}/LocalConfig.kmk @${ECHO_CMD} 'VBOX_GCC_std = -std=c++11' >> ${WRKSRC}/LocalConfig.kmk .if ${COMPILER_TYPE} == clang @${REINPLACE_CMD} -e 's| -finline-limit=8000||' \ -e 's| -fno-merge-constants||' \ -e 's| -mpreferred-stack-boundary=2||' ${WRKSRC}/Config.kmk .endif @${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g' \ ${WRKSRC}/Config.kmk ${WRKSRC}/configure \ ${WRKSRC}/kBuild/header.kmk ${WRKSRC}/kBuild/units/qt4.kmk \ ${WRKSRC}/kBuild/units/qt5.kmk ${WRKSRC}/kBuild/sdks/LIBSDL.kmk \ ${WRKSRC}/src/VBox/Additions/x11/Installer/98vboxadd-xclient \ ${WRKSRC}/src/VBox/Additions/x11/Installer/vboxclient.desktop \ ${WRKSRC}/src/VBox/Additions/x11/vboxmouse/Makefile.kmk \ ${WRKSRC}/src/VBox/Additions/x11/vboxvideo/Makefile.kmk @${REINPLACE_CMD} \ -e 's|\$$KBUILDDIR_BIN/kmk_sed|${LOCALBASE}/bin/kmk_sed|g' \ ${WRKSRC}/configure .if empty(ICONV_LIB) @${REINPLACE_CMD} -e 's|iconv||' ${WRKSRC}/Config.kmk \ ${WRKSRC}/src/VBox/Runtime/Makefile.kmk \ ${WRKSRC}/src/VBox/Additions/x11/VBoxClient/Makefile.kmk @${ECHO_CMD} 'VBOX_ICONV_DEFS = LIBICONV_PLUG' >> ${WRKSRC}/LocalConfig.kmk .endif post-patch-X11-on: @${ECHO_CMD} 'VBOX_USE_SYSTEM_XORG_HEADERS = 1' >> \ ${WRKSRC}/LocalConfig.kmk pre-build: cd ${WRKSRC} && ${SH} -c \ ". env.sh && ${KMK_CONFIG} ${LOCALBASE}/bin/kmk" do-install: ${MKDIR} ${STAGEDIR}${KMODDIR} ${INSTALL_KLD} ${VBOX_BIN}/src/vboxguest/vboxguest.ko \ ${STAGEDIR}${KMODDIR} ${INSTALL_KLD} ${VBOX_BIN}/vboxvfs.ko ${STAGEDIR}${KMODDIR} ${INSTALL_LIB} ${VBOX_BIN}/pam_vbox.so ${STAGEDIR}${PREFIX}/lib ${INSTALL_PROGRAM} ${VBOX_SBINS:S|^|${VBOX_BIN}/|} \ ${STAGEDIR}${PREFIX}/sbin/ do-install-X11-on: ${INSTALL_PROGRAM} ${VBOX_BIN}/VBoxClient ${STAGEDIR}${PREFIX}/bin/ ${INSTALL_SCRIPT} \ ${WRKSRC}/src/VBox/Additions/x11/Installer/98vboxadd-xclient \ ${STAGEDIR}${PREFIX}/bin/VBoxClient-all # X11 autostart ${MKDIR} ${STAGEDIR}${PREFIX}/etc/xdg/autostart/ ${INSTALL_DATA} \ ${WRKSRC}/src/VBox/Additions/x11/Installer/vboxclient.desktop \ ${STAGEDIR}${PREFIX}/etc/xdg/autostart/ # KDE autostart ${MKDIR} ${STAGEDIR}${PREFIX}/share/autostart/ ${INSTALL_DATA} \ ${WRKSRC}/src/VBox/Additions/x11/Installer/vboxclient.desktop \ ${STAGEDIR}${PREFIX}/share/autostart/ ${MKDIR} ${STAGEDIR}${VIDEODIR} - ${INSTALL_DATA} ${VBOX_BIN}/vboxvideo_drv_system.so \ + ${INSTALL_LIB} ${VBOX_BIN}/vboxvideo_drv_system.so \ ${STAGEDIR}${VIDEODIR}/vboxvideo_drv.so ${MKDIR} ${STAGEDIR}${INPUTDIR} - ${INSTALL_DATA} ${VBOX_BIN}/vboxmouse_drv_system.so \ + ${INSTALL_LIB} ${VBOX_BIN}/vboxmouse_drv_system.so \ ${STAGEDIR}${INPUTDIR}/vboxmouse_drv.so .include diff --git a/emulators/virtualbox-ose-additions/distinfo b/emulators/virtualbox-ose-additions/distinfo index bd3152a6518c..248bf5a683be 100644 --- a/emulators/virtualbox-ose-additions/distinfo +++ b/emulators/virtualbox-ose-additions/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1613903085 -SHA256 (VirtualBox-6.1.18.tar.bz2) = 108d42b9b391b7a332a33df1662cf7b0e9d9a80f3079d16288d8b9487f427d40 -SIZE (VirtualBox-6.1.18.tar.bz2) = 165507486 +TIMESTAMP = 1619010563 +SHA256 (VirtualBox-6.1.20.tar.bz2) = e690c91974a2e7a5aca2c0939ad514382f9a2136797a5e0b96aab778e42bc8a7 +SIZE (VirtualBox-6.1.20.tar.bz2) = 165569564 diff --git a/emulators/virtualbox-ose-kmod/Makefile b/emulators/virtualbox-ose-kmod/Makefile index c8d08b3a0cde..6c78df5a7776 100644 --- a/emulators/virtualbox-ose-kmod/Makefile +++ b/emulators/virtualbox-ose-kmod/Makefile @@ -1,108 +1,107 @@ # Created by: Bernhard Froehlich PORTNAME= virtualbox-ose -PORTVERSION= 6.1.18 -PORTREVISION= 1 +PORTVERSION= 6.1.20 CATEGORIES= emulators MASTER_SITES= https://download.virtualbox.org/virtualbox/${PORTVERSION}/ PKGNAMESUFFIX= -kmod DISTNAME= VirtualBox-${PORTVERSION} MAINTAINER= vbox@FreeBSD.org COMMENT= VirtualBox kernel module for FreeBSD LICENSE= GPLv2 LICENSE_FILE= ${WRKSRC}/COPYING BUILD_DEPENDS= kmk:devel/kBuild CPE_VENDOR= oracle CPE_PRODUCT= vm_virtualbox USES= cpe compiler:c++14-lang kmod tar:bzip2 PATCHDIR= ${.CURDIR}/../${PORTNAME}/files WRKSRC= ${WRKDIR}/VirtualBox-${PORTVERSION} USE_RC_SUBR= vboxnet ONLY_FOR_ARCHS= amd64 HAS_CONFIGURE= yes CONFIGURE_ARGS+= --build-headless CONFIGURE_ARGS+= --disable-alsa \ --disable-dbus \ --disable-docs \ --disable-libvpx \ --disable-pulse \ --disable-python \ --disable-sdl-ttf \ --disable-xpcom CONFIGURE_ARGS+= --nofatal --with-gcc="${CC}" --with-g++="${CXX}" CONFLICTS_INSTALL= virtualbox-ose-kmod-devel-* \ virtualbox-ose-kmod-legacy-* OPTIONS_DEFINE= DEBUG VIMAGE OPTIONS_DEFAULT=VIMAGE OPTIONS_SUB= yes DEBUG_DESC= Debug symbols, additional logs and assertions VIMAGE_DESC= VIMAGE virtual networking support .include VBOX_BIN= ${WRKSRC}/out/${KMK_ARCH}/${KMK_BUILDTYPE}/bin/src VBOX_KMODS= vboxdrv \ vboxnetadp \ vboxnetflt BUILD_WRKSRC= ${VBOX_BIN} KMK_BUILDTYPE= release KMK_CONFIG= VBOX_LIBPATH_X11=${LOCALBASE} VBOX_FREEBSD_SRC=${SRC_BASE}/sys KMK_FLAGS= HostDrivers-scripts vboxdrv-src VBoxNetFlt-src VBoxNetAdp-src .if ${PORT_OPTIONS:MDEBUG} KMK_FLAGS+= BUILD_TYPE=debug KMK_BUILDTYPE= debug EXTRA_PATCHES+= ${PATCHDIR}/extrapatch-Config.kmk \ ${PATCHDIR}/extrapatch-src-VBox-HostDrivers-Support-freebsd-Makefile MAKE_ARGS+= DEBUG_FLAGS="-O1 -g" .endif .if ${ARCH} == i386 KMK_ARCH= freebsd.x86 .else KMK_ARCH= freebsd.${ARCH} .endif .include SYMBOLSUFFIX= debug PLIST_SUB+= SYMBOLSUFFIX=${SYMBOLSUFFIX} post-patch: @${ECHO_CMD} 'VBOX_WITH_VBOXDRV = 1' > ${WRKSRC}/LocalConfig.kmk @${ECHO_CMD} 'VBOX_WITH_NETFLT = 1' >> ${WRKSRC}/LocalConfig.kmk @${ECHO_CMD} 'VBOX_WITH_NETADP = 1' >> ${WRKSRC}/LocalConfig.kmk @${ECHO_CMD} 'VBOX_WITH_ADDITIONS =' >> ${WRKSRC}/LocalConfig.kmk .if ${PORT_OPTIONS:MVIMAGE} @${ECHO_CMD} 'VBOX_WITH_NETFLT_VIMAGE = 1' >> ${WRKSRC}/LocalConfig.kmk .endif @${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g' \ ${WRKSRC}/Config.kmk ${WRKSRC}/configure @${REINPLACE_CMD} \ -e 's|\$$KBUILDDIR_BIN/kmk_sed|${LOCALBASE}/bin/kmk_sed|g' \ ${WRKSRC}/configure pre-build: cd ${WRKSRC}/src/VBox/HostDrivers && ${SH} -c \ '. ${WRKSRC}/env.sh && ${KMK_CONFIG} ${LOCALBASE}/bin/kmk ${KMK_FLAGS}' do-install: ${MKDIR} ${STAGEDIR}${KMODDIR} .for i in ${VBOX_KMODS} ${INSTALL_KLD} ${VBOX_BIN}/${i}/${i}.ko ${STAGEDIR}${KMODDIR} .if ${PORT_OPTIONS:MDEBUG} ${INSTALL_KLD} ${VBOX_BIN}/${i}/${i}.ko.${SYMBOLSUFFIX} ${STAGEDIR}${KMODDIR} .endif .endfor .include diff --git a/emulators/virtualbox-ose-kmod/distinfo b/emulators/virtualbox-ose-kmod/distinfo index fd36c0cc9df7..248bf5a683be 100644 --- a/emulators/virtualbox-ose-kmod/distinfo +++ b/emulators/virtualbox-ose-kmod/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1613865409 -SHA256 (VirtualBox-6.1.18.tar.bz2) = 108d42b9b391b7a332a33df1662cf7b0e9d9a80f3079d16288d8b9487f427d40 -SIZE (VirtualBox-6.1.18.tar.bz2) = 165507486 +TIMESTAMP = 1619010563 +SHA256 (VirtualBox-6.1.20.tar.bz2) = e690c91974a2e7a5aca2c0939ad514382f9a2136797a5e0b96aab778e42bc8a7 +SIZE (VirtualBox-6.1.20.tar.bz2) = 165569564 diff --git a/emulators/virtualbox-ose/Makefile b/emulators/virtualbox-ose/Makefile index 30fd87793412..58147713719e 100644 --- a/emulators/virtualbox-ose/Makefile +++ b/emulators/virtualbox-ose/Makefile @@ -1,427 +1,427 @@ # Created by: Bernhard Froehlich PORTNAME= virtualbox-ose -PORTVERSION= 6.1.18 +PORTVERSION= 6.1.20 CATEGORIES= emulators MASTER_SITES= https://download.virtualbox.org/virtualbox/${PORTVERSION}/ DISTFILES= VirtualBox-${PORTVERSION}${EXTRACT_SUFX} ${GUESTADDITIONS} EXTRACT_ONLY= VirtualBox-${PORTVERSION}${EXTRACT_SUFX} MAINTAINER= vbox@FreeBSD.org COMMENT= General-purpose full virtualizer for x86 hardware LICENSE= GPLv2 LICENSE_FILE= ${WRKSRC}/COPYING BUILD_DEPENDS= yasm:devel/yasm \ xsltproc:textproc/libxslt \ kmk:devel/kBuild \ gtar:archivers/gtar LIB_DEPENDS= libpng.so:graphics/png \ libxslt.so:textproc/libxslt \ libcurl.so:ftp/curl RUN_DEPENDS= ${LOCALBASE}/etc/rc.d/vboxnet:emulators/virtualbox-ose-kmod CPE_VENDOR= oracle CPE_PRODUCT= vm_virtualbox WRKSRC= ${WRKDIR}/VirtualBox-${PORTVERSION} ONLY_FOR_ARCHS= amd64 USES= compiler:c++14-lang cpe gnome iconv pkgconfig ssl tar:bzip2 USE_GNOME= libidl libxml2 HAS_CONFIGURE= yes CONFIGURE_ARGS= --disable-java --passive-mesa CONFIGURE_ARGS+= --with-gcc="${CC}" --with-g++="${CXX}" CONFLICTS_INSTALL= virtualbox-ose-additions-* \ virtualbox-ose-devel-[0-9]* \ virtualbox-ose-legacy-[0-9]* \ virtualbox-ose-lite-[0-9]* VBOXUSER?= vboxusers VBOXWSUSER?= vboxusers VBOXGROUP?= vboxusers USERS= ${VBOXUSER} GROUPS= ${VBOXGROUP} VBOX_DIR= ${PREFIX}/${VBOX_DIR_REL} VBOX_DIR_REL= lib/virtualbox VBOX_LINKS= VBoxVRDP VBOX_PROGS= VBoxAutostart VBoxBalloonCtrl VBoxBugReport VBoxHeadless \ VBoxManage VBOX_UTILS= VBoxExtPackHelperApp VBoxNetAdpCtl VBoxNetDHCP VBoxNetNAT \ VBoxSVC VBoxXPCOMIPCD OPTIONS_DEFINE= AIO ALSA DBUS DEBUG GUESTADDITIONS MANUAL NLS OPUS PULSEAUDIO \ PYTHON QT5 R0LOGGING UDPTUNNEL VDE VNC WEBSERVICE VPX X11 OPTIONS_DEFAULT= AIO DBUS QT5 UDPTUNNEL VNC WEBSERVICE X11 OPTIONS_SUB= yes AIO_DESC= Enable Asyncronous IO support (check pkg-message) DEBUG_DESC= Debug symbols, additional logs and assertions GUESTADDITIONS_DESC= Build with Guest Additions MANUAL_DESC= Build with user manual NLS_DESC= Native language support (requires QT5) OPUS_DESC= Use libvpx for audio recording (requires VPX) QT5_DESC= Build with QT5 frontend (requires X11) R0LOGGING_DESC= Enable R0 logging (requires DEBUG) UDPTUNNEL_DESC= Build with UDP tunnel support VDE_DESC= Build with VDE support VNC_DESC= Build with VNC support VPX_DESC= Use libvpx for video recording WEBSERVICE_DESC= Build Webservice ALSA_CONFIGURE_OFF= --disable-alsa ALSA_LIB_DEPENDS= libasound.so:audio/alsa-lib DBUS_CONFIGURE_OFF= --disable-dbus DBUS_LIB_DEPENDS= libdbus-1.so:devel/dbus DEBUG_CONFIGURE_ON= --build-debug MANUAL_BUILD_DEPENDS= ${LOCALBASE}/share/xml/docbook/4.4/docbookx.dtd:textproc/docbook-xml MANUAL_CONFIGURE_OFF= --disable-docs NLS_IMPLIES= QT5 OPUS_CONFIGURE_OFF= --disable-libopus OPUS_LIB_DEPENDS= libopus.so:audio/opus OPUS_IMPLIES= VPX PULSEAUDIO_CONFIGURE_OFF= --disable-pulse PULSEAUDIO_LIB_DEPENDS= libpulse.so:audio/pulseaudio PYTHON_CONFIGURE_OFF= --disable-python QT5_IMPLIES= X11 R0LOGGING_IMPLIES= DEBUG UDPTUNNEL_CONFIGURE_OFF= --disable-udptunnel VDE_CONFIGURE_ON= --enable-vde VDE_RUN_DEPENDS= vde_switch:net/vde2 VNC_CONFIGURE_ON= --enable-vnc VNC_LIB_DEPENDS= libvncserver.so:net/libvncserver VPX_CONFIGURE_OFF= --disable-libvpx VPX_LIB_DEPENDS= libvpx.so:multimedia/libvpx X11_CONFIGURE_OFF= --build-headless ENV= .export ENV PLIST_SUB= GUEST_VER=${PORTVERSION} \ PYTHON_VERU=${PYTHON_VER:S/./_/}${PYTHON_ABIVER} \ VBOXGROUP=${VBOXGROUP} SUB_LIST= VBOXDIR=${VBOX_DIR} \ VBOXGROUP=${VBOXGROUP} \ VBOXUSER=${VBOXUSER} \ VBOXWSUSER=${VBOXWSUSER} USE_RC_SUBR= vboxheadless vboxwatchdog .include .if ${SLAVE_PORT} == no CONFLICTS_INSTALL+= virtualbox-ose-nox11-[0-9]* OPTIONS_DEFAULT+= PYTHON .else CONFLICTS_INSTALL+= virtualbox-ose-[0-9]* .endif .if ${ARCH} == "amd64" _ELF32!= kldstat -q -m elf32 && echo yes || echo no .endif .if ${PORT_OPTIONS:MDEBUG} KMK_BUILDTYPE= debug KMK_FLAGS+= BUILD_TYPE=debug WITH_DEBUG= yes .else KMK_BUILDTYPE= release .endif .if ${PORT_OPTIONS:MGUESTADDITIONS} GUESTADDITIONS= VBoxGuestAdditions_${PORTVERSION}.iso RESTRICTED= for personal use only RESTRICTED_FILES= ${GUESTADDITIONS} .endif .if ${PORT_OPTIONS:MMANUAL} DBKXMLDIR= ${LOCALBASE}/share/xml/docbook/4.4 DBKXSLDIR= ${LOCALBASE}/share/xsl/docbook USE_TEX= dvipsk:build formats:build .endif .if ${PORT_OPTIONS:MPYTHON} USES+= python USE_PYTHON= distutils noegginfo noflavors PYDISTUTILS_PKGNAME= vboxapi PYDISTUTILS_PKGVERSION= 1.0 .else USES+= python:build .endif .if ${PORT_OPTIONS:MQT5} CONFIGURE_ARGS+= --enable-qt5 PLIST_SUB+= QT="" USES+= gl qmake:no_env qt:5 xorg USE_GL= gl glu USE_QT= buildtools_build core dbus gui linguisttools_build opengl USE_QT+= printsupport widgets x11extras USE_XORG= xcb INSTALLS_ICONS= yes VBOX_PROGS+= VirtualBox VirtualBoxVM VBOX_UTILS+= VBoxTestOGL VBOX_WITH_QT= 1 .else CONFIGURE_ARGS+= --disable-qt PLIST_SUB+= QT="@comment " .endif .if ${PORT_OPTIONS:MWEBSERVICE} BUILD_DEPENDS+= soapcpp2:devel/gsoap USE_RC_SUBR+= vboxwebsrv VBOX_LINKS+= vboxwebsrv VBOX_UTILS+= vboxwebsrv webtest .endif .if ${PORT_OPTIONS:MX11} USES+= sdl xorg USE_SDL= sdl USE_XORG+= xorgproto x11 xcursor xext xinerama xmu xt VBOX_PROGS+= VBoxSDL .endif .if ${PORT_OPTIONS:MPYTHON} || ${PORT_OPTIONS:MWEBSERVICE} PLIST_SUB+= SDK="" .else PLIST_SUB+= SDK="@comment " .endif .if ${ARCH} == i386 KMK_ARCH= freebsd.x86 PLIST_SUB+= I386="" .else KMK_ARCH= freebsd.${ARCH} PLIST_SUB+= I386="@comment " .endif PLIST_SUB+= ARCH="${KMK_ARCH}" KMK_BUILDDIR= ${WRKSRC}/out/${KMK_ARCH}/${KMK_BUILDTYPE} KMK_CONFIG= VBOX_LIBPATH_X11=${LOCALBASE} VBOX_FREEBSD_SRC=${SRC_BASE}/sys KMK_FLAGS+= -j${MAKE_JOBS_NUMBER} .include .if ${CHOSEN_COMPILER_TYPE} == clang # llvm10 in FreeBSD before r364284 miscompiles virtualbox 6.1 causing errors. # force llvm11 from ports .if ${OPSYS} == FreeBSD && ${OSVERSION} < 1300109 BUILD_DEPENDS+= clang11:devel/llvm${VBOX_LLVM_VER} CC= ${LOCALBASE}/bin/clang${VBOX_LLVM_VER} CXX= ${LOCALBASE}/bin/clang++${VBOX_LLVM_VER} VBOX_LLVM_VER?= 11 .endif PATCH_DEPENDS+= ${LOCALBASE}/share/kBuild/tools/GXX3.kmk:devel/kBuild EXTRA_PATCHES+= ${PATCHDIR}/extrapatch-src-VBox-Devices-PC-ipxe-Makefile.kmk .endif .if ${PYTHON_MAJOR_VER} >= 3 PLIST_SUB+= PYTHON_PYCDIR=/__pycache__/ \ PYTHON_PYCEXT=.cpython-${PYTHON_SUFFIX}.pyc .else PLIST_SUB+= PYTHON_PYCDIR=/ \ PYTHON_PYCEXT=.pyc .endif .if ${SSL_DEFAULT} != base CONFIGURE_ARGS+= --with-openssl-dir="${OPENSSLBASE}" .endif pre-everything:: .if ${ARCH} == "amd64" .if ${_ELF32} != yes @${ECHO_MSG} 'Requires 32-bit runtime support in kernel.' @${ECHO_MSG} 'Rebuild kernel with "options COMPAT_FREEBSD32" and reboot.' @${FALSE} .elif !exists(/usr/lib32/libc.so) @${ECHO_MSG} 'Requires 32-bit libraries installed under /usr/lib32.' @${ECHO_MSG} 'Do: cd /usr/src; make build32 install32; service ldconfig restart' @${FALSE} .endif .endif post-patch: @${ECHO_CMD} 'VBOX_PATH_APP_PRIVATE_ARCH = ${VBOX_DIR}' > \ ${WRKSRC}/LocalConfig.kmk @${ECHO_CMD} 'VBOX_PATH_DOCBOOK = ${DBKXSLDIR}' >> \ ${WRKSRC}/LocalConfig.kmk @${ECHO_CMD} 'VBOX_PATH_DOCBOOK_DTD = ${DBKXMLDIR}' >> \ ${WRKSRC}/LocalConfig.kmk @${ECHO_CMD} 'VBOX_PATH_SHARED_LIBS = ${VBOX_DIR}' >> \ ${WRKSRC}/LocalConfig.kmk # Please keep this even if using Clang to avoid repeated regressions. # PR 245048 @${ECHO_CMD} "VBOX_WITH_RUNPATH = ${_GCC_RUNTIME:D${_GCC_RUNTIME}\:}${VBOX_DIR}" >> \ ${WRKSRC}/LocalConfig.kmk @${ECHO_CMD} 'VBOX_PATH_APP_PRIVATE = ${DATADIR}' >> \ ${WRKSRC}/LocalConfig.kmk @${ECHO_CMD} 'VBOX_PATH_APP_DOCS = ${DOCSDIR}' >> ${WRKSRC}/LocalConfig.kmk .if ${SSL_DEFAULT} != base @${ECHO_CMD} 'VBOX_WITH_ALT_HASH_CODE = 1' >> ${WRKSRC}/LocalConfig.kmk .endif @${ECHO_CMD} 'VBOX_WITH_EXTPACK_VBOXDTRACE =' >> ${WRKSRC}/LocalConfig.kmk @${ECHO_CMD} 'VBOX_WITH_INSTALLER = 1' >> ${WRKSRC}/LocalConfig.kmk @${ECHO_CMD} 'VBOX_WITH_VBOXDRV =' >> ${WRKSRC}/LocalConfig.kmk @${ECHO_CMD} 'VBOX_WITH_TESTCASES =' >> ${WRKSRC}/LocalConfig.kmk @${ECHO_CMD} 'SDK_VBOX_LIBPNG_INCS = ${PREFIX}/include/libpng' >> \ ${WRKSRC}/LocalConfig.kmk @${ECHO_CMD} 'SDK_VBOX_LIBPNG_LIBS = png' >> ${WRKSRC}/LocalConfig.kmk @${ECHO_CMD} 'VBOX_WITH_ADDITIONS =' >> ${WRKSRC}/LocalConfig.kmk @${ECHO_CMD} 'VBOX_WITH_DRAG_AND_DROP = ${VBOX_WITH_QT}' >> \ ${WRKSRC}/LocalConfig.kmk @${ECHO_CMD} 'VBOX_WITH_DRAG_AND_DROP_GH = ${VBOX_WITH_QT}' >> \ ${WRKSRC}/LocalConfig.kmk @${ECHO_CMD} 'VBOX_WITH_VALIDATIONKIT =' >> ${WRKSRC}/LocalConfig.kmk @${ECHO_CMD} 'VBOX_WITH_X11_ADDITIONS =' >> ${WRKSRC}/LocalConfig.kmk .if ${PORT_OPTIONS:MR0LOGGING} @${ECHO_CMD} 'VBOX_WITH_R0_LOGGING = 1' >> ${WRKSRC}/LocalConfig.kmk .endif .if ${PORT_OPTIONS:MWEBSERVICE} @${ECHO_CMD} 'VBOX_WITH_WEBSERVICES = 1' >> ${WRKSRC}/LocalConfig.kmk @${ECHO_CMD} 'VBOX_GSOAP_INSTALLED = 1' >> ${WRKSRC}/LocalConfig.kmk @${ECHO_CMD} 'VBOX_PATH_GSOAP = ${PREFIX}/lib/gsoap' >> \ ${WRKSRC}/LocalConfig.kmk @${ECHO_CMD} 'VBOX_PATH_GSOAP_BIN = ${PREFIX}/bin' >> \ ${WRKSRC}/LocalConfig.kmk @${ECHO_CMD} 'VBOX_PATH_GSOAP_IMPORT = ${PREFIX}/share/gsoap/import' >> \ ${WRKSRC}/LocalConfig.kmk @${ECHO_CMD} 'VBOX_GCC_PEDANTIC_CXX = -Wshadow $$(VBOX_GCC_WARN) -Wno-long-long' >> \ ${WRKSRC}/LocalConfig.kmk .endif .if empty(PORT_OPTIONS:MX11) @${ECHO} 'VBOX_WITH_VMSVGA3D =' >> ${WRKSRC}/LocalConfig.kmk .endif .if ${CHOSEN_COMPILER_TYPE} == clang @${REINPLACE_CMD} -e 's| -finline-limit=8000||' \ -e 's| -mpreferred-stack-boundary=2||' ${WRKSRC}/Config.kmk @${REINPLACE_CMD} -e 's| -fpermissive||' ${WRKSRC}/Config.kmk \ ${WRKSRC}/src/VBox/Main/webservice/Makefile.kmk @${ECHO_CMD} 'TOOL_VBoxGccFreeBSD_LD = ${CXX}' >> ${WRKSRC}/LocalConfig.kmk @${SED} -e 's|GXX3|VBoxGccFreeBSD|g' \ ${LOCALBASE}/share/kBuild/tools/GXX3.kmk > \ ${WRKSRC}/tools/kBuildTools/VBoxGccFreeBSD.kmk .endif @${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g' \ ${WRKSRC}/Config.kmk ${WRKSRC}/configure \ ${WRKSRC}/kBuild/header.kmk ${WRKSRC}/kBuild/units/qt4.kmk \ ${WRKSRC}/kBuild/units/qt5.kmk ${WRKSRC}/kBuild/sdks/LIBSDL.kmk \ ${WRKSRC}/src/libs/xpcom18a4/python/gen_python_deps.py @${REINPLACE_CMD} \ -e 's|\$$KBUILDDIR_BIN/kmk_sed|${LOCALBASE}/bin/kmk_sed|g' \ -e 's|SUPPYTHONLIBS=.*|SUPPYTHONLIBS="${PYTHON_VERSION}${PYTHON_ABIVER}"|' \ ${WRKSRC}/configure .if empty(ICONV_LIB) @${REINPLACE_CMD} -e 's|iconv||' ${WRKSRC}/Config.kmk \ ${WRKSRC}/src/VBox/Runtime/Makefile.kmk @${ECHO_CMD} 'VBOX_ICONV_DEFS = LIBICONV_PLUG' >> ${WRKSRC}/LocalConfig.kmk .endif @${REINPLACE_CMD} -e 's|/usr/local/lib/virtualbox|${VBOX_DIR}|' \ -e 's|/usr/local|${PREFIX}|' \ ${WRKSRC}/src/VBox/Installer/freebsd/VBox.sh @${REINPLACE_CMD} \ -e 's|^versions =.*|versions = ["${PYTHON_VER}${PYTHON_ABIVER}"]|' \ ${WRKSRC}/src/libs/xpcom18a4/python/gen_python_deps.py post-patch-AIO-off: @${REINPLACE_CMD} 's|r3/freebsd/fileaio-freebsd.cpp|r3/posix/fileaio-posix.cpp|' \ ${WRKSRC}/src/VBox/Runtime/Makefile.kmk do-build: cd ${WRKSRC} && ${SH} -c '. ${WRKSRC}/env.sh && \ ${KMK_CONFIG} ${LOCALBASE}/bin/kmk ${KMK_FLAGS}' .if ${PORT_OPTIONS:MPYTHON} ${PYTHON_CMD} -mcompileall \ ${KMK_BUILDDIR}/bin/sdk/bindings/xpcom/python/xpcom .endif do-install: .if ${PORT_OPTIONS:MPYTHON} || ${PORT_OPTIONS:MWEBSERVICE} ${MKDIR} ${STAGEDIR}${DATADIR}/sdk .endif cd ${KMK_BUILDDIR}/bin/sdk/bindings/xpcom && \ ${COPYTREE_SHARE} "idl samples" ${STAGEDIR}${DATADIR} ${MKDIR} ${STAGEDIR}${PREFIX}/include/virtualbox cd ${KMK_BUILDDIR}/bin/sdk/bindings/xpcom/include && \ ${COPYTREE_SHARE} "*" ${STAGEDIR}${PREFIX}/include/virtualbox ${MKDIR} ${STAGEDIR}${VBOX_DIR} cd ${KMK_BUILDDIR}/bin && ${COPYTREE_SHARE} \ "*.fd *.r0 *.so components" ${STAGEDIR}${VBOX_DIR} .if ${PORT_OPTIONS:MPYTHON} || ${PORT_OPTIONS:MWEBSERVICE} ${RLN} ${STAGEDIR}${DATADIR}/sdk ${STAGEDIR}${VBOX_DIR} .endif ${INSTALL_SCRIPT} ${WRKSRC}/src/VBox/Installer/freebsd/VBox.sh \ ${STAGEDIR}${VBOX_DIR} .for f in ${VBOX_PROGS} ${VBOX_UTILS} ${INSTALL_PROGRAM} ${KMK_BUILDDIR}/bin/${f} ${STAGEDIR}${VBOX_DIR} .endfor .for f in ${VBOX_PROGS} ${VBOX_LINKS} ${LN} -fs ../${VBOX_DIR_REL}/VBox.sh ${STAGEDIR}${PREFIX}/bin/${f} .endfor .for f in ${VBOX_PROGS} ${LN} -fs ../${VBOX_DIR_REL}/VBox.sh ${STAGEDIR}${PREFIX}/bin/${f:tl} .endfor .if ${PORT_OPTIONS:MGUESTADDITIONS} ${MKDIR} ${STAGEDIR}${VBOX_DIR}/additions ${INSTALL_DATA} ${DISTDIR}/${GUESTADDITIONS} \ ${STAGEDIR}${VBOX_DIR}/additions/ ${RLN} ${STAGEDIR}${VBOX_DIR}/additions/${GUESTADDITIONS} \ ${STAGEDIR}${VBOX_DIR}/additions/VBoxGuestAdditions.iso .endif .if ${PORT_OPTIONS:MMANUAL} ${MKDIR} ${STAGEDIR}${DOCSDIR} ${INSTALL_DATA} ${KMK_BUILDDIR}/bin/UserManual*.pdf \ ${STAGEDIR}${DOCSDIR} .endif .if ${PORT_OPTIONS:MNLS} cd ${KMK_BUILDDIR}/obj/VirtualBox/qtnls && \ ${COPYTREE_SHARE} "*.qm" ${STAGEDIR}${DATADIR}/nls .endif .if ${PORT_OPTIONS:MPYTHON} cd ${KMK_BUILDDIR}/bin/sdk/installer && \ ${SETENV} VBOX_INSTALL_PATH="${VBOX_DIR}" \ ${PYTHON_CMD} vboxapisetup.py install --root=${STAGEDIR} @${MKDIR} ${STAGEDIR}${PYTHON_SITELIBDIR}/xpcom cd ${KMK_BUILDDIR}/bin/sdk/bindings/xpcom/python/xpcom && \ ${COPYTREE_SHARE} "*" ${STAGEDIR}${PYTHON_SITELIBDIR}/xpcom @${MKDIR} ${STAGEDIR}${DATADIR}/sdk/bindings/xpcom/python ${RLN} ${STAGEDIR}${PYTHON_SITELIBDIR}/xpcom \ ${STAGEDIR}${DATADIR}/sdk/bindings/xpcom/python .endif .if ${PORT_OPTIONS:MQT5} ${INSTALL_DATA} \ ${WRKSRC}/src/VBox/Frontends/VirtualBox/images/OSE/VirtualBox_48px.png \ ${STAGEDIR}${PREFIX}/share/pixmaps/VBox.png ${INSTALL_DATA} \ ${WRKSRC}/src/VBox/Installer/freebsd/virtualbox.desktop \ ${STAGEDIR}${PREFIX}/share/applications/virtualbox.desktop .endif .if ${PORT_OPTIONS:MVNC} ${MKDIR} ${STAGEDIR}${VBOX_DIR}/ExtensionPacks/VNC/${KMK_ARCH} ${INSTALL_DATA} ${KMK_BUILDDIR}/bin/ExtensionPacks/VNC/ExtPack* \ ${STAGEDIR}${VBOX_DIR}/ExtensionPacks/VNC/ ${INSTALL_LIB} ${KMK_BUILDDIR}/bin/ExtensionPacks/VNC/${KMK_ARCH}/* \ ${STAGEDIR}${VBOX_DIR}/ExtensionPacks/VNC/${KMK_ARCH}/ .endif .if ${PORT_OPTIONS:MWEBSERVICE} ${MKDIR} ${STAGEDIR}${DATADIR}/sdk/bindings/webservice ${INSTALL_DATA} ${KMK_BUILDDIR}/obj/webservice/vboxweb.wsdl \ ${STAGEDIR}${DATADIR}/sdk/bindings/webservice/ .endif post-install: ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/virtualbox/*.so \ ${STAGEDIR}${PREFIX}/lib/virtualbox/components/*.so .include diff --git a/emulators/virtualbox-ose/distinfo b/emulators/virtualbox-ose/distinfo index 966401a69196..2cb40a75f2d9 100644 --- a/emulators/virtualbox-ose/distinfo +++ b/emulators/virtualbox-ose/distinfo @@ -1,5 +1,5 @@ -TIMESTAMP = 1613863264 -SHA256 (VirtualBox-6.1.18.tar.bz2) = 108d42b9b391b7a332a33df1662cf7b0e9d9a80f3079d16288d8b9487f427d40 -SIZE (VirtualBox-6.1.18.tar.bz2) = 165507486 -SHA256 (VBoxGuestAdditions_6.1.18.iso) = 904432eb331d7ae517afaa4e4304e6492b7947b46ecb8267de7ef792c4921b4c -SIZE (VBoxGuestAdditions_6.1.18.iso) = 61157376 +TIMESTAMP = 1619010563 +SHA256 (VirtualBox-6.1.20.tar.bz2) = e690c91974a2e7a5aca2c0939ad514382f9a2136797a5e0b96aab778e42bc8a7 +SIZE (VirtualBox-6.1.20.tar.bz2) = 165569564 +SHA256 (VBoxGuestAdditions_6.1.20.iso) = 65d22a9f1fcf690d77be99d549149ec9129e2a728ddd9202df436ed9593ba520 +SIZE (VBoxGuestAdditions_6.1.20.iso) = 61018112 diff --git a/emulators/virtualbox-ose/files/patch-include-iprt-x86.h b/emulators/virtualbox-ose/files/patch-include-iprt-x86.h index 9a66249e045e..ca73a306df88 100644 --- a/emulators/virtualbox-ose/files/patch-include-iprt-x86.h +++ b/emulators/virtualbox-ose/files/patch-include-iprt-x86.h @@ -1,19 +1,19 @@ ---- include/iprt/x86.h.orig 2021-01-07 15:31:34 UTC +--- include/iprt/x86.h.orig 2021-04-20 04:22:23 UTC +++ include/iprt/x86.h @@ -38,6 +38,16 @@ # pragma D depends_on library vbox-types.d #endif +/* Workaround for FreeBSD machine/specialreg.h defining MSRs */ +#ifdef RT_OS_FREEBSD +# undef MSR_P5_MC_ADDR +# undef MSR_P5_MC_TYPE +# undef MSR_IA32_PLATFORM_ID +# undef MSR_BBL_CR_CTL3 +# undef MSR_IA32_MISC_ENABLE +# undef MSR_IA32_FEATURE_CONTROL +#endif + - /* Workaround for Solaris sys/regset.h defining CS, DS */ + /** Workaround for Solaris sys/regset.h defining CS, DS and sys/controlregs.h + * defining MSR_IA32_FLUSH_CMD */ #ifdef RT_OS_SOLARIS - # undef CS diff --git a/emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vfsops.c b/emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vfsops.c index 5d21a89925de..f496e3367647 100644 --- a/emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vfsops.c +++ b/emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vfsops.c @@ -1,644 +1,640 @@ ---- src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vfsops.c.orig 2021-01-07 15:34:22 UTC +--- src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vfsops.c.orig 2021-04-20 04:24:19 UTC +++ src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vfsops.c @@ -1,8 +1,3 @@ -/* $Id: vboxvfs_vfsops.c $ */ -/** @file - * Description. - */ - /* * Copyright (C) 2008-2020 Oracle Corporation * -@@ -14,245 +9,478 @@ +@@ -14,245 +9,474 @@ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. */ - -#include "vboxvfs.h" +#include #include #include #include #include #include +#include +#include #include #include #include #include +#include +#include +#include #include #include #include +#include -#include +#include +#include +#include "vboxvfs.h" + #define VFSMP2SFGLOBINFO(mp) ((struct sf_glob_info *)mp->mnt_data) -static int vboxvfs_version = VBOXVFS_VERSION; +#ifdef MALLOC_DECLARE +MALLOC_DEFINE(M_VBOXVFS, "vboxvfs", "VBOX VFS"); +#endif -SYSCTL_NODE(_vfs, OID_AUTO, vboxvfs, CTLFLAG_RW, 0, "VirtualBox shared filesystem"); -SYSCTL_INT(_vfs_vboxvfs, OID_AUTO, version, CTLFLAG_RD, &vboxvfs_version, 0, ""); +static sfp_connection_t *sfprov = NULL; -/* global connection to the host service. */ -static VBGLSFCLIENT g_vboxSFClient; +static int vboxfs_version = VBOXVFS_VERSION; +u_int vboxvfs_debug = 1; -static vfs_init_t vboxvfs_init; -static vfs_uninit_t vboxvfs_uninit; -static vfs_cmount_t vboxvfs_cmount; -static vfs_mount_t vboxvfs_mount; -static vfs_root_t vboxvfs_root; -static vfs_quotactl_t vboxvfs_quotactl; -static vfs_statfs_t vboxvfs_statfs; -static vfs_unmount_t vboxvfs_unmount; +SYSCTL_NODE(_vfs, OID_AUTO, vboxfs, CTLFLAG_RW, 0, "VirtualBox shared filesystem"); +SYSCTL_INT(_vfs_vboxfs, OID_AUTO, version, CTLFLAG_RD, &vboxfs_version, 0, ""); +SYSCTL_UINT(_vfs_vboxfs, OID_AUTO, debug, CTLFLAG_RW, &vboxvfs_debug, 0, "Debug level"); -static struct vfsops vboxvfs_vfsops = { - .vfs_init = vboxvfs_init, - .vfs_cmount = vboxvfs_cmount, - .vfs_mount = vboxvfs_mount, - .vfs_quotactl = vboxvfs_quotactl, - .vfs_root = vboxvfs_root, - .vfs_statfs = vboxvfs_statfs, - .vfs_sync = vfs_stdsync, - .vfs_uninit = vboxvfs_uninit, - .vfs_unmount = vboxvfs_unmount, +static vfs_init_t vboxfs_init; +static vfs_uninit_t vboxfs_uninit; +static vfs_cmount_t vboxfs_cmount; +static vfs_mount_t vboxfs_mount; +static vfs_root_t vboxfs_root; +static vfs_quotactl_t vboxfs_quotactl; +static vfs_statfs_t vboxfs_statfs; +static vfs_unmount_t vboxfs_unmount; + +static struct vfsops vboxfs_vfsops = { + .vfs_init = vboxfs_init, + .vfs_cmount = vboxfs_cmount, + .vfs_mount = vboxfs_mount, + .vfs_quotactl = vboxfs_quotactl, + .vfs_root = vboxfs_root, + .vfs_statfs = vboxfs_statfs, + .vfs_sync = vfs_stdsync, + .vfs_uninit = vboxfs_uninit, + .vfs_unmount = vboxfs_unmount }; -VFS_SET(vboxvfs_vfsops, vboxvfs, VFCF_NETWORK); +VFS_SET(vboxfs_vfsops, vboxvfs, VFCF_NETWORK); MODULE_DEPEND(vboxvfs, vboxguest, 1, 1, 1); -static int vboxvfs_cmount(struct mntarg *ma, void * data, int flags, struct thread *td) +/* + * Allocates a new node of type 'type' inside the 'tmp' mount point, with + * its owner set to 'uid', its group to 'gid' and its mode set to 'mode', + * using the credentials of the process 'p'. + * + * If the node type is set to 'VDIR', then the parent parameter must point + * to the parent directory of the node being created. It may only be NULL + * while allocating the root node. + * + * If the node type is set to 'VBLK' or 'VCHR', then the rdev parameter + * specifies the device the node represents. + * + * If the node type is set to 'VLNK', then the parameter target specifies + * the file name of the target file for the symbolic link that is being + * created. + * + * Note that new nodes are retrieved from the available list if it has + * items or, if it is empty, from the node pool as long as there is enough + * space to create them. + * + * Returns zero on success or an appropriate error code on failure. + */ +int +vboxfs_alloc_node(struct mount *mp, struct vboxfs_mnt *vsfmp, const char *fullpath, + enum vtype type, uid_t uid, gid_t gid, mode_t mode, struct vboxfs_node *parent, + struct vboxfs_node **node) { - struct vboxvfs_mount_info args; - int rc = 0; + struct vboxfs_node *nnode; - printf("%s: Enter\n", __FUNCTION__); + if ((mp->mnt_kern_flag & MNTK_UNMOUNT) != 0) { + /* + * When a new tmpfs node is created for fully + * constructed mount point, there must be a parent + * node, which vnode is locked exclusively. As + * consequence, if the unmount is executing in + * parallel, vflush() cannot reclaim the parent vnode. + * Due to this, the check for MNTK_UNMOUNT flag is not + * racy: if we did not see MNTK_UNMOUNT flag, then tmp + * cannot be destroyed until node construction is + * finished and the parent vnode unlocked. + * + * Tmpfs does not need to instantiate new nodes during + * unmount. + */ + return (EBUSY); + } - rc = copyin(data, &args, sizeof(struct vboxvfs_mount_info)); - if (rc) - return rc; + nnode = (struct vboxfs_node *)uma_zalloc_arg( + vsfmp->sf_node_pool, vsfmp, M_WAITOK); - ma = mount_argf(ma, "uid", "%d", args.uid); - ma = mount_argf(ma, "gid", "%d", args.gid); - ma = mount_arg(ma, "from", args.name, -1); + /* Generic initialization. */ + nnode->sf_type = type; + nnode->sf_ino = vsfmp->sf_ino++; + nnode->sf_path = strdup(fullpath, M_VBOXVFS); + nnode->sf_parent = parent; + nnode->vboxfsmp = vsfmp; - rc = kernel_mount(ma, flags); + /* Type-specific initialization. */ + switch (nnode->sf_type) { + case VBLK: + case VCHR: + case VDIR: + case VFIFO: + case VSOCK: + case VLNK: + case VREG: + break; - printf("%s: Leave rc=%d\n", __FUNCTION__, rc); + default: + panic("vboxfs_alloc_node: type %p %d", nnode, (int)nnode->sf_type); + } - return rc; + *node = nnode; + return 0; } -static const char *vboxvfs_opts[] = { - "uid", "gid", "from", "fstype", "fspath", "errmsg", NULL -}; - -static int vboxvfs_mount(struct mount *mp, struct thread *td) +void +vboxfs_free_node(struct vboxfs_mnt *vboxfs, struct vboxfs_node *node) { - int rc; - char *pszShare; - int cbShare, cbOption; - int uid = 0, gid = 0; - struct sf_glob_info *pShFlGlobalInfo; - SHFLSTRING *pShFlShareName = NULL; - int cbShFlShareName; - printf("%s: Enter\n", __FUNCTION__); +#ifdef INVARIANTS + TMPFS_NODE_LOCK(node); + MPASS(node->sf_vnode == NULL); + MPASS((node->sf_vpstate & TMPFS_VNODE_ALLOCATING) == 0); + TMPFS_NODE_UNLOCK(node); +#endif + if (node->sf_path) + free(node->sf_path, M_VBOXVFS); - if (mp->mnt_flag & (MNT_UPDATE | MNT_ROOTFS)) - return EOPNOTSUPP; + uma_zfree(vboxfs->sf_node_pool, node); +} - if (vfs_filteropt(mp->mnt_optnew, vboxvfs_opts)) - { - vfs_mount_error(mp, "%s", "Invalid option"); - return EINVAL; - } +static int +vboxfs_cmount(struct mntarg *ma, void *data, uint64_t flags) +{ + struct vboxfs_mount_info args; + int error = 0; - rc = vfs_getopt(mp->mnt_optnew, "from", (void **)&pszShare, &cbShare); - if (rc || pszShare[cbShare-1] != '\0' || cbShare > 0xfffe) - return EINVAL; + if (data == NULL) + return (EINVAL); + error = copyin(data, &args, sizeof(struct vboxfs_mount_info)); + if (error) + return (error); - rc = vfs_getopt(mp->mnt_optnew, "gid", (void **)&gid, &cbOption); - if ((rc != ENOENT) && (rc || cbOption != sizeof(gid))) - return EINVAL; + ma = mount_argf(ma, "uid", "%d", args.uid); + ma = mount_argf(ma, "gid", "%d", args.gid); + ma = mount_argf(ma, "file_mode", "%d", args.fmode); + ma = mount_argf(ma, "dir_mode", "%d", args.dmode); + ma = mount_arg(ma, "from", args.name, -1); - rc = vfs_getopt(mp->mnt_optnew, "uid", (void **)&uid, &cbOption); - if ((rc != ENOENT) && (rc || cbOption != sizeof(uid))) - return EINVAL; + return (kernel_mount(ma, flags)); +} - pShFlGlobalInfo = RTMemAllocZ(sizeof(struct sf_glob_info)); - if (!pShFlGlobalInfo) - return ENOMEM; +static const char *vboxfs_opts[] = { + "fstype", + "fspath", + "from", + "uid", + "gid", + "file_mode", + "dir_mode", + "errmsg", + NULL +}; - cbShFlShareName = offsetof (SHFLSTRING, String.utf8) + cbShare + 1; - pShFlShareName = RTMemAllocZ(cbShFlShareName); - if (!pShFlShareName) - return VERR_NO_MEMORY; +#define VBOX_INTOPT(optname, val, base) do { \ + char *ep, *optarg = NULL; \ + if (vfs_getopt(opts, optname, (void **)&optarg, NULL) == 0) { \ + if (optarg != NULL && *optarg == '\0') \ + optarg = NULL; \ + if (optarg != NULL) \ + val = strtoul(optarg, &ep, base); \ + if (optarg == NULL || *ep != '\0') { \ + struct sbuf *sb = sbuf_new_auto(); \ + sbuf_printf(sb, "Invalid %s: \"%s\"", optname, \ + optarg); \ + sbuf_finish(sb); \ + vfs_mount_error(mp, sbuf_data(sb)); \ + sbuf_delete(sb); \ + return (EINVAL); \ + } \ + } \ +} while (0) - pShFlShareName->u16Length = cbShare; - pShFlShareName->u16Size = cbShare + 1; - memcpy (pShFlShareName->String.utf8, pszShare, cbShare + 1); +static int +vboxfs_node_ctor(void *mem, int size, void *arg, int flags) +{ + struct vboxfs_node *node = (struct vboxfs_node *)mem; - rc = VbglR0SfMapFolder (&g_vboxSFClient, pShFlShareName, &pShFlGlobalInfo->map); - RTMemFree(pShFlShareName); + node->sf_vnode = NULL; + node->sf_vpstate = 0; - if (RT_FAILURE (rc)) - { - RTMemFree(pShFlGlobalInfo); - printf("VbglR0SfMapFolder failed rc=%d\n", rc); - return EPROTO; - } + return (0); +} - pShFlGlobalInfo->uid = uid; - pShFlGlobalInfo->gid = gid; +static void +vboxfs_node_dtor(void *mem, int size, void *arg) +{ + struct vboxfs_node *node = (struct vboxfs_node *)mem; + node->sf_type = VNON; +} - mp->mnt_data = pShFlGlobalInfo; +static int +vboxfs_node_init(void *mem, int size, int flags) +{ + struct vboxfs_node *node = (struct vboxfs_node *)mem; + node->sf_ino = 0; - /** @todo root vnode. */ + mtx_init(&node->sf_interlock, "tmpfs node interlock", NULL, MTX_DEF); - vfs_getnewfsid(mp); - vfs_mountedfrom(mp, pszShare); + return (0); +} - printf("%s: Leave rc=0\n", __FUNCTION__); +static void +vboxfs_node_fini(void *mem, int size) +{ + struct vboxfs_node *node = (struct vboxfs_node *)mem; - return 0; + mtx_destroy(&node->sf_interlock); } -static int vboxvfs_unmount(struct mount *mp, int mntflags, struct thread *td) +static int +vboxfs_mount(struct mount *mp) { - struct sf_glob_info *pShFlGlobalInfo = VFSMP2SFGLOBINFO(mp); - int rc; - int flags = 0; + struct vboxfs_mnt *vboxfsmp = NULL; + struct vfsoptlist *opts = mp->mnt_optnew; + sfp_mount_t *handle = NULL; + int readonly = 0; + sffs_fsinfo_t fsinfo; + int error, share_len; + char *share_name; + mode_t file_mode = 0, dir_mode = 0; + uid_t uid = 0; + gid_t gid = 0; + struct vboxfs_node *root; - rc = VbglR0SfUnmapFolder(&g_vboxSFClient, &pShFlGlobalInfo->map); - if (RT_FAILURE(rc)) - printf("Failed to unmap shared folder\n"); + if (mp->mnt_flag & (MNT_UPDATE | MNT_ROOTFS)) + return (EOPNOTSUPP); - if (mntflags & MNT_FORCE) - flags |= FORCECLOSE; + if (vfs_filteropt(opts, vboxfs_opts)) { + vfs_mount_error(mp, "%s", "Invalid option"); + return (EINVAL); + } - /* There is 1 extra root vnode reference (vnode_root). */ - rc = vflush(mp, 1, flags, td); - if (rc) - return rc; + VBOX_INTOPT("uid", uid, 10); + VBOX_INTOPT("gid", gid, 10); + VBOX_INTOPT("file_mode", file_mode, 8); + VBOX_INTOPT("dir_mode", dir_mode, 8); + VBOX_INTOPT("ro", readonly, 10); + error = vfs_getopt(opts, "from", (void **)&share_name, &share_len); + if (error != 0 || share_len == 0) { + vfs_mount_error(mp, "Invalid from"); + return (EINVAL); + } - RTMemFree(pShFlGlobalInfo); - mp->mnt_data = NULL; + vboxfsmp = malloc(sizeof(struct vboxfs_mnt), M_VBOXVFS, M_WAITOK | M_ZERO); + vboxfsmp->sf_uid = uid; + vboxfsmp->sf_gid = gid; + vboxfsmp->sf_fmode = file_mode & (S_IRWXU | S_IRWXG | S_IRWXO); + vboxfsmp->sf_dmode = dir_mode & (S_IRWXU | S_IRWXG | S_IRWXO); + vboxfsmp->sf_ino = 3; + vboxfsmp->sf_stat_ttl = 200; - return 0; + /* Invoke Hypervisor mount interface before proceeding */ + error = sfprov_mount(share_name, &handle); + if (error) + return (error); + + /* Determine whether the filesystem must be read-only. */ + error = sfprov_get_fsinfo(handle, &fsinfo); + if (error != 0) { + sfprov_unmount(handle); + return (error); + } + if (readonly == 0) + readonly = (fsinfo.readonly != 0); + + vboxfsmp->sf_handle = handle; + vboxfsmp->sf_vfsp = mp; + + vboxfsmp->sf_node_pool = uma_zcreate("VBOXFS node", + sizeof(struct vboxfs_node), + vboxfs_node_ctor, vboxfs_node_dtor, + vboxfs_node_init, vboxfs_node_fini, + UMA_ALIGN_PTR, 0); + + /* Allocate the root node. */ + error = vboxfs_alloc_node(mp, vboxfsmp, "", VDIR, 0, + 0, 0755, NULL, &root); + + if (error != 0 || root == NULL) { + uma_zdestroy(vboxfsmp->sf_node_pool); + free(vboxfsmp, M_VBOXVFS); + return error; + } + + root->sf_parent = root; + vboxfsmp->sf_root = root; + + MNT_ILOCK(mp); + mp->mnt_data = vboxfsmp; + mp->mnt_stat.f_fsid.val[0] = fsinfo.serial; + mp->mnt_stat.f_fsid.val[1] = 0; + mp->mnt_flag |= MNT_LOCAL; + if (readonly != 0) + mp->mnt_flag |= MNT_RDONLY; -+#if __FreeBSD_version >= 1000021 ++ + mp->mnt_kern_flag |= MNTK_LOOKUP_SHARED | MNTK_EXTENDED_SHARED; -+#else -+ mp->mnt_kern_flag |= MNTK_MPSAFE | MNTK_LOOKUP_SHARED | -+ MNTK_EXTENDED_SHARED; -+#endif + MNT_IUNLOCK(mp); + vfs_mountedfrom(mp, share_name); + + return (0); } -static int vboxvfs_root(struct mount *mp, int flags, struct vnode **vpp, struct thread *td) +/* + * Unmount a shared folder. + * + * vboxfs_unmount umounts the mounted file system. It return 0 + * on sucess and any relevant errno on failure. + */ +static int +vboxfs_unmount(struct mount *mp, int mntflags) { - int rc = 0; - struct sf_glob_info *pShFlGlobalInfo = VFSMP2SFGLOBINFO(mp); - struct vnode *vp; + struct vboxfs_mnt *vboxfsmp; + struct thread *td; + int error; + int flags; - printf("%s: Enter\n", __FUNCTION__); + vboxfsmp = VFSTOVBOXFS(mp); + td = curthread; + flags = 0; + if (mntflags & MNT_FORCE) + flags |= FORCECLOSE; - vp = pShFlGlobalInfo->vnode_root; - VREF(vp); + error = vflush(mp, 0, flags, td); + if (error) + return (error); - vn_lock(vp, flags | LK_RETRY, td); - *vpp = vp; + /* Invoke Hypervisor unmount interface before proceeding */ + error = sfprov_unmount(vboxfsmp->sf_handle); + if (error != 0) { + /* TBD anything here? */ + } - printf("%s: Leave\n", __FUNCTION__); + uma_zdestroy(vboxfsmp->sf_node_pool); - return rc; + free(vboxfsmp, M_VBOXVFS); + MNT_ILOCK(mp); + mp->mnt_data = NULL; + mp->mnt_flag &= ~MNT_LOCAL; + MNT_IUNLOCK(mp); + + return (0); } -static int vboxvfs_quotactl(struct mount *mp, int cmd, uid_t uid, void *arg, struct thread *td) +static int +vboxfs_root(struct mount *mp, int flags, struct vnode **vpp) { - return EOPNOTSUPP; + int error; + error = vboxfs_alloc_vp(mp, VFSTOVBOXFS(mp)->sf_root, flags, vpp); + + if (!error) + (*vpp)->v_vflag |= VV_ROOT; + + return error; } -int vboxvfs_init(struct vfsconf *vfsp) +/* + * Do operation associated with quotas, not supported + */ +static int +vboxfs_quotactl(struct mount *mp, int cmd, uid_t uid, void *arg) { - int rc; + return (EOPNOTSUPP); +} - /* Initialize the R0 guest library. */ - rc = VbglR0SfInit(); - if (RT_FAILURE(rc)) - return ENXIO; +/* + * Initialize the filesystem globals. + */ +static int +vboxfs_init(struct vfsconf *vfsp) +{ + int error; - /* Connect to the host service. */ - rc = VbglR0SfConnect(&g_vboxSFClient); - if (RT_FAILURE(rc)) - { - printf("Failed to get connection to host! rc=%d\n", rc); - VbglR0SfTerm(); - return ENXIO; - } + DROP_GIANT(); - rc = VbglR0SfSetUtf8(&g_vboxSFClient); - if (RT_FAILURE (rc)) - { - printf("VbglR0SfSetUtf8 failed, rc=%d\n", rc); - VbglR0SfDisconnect(&g_vboxSFClient); - VbglR0SfTerm(); - return EPROTO; - } + sfprov = sfprov_connect(SFPROV_VERSION); + if (sfprov == NULL) { + printf("%s: couldn't connect to sf provider", __func__); + return (ENODEV); + } - printf("Successfully loaded shared folder module\n"); + error = sfprov_set_show_symlinks(); + if (error != 0) + printf("%s: host unable to show symlinks, error=%d\n", + __func__, error); - return 0; + PICKUP_GIANT(); + return (0); } -int vboxvfs_uninit(struct vfsconf *vfsp) +/* + * Undo the work of vboxfs_init(). + */ +static int +vboxfs_uninit(struct vfsconf *vfsp) { - VbglR0SfDisconnect(&g_vboxSFClient); - VbglR0SfTerm(); - return 0; + DROP_GIANT(); + sfprov_disconnect(); + PICKUP_GIANT(); + return (0); } -int vboxvfs_statfs(struct mount *mp, struct statfs *sbp, struct thread *td) +/* + * Get filesystem statistics. + */ +static int +vboxfs_statfs(struct mount *mp, struct statfs *sbp) { - return 0; + struct vboxfs_mnt *vboxfsmp; + sffs_fsinfo_t fsinfo; + int error; + + vboxfsmp = VFSTOVBOXFS(mp); + + error = sfprov_get_fsinfo(vboxfsmp->sf_handle, &fsinfo); + if (error != 0) + return (error); + + sbp->f_iosize = fsinfo.blksize; + sbp->f_bsize = fsinfo.blksize; + + sbp->f_bfree = fsinfo.blksavail; + sbp->f_bavail = fsinfo.blksavail; + sbp->f_files = fsinfo.blksavail / 4; /* some kind of reasonable value */ + sbp->f_ffree = fsinfo.blksavail / 4; + + sbp->f_blocks = fsinfo.blksused + sbp->f_bavail; + sbp->f_fsid.val[0] = mp->mnt_stat.f_fsid.val[0]; + sbp->f_fsid.val[1] = mp->mnt_stat.f_fsid.val[1]; + sbp->f_namemax = fsinfo.maxnamesize; + + return (0); } diff --git a/emulators/virtualbox-ose/files/patch-src_VBox_Devices_Audio_DrvHostALSAAudio.cpp b/emulators/virtualbox-ose/files/patch-src_VBox_Devices_Audio_DrvHostAudioAlsa.cpp similarity index 67% rename from emulators/virtualbox-ose/files/patch-src_VBox_Devices_Audio_DrvHostALSAAudio.cpp rename to emulators/virtualbox-ose/files/patch-src_VBox_Devices_Audio_DrvHostAudioAlsa.cpp index 3d4a63920b68..fec7ba18f722 100644 --- a/emulators/virtualbox-ose/files/patch-src_VBox_Devices_Audio_DrvHostALSAAudio.cpp +++ b/emulators/virtualbox-ose/files/patch-src_VBox_Devices_Audio_DrvHostAudioAlsa.cpp @@ -1,18 +1,18 @@ ---- src/VBox/Devices/Audio/DrvHostALSAAudio.cpp.orig 2021-01-07 15:37:12 UTC -+++ src/VBox/Devices/Audio/DrvHostALSAAudio.cpp -@@ -820,6 +820,7 @@ static DECLCALLBACK(int) drvHostAlsaAudioHA_StreamPlay +--- src/VBox/Devices/Audio/DrvHostAudioAlsa.cpp.orig 2021-04-20 04:27:52 UTC ++++ src/VBox/Devices/Audio/DrvHostAudioAlsa.cpp +@@ -833,6 +833,7 @@ static DECLCALLBACK(int) drvHostAlsaAudioHA_StreamPlay continue; } +#if EPIPE != ESTRPIPE case -ESTRPIPE: { /* Stream was suspended and waiting for a recovery. */ -@@ -833,6 +834,7 @@ static DECLCALLBACK(int) drvHostAlsaAudioHA_StreamPlay +@@ -846,6 +847,7 @@ static DECLCALLBACK(int) drvHostAlsaAudioHA_StreamPlay LogFlowFunc(("Resumed suspended output stream\n")); continue; } +#endif default: LogFlowFunc(("Failed to write %RU32 bytes, error unknown\n", cbToWrite)); diff --git a/emulators/virtualbox-ose/files/patch-src_VBox_Devices_Audio_DrvHostOSSAudio.cpp b/emulators/virtualbox-ose/files/patch-src_VBox_Devices_Audio_DrvHostAudioOss.cpp similarity index 76% rename from emulators/virtualbox-ose/files/patch-src_VBox_Devices_Audio_DrvHostOSSAudio.cpp rename to emulators/virtualbox-ose/files/patch-src_VBox_Devices_Audio_DrvHostAudioOss.cpp index 7c484bb9d3b6..0c79581ccd3f 100644 --- a/emulators/virtualbox-ose/files/patch-src_VBox_Devices_Audio_DrvHostOSSAudio.cpp +++ b/emulators/virtualbox-ose/files/patch-src_VBox_Devices_Audio_DrvHostAudioOss.cpp @@ -1,31 +1,31 @@ ---- src/VBox/Devices/Audio/DrvHostOSSAudio.cpp.orig 2021-01-07 15:37:12 UTC -+++ src/VBox/Devices/Audio/DrvHostOSSAudio.cpp +--- src/VBox/Devices/Audio/DrvHostAudioOss.cpp.orig 2021-04-20 04:27:52 UTC ++++ src/VBox/Devices/Audio/DrvHostAudioOss.cpp @@ -253,10 +253,11 @@ static int ossStreamOpen(const char *pszDev, int fOpen default: rc = VERR_AUDIO_STREAM_COULD_NOT_CREATE; + iFormat = -1; break; } - if (RT_FAILURE(rc)) + if (RT_UNLIKELY(iFormat == -1)) break; if (ioctl(fdFile, SNDCTL_DSP_SAMPLESIZE, &iFormat)) @@ -664,6 +665,7 @@ static int ossCreateStreamIn(POSSAUDIOSTREAM pStreamOS pCfgAcq->Backend.cFramesPeriod = PDMAUDIOSTREAMCFG_B2F(pCfgAcq, ossAcq.cbFragmentSize); pCfgAcq->Backend.cFramesBufferSize = pCfgAcq->Backend.cFramesPeriod * 2; /* Use "double buffering". */ -+ pCfgAcq->Backend.cFramesPreBuffering = pCfgAcq->Backend.cFramesBufferSize; ++ pCfgAcq->Backend.cFramesPreBuffering = pCfgAcq->Backend.cFramesBufferSize; /** @todo Pre-buffering required? */ } } @@ -782,6 +784,7 @@ static int ossCreateStreamOut(POSSAUDIOSTREAM pStreamO #endif pCfgAcq->Backend.cFramesPeriod = PDMAUDIOSTREAMCFG_B2F(pCfgAcq, obtStream.cbFragmentSize); pCfgAcq->Backend.cFramesBufferSize = pCfgAcq->Backend.cFramesPeriod * 2; /* Use "double buffering" */ -+ pCfgAcq->Backend.cFramesPreBuffering = pCfgAcq->Backend.cFramesBufferSize; ++ pCfgAcq->Backend.cFramesPreBuffering = pCfgAcq->Backend.cFramesBufferSize; } } while (0); diff --git a/emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_thread-r0drv-freebsd.c b/emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_thread-r0drv-freebsd.c index 2c65ff3a2029..c1ba2d811cde 100644 --- a/emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_thread-r0drv-freebsd.c +++ b/emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_thread-r0drv-freebsd.c @@ -1,99 +1,91 @@ ---- src/VBox/Runtime/r0drv/freebsd/thread-r0drv-freebsd.c.orig 2018-10-15 14:31:31 UTC +--- src/VBox/Runtime/r0drv/freebsd/thread-r0drv-freebsd.c.orig 2021-04-20 04:32:44 UTC +++ src/VBox/Runtime/r0drv/freebsd/thread-r0drv-freebsd.c @@ -49,7 +49,6 @@ RTDECL(RTNATIVETHREAD) RTThreadNativeSelf(void) static int rtR0ThreadFbsdSleepCommon(RTMSINTERVAL cMillies) { int rc; - int cTicks; /* * 0 ms sleep -> yield. -@@ -60,11 +59,28 @@ static int rtR0ThreadFbsdSleepCommon(RTMSINTERVAL cMil +@@ -60,30 +59,34 @@ static int rtR0ThreadFbsdSleepCommon(RTMSINTERVAL cMil return VINF_SUCCESS; } + IPRT_FREEBSD_SAVE_EFL_AC(); + /* * Translate milliseconds into ticks and go to sleep. */ if (cMillies != RT_INDEFINITE_WAIT) { -+#if __FreeBSD_version >= 1000029 +- if (hz == 1000) +- cTicks = cMillies; +- else if (hz == 100) +- cTicks = cMillies / 10; +- else +- { +- int64_t cTicks64 = ((uint64_t)cMillies * hz) / 1000; +- cTicks = (int)cTicks64; +- if (cTicks != cTicks64) +- cTicks = INT_MAX; +- } + struct timeval tv; + + tv.tv_sec = cMillies / 1000; + tv.tv_usec = cMillies * 1000; + + rc = tsleep_sbt((void *)RTThreadSleep, + PZERO | PCATCH, + "iprtsl", /* max 6 chars */ + tvtosbt(tv), + 0, + C_ABSOLUTE); -+#else -+ int cTicks; -+ - if (hz == 1000) - cTicks = cMillies; - else if (hz == 100) -@@ -76,14 +92,24 @@ static int rtR0ThreadFbsdSleepCommon(RTMSINTERVAL cMil - if (cTicks != cTicks64) - cTicks = INT_MAX; - } -+ if (!cTicks) -+ cTicks = 1; -+ -+ rc = tsleep((void *)RTThreadSleep, -+ PZERO | PCATCH, -+ "iprtsl", /* max 6 chars */ -+ cTicks); -+#endif } else - cTicks = 0; /* requires giant lock! */ - - rc = tsleep((void *)RTThreadSleep, - PZERO | PCATCH, - "iprtsl", /* max 6 chars */ - cTicks); + { + /* requires giant lock! */ + rc = tsleep((void *)RTThreadSleep, + PZERO | PCATCH, + "iprts0", /* max 6 chars */ + 0); + } + IPRT_FREEBSD_RESTORE_EFL_AC(); switch (rc) { case 0: -@@ -114,11 +140,13 @@ RTDECL(int) RTThreadSleepNoLog(RTMSINTERVAL cMillies) +@@ -114,11 +117,13 @@ RTDECL(int) RTThreadSleepNoLog(RTMSINTERVAL cMillies) RTDECL(bool) RTThreadYield(void) { + IPRT_FREEBSD_SAVE_EFL_AC(); #if __FreeBSD_version >= 900032 kern_yield(curthread->td_user_pri); #else uio_yield(); #endif + IPRT_FREEBSD_RESTORE_EFL_AC(); return false; /** @todo figure this one ... */ } -@@ -167,12 +195,14 @@ RTDECL(void) RTThreadPreemptDisable(PRTTHREADPREEMPTST +@@ -167,12 +172,14 @@ RTDECL(void) RTThreadPreemptDisable(PRTTHREADPREEMPTST RTDECL(void) RTThreadPreemptRestore(PRTTHREADPREEMPTSTATE pState) { + IPRT_FREEBSD_SAVE_EFL_AC(); /* paranoia */ AssertPtr(pState); Assert(pState->u32Reserved == 42); pState->u32Reserved = 0; RT_ASSERT_PREEMPT_CPUID_RESTORE(pState); critical_exit(); + IPRT_FREEBSD_RESTORE_EFL_ONLY_AC(); /* paranoia */ }