diff --git a/emulators/Makefile b/emulators/Makefile index 3940ba358293..bdd2eb0d4009 100644 --- a/emulators/Makefile +++ b/emulators/Makefile @@ -1,202 +1,205 @@ COMMENT = Emulators for other operating systems SUBDIR += 86Box SUBDIR += Ymir SUBDIR += adamem SUBDIR += almostti SUBDIR += anese SUBDIR += aqemu SUBDIR += aranym SUBDIR += ares SUBDIR += atari800 SUBDIR += bfe SUBDIR += bochs SUBDIR += bsvc SUBDIR += cannonball SUBDIR += catapult SUBDIR += cemu SUBDIR += cingb SUBDIR += citra SUBDIR += citra-qt5 SUBDIR += cpmtools SUBDIR += cpmtools2 SUBDIR += darcnes SUBDIR += dgen-sdl SUBDIR += dolphin-emu SUBDIR += dosbox SUBDIR += dosbox-staging SUBDIR += dosbox-x SUBDIR += dps8m SUBDIR += dynamips-community SUBDIR += edumips64 SUBDIR += elliott-803 SUBDIR += emu64 SUBDIR += emulationstation SUBDIR += es-de SUBDIR += fbneo SUBDIR += fbsd-duckstation SUBDIR += fceux SUBDIR += firebird-emu SUBDIR += flexemu SUBDIR += flycast SUBDIR += fmsx SUBDIR += frodo SUBDIR += fs-uae SUBDIR += fs-uae-launcher SUBDIR += fuse SUBDIR += fuse-roms SUBDIR += fuse-utils SUBDIR += gbe SUBDIR += gens SUBDIR += gngb SUBDIR += gxemul SUBDIR += hatari SUBDIR += hercules SUBDIR += higan SUBDIR += hv_kvp_cmd SUBDIR += javatari SUBDIR += joytran SUBDIR += jzintv SUBDIR += klh10 SUBDIR += lib765 SUBDIR += libc6-shim SUBDIR += libdsk SUBDIR += libretro-bsnes SUBDIR += libretro-flycast SUBDIR += libretro-kronos SUBDIR += libretro-pcsx2 SUBDIR += libretro-ppsspp SUBDIR += libretro-reicast SUBDIR += libretro-vice SUBDIR += libspectrum SUBDIR += linux-c7 SUBDIR += linux-power10-functional-sim SUBDIR += linux-power9-functional-sim SUBDIR += linux-rl9 SUBDIR += linux_base-c7 SUBDIR += linux_base-rl9 SUBDIR += magia SUBDIR += mame SUBDIR += mastergear SUBDIR += mednafen SUBDIR += mesen SUBDIR += mgba SUBDIR += mupen64plus SUBDIR += mupen64plus-audio-sdl SUBDIR += mupen64plus-core SUBDIR += mupen64plus-input-sdl SUBDIR += mupen64plus-plugins SUBDIR += mupen64plus-qt SUBDIR += mupen64plus-rsp-cxd4 SUBDIR += mupen64plus-rsp-hle SUBDIR += mupen64plus-rsp-z64 SUBDIR += mupen64plus-ui-console SUBDIR += mupen64plus-video-arachnoid SUBDIR += mupen64plus-video-glide64 SUBDIR += mupen64plus-video-glide64mk2 SUBDIR += mupen64plus-video-rice SUBDIR += mupen64plus-video-z64 SUBDIR += nemu SUBDIR += nestopia SUBDIR += o2em SUBDIR += ods2reader SUBDIR += open-simh SUBDIR += open-vm-kmod SUBDIR += open-vm-tools SUBDIR += openmsx SUBDIR += p5-Acme-6502 SUBDIR += parallels-tools SUBDIR += pcem SUBDIR += pcemu SUBDIR += pcsx2 SUBDIR += playonbsd SUBDIR += ppsspp SUBDIR += ppsspp-qt5 SUBDIR += py-gns3-converter SUBDIR += py-m64py SUBDIR += py-unicorn SUBDIR += qemu SUBDIR += qemu-cheri SUBDIR += qemu-devel SUBDIR += qemu-powernv SUBDIR += qemu-user-static SUBDIR += qemu-user-static-devel SUBDIR += qmc2 SUBDIR += quasi88 SUBDIR += reicast SUBDIR += ripes SUBDIR += riscv-isa-sim SUBDIR += rpcs3 SUBDIR += rubygem-fission SUBDIR += rvvm SUBDIR += sameboy SUBDIR += simh SUBDIR += simh-hp2100 SUBDIR += simh-hp3000 SUBDIR += simh-hpdoc SUBDIR += snes9x-gtk SUBDIR += spim SUBDIR += stella SUBDIR += stonx SUBDIR += teo SUBDIR += tic-80 SUBDIR += tiemu3 SUBDIR += tilem SUBDIR += tme SUBDIR += tnylpo SUBDIR += tpm-emulator SUBDIR += uae SUBDIR += ucon64 SUBDIR += uconvert SUBDIR += ukncbtl SUBDIR += unicorn SUBDIR += vba SUBDIR += vboxtool SUBDIR += vgb-bin SUBDIR += vgba-bin SUBDIR += vice SUBDIR += virtualbox-ose SUBDIR += virtualbox-ose-70 SUBDIR += virtualbox-ose-71 + SUBDIR += virtualbox-ose-72 SUBDIR += virtualbox-ose-additions SUBDIR += virtualbox-ose-additions-legacy SUBDIR += virtualbox-ose-additions-nox11 SUBDIR += virtualbox-ose-additions-nox11-legacy SUBDIR += virtualbox-ose-kmod SUBDIR += virtualbox-ose-kmod-70 SUBDIR += virtualbox-ose-kmod-71 + SUBDIR += virtualbox-ose-kmod-72 SUBDIR += virtualbox-ose-kmod-legacy SUBDIR += virtualbox-ose-legacy SUBDIR += virtualbox-ose-nox11 SUBDIR += virtualbox-ose-nox11-70 SUBDIR += virtualbox-ose-nox11-71 + SUBDIR += virtualbox-ose-nox11-72 SUBDIR += virtualbox-ose-nox11-legacy SUBDIR += visualboyadvance-m SUBDIR += vmips SUBDIR += vmsbackup SUBDIR += vmw SUBDIR += vt100 SUBDIR += wine SUBDIR += wine-devel SUBDIR += wine-gecko SUBDIR += wine-gecko-devel SUBDIR += wine-mono SUBDIR += wine-mono-devel SUBDIR += wine-proton SUBDIR += winetricks SUBDIR += x16-emulator SUBDIR += x16-rom SUBDIR += x48 SUBDIR += x49gp SUBDIR += xbraitenberg SUBDIR += xcpc SUBDIR += xen-kernel SUBDIR += xhomer SUBDIR += xsystem35 SUBDIR += xzx SUBDIR += yaze-ag SUBDIR += yuzu SUBDIR += z80pack SUBDIR += zsnes .include diff --git a/emulators/virtualbox-ose-72/Makefile b/emulators/virtualbox-ose-72/Makefile index 7b5d79a0d306..3110b3efe1aa 100644 --- a/emulators/virtualbox-ose-72/Makefile +++ b/emulators/virtualbox-ose-72/Makefile @@ -1,426 +1,426 @@ PORTNAME= virtualbox-ose -DISTVERSION= 7.1.12 +DISTVERSION= 7.2.0 PORTREVISION?= 0 CATEGORIES= emulators MASTER_SITES= https://download.virtualbox.org/virtualbox/${DISTVERSION}/:src \ LOCAL/vvd:docs -PKGNAMESUFFIX?= -71 +PKGNAMESUFFIX?= -72 DISTFILES= VirtualBox-${DISTVERSION}${EXTRACT_SUFX}:src \ VirtualBox-docs-${DISTVERSION}${EXTRACT_SUFX}:docs EXTRACT_ONLY= VirtualBox-${DISTVERSION}${EXTRACT_SUFX} \ VirtualBox-docs-${DISTVERSION}${EXTRACT_SUFX} MAINTAINER= vbox@FreeBSD.org COMMENT= General-purpose full virtualizer for x86 hardware WWW= https://www.virtualbox.org/ LICENSE= GPLv2 LICENSE_FILE= ${WRKSRC}/COPYING ONLY_FOR_ARCHS= amd64 BUILD_DEPENDS= gtar:archivers/gtar \ kmk:devel/kBuild \ yasm:devel/yasm \ xsltproc:textproc/libxslt LIB_DEPENDS= libpng.so:graphics/png \ libcurl.so:ftp/curl -RUN_DEPENDS= ${LOCALBASE}/etc/rc.d/vboxnet:emulators/virtualbox-ose-kmod-71 +RUN_DEPENDS= ${LOCALBASE}/etc/rc.d/vboxnet:emulators/virtualbox-ose-kmod-72 USES= compiler:c++17-lang cpe gnome iconv pkgconfig qt:6 ssl tar:bzip2 CPE_VENDOR= oracle CPE_PRODUCT= vm_virtualbox USE_BINUTILS= yes USE_GNOME= libxml2 USE_QT= tools:build USE_RC_SUBR= vboxheadless vboxwatchdog HAS_CONFIGURE= yes CONFIGURE_ARGS= --disable-java --passive-mesa --disable-docs CONFIGURE_ARGS+= --with-gcc="${CC}" --with-g++="${CXX}" CONFLICTS_INSTALL= virtualbox-ose-legacy \ virtualbox-ose-nox11-legacy \ virtualbox-ose \ virtualbox-ose-nox11 \ virtualbox-ose-70 \ virtualbox-ose-nox11-70 \ - virtualbox-ose-72 \ - virtualbox-ose-nox11-72 + virtualbox-ose-71 \ + virtualbox-ose-nox11-71 -PORTSCOUT= limit:^7\.1\. +PORTSCOUT= limit:^7\.2\. SUB_FILES= pkg-message SUB_LIST= VBOXDIR=${VBOX_DIR} \ VBOX_ETC=${VBOX_ETC} \ VBOXGROUP=${VBOXGROUP} \ VBOXUSER=${VBOXUSER} \ VBOXWSUSER=${VBOXWSUSER} WRKSRC= ${WRKDIR}/VirtualBox-${DISTVERSION} VBOXUSER?= vboxusers VBOXWSUSER?= vboxusers VBOXGROUP?= vboxusers USERS= ${VBOXUSER} GROUPS= ${VBOXGROUP} VBOX_DIR= ${PREFIX}/${VBOX_DIR_REL} VBOX_DIR_REL= lib/virtualbox VBOX_ETC= ${PREFIX}/etc/vbox VBOX_LINKS= VBoxVRDP VBOX_PROGS= VBoxAutostart VBoxBalloonCtrl VBoxBugReport VBoxHeadless \ VBoxManage VBOX_UTILS= VBoxExtPackHelperApp VBoxNetAdpCtl VBoxNetDHCP VBoxNetNAT \ VBoxSVC PLIST_SUB= GUEST_VER=${DISTVERSION} \ PYTHON_VERU=${PYTHON_VER:S/./_/}${PYTHON_ABIVER} \ VBOXGROUP=${VBOXGROUP} SLAVE_PORT?= no OPTIONS_DEFINE= AIO ALSA DBUS DEBUG DOCS GUESTADDITIONS NLS OGG PULSEAUDIO \ PYTHON QT6 R0LOGGING UDPTUNNEL VBOXIMG VDE VNC VORBIS VPX \ WEBSERVICE X11 OPTIONS_DEFAULT= AIO DBUS QT6 UDPTUNNEL VNC WEBSERVICE X11 .if ${SLAVE_PORT} == no OPTIONS_DEFAULT+= PYTHON .endif # Since version 6.1.24 pulseaudio is broken at runtime, preventing # virtual machines from starting if configured to use it. OPTIONS_EXCLUDE+= PULSEAUDIO 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 NLS_DESC= Native language support (requires QT6) OGG_DESC= Use libogg from audio/libogg instead of bundled one QT6_DESC= Build with QT6 frontend (requires X11) R0LOGGING_DESC= Enable R0 logging (requires DEBUG) UDPTUNNEL_DESC= Build with UDP tunnel support VBOXIMG_DESC= Build vboximg-mount (requires fuse-libs) VDE_DESC= Build with VDE support VNC_DESC= Build with VNC support VORBIS_DESC= Use libvorbis from audio/libvorbis instead of bundled one VPX_DESC= Use libvpx for video recording WEBSERVICE_DESC= Build Webservice ALSA_LIB_DEPENDS= libasound.so:audio/alsa-lib ALSA_CONFIGURE_OFF= --disable-alsa DBUS_LIB_DEPENDS= libdbus-1.so:devel/dbus DBUS_CONFIGURE_OFF= --disable-dbus DEBUG_CONFIGURE_ON= --build-debug NLS_IMPLIES= QT6 OGG_LIB_DEPENDS= libogg.so:audio/libogg OGG_CONFIGURE_ON= --enable-libogg PULSEAUDIO_LIB_DEPENDS= libpulse.so:audio/pulseaudio PULSEAUDIO_CONFIGURE_OFF= --disable-pulse PYTHON_USES= python PYTHON_USES_OFF= python:build PYTHON_USE= PYTHON=distutils,noegginfo,noflavors PYTHON_CONFIGURE_OFF= --disable-python PYTHON_VARS= pydistutils_pkgname=vboxapi pydistutils_pkgversion=1.0 QT6_IMPLIES= X11 QT6_USES= gl qmake:no_env qt:6 xorg QT6_USE= QT=base,scxml,tools,translations \ XORG=xcb GL=gl QT6_CONFIGURE_OFF= --disable-qt R0LOGGING_IMPLIES= DEBUG UDPTUNNEL_CONFIGURE_OFF= --disable-udptunnel VBOXIMG_LIB_DEPENDS= libfuse.so.2:filesystems/fusefs-libs VDE_RUN_DEPENDS= vde_switch:net/vde2 VDE_CONFIGURE_ON= --enable-vde VNC_LIB_DEPENDS= libvncserver.so:net/libvncserver VNC_CONFIGURE_ON= --enable-vnc VORBIS_LIB_DEPENDS= libvorbis.so:audio/libvorbis \ libvorbisenc.so:audio/libvorbis VORBIS_CONFIGURE_ON= --enable-libvorbis VPX_LIB_DEPENDS= libvpx.so:multimedia/libvpx VPX_CONFIGURE_OFF= --disable-libvpx WEBSERVICE_BUILD_DEPENDS= soapcpp2:devel/gsoap X11_USES= sdl xorg X11_USE= SDL=sdl XORG=x11,xcursor,xext,xinerama,xmu,xorgproto,xt X11_CONFIGURE_OFF= --build-headless ENV= .export ENV .include .if ${SLAVE_PORT} == no -CONFLICTS_INSTALL+= virtualbox-ose-nox11-71 +CONFLICTS_INSTALL+= virtualbox-ose-nox11-72 .else -CONFLICTS_INSTALL+= virtualbox-ose-71 +CONFLICTS_INSTALL+= virtualbox-ose-72 .endif .if ${PORT_OPTIONS:MDEBUG} KMK_BUILDTYPE= debug KMK_FLAGS+= BUILD_TYPE=debug .else KMK_BUILDTYPE= release .endif .if ${PORT_OPTIONS:MGUESTADDITIONS} GUESTADDITIONS= VBoxGuestAdditions_${DISTVERSION}.iso DISTFILES+= ${GUESTADDITIONS}:src LICENSE+= Additions LICENSE_COMB= multi LICENSE_NAME_Additions= Guest Additions LICENSE_PERMS_Additions= auto-accept LICENSE_DISTFILES_Additions= ${GUESTADDITIONS} .endif .if ${PORT_OPTIONS:MQT6} PLIST_SUB+= QT="" VBOX_PROGS+= VirtualBox VirtualBoxVM VBOX_WITH_QT= 1 .else PLIST_SUB+= QT="@comment " .endif .if ${PORT_OPTIONS:MWEBSERVICE} USE_RC_SUBR+= vboxinit vboxwebsrv VBOX_LINKS+= vboxwebsrv VBOX_UTILS+= vboxwebsrv webtest .endif .if ${PORT_OPTIONS:MX11} #VBOX_PROGS+= VBoxSDL .endif .if ${PORT_OPTIONS:MPYTHON} || ${PORT_OPTIONS:MWEBSERVICE} PLIST_SUB+= SDK="" .else PLIST_SUB+= SDK="@comment " .endif .if ${PORT_OPTIONS:MVBOXIMG} EXTRA_PATCHES+= ${PATCHDIR}/extrapatch-vboximg-Config.kmk VBOX_UTILS+= vboximg-mount PLIST_SUB+= VBOXIMG="" .else PLIST_SUB+= VBOXIMG="@comment " .endif KMK_ARCH= freebsd.${ARCH} 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 VBOX_WITHOUT_DOCS=1 VBOX_GCC_std=-std=c++17 KMK_FLAGS+= -j${MAKE_JOBS_NUMBER} .include .if ${CHOSEN_COMPILER_TYPE} == clang PATCH_DEPENDS+= ${LOCALBASE}/share/kBuild/tools/GXX3.kmk:devel/kBuild .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 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 @${ECHO_CMD} 'VBOX_BLD_PYTHON = ${LOCALBASE}/bin/${PYTHON_VERSION}' >> \ ${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 .if ${OPSYS} == FreeBSD && ${OSVERSION} >= 1500013 @${ECHO_CMD} 'VBoxSVC_LDFLAGS.freebsd = -lsys' >> ${WRKSRC}/LocalConfig.kmk .endif # Causes a "reinplace" QA warning with default LOCALBASE @${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/units/qt6.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|%%VBOX_DIR%%|${VBOX_DIR}|g' \ -e 's|%%VBOX_ETC%%|${VBOX_ETC}|g' \ -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \ ${WRKSRC}/src/VBox/Installer/freebsd/VBox.sh @${REINPLACE_CMD} -e 's|%%VBOX_ETC%%|${VBOX_ETC}|g' \ ${WRKSRC}/src/VBox/HostDrivers/adpctl/VBoxNetAdpCtl.cpp @${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 && \ ${SETENV} ${MAKE_ENV} ${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:MDOCS} ${MKDIR} ${STAGEDIR}${DOCSDIR} ${INSTALL_DATA} ${WRKDIR}/VirtualBox-docs-${DISTVERSION}/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/python && \ ${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:MQT6} ${INSTALL_DATA} \ ${WRKSRC}/src/VBox/Frontends/VirtualBox/images/OSE/VirtualBox_48px.png \ ${STAGEDIR}${PREFIX}/share/pixmaps/VBox.png ${INSTALL_DATA} \ ${FILESDIR}/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:MVBOXIMG} ${LN} -fs ../${VBOX_DIR_REL}/vboximg-mount ${STAGEDIR}${PREFIX}/bin/ .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-72/distinfo b/emulators/virtualbox-ose-72/distinfo index e7b992b0b10c..ed4ac420cdd3 100644 --- a/emulators/virtualbox-ose-72/distinfo +++ b/emulators/virtualbox-ose-72/distinfo @@ -1,7 +1,7 @@ -TIMESTAMP = 1752700000 -SHA256 (VirtualBox-7.1.12.tar.bz2) = 6f9618f39168898134975f51df7c2d6d5129c0aa82b6ae11cf47f920c70df276 -SIZE (VirtualBox-7.1.12.tar.bz2) = 214691769 -SHA256 (VirtualBox-docs-7.1.12.tar.bz2) = ba48f2da2593d8cae56fcf601c132d77dbf1d16b1e26db162c89449250c269bd -SIZE (VirtualBox-docs-7.1.12.tar.bz2) = 10109084 -SHA256 (VBoxGuestAdditions_7.1.12.iso) = 256883e2eabf7ab5c10fb3b6831c294942ce34bc615807f9d0cf6c3d2e882236 -SIZE (VBoxGuestAdditions_7.1.12.iso) = 61331456 +TIMESTAMP = 1756400000 +SHA256 (VirtualBox-7.2.0.tar.bz2) = 4f2804ff27848ea772aee6b637bb1e10ee74ec2da117c257413e2d2c4f670ba0 +SIZE (VirtualBox-7.2.0.tar.bz2) = 206755781 +SHA256 (VirtualBox-docs-7.2.0.tar.bz2) = 12b27989f2ab9b9316384322a8f1cdadd7003d2e2d6592298e1a84e81f5e0572 +SIZE (VirtualBox-docs-7.2.0.tar.bz2) = 9200668 +SHA256 (VBoxGuestAdditions_7.2.0.iso) = 43f7a1045cad0aab40e3af906fea37244ba6873b91b4e227245a14e51b399abd +SIZE (VBoxGuestAdditions_7.2.0.iso) = 53143552 diff --git a/emulators/virtualbox-ose-72/files/patch-Config.kmk b/emulators/virtualbox-ose-72/files/patch-Config.kmk index 7aaf90147847..c284262eb189 100644 --- a/emulators/virtualbox-ose-72/files/patch-Config.kmk +++ b/emulators/virtualbox-ose-72/files/patch-Config.kmk @@ -1,402 +1,421 @@ ---- Config.kmk.orig 2025-05-10 18:43:02 UTC +--- Config.kmk.orig 2025-08-28 22:09:24 UTC +++ Config.kmk -@@ -610,11 +610,11 @@ endif +@@ -624,11 +624,11 @@ endif # Enable OSS audio support. VBOX_WITH_AUDIO_OSS = 1 endif -if1of ($(KBUILD_TARGET), linux) +if1of ($(KBUILD_TARGET), freebsd linux) # Enable ALSA audio support. VBOX_WITH_AUDIO_ALSA = 1 endif -if1of ($(KBUILD_TARGET), linux) +if1of ($(KBUILD_TARGET), freebsd linux) # Enable PulseAudio audio support. VBOX_WITH_AUDIO_PULSE = 1 endif -@@ -627,11 +627,11 @@ VBOX_WITH_PCI_PASSTHROUGH = +@@ -641,11 +641,11 @@ VBOX_WITH_PCI_PASSTHROUGH = # (disabled with 6.1, since it's not complete/useful enough) VBOX_WITH_PCI_PASSTHROUGH = # Enable statically linked dbus support. -if1of ($(KBUILD_TARGET), linux solaris) +if1of ($(KBUILD_TARGET), freebsd linux solaris) VBOX_WITH_DBUS = 1 endif # Enable building PAM modules. -if1of ($(KBUILD_TARGET), linux solaris) +if1of ($(KBUILD_TARGET), freebsd linux solaris) VBOX_WITH_PAM = 1 endif # Enable internal networking. -@@ -639,7 +639,7 @@ VBOX_WITH_VMSVGA = 1 +@@ -653,7 +653,7 @@ VBOX_WITH_VMSVGA = 1 # Enable vmsvga (svga2) graphics device variant, 2D part VBOX_WITH_VMSVGA = 1 # Enable vmsvga (svga2) graphics device variant, 3D part -if1of ($(KBUILD_TARGET), darwin linux win) +if1of ($(KBUILD_TARGET), darwin freebsd linux win) VBOX_WITH_VMSVGA3D = 1 endif # Enable vmsvga (svga2) graphics device variant, 3D part, VGPU10 DX commands -@@ -825,7 +825,7 @@ VBOX_WITH_VBOXMANAGE_NLS = 1 +@@ -847,7 +847,7 @@ VBOX_WITH_VBOXMANAGE_NLS = 1 #endif # Set this to prefix all C symbols in XPCOM, to avoid dynamic linking problems # caused by our XPCOM library polluting the symbol namespace for system libs. -if1of ($(KBUILD_TARGET), linux solaris) +if1of ($(KBUILD_TARGET), freebsd linux solaris) VBOX_WITH_XPCOM_NAMESPACE_CLEANUP = 1 endif # The webservices api. -@@ -1357,10 +1357,6 @@ endif +@@ -1376,10 +1376,6 @@ endif endif endif -ifeq ($(KBUILD_TARGET),freebsd) - VBOX_WITH_DOCS = -endif - ifeq ($(KBUILD_TARGET),haiku) VBOX_WITH_VRDP_RDESKTOP = # Permanent (no working SDL). -@@ -1545,7 +1541,7 @@ ifdef VBOX_OSE +@@ -1563,7 +1559,7 @@ ifdef VBOX_OSE # not yet VBOX_WITH_PLUGIN_CRYPT = VBOX_WITH_DRAG_AND_DROP_PROMISES = - ifn1of ($(KBUILD_TARGET), linux) + ifn1of ($(KBUILD_TARGET), freebsd linux) VBOX_WITH_DOCS = VBOX_WITH_DOCS_PACKING = endif -@@ -3680,19 +3676,7 @@ ifndef VBOX_GCC_std +@@ -3637,19 +3633,19 @@ ifndef VBOX_GCC_std # ## @todo consider maxing this out. ifndef VBOX_GCC_std -- if1of ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH), darwin.arm64) # Go straight for c++17 here. +- if1of ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH), darwin.arm64 linux.arm64) # Go straight for c++17 here. ++# if1of ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH), darwin.arm64 linux.arm64) # Go straight for c++17 here. VBOX_GCC_std := -std=c++17 - # else if "$(VBOX_CLANG_VERSION_CXX)" vge 60000 # Most language features complete by v6. Lib stuff was less complete in v6, but hopefully acceptable for out purposes. - #VBOX_GCC_std := -std=c++17 - else if "$(VBOX_CLANG_VERSION_CXX)" vge 50000 # darwin Xcode 5 allegedly knows what C++11 is - VBOX_GCC_std := -std=c++11 - # else if "$(VBOX_GCC_VERSION_CXX)" vge 70000 # Language feature P0512R0 was v8, rest v7 or earlier. Most lib stuff present in 7, complete in v12. - #VBOX_GCC_std := -std=gnu++17 - else if "$(VBOX_GCC_VERSION_CXX)" vge 40800 - VBOX_GCC_std := -std=c++11 - else if "$(VBOX_GCC_VERSION_CXX)" vge 40600 - VBOX_GCC_std := -std=c++0x - endif ++# # else if "$(VBOX_CLANG_VERSION_CXX)" vge 60000 # Most language features complete by v6. Lib stuff was less complete in v6, but hopefully acceptable for out purposes. ++# #VBOX_GCC_std := -std=c++17 ++# else if "$(VBOX_CLANG_VERSION_CXX)" vge 50000 # darwin Xcode 5 allegedly knows what C++11 is ++# VBOX_GCC_std := -std=c++11 ++# # else if "$(VBOX_GCC_VERSION_CXX)" vge 70000 # Language feature P0512R0 was v8, rest v7 or earlier. Most lib stuff present in 7, complete in v12. ++# #VBOX_GCC_std := -std=gnu++17 ++# else if "$(VBOX_GCC_VERSION_CXX)" vge 40800 ++# VBOX_GCC_std := -std=c++11 ++# else if "$(VBOX_GCC_VERSION_CXX)" vge 40600 ++# VBOX_GCC_std := -std=c++0x ++# endif endif ifndef VBOX_VCC_std if $(VBOX_VCC_TOOL_STEM) >= VCC141 # since 2017 15.3 -@@ -5682,11 +5666,11 @@ ifeq ($(VBOX_LDR_FMT),elf) +@@ -5688,11 +5684,11 @@ ifeq ($(VBOX_LDR_FMT),elf) # Solaris driver signing. TEMPLATE_VBoxR0_POST_CMDS = $(VBOX_SIGN_DRIVER_CMDS) else - TEMPLATE_VBoxR0_LDFLAGS = -nostdlib -Bsymbolic -g + TEMPLATE_VBoxR0_LDFLAGS = -nostdlib -Bsymbolic -g -fuse-ld=bfd ## @todo WTF doesn't the globals work? Debug info is supposed to be split everywhere. GRR TEMPLATE_VBoxR0_LD_DEBUG = split endif - if "$(KBUILD_TARGET)" == "linux" && !defined(VBOX_WITH_KMOD_WRAPPED_R0_MODS) + if ( "$(KBUILD_TARGET)" == "linux" || "$(KBUILD_TARGET)" == "freebsd") && !defined(VBOX_WITH_KMOD_WRAPPED_R0_MODS) VBOX_WITH_VBOXR0_AS_DLL = 1 TEMPLATE_VBoxR0_DLLSUFF = .r0 TEMPLATE_VBoxR0_CFLAGS += -fPIC -@@ -5697,7 +5681,7 @@ ifeq ($(VBOX_LDR_FMT),elf) +@@ -5703,7 +5699,7 @@ ifeq ($(VBOX_LDR_FMT),elf) else TEMPLATE_VBoxR0_CFLAGS.amd64 += -mcmodel=kernel TEMPLATE_VBoxR0_CXXFLAGS.amd64 += -mcmodel=kernel - endif +endif ifdef VBOX_WITH_KMOD_WRAPPED_R0_MODS # For BTF/pahold issue we use -g1 TEMPLATE_VBoxR0_DEFS += VBOX_WITH_KMOD_WRAPPED_R0_MODS TEMPLATE_VBoxR0_LDFLAGS.linux += $(PATH_ROOT)/src/VBox/HostDrivers/Support/linux/VBoxR0-wrapped.lds -@@ -6081,7 +6065,7 @@ ifeq ($(KBUILD_TARGET),freebsd) +@@ -6100,7 +6096,7 @@ ifeq ($(KBUILD_TARGET),freebsd) # x86 FreeBSD (6.2 or something): # cc -O2 -fno-strict-aliasing -pipe -Werror -D_KERNEL -DKLD_MODULE \ # -nostdinc -I- -I. -I@ -I@/contrib/altq -I@/../include -I/usr/include \ - # -finline-limit=8000 -fno-common -mno-align-long-strings -mpreferred-stack-boundary=2 \ + # -fno-common -mno-align-long-strings \ # -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -ffreestanding -Wall -Wredundant-decls -Wnested-externs \ # -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -fformat-extensions \ # -std=c99 -c ../my.c -@@ -6092,7 +6076,7 @@ ifeq ($(KBUILD_TARGET),freebsd) +@@ -6111,7 +6107,7 @@ ifeq ($(KBUILD_TARGET),freebsd) # # AMD64 FreeBSD (7.1): # cc -O2 -fno-strict-aliasing -pipe -D_KERNEL -DKLD_MODULE -std=c99 -nostdinc -I. -I@ -I@/contrib/altq \ - # -finline-limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000 -fno-common \ + # --param inline-unit-growth=100 --param large-function-growth=1000 -fno-common \ # -fno-omit-frame-pointer -mcmodel=kernel -mno-red-zone -mfpmath=387 -mno-sse -mno-sse2 -mno-mmx \ # -mno-3dnow -msoft-float -fno-asynchronous-unwind-tables -ffreestanding \ # -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign \ -@@ -6174,7 +6158,7 @@ ifeq ($(KBUILD_TARGET),freebsd) +@@ -6193,7 +6189,7 @@ ifeq ($(KBUILD_TARGET),freebsd) | xargs -J% objcopy % $(outbase).kld # Link the final .ko (a shared object). - ld $(flags) -Bshareable -o $(out) $(outbase).kld + ld $(flags) -Bshareable -znotext -o $(out) $(outbase).kld endef endif # x86 -@@ -6209,7 +6193,7 @@ ifeq ($(KBUILD_TARGET),netbsd) - $(VBOX_GCC_fdiagnostics-show-option) \ +@@ -6228,7 +6224,7 @@ ifeq ($(KBUILD_TARGET),netbsd) + $(VBOX_GCC_fdiagnostics-show-option) $(VBOX_GCC_fdiagnostics-color) \ -Wstrict-prototypes -Wmissing-prototypes -Wstrict-prototypes \ -Wimplicit-function-declaration -Werror-implicit-function-declaration \ - -O2 -ffreestanding -fno-strict-aliasing -fno-common -finline-limit=8000 \ + -O2 -ffreestanding -fno-strict-aliasing -fno-common \ $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) \ -nostdinc -std=c99 -msoft-float TEMPLATE_VBoxR0Drv_CFLAGS.x86 = -m32 -mno-mmx -mno-sse -mno-avx \ -@@ -6220,7 +6204,7 @@ ifeq ($(KBUILD_TARGET),netbsd) +@@ -6239,7 +6235,7 @@ ifeq ($(KBUILD_TARGET),netbsd) -fno-asynchronous-unwind-tables -mno-fp-ret-in-387 TEMPLATE_VBoxR0Drv_CXXFLAGS = -fno-exceptions -fno-rtti \ $(VBOX_GCC_WARN) -Wpointer-arith -Winline \ - -O2 -fno-strict-aliasing -fno-common -finline-limit=8000 \ + -O2 -fno-strict-aliasing -fno-common \ $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) \ -nostdinc -msoft-float TEMPLATE_VBoxR0Drv_CXXFLAGS.x86 = $(TEMPLATE_VBoxR0Drv_CFLAGS.x86) -@@ -6528,11 +6512,11 @@ else # the gcc guys - TEMPLATE_VBoxR3Exe_LIBS = pthread m rt dl +@@ -6565,11 +6561,11 @@ else # the gcc guys + TEMPLATE_VBoxR3Exe_LATE_LIBS = pthread m rt dl else ifeq ($(KBUILD_TARGET),os2) TEMPLATE_VBoxR3Exe_TOOL = GXX3OMF -- TEMPLATE_VBoxR3Exe_LIBS = socket iconv -+ TEMPLATE_VBoxR3Exe_LIBS = socket +- TEMPLATE_VBoxR3Exe_LATE_LIBS = socket iconv ++ TEMPLATE_VBoxR3Exe_LATE_LIBS = socket else ifeq ($(KBUILD_TARGET),darwin) TEMPLATE_VBoxR3Exe_TOOL = $(VBOX_GCC_TOOL) - TEMPLATE_VBoxR3Exe_LIBS = + TEMPLATE_VBoxR3Exe_LATE_LIBS = - TEMPLATE_VBoxR3Exe_DEFS += LIBICONV_PLUG # Avoid 3rd party libiconv (from macports). + TEMPLATE_VBoxR3Exe_DEFS += LIBICONV_PLUG # Avoid 3rd party lib (from macports). TEMPLATE_VBoxR3Exe_SDKS.darwin = $(VBOX_DARWIN_DEF_SDK_SDKS) TEMPLATE_VBoxR3Exe_DEFS.darwin = $(VBOX_DARWIN_DEF_SDK_DEFS) TEMPLATE_VBoxR3Exe_CFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_CFLAGS) -fno-common -@@ -6549,17 +6533,26 @@ else # the gcc guys +@@ -6585,24 +6581,29 @@ else # the gcc guys else ifeq ($(KBUILD_TARGET),haiku) TEMPLATE_VBoxR3Exe_TOOL = GXX3 - TEMPLATE_VBoxR3Exe_POST_CMDS = $(VBOX_HAIKU_XRES_SETVER_CMDS) -- TEMPLATE_VBoxR3Exe_LIBS = network iconv stdc++ supc++ -+ TEMPLATE_VBoxR3Exe_LIBS = network stdc++ supc++ + TEMPLATE_VBoxR3Exe_POST_CMDS = $(VBOX_HAIKU_XRES_SETVER_CMDS) +- TEMPLATE_VBoxR3Exe_LATE_LIBS = network iconv stdc++ supc++ ++ TEMPLATE_VBoxR3Exe_LATE_LIBS = network stdc++ supc++ TEMPLATE_VBoxR3Exe_LIBPATH += \ /boot/common/lib # Haiku uses PIC by default... TEMPLATE_VBoxR3Exe_CFLAGS += -fno-pic TEMPLATE_VBoxR3Exe_CXXFLAGS += -fno-pic TEMPLATE_VBoxR3Exe_LDFLAGS += -fno-pic - else if1of ($(KBUILD_TARGET), freebsd openbsd) -+ else ifeq ($(KBUILD_TARGET), freebsd) ++ else if1of ($(KBUILD_TARGET), freebsd) TEMPLATE_VBoxR3Exe_TOOL = GXX3 - TEMPLATE_VBoxR3Exe_LIBS = pthread + TEMPLATE_VBoxR3Exe_LATE_LIBS = pthread + TEMPLATE_VBoxR3Exe_LDFLAGS = -Wl,-z,noexecstack,-z,relro $(VBOX_LD_as_needed) + TEMPLATE_VBoxR3Exe_LDFLAGS.freebsd.x86 = -Wl,-z,notext TEMPLATE_VBoxR3Exe_INCS += \ -+ /usr/local/include -+ TEMPLATE_VBoxR3Exe_LIBPATH += \ -+ /usr/local/lib +- /usr/include \ +- /usr/X11R6/include \ + /usr/local/include + TEMPLATE_VBoxR3Exe_LIBPATH += \ +- /usr/lib \ +- /usr/X11R6/lib \ + /usr/local/lib + else ifeq ($(KBUILD_TARGET), openbsd) + TEMPLATE_VBoxR3Exe_TOOL = GXX3 + TEMPLATE_VBoxR3Exe_LIBS = pthread + TEMPLATE_VBoxR3Exe_INCS += \ - /usr/include \ - /usr/X11R6/include \ - /usr/local/include -@@ -6578,7 +6571,7 @@ else # the gcc guys ++ /usr/include \ ++ /usr/X11R6/include \ ++ /usr/local/include + else ifeq ($(KBUILD_TARGET),netbsd) + TEMPLATE_VBoxR3Exe_TOOL = GXX3 + TEMPLATE_VBoxR3Exe_LATE_LIBS = pthread +@@ -6614,7 +6615,7 @@ else # the gcc guys /usr/X11R7/lib else ifeq ($(KBUILD_TARGET),solaris) TEMPLATE_VBoxR3Exe_TOOL = GXX3PLAIN - TEMPLATE_VBoxR3Exe_DEFS += LIBICONV_PLUG _REENTRANT # Avoid the GNU libiconv, for now at least. + TEMPLATE_VBoxR3Exe_DEFS += LIBICONV_PLUG _REENTRANT # Avoid the GNU lib, for now at least. if $(VBOX_GCC_VERSION_CC) < 30500 TEMPLATE_VBoxR3Exe_CFLAGS += -std=gnu99 endif -@@ -6594,6 +6587,7 @@ else # the gcc guys +@@ -6630,6 +6631,7 @@ else # the gcc guys TEMPLATE_VBoxR3Exe_LDFLAGS += '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RELATIVE_RUNPATH)' endif ifdef VBOX_WITH_ORIGIN + TEMPLATE_VBoxR3Exe_LDFLAGS.freebsd += $(VBOX_GCC_ORIGIN_OPT) TEMPLATE_VBoxR3Exe_LDFLAGS.linux += $(VBOX_GCC_ORIGIN_OPT) endif endif -@@ -6808,7 +6802,7 @@ else +@@ -6868,7 +6870,7 @@ else ifdef VBOX_WITH_NOCRT_STATIC TEMPLATE_VBoxR3StaticBase_DEFS += RT_WITH_NOCRT_WRAPPERS endif - ifn1of ($(KBUILD_TARGET), darwin linux solaris) + ifn1of ($(KBUILD_TARGET), darwin freebsd linux solaris) # The gcc guys sans darwin, linux and solaris (don't depend on statically compiled system libs there) TEMPLATE_VBoxR3StaticBase_CFLAGS = $(TEMPLATE_VBoxR3Exe_CFLAGS) -static TEMPLATE_VBoxR3StaticBase_CXXFLAGS = $(TEMPLATE_VBoxR3Exe_CXXFLAGS) -static -@@ -6876,7 +6870,7 @@ else - $(SDK_VBoxZlib_LIBS) \ +@@ -6936,7 +6938,7 @@ else + $(SDK_VBoxZlib_LATE_LIBS) \ $(SDK_VBoxLibLzma_LIBS) if1of ($(KBUILD_TARGET), darwin freebsd) -- TEMPLATE_VBoxR3Static_LIBS += iconv -+ TEMPLATE_VBoxR3Static_LIBS += +- TEMPLATE_VBoxR3Static_LATE_LIBS += iconv ++ TEMPLATE_VBoxR3Static_LATE_LIBS += else ifeq ($(KBUILD_TARGET),solaris) - TEMPLATE_VBoxR3Static_LIBS += kstat + TEMPLATE_VBoxR3Static_LATE_LIBS += kstat endif -@@ -7048,6 +7042,7 @@ else ifn1of ($(KBUILD_TARGET), os2) +@@ -7137,6 +7139,7 @@ else ifn1of ($(KBUILD_TARGET), os2) else ifn1of ($(KBUILD_TARGET), os2) ifneq ($(KBUILD_TYPE),asan) # Keep RPATH in asan builds so we can find libasan.so.X and libubsan.so.Y. - TEMPLATE_VBoxR3HardenedExe_LDFLAGS = $(filter-out '$(VBOX_GCC_RPATH_OPT)%,$(TEMPLATE_VBoxR3Exe_LDFLAGS)) -+ TEMPLATE_VBoxR3HardenedExe_LDFLAGS.freebsd = $(filter-out $(VBOX_GCC_ORIGIN_OPT),$(TEMPLATE_VBoxR3Exe_LDFLAGS.freebsd)) - TEMPLATE_VBoxR3HardenedExe_LDFLAGS.linux = $(filter-out $(VBOX_GCC_ORIGIN_OPT),$(TEMPLATE_VBoxR3Exe_LDFLAGS.linux)) + TEMPLATE_VBoxR3HardenedExe_LDFLAGS = $(filter-out '$(VBOX_GCC_RPATH_OPT)%,$(TEMPLATE_VBoxR3Exe_LDFLAGS)) ++ TEMPLATE_VBoxR3HardenedExe_LDFLAGS.freebsd = $(filter-out $(VBOX_GCC_ORIGIN_OPT),$(TEMPLATE_VBoxR3Exe_LDFLAGS.freebsd)) + TEMPLATE_VBoxR3HardenedExe_LDFLAGS.linux = $(filter-out $(VBOX_GCC_ORIGIN_OPT),$(TEMPLATE_VBoxR3Exe_LDFLAGS.linux)) endif endif -@@ -7079,6 +7074,7 @@ ifn1of ($(KBUILD_TARGET), win os2) +@@ -7168,6 +7171,7 @@ ifn1of ($(KBUILD_TARGET), win os2) $(if-expr !defined(VBOX_WITHOUT_WINDOWS_KERNEL_CODE_SIGNING_CERT),-IntegrityCheck,) ifn1of ($(KBUILD_TARGET), win os2) TEMPLATE_VBoxR3HardenedTstDll_LDFLAGS = $(filter-out '$(VBOX_GCC_RPATH_OPT)%,$(TEMPLATE_VBoxR3TstDll_LDFLAGS)) + TEMPLATE_VBoxR3HardenedTstDll_LDFLAGS.freebsd = $(filter-out $(VBOX_GCC_ORIGIN_OPT),$(TEMPLATE_VBoxR3TstDll_LDFLAGS.freebsd)) TEMPLATE_VBoxR3HardenedTstDll_LDFLAGS.linux = $(filter-out $(VBOX_GCC_ORIGIN_OPT),$(TEMPLATE_VBoxR3TstDll_LDFLAGS.linux)) endif -@@ -7102,6 +7098,7 @@ ifndef VBOX_WITH_HARDENING +@@ -7192,6 +7196,7 @@ ifndef VBOX_WITH_HARDENING TEMPLATE_VBoxR3SetUidToRoot_LDFLAGS += '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RELATIVE_RUNPATH)' endif ifdef VBOX_WITH_ORIGIN + TEMPLATE_VBoxR3SetUidToRoot_LDFLAGS.freebsd += $(VBOX_GCC_ORIGIN_OPT) TEMPLATE_VBoxR3SetUidToRoot_LDFLAGS.linux += $(VBOX_GCC_ORIGIN_OPT) endif endif -@@ -7454,7 +7451,7 @@ else # the GCC guys: +@@ -7570,7 +7575,7 @@ else # the GCC guys: endif TEMPLATE_VBoxMainExe_CXXFLAGS = -g $(VBOX_GCC_pipe) \ $(VBOX_GCC_PEDANTIC_CXX) $(VBOX_GCC_Wno-variadic-macros) $(VBOX_GCC_Wno-multistatement-macros) $(VBOX_GCC_Wno-class-memaccess) -Wshadow \ - -fshort-wchar -fpermissive -fexceptions -frtti $(VBOX_GCC_OPT) $(VBOX_GCC_FP) -fno-strict-aliasing \ + -fshort-wchar -fexceptions -frtti $(VBOX_GCC_OPT) $(VBOX_GCC_FP) -fno-strict-aliasing \ $(VBOX_GCC_fvisibility-inlines-hidden) $(VBOX_GCC_fvisibility-hidden) $(VBOX_GCC_std) $(VBOX_GCC_IPRT_FMT_CHECK) \ $(VBOX_GCC_SANITIZER_FLAGS) if !defined("VBOX_GCC_Wno-delete-non-virtual-dtor") && defined("VBOX_GCC_Wno-non-virtual-dtor") -@@ -7518,10 +7515,19 @@ else # the GCC guys: +@@ -7633,10 +7638,19 @@ else # the GCC guys: else ifeq ($(KBUILD_TARGET),haiku) TEMPLATE_VBoxMainExe_TOOL = GXX3 - TEMPLATE_VBoxMainExe_LIBS = $(LIB_RUNTIME) network stdc++ supc++ + TEMPLATE_VBoxMainExe_LATE_LIBS = $(LIB_RUNTIME) network stdc++ supc++ - else if1of ($(KBUILD_TARGET), freebsd openbsd) -+ else ifeq ($(KBUILD_TARGET), freebsd) ++ else if1of ($(KBUILD_TARGET), freebsd) TEMPLATE_VBoxMainExe_TOOL = GXX3 - TEMPLATE_VBoxMainExe_LIBS = $(LIB_RUNTIME) + TEMPLATE_VBoxMainExe_LATE_LIBS = $(LIB_RUNTIME) + TEMPLATE_VBoxMainExe_LDFLAGS = -Wl,-z,noexecstack,-z,relro $(VBOX_LD_as_needed) + TEMPLATE_VBoxMainExe_LDFLAGS.freebsd.x86 = -Wl,-z,notext TEMPLATE_VBoxMainExe_INCS += \ -+ /usr/local/include ++ /usr/local/include + TEMPLATE_VBoxMainExe_LIBPATH += \ -+ /usr/local/lib ++ /usr/local/lib + else ifeq ($(KBUILD_TARGET), openbsd) + TEMPLATE_VBoxMainExe_TOOL = GXX3 + TEMPLATE_VBoxMainExe_LIBS = $(LIB_RUNTIME) + TEMPLATE_VBoxMainExe_INCS += \ /usr/include \ /usr/X11R6/include \ /usr/local/include -@@ -7553,6 +7559,7 @@ else # the GCC guys: +@@ -7668,6 +7682,7 @@ else # the GCC guys: TEMPLATE_VBoxMainExe_LDFLAGS += '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RELATIVE_RUNPATH)' endif ifdef VBOX_WITH_ORIGIN + TEMPLATE_VBoxMainExe_LDFLAGS.freebsd += $(VBOX_GCC_ORIGIN_OPT) TEMPLATE_VBoxMainExe_LDFLAGS.linux += $(VBOX_GCC_ORIGIN_OPT) endif -@@ -8181,14 +8188,13 @@ ifdef VBOX_WITH_QTGUI +@@ -8352,14 +8367,13 @@ ifdef VBOX_WITH_QTGUI TEMPLATE_VBoxQtGuiExe_LIBPATH += \ $(VBOX_LIBPATH_X11) ifeq ($(KBUILD_TARGET),freebsd) + TEMPLATE_VBoxQtGuiExe_LDFLAGS += -Wl,-z,noexecstack,-z,relro $(VBOX_LD_as_needed) + TEMPLATE_VBoxQtGuiExe_LDFLAGS.freebsd.x86 = -Wl,-z,notext TEMPLATE_VBoxQtGuiExe_INCS += \ - /usr/include \ - /usr/X11R6/include \ /usr/local/include TEMPLATE_VBoxQtGuiExe_LIBPATH += \ - /usr/lib \ - /usr/X11R6/lib \ /usr/local/lib + TEMPLATE_VBoxQtGuiExe_LIBS += /usr/local/lib/qt6/libQt6PrintSupport.so endif ifeq ($(KBUILD_TARGET),solaris) TEMPLATE_VBoxQtGuiExe_LDFLAGS.solaris = -Wl,-z,ignore # Same as VBOX_LD_as_needed. -@@ -8460,7 +8466,7 @@ else - TEMPLATE_VBoxBldProg_LIBS = pthread m rt dl +@@ -8623,7 +8637,7 @@ else + TEMPLATE_VBoxBldProg_LATE_LIBS = pthread m rt dl else ifeq ($(KBUILD_HOST),os2) TEMPLATE_VBoxBldProg_TOOL = GXX3OMF -- TEMPLATE_VBoxBldProg_LIBS = socket iconv -+ TEMPLATE_VBoxBldProg_LIBS = socket +- TEMPLATE_VBoxBldProg_LATE_LIBS = socket iconv ++ TEMPLATE_VBoxBldProg_LATE_LIBS = socket else ifeq ($(KBUILD_HOST),darwin) TEMPLATE_VBoxBldProg_TOOL = $(VBOX_GCC_TOOL) if "$(VBOX_DEF_MACOSX_VERSION_MIN)" == "10.7" || "$(VBOX_DARWIN_HOST_VERSION_MAJOR)" == "7" -@@ -8500,13 +8506,20 @@ else - TEMPLATE_VBoxBldProg_LIBS = +@@ -8663,13 +8677,20 @@ else + TEMPLATE_VBoxBldProg_LATE_LIBS = else ifeq ($(KBUILD_HOST),haiku) TEMPLATE_VBoxBldProg_TOOL = GXX3 -- TEMPLATE_VBoxBldProg_LIBS = network iconv -+ TEMPLATE_VBoxBldProg_LIBS = network +- TEMPLATE_VBoxBldProg_LATE_LIBS = network iconv ++ TEMPLATE_VBoxBldProg_LATE_LIBS = network TEMPLATE_VBoxBldProg_LIBPATH += \ /boot/common/lib - else if1of ($(KBUILD_HOST), freebsd openbsd) -+ else ifeq ($(KBUILD_HOST), freebsd) ++ else if1of ($(KBUILD_HOST), freebsd) TEMPLATE_VBoxBldProg_TOOL = $(VBOX_GCC_TOOL) - TEMPLATE_VBoxBldProg_LIBS = pthread + TEMPLATE_VBoxBldProg_LATE_LIBS = pthread TEMPLATE_VBoxBldProg_INCS += \ -+ /usr/local/include ++ /usr/local/include + TEMPLATE_VBoxBldProg_LIBPATH += \ -+ /usr/local/lib ++ /usr/local/lib + else ifeq ($(KBUILD_HOST), openbsd) + TEMPLATE_VBoxBldProg_TOOL = $(VBOX_GCC_TOOL) + TEMPLATE_VBoxBldProg_LIBS = pthread + TEMPLATE_VBoxBldProg_INCS += \ /usr/include \ /usr/X11R6/include \ /usr/local/include -@@ -8553,11 +8566,11 @@ TEMPLATE_VBoxAdvBldProg_LIBS.darwin = \ - $(TEMPLATE_VBoxBldProg_LIBS) - TEMPLATE_VBoxAdvBldProg_LIBS.darwin = \ - $(TEMPLATE_VBoxAdvBldProg_LIBS) \ +@@ -8716,11 +8737,11 @@ TEMPLATE_VBoxAdvBldProg_LATE_LIBS.darwin = \ + $(TEMPLATE_VBoxBldProg_LATE_LIBS) + TEMPLATE_VBoxAdvBldProg_LATE_LIBS.darwin = \ + $(TEMPLATE_VBoxAdvBldProg_LATE_LIBS) \ - iconv \ -+ \ - $(TEMPLATE_VBoxBldProg_LIBS.darwin) - TEMPLATE_VBoxAdvBldProg_LIBS.freebsd = \ - $(TEMPLATE_VBoxAdvBldProg_LIBS) \ ++ \ + $(TEMPLATE_VBoxBldProg_LATE_LIBS.darwin) + TEMPLATE_VBoxAdvBldProg_LATE_LIBS.freebsd = \ + $(TEMPLATE_VBoxAdvBldProg_LATE_LIBS) \ - iconv \ -+ \ ++ \ rt \ - $(TEMPLATE_VBoxBldProg_LIBS.freebsd) - TEMPLATE_VBoxAdvBldProg_LIBS.linux = \ -@@ -8648,6 +8661,7 @@ else # the gcc guys + $(TEMPLATE_VBoxBldProg_LATE_LIBS.freebsd) + TEMPLATE_VBoxAdvBldProg_LATE_LIBS.linux = \ +@@ -8813,6 +8834,7 @@ else # the gcc guys # Do not inherit sanitizer flags from VBoxR3Exe in guest executables. Deal with them separately. TEMPLATE_VBoxGuestR3ExeBase_CXXFLAGS.debug = $(NO_SUCH_VARIABLE) TEMPLATE_VBoxGuestR3ExeBase_CFLAGS.debug = $(NO_SUCH_VARIABLE) + TEMPLATE_VBoxGuestR3ExeBase_LDFLAGS.freebsd = $(filter-out $(VBOX_GCC_ORIGIN_OPT),$(TEMPLATE_$(TEMPLATE_VBoxGuestR3ExeBase_EXTENDS)_LDFLAGS.freebsd)) TEMPLATE_VBoxGuestR3ExeBase_LDFLAGS.linux = $(filter-out $(VBOX_GCC_ORIGIN_OPT),$(TEMPLATE_$(TEMPLATE_VBoxGuestR3ExeBase_EXTENDS)_LDFLAGS.linux)) TEMPLATE_VBoxGuestR3ExeBase_LDFLAGS.debug = $(NO_SUCH_VARIABLE) TEMPLATE_VBoxGuestR3ExeBase_LDFLAGS = $(filter-out '$(VBOX_GCC_RPATH_OPT)%,$(TEMPLATE_$(TEMPLATE_VBoxGuestR3ExeBase_EXTENDS)_LDFLAGS)) -@@ -8671,7 +8685,7 @@ else if1of ($(KBUILD_TARGET), darwin freebsd openbsd) +@@ -8836,7 +8858,7 @@ else if1of ($(KBUILD_TARGET), darwin freebsd openbsd) ifeq ($(KBUILD_TARGET),linux) # As few libs as possible on linux. - TEMPLATE_VBoxGuestR3ExeBase_LIBS = pthread rt m dl + TEMPLATE_VBoxGuestR3ExeBase_LATE_LIBS = pthread rt m dl else if1of ($(KBUILD_TARGET), darwin freebsd openbsd) -- TEMPLATE_VBoxGuestR3ExeBase_LIBS = $(TEMPLATE_$(TEMPLATE_VBoxGuestR3ExeBase_EXTENDS)_LIBS) iconv -+ TEMPLATE_VBoxGuestR3ExeBase_LIBS = $(TEMPLATE_$(TEMPLATE_VBoxGuestR3ExeBase_EXTENDS)_LIBS) +- TEMPLATE_VBoxGuestR3ExeBase_LATE_LIBS = $(TEMPLATE_$(TEMPLATE_VBoxGuestR3ExeBase_EXTENDS)_LATE_LIBS) iconv ++ TEMPLATE_VBoxGuestR3ExeBase_LATE_LIBS = $(TEMPLATE_$(TEMPLATE_VBoxGuestR3ExeBase_EXTENDS)_LATE_LIBS) else ifeq ($(KBUILD_TARGET),solaris) - TEMPLATE_VBoxGuestR3ExeBase_LIBS = $(TEMPLATE_$(TEMPLATE_VBoxGuestR3ExeBase_EXTENDS)_LIBS) nsl + TEMPLATE_VBoxGuestR3ExeBase_LATE_LIBS = $(TEMPLATE_$(TEMPLATE_VBoxGuestR3ExeBase_EXTENDS)_LATE_LIBS) nsl endif -@@ -8684,6 +8698,7 @@ TEMPLATE_VBoxGuestR3ExeBase_CFLAGS.linux = $(TEMP +@@ -8849,6 +8871,7 @@ TEMPLATE_VBoxGuestR3ExeBase_CFLAGS.linux = $(TEMP $(VBOX_GCC_fno-stack-protector) TEMPLATE_VBoxGuestR3ExeBase_CFLAGS.linux = $(TEMPLATE_VBoxGuestR3ExeBase_CXXFLAGS.linux) # The GNU_HASH ELF tag is not supported by older systems. +TEMPLATE_VBoxGuestR3ExeBase_LDFLAGS.freebsd += $(VBOX_LD_hash_style_sysv) TEMPLATE_VBoxGuestR3ExeBase_LDFLAGS.linux += $(VBOX_LD_hash_style_sysv) -@@ -8929,6 +8944,7 @@ TEMPLATE_VBoxGuestR3XFree86Mod_LDFLAGS.$(KBUILD_TARGET +@@ -9085,6 +9108,7 @@ TEMPLATE_VBoxGuestR3XFree86Mod_LDFLAGS.$(KBUILD_TARGET TEMPLATE_VBoxGuestR3XFree86Mod_CXXFLAGS.linux = $(VBOX_GCC_fno-stack-protector) # Remove symvers.h TEMPLATE_VBoxGuestR3XFree86Mod_LDFLAGS.$(KBUILD_TARGET) = $(NO_SUCH_VARIABLE) # The GNU_HASH ELF tag is not supported by older glibc dynamic linkers. +TEMPLATE_VBoxGuestR3XFree86Mod_LDFLAGS.freebsd = $(subst -Wl$(COMMA),,$(VBOX_LD_hash_style_sysv)) TEMPLATE_VBoxGuestR3XFree86Mod_LDFLAGS.linux = $(subst -Wl$(COMMA),,$(VBOX_LD_hash_style_sysv)) TEMPLATE_VBoxGuestR3XFree86Mod_LDFLAGS.$(KBUILD_TYPE) = $(NO_SUCH_VARIABLE) TEMPLATE_VBoxGuestR3XFree86Mod_LDFLAGS := -r -@@ -8970,7 +8986,7 @@ TEMPLATE_VBoxGuestR3XOrgMod_LIBS.$(KBUILD_TARGET) = - TEMPLATE_VBoxGuestR3XOrgMod_LIBS = $(VBOX_LIB_VBGL_R3_XORG) - TEMPLATE_VBoxGuestR3XOrgMod_LIBS.$(KBUILD_TYPE) = $(NO_SUCH_VARIABLE) - TEMPLATE_VBoxGuestR3XOrgMod_LIBS.$(KBUILD_TARGET) = $(NO_SUCH_VARIABLE) --TEMPLATE_VBoxGuestR3XOrgMod_LIBS.freebsd += iconv -+TEMPLATE_VBoxGuestR3XOrgMod_LIBS.freebsd += - - - # +@@ -9128,7 +9152,7 @@ TEMPLATE_VBoxGuestR3XOrgMod_LATE_LIBS.$(KBUILD_TARGET) + TEMPLATE_VBoxGuestR3XOrgMod_LATE_LIBS = $(VBOX_LIB_VBGL_R3_XORG) + TEMPLATE_VBoxGuestR3XOrgMod_LATE_LIBS.$(KBUILD_TYPE) = $(NO_SUCH_VARIABLE) + TEMPLATE_VBoxGuestR3XOrgMod_LATE_LIBS.$(KBUILD_TARGET) = $(NO_SUCH_VARIABLE) +-TEMPLATE_VBoxGuestR3XOrgMod_LATE_LIBS.freebsd = iconv ++TEMPLATE_VBoxGuestR3XOrgMod_LATE_LIBS.freebsd = + TEMPLATE_VBoxGuestR3XOrgMod_LIBS = $(NO_SUCH_VARIABLE) # These three aren't necessary, just being careful. + TEMPLATE_VBoxGuestR3XOrgMod_LIBS.$(KBUILD_TYPE) = $(NO_SUCH_VARIABLE) + TEMPLATE_VBoxGuestR3XOrgMod_LIBS.$(KBUILD_TARGET) = $(NO_SUCH_VARIABLE) diff --git a/emulators/virtualbox-ose-72/files/patch-configure b/emulators/virtualbox-ose-72/files/patch-configure index 3645d1236ea8..76ed44e26acf 100644 --- a/emulators/virtualbox-ose-72/files/patch-configure +++ b/emulators/virtualbox-ose-72/files/patch-configure @@ -1,138 +1,126 @@ ---- configure.orig 2025-04-14 17:41:37 UTC +--- configure.orig 2025-08-13 19:37:05 UTC +++ configure -@@ -158,10 +158,14 @@ if [ "$OS" = "freebsd" ]; then +@@ -155,10 +155,14 @@ if [ "$OS" = "freebsd" ]; then if [ "$OS" = "freebsd" ]; then INCCURL="-I/usr/local/include" LIBCURL="-L/usr/local/lib -lcurl" + INCALSA="-I/usr/local/include" + LIBALSA="-L/usr/local/lib" INCPULSE="-I/usr/local/include" LIBPULSE="-L/usr/local/lib" INCPNG="-I/usr/local/include" LIBPNG="-L/usr/local/lib -lpng" + INCVNCSERVER="-I/usr/local/include" + LIBVNCSERVER="-L/usr/local/lib" else INCCURL="" LIBCURL="-lcurl" -@@ -1211,6 +1215,9 @@ extern "C" int main(int argc, char** argv) +@@ -1171,6 +1175,9 @@ extern "C" int main(int argc, char** argv) printf("found version %d.%d.%d", SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL); #if SDL_VERSION_ATLEAST(1,2,7) +#if !defined(SDL_VIDEO_DRIVER_X11) +#error SDL must be compiled with X11 support +#endif printf(", OK.\n"); return 0; #else -@@ -1295,7 +1302,7 @@ EOF +@@ -1255,7 +1262,7 @@ EOF #endif } EOF - if test_compile "-lasound" asound asound; then + if test_compile "$INCALSA $LIBALSA -lasound" asound asound; then test_execute fi } -@@ -1599,6 +1606,7 @@ EOF +@@ -1559,6 +1566,7 @@ EOF SDKQT6=$PATH_SDK_QT6 fi FLGQT6="-framework QtCore -std=c++17 -Wl,-rpath,`L_to_PATH "$LIBQT6"`" + FLGQT6="$FLGQT6 -std=c++11" else log_failure "Qt6 framework not found (can be disabled using --disable-qt)" fail -@@ -1875,9 +1883,9 @@ check_libvorbis() - if which_wrapper pkg-config > /dev/null; then - libvorbis_ver=`pkg-config vorbis --modversion 2>> $LOG` - if [ $? -eq 0 ]; then -- FLGVRB=`pkg-config vorbis --cflags` -+ FLGVRB=`pkg-config vorbis vorbisenc --cflags` - INCVRB=`strip_I "$FLGVRB"` -- LIBVRB=`pkg-config vorbis --libs` -+ LIBVRB=`pkg-config vorbis vorbisenc --libs` - fi - cat > $ODIR.tmp_src.cc << EOF - #include -@@ -1927,7 +1935,7 @@ EOF +@@ -1897,7 +1905,7 @@ EOF return 0; } EOF - [ -n "$INCOGG" ] && I_INCVRB=`prefix_I "$INCOGG"` + [ -n "$INCOGG" ] && I_INCOGG=`prefix_I "$INCOGG"` if test_compile "$LIBOGG $I_INCOGG" ogg ogg nofatal; then if test_execute; then cnf_append "SDK_VBoxLibOgg_INCS" "$INCOGG" -@@ -2194,8 +2202,8 @@ EOF +@@ -2125,8 +2133,8 @@ EOF echo "compiling the following source file:" >> $LOG cat $ODIR.tmp_src.cc >> $LOG echo "using the following command line:" >> $LOG - echo "$CXX -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.cc -I$p/include/$d $p/$b/lib$d.so" >> $LOG - $CXX -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.cc -I$p/include/$d $p/$b/lib$d.so >> $LOG 2>&1 + echo "$CXX -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.cc -I$p/include/$d $p/$b/lib$d.so -pthread" >> $LOG + $CXX -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.cc -I$p/include/$d $p/$b/lib$d.so -pthread >> $LOG 2>&1 if [ $? -eq 0 ]; then found=1 break -@@ -2311,7 +2319,7 @@ check_gsoap() +@@ -2246,7 +2254,7 @@ check_gsoap() else cnf_append "VBOX_GSOAP_CXX_SOURCES" "" fi - cnf_append "VBOX_GSOAP_CXX_LIBS" "`strip_l "$GSOAP_CXX_LIBS"`" + cnf_append "VBOX_GSOAP_CXX_LIBS" "`strip_l "$GSOAP_CXX_LIBS"` z" gsoap_version=`pkg-config gsoapssl++ --modversion` log_success "found version $gsoap_version" return -@@ -2687,7 +2695,7 @@ for option in "$@"; do +@@ -2619,7 +2627,7 @@ for option in "$@"; do --with-openssl-dir=*) OPENSSLDIR=`echo $option | cut -d'=' -f2` INCCRYPTO="-I${OPENSSLDIR}/include" - LIBCRYPTO="${OPENSSLDIR}/lib/libssl.a ${OPENSSLDIR}/lib/libcrypto.a" + LIBCRYPTO="-L${OPENSSLDIR}/lib -lssl -lcrypto" # On Darwin (at least for macports) static OpenSSL also needs zlib. [ "$OS" = "darwin" ] && LIBCRYPTO="$LIBCRYPTO ${OPENSSLDIR}/lib/libz.a" # On Linux static OpenSSL typically needs a few additional libraries. -@@ -3054,12 +3062,22 @@ if [ $ONLY_ADDITIONS -eq 0 ]; then +@@ -2978,12 +2986,22 @@ if [ $ONLY_ADDITIONS -eq 0 ]; then [ $WITH_JAVA -eq 1 ] && check_java # PulseAudio - if [ $WITH_PULSE -eq 1 ]; then - check_pulse - elif [ $WITH_PULSE -eq 0 ]; then # Force disabling PulseAudio. - cnf_append "VBOX_WITH_AUDIO_PULSE" "" - elif [ $WITH_PULSE -eq 2 ]; then # --enable-pulse was passed, force PulseAudio. - cnf_append "VBOX_WITH_AUDIO_PULSE" "1" + if [ "$OS" = "linux" -o "$OS" = "freebsd" -o "$OS" = "netbsd" ]; then + if [ $WITH_ALSA -eq 1 ]; then + check_alsa + else + cnf_append "VBOX_WITH_AUDIO_ALSA" "" + fi + if [ $WITH_PULSE -eq 1 ]; then + check_pulse + elif [ $WITH_PULSE -eq 0 ]; then # Force disabling PulseAudio. + cnf_append "VBOX_WITH_AUDIO_PULSE" "" + elif [ $WITH_PULSE -eq 2 ]; then # --enable-pulse was passed, force PulseAudio. + cnf_append "VBOX_WITH_AUDIO_PULSE" "1" + fi + if [ $WITH_DBUS -eq 0 ]; then + cnf_append "VBOX_WITH_DBUS" "" + fi fi fi -@@ -3075,14 +3093,6 @@ if [ "$OS" = "linux" ]; then +@@ -2999,14 +3017,6 @@ if [ "$OS" = "linux" ]; then cnf_append "VBOX_WITHOUT_LINUX_TEST_BUILDS" "1" fi if [ $ONLY_ADDITIONS -eq 0 ]; then - if [ $WITH_ALSA -eq 1 ]; then - check_alsa - else - cnf_append "VBOX_WITH_AUDIO_ALSA" "" - fi - if [ $WITH_DBUS -eq 0 ]; then - cnf_append "VBOX_WITH_DBUS" "" - fi if [ $WITH_DEVMAPPER -eq 1 ]; then check_libdevmapper else diff --git a/emulators/virtualbox-ose-72/files/patch-doc_manual_en__US_dita_UserManual.ditamap b/emulators/virtualbox-ose-72/files/patch-doc_manual_en__US_dita_UserManual.ditamap index 93550ddbf766..c8337d7aeba6 100644 --- a/emulators/virtualbox-ose-72/files/patch-doc_manual_en__US_dita_UserManual.ditamap +++ b/emulators/virtualbox-ose-72/files/patch-doc_manual_en__US_dita_UserManual.ditamap @@ -1,11 +1,11 @@ ---- doc/manual/en_US/dita/UserManual.ditamap.orig 2025-04-14 17:41:38 UTC +--- doc/manual/en_US/dita/UserManual.ditamap.orig 2025-08-13 19:37:06 UTC +++ doc/manual/en_US/dita/UserManual.ditamap -@@ -613,7 +613,7 @@ +@@ -540,7 +540,7 @@ - + diff --git a/emulators/virtualbox-ose-72/files/patch-include-iprt-x86.h b/emulators/virtualbox-ose-72/files/patch-include-iprt-x86.h index ca73a306df88..cedf78a0ef02 100644 --- a/emulators/virtualbox-ose-72/files/patch-include-iprt-x86.h +++ b/emulators/virtualbox-ose-72/files/patch-include-iprt-x86.h @@ -1,19 +1,19 @@ ---- include/iprt/x86.h.orig 2021-04-20 04:22:23 UTC +--- include/iprt/x86.h.orig 2025-08-13 19:37:26 UTC +++ include/iprt/x86.h -@@ -38,6 +38,16 @@ +@@ -53,6 +53,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 and sys/controlregs.h - * defining MSR_IA32_FLUSH_CMD */ + * defining MSR_IA32_FLUSH_CMD and MSR_AMD_VIRT_SPEC_CTL */ #ifdef RT_OS_SOLARIS diff --git a/emulators/virtualbox-ose-72/files/patch-include_VBox_com_array.h b/emulators/virtualbox-ose-72/files/patch-include_VBox_com_array.h index 9d65058e6b50..77d77ddd3e11 100644 --- a/emulators/virtualbox-ose-72/files/patch-include_VBox_com_array.h +++ b/emulators/virtualbox-ose-72/files/patch-include_VBox_com_array.h @@ -1,36 +1,36 @@ ---- include/VBox/com/array.h.orig 2021-01-07 15:31:25 UTC +--- include/VBox/com/array.h.orig 2025-08-13 19:37:15 UTC +++ include/VBox/com/array.h -@@ -171,7 +171,7 @@ +@@ -181,7 +181,7 @@ #include "VBox/com/defs.h" -#if RT_GNUC_PREREQ(4, 6) || (defined(_MSC_VER) && (_MSC_VER >= 1600)) +#if RT_GNUC_PREREQ(4, 6) || (defined(_MSC_VER) && (_MSC_VER >= 1600)) || defined(_LIBCPP_VERSION) /** @def VBOX_WITH_TYPE_TRAITS * Type traits are a C++ 11 feature, so not available everywhere (yet). * Only GCC 4.6 or newer and MSVC++ 16.0 (Visual Studio 2010) or newer. -@@ -960,12 +960,12 @@ class SafeArray : public Traits (public) +@@ -1014,12 +1014,12 @@ class SafeArray : public Traits (public) { /** @todo r=klaus should do this as a AssertCompile, but cannot find a way which works. */ Assert(sizeof(T) <= sizeof(Zeroes)); - AssertReturn(m.arr != NULL, *(T *)&Zeroes[0]); - AssertReturn(aIdx < size(), *(T *)&Zeroes[0]); + AssertReturn(m.arr != NULL, *((T *)1)); + AssertReturn(aIdx < size(), *((T *)1)); #ifdef VBOX_WITH_XPCOM return m.arr[aIdx]; #else - AssertReturn(m.raw != NULL, *(T *)&Zeroes[0]); + AssertReturn(m.raw != NULL, *((T *)1)); return m.raw[aIdx]; #endif } -@@ -980,7 +980,7 @@ class SafeArray : public Traits (public) +@@ -1034,7 +1034,7 @@ class SafeArray : public Traits (public) #ifdef VBOX_WITH_XPCOM return m.arr[aIdx]; #else - AssertReturn(m.raw != NULL, *(const T *)&Zeroes[0]); + AssertReturn(m.raw != NULL, *((T *)1)); return m.raw[aIdx]; #endif } diff --git a/emulators/virtualbox-ose-72/files/patch-include_VBox_sup.h b/emulators/virtualbox-ose-72/files/patch-include_VBox_sup.h index 9cf3fabe63f1..77fee2d23d0a 100644 --- a/emulators/virtualbox-ose-72/files/patch-include_VBox_sup.h +++ b/emulators/virtualbox-ose-72/files/patch-include_VBox_sup.h @@ -1,11 +1,11 @@ ---- include/VBox/sup.h.orig 2024-12-27 04:08:45.986426000 +0100 -+++ include/VBox/sup.h 2024-12-27 04:09:08.925387000 +0100 -@@ -2248,7 +2248,7 @@ +--- include/VBox/sup.h.orig 2025-08-13 19:37:16 UTC ++++ include/VBox/sup.h +@@ -2325,7 +2325,7 @@ SUPR0DECL(void) SUPR0BadContext(PSUPDRVSESSION pSessio SUPR0DECL(void) SUPR0BadContext(PSUPDRVSESSION pSession, const char *pszFile, uint32_t uLine, const char *pszExpr); -#if defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) +#if defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) /** * Translates a physical address to a virtual mapping (valid up to end of page). * @returns VBox status code. diff --git a/emulators/virtualbox-ose-72/files/patch-include_iprt_string.h b/emulators/virtualbox-ose-72/files/patch-include_iprt_string.h index 95119057d1ca..b06991588730 100644 --- a/emulators/virtualbox-ose-72/files/patch-include_iprt_string.h +++ b/emulators/virtualbox-ose-72/files/patch-include_iprt_string.h @@ -1,14 +1,14 @@ ---- include/iprt/string.h.orig 2021-01-07 15:31:33 UTC +--- include/iprt/string.h.orig 2025-08-13 19:37:25 UTC +++ include/iprt/string.h -@@ -46,6 +46,11 @@ +@@ -57,6 +57,11 @@ #elif defined(RT_OS_FREEBSD) && defined(_KERNEL) RT_C_DECLS_BEGIN # include + /* + * Kludge for the FreeBSD kernel: + * sys/libkern.h includes sys/param.h via sys/systm.h since r335879. + */ +# undef PVM RT_C_DECLS_END #elif defined(RT_OS_NETBSD) && defined(_KERNEL) diff --git a/emulators/virtualbox-ose-72/files/patch-src-VBox-Additions-common-VBoxGuest-VBoxGuest-freebsd.c b/emulators/virtualbox-ose-72/files/patch-src-VBox-Additions-common-VBoxGuest-VBoxGuest-freebsd.c index e790f372f95f..5344a7ab812f 100644 --- a/emulators/virtualbox-ose-72/files/patch-src-VBox-Additions-common-VBoxGuest-VBoxGuest-freebsd.c +++ b/emulators/virtualbox-ose-72/files/patch-src-VBox-Additions-common-VBoxGuest-VBoxGuest-freebsd.c @@ -1,284 +1,284 @@ ---- src/VBox/Additions/common/VBoxGuest/VBoxGuest-freebsd.c.orig 2022-10-06 19:03:06.000000000 +0200 -+++ src/VBox/Additions/common/VBoxGuest/VBoxGuest-freebsd.c 2024-12-26 15:28:38.066230000 +0100 +--- src/VBox/Additions/common/VBoxGuest/VBoxGuest-freebsd.c.orig 2025-08-13 19:41:14 UTC ++++ src/VBox/Additions/common/VBoxGuest/VBoxGuest-freebsd.c @@ -55,6 +55,7 @@ #include #include #include +#include #include #include #include @@ -71,6 +72,7 @@ #include #include #include +#include #include #include #include -@@ -112,8 +114,6 @@ +@@ -112,8 +114,6 @@ struct VBoxGuestDeviceState struct resource *pIrqRes; /** Pointer to the IRQ handler. */ void *pfnIrqHandler; - /** VMMDev version */ - uint32_t u32Version; }; -@@ -123,8 +123,7 @@ +@@ -123,8 +123,7 @@ struct VBoxGuestDeviceState /* * Character device file handlers. */ -static d_fdopen_t vgdrvFreeBSDOpen; -static d_close_t vgdrvFreeBSDClose; +static d_open_t vgdrvFreeBSDOpen; static d_ioctl_t vgdrvFreeBSDIOCtl; static int vgdrvFreeBSDIOCtlSlow(PVBOXGUESTSESSION pSession, u_long ulCmd, caddr_t pvData, struct thread *pTd); static d_write_t vgdrvFreeBSDWrite; -@@ -155,8 +154,7 @@ +@@ -155,8 +154,7 @@ static struct cdevsw g_vgdrvFreeBSDChrDevSW = { .d_version = D_VERSION, .d_flags = D_TRACKCLOSE | D_NEEDMINOR, - .d_fdopen = vgdrvFreeBSDOpen, - .d_close = vgdrvFreeBSDClose, + .d_open = vgdrvFreeBSDOpen, .d_ioctl = vgdrvFreeBSDIOCtl, .d_read = vgdrvFreeBSDRead, .d_write = vgdrvFreeBSDWrite, -@@ -164,81 +162,28 @@ +@@ -164,81 +162,28 @@ static struct cdevsw g_vgdrvFreeBSDChrDevSW = .d_name = "vboxguest" }; +/** Device structure. */ +static struct cdev *g_pDev; + /** Device extention & session data association structure. */ static VBOXGUESTDEVEXT g_DevExt; -/** List of cloned device. Managed by the kernel. */ -static struct clonedevs *g_pvgdrvFreeBSDClones; -/** The dev_clone event handler tag. */ -static eventhandler_tag g_vgdrvFreeBSDEHTag; /** Reference counter */ static volatile uint32_t cUsers; /** selinfo structure used for polling. */ static struct selinfo g_SelInfo; -/** - * DEVFS event handler. - */ -static void vgdrvFreeBSDClone(void *pvArg, struct ucred *pCred, char *pszName, int cchName, struct cdev **ppDev) +static void vgdrvFreeBSDDtr(void *pSession) { - int iUnit; - int rc; - - Log(("vgdrvFreeBSDClone: pszName=%s ppDev=%p\n", pszName, ppDev)); - - /* - * One device node per user, si_drv1 points to the session. - * /dev/vboxguest where N = {0...255}. - */ - if (!ppDev) - return; - if (strcmp(pszName, "vboxguest") == 0) - iUnit = -1; - else if (dev_stdclone(pszName, NULL, "vboxguest", &iUnit) != 1) - return; - if (iUnit >= 256) - { - Log(("vgdrvFreeBSDClone: iUnit=%d >= 256 - rejected\n", iUnit)); - return; - } - - Log(("vgdrvFreeBSDClone: pszName=%s iUnit=%d\n", pszName, iUnit)); - - rc = clone_create(&g_pvgdrvFreeBSDClones, &g_vgdrvFreeBSDChrDevSW, &iUnit, ppDev, 0); - Log(("vgdrvFreeBSDClone: clone_create -> %d; iUnit=%d\n", rc, iUnit)); - if (rc) - { - *ppDev = make_dev(&g_vgdrvFreeBSDChrDevSW, - iUnit, - UID_ROOT, - GID_WHEEL, - 0664, - "vboxguest%d", iUnit); - if (*ppDev) - { - dev_ref(*ppDev); - (*ppDev)->si_flags |= SI_CHEAPCLONE; - Log(("vgdrvFreeBSDClone: Created *ppDev=%p iUnit=%d si_drv1=%p si_drv2=%p\n", - *ppDev, iUnit, (*ppDev)->si_drv1, (*ppDev)->si_drv2)); - (*ppDev)->si_drv1 = (*ppDev)->si_drv2 = NULL; - } - else - Log(("vgdrvFreeBSDClone: make_dev iUnit=%d failed\n", iUnit)); - } - else - Log(("vgdrvFreeBSDClone: Existing *ppDev=%p iUnit=%d si_drv1=%p si_drv2=%p\n", - *ppDev, iUnit, (*ppDev)->si_drv1, (*ppDev)->si_drv2)); + VGDrvCommonCloseSession(&g_DevExt, pSession); + ASMAtomicDecU32(&cUsers); } /** * File open handler * */ -#if __FreeBSD_version >= 700000 -static int vgdrvFreeBSDOpen(struct cdev *pDev, int fOpen, struct thread *pTd, struct file *pFd) -#else -static int vgdrvFreeBSDOpen(struct cdev *pDev, int fOpen, struct thread *pTd) -#endif +static int vgdrvFreeBSDOpen(struct cdev *pDev, int fOpen, int DevType, struct thread *pTd) { int rc; PVBOXGUESTSESSION pSession; -@@ -250,12 +195,6 @@ +@@ -250,12 +195,6 @@ static int vgdrvFreeBSDOpen(struct cdev *pDev, int fOp LogFlow(("vgdrvFreeBSDOpen:\n")); /* - * Try grab it (we don't grab the giant, remember). - */ - if (!ASMAtomicCmpXchgPtr(&pDev->si_drv1, (void *)0x42, NULL)) - return EBUSY; - - /* * Create a new session. */ fRequestor = VMMDEV_REQUESTOR_USERMODE | VMMDEV_REQUESTOR_TRUST_NOT_GIVEN; -@@ -272,47 +211,20 @@ +@@ -272,47 +211,20 @@ static int vgdrvFreeBSDOpen(struct cdev *pDev, int fOp rc = VGDrvCommonCreateUserSession(&g_DevExt, fRequestor, &pSession); if (RT_SUCCESS(rc)) { - if (ASMAtomicCmpXchgPtr(&pDev->si_drv1, pSession, (void *)0x42)) - { - Log(("vgdrvFreeBSDOpen: success - g_DevExt=%p pSession=%p rc=%d pid=%d\n", &g_DevExt, pSession, rc, (int)RTProcSelf())); + Log(("vgdrvFreeBSDOpen: success - g_DevExt=%p pSession=%p rc=%d pid=%d\n", &g_DevExt, pSession, rc, (int)RTProcSelf())); + rc = devfs_set_cdevpriv(pSession, vgdrvFreeBSDDtr); + if (rc) + VGDrvCommonCloseSession(&g_DevExt, pSession); + else ASMAtomicIncU32(&cUsers); - return 0; - } - - VGDrvCommonCloseSession(&g_DevExt, pSession); + return rc; } LogRel(("vgdrvFreeBSDOpen: failed. rc=%d\n", rc)); return RTErrConvertToErrno(rc); } -/** - * File close handler - * - */ -static int vgdrvFreeBSDClose(struct cdev *pDev, int fFile, int DevType, struct thread *pTd) -{ - PVBOXGUESTSESSION pSession = (PVBOXGUESTSESSION)pDev->si_drv1; - Log(("vgdrvFreeBSDClose: fFile=%#x pSession=%p\n", fFile, pSession)); - /* - * Close the session if it's still hanging on to the device... - */ - if (RT_VALID_PTR(pSession)) - { - VGDrvCommonCloseSession(&g_DevExt, pSession); - if (!ASMAtomicCmpXchgPtr(&pDev->si_drv1, NULL, pSession)) - Log(("vgdrvFreeBSDClose: si_drv1=%p expected %p!\n", pDev->si_drv1, pSession)); - ASMAtomicDecU32(&cUsers); - /* Don't use destroy_dev here because it may sleep resulting in a hanging user process. */ - destroy_dev_sched(pDev); - } - else - Log(("vgdrvFreeBSDClose: si_drv1=%p!\n", pSession)); - return 0; -} - - /** * I/O control request. * -@@ -326,8 +238,12 @@ +@@ -326,8 +238,12 @@ static int vgdrvFreeBSDIOCtl(struct cdev *pDev, u_long static int vgdrvFreeBSDIOCtl(struct cdev *pDev, u_long ulCmd, caddr_t pvData, int fFile, struct thread *pTd) { PVBOXGUESTSESSION pSession; - devfs_get_cdevpriv((void **)&pSession); + int rc; + rc = devfs_get_cdevpriv((void **)&pSession); + if (rc) + return rc; + /* * Deal with the fast ioctl path first. */ -@@ -526,8 +442,10 @@ +@@ -526,8 +442,10 @@ static int vgdrvFreeBSDPoll(struct cdev *pDev, int fEv LogFlow(("vgdrvFreeBSDPoll: fEvents=%d\n", fEvents)); - PVBOXGUESTSESSION pSession = (PVBOXGUESTSESSION)pDev->si_drv1; - if (RT_UNLIKELY(!RT_VALID_PTR(pSession))) { + + rc = devfs_get_cdevpriv((void **)&pSession); + if (rc) + { Log(("vgdrvFreeBSDPoll: no state data for %s\n", devtoname(pDev))); return (fEvents & (POLLHUP|POLLIN|POLLRDNORM|POLLOUT|POLLWRNORM)); } -@@ -568,11 +486,8 @@ +@@ -568,11 +486,8 @@ static int vgdrvFreeBSDDetach(device_t pDevice) /* * Reverse what we did in vgdrvFreeBSDAttach. */ - if (g_vgdrvFreeBSDEHTag != NULL) - EVENTHANDLER_DEREGISTER(dev_clone, g_vgdrvFreeBSDEHTag); + destroy_dev(g_pDev); - clone_cleanup(&g_pvgdrvFreeBSDClones); - vgdrvFreeBSDRemoveIRQ(pDevice, pState); if (pState->pVMMDevMemRes) -@@ -737,18 +652,21 @@ +@@ -738,18 +653,21 @@ static int vgdrvFreeBSDAttach(device_t pDevice) VGDrvCommonProcessOptionsFromHost(&g_DevExt); /* - * Configure device cloning. + * Configure device. */ - clone_setup(&g_pvgdrvFreeBSDClones); - g_vgdrvFreeBSDEHTag = EVENTHANDLER_REGISTER(dev_clone, vgdrvFreeBSDClone, 0, 1000); - if (g_vgdrvFreeBSDEHTag) + g_pDev = make_dev(&g_vgdrvFreeBSDChrDevSW, + 0, + UID_ROOT, + GID_WHEEL, + 0664, + "vboxguest"); + if (g_pDev) { printf(DEVICE_NAME ": loaded successfully\n"); return 0; } - printf(DEVICE_NAME ": EVENTHANDLER_REGISTER(dev_clone,,,) failed\n"); - clone_cleanup(&g_pvgdrvFreeBSDClones); + printf(DEVICE_NAME ": make_dev failed\n"); vgdrvFreeBSDRemoveIRQ(pDevice, pState); } else -@@ -792,8 +710,12 @@ +@@ -793,8 +711,12 @@ static driver_t vgdrvFreeBSDDriver = sizeof(struct VBoxGuestDeviceState), }; +#if __FreeBSD_version >= 1400058 +DRIVER_MODULE(vboxguest, pci, vgdrvFreeBSDDriver, 0, 0); +#else static devclass_t vgdrvFreeBSDClass; DRIVER_MODULE(vboxguest, pci, vgdrvFreeBSDDriver, vgdrvFreeBSDClass, 0, 0); +#endif MODULE_VERSION(vboxguest, 1); diff --git a/emulators/virtualbox-ose-72/files/patch-src-VBox-Additions-common-VBoxGuest-freebsd-Makefile b/emulators/virtualbox-ose-72/files/patch-src-VBox-Additions-common-VBoxGuest-freebsd-Makefile index 476346a59b13..1430dbb721fb 100644 --- a/emulators/virtualbox-ose-72/files/patch-src-VBox-Additions-common-VBoxGuest-freebsd-Makefile +++ b/emulators/virtualbox-ose-72/files/patch-src-VBox-Additions-common-VBoxGuest-freebsd-Makefile @@ -1,27 +1,27 @@ ---- src/VBox/Additions/common/VBoxGuest/freebsd/Makefile.orig 2019-04-16 10:09:09 UTC +--- src/VBox/Additions/common/VBoxGuest/freebsd/Makefile.orig 2025-08-13 19:41:14 UTC +++ src/VBox/Additions/common/VBoxGuest/freebsd/Makefile -@@ -25,7 +25,7 @@ +@@ -35,7 +35,7 @@ KMOD = vboxguest # KMOD = vboxguest -CFLAGS += -DRT_OS_FREEBSD -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX -Iinclude -I. -Ir0drv -w -DVBGL_VBOXGUEST -DVBOX_WITH_HGCM -DVBOX_WITH_64_BITS_GUESTS +CFLAGS += -DRT_OS_FREEBSD -DIN_RING0 -DIN_RT_R0 -DIN_GUEST -DIN_GUEST_R0 -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX -Iinclude -I. -Ir0drv -w -DVBGL_VBOXGUEST -DVBOX_WITH_HGCM -DVBOX_WITH_64_BITS_GUESTS .if (${MACHINE_ARCH} == "i386") CFLAGS += -DRT_ARCH_X86 -@@ -80,6 +80,7 @@ SRCS += \ +@@ -91,6 +91,7 @@ SRCS += \ handletable.c \ handletablectx.c \ once.c \ + term.c \ thread.c .PATH: ${.CURDIR}/common/string -@@ -147,6 +148,7 @@ SRCS += \ +@@ -163,6 +164,7 @@ SRCS += \ .PATH: ${.CURDIR}/r0drv SRCS += \ + alloc-ef-r0drv.c \ alloc-r0drv.c \ initterm-r0drv.c \ memobj-r0drv.c \ diff --git a/emulators/virtualbox-ose-72/files/patch-src-VBox-Additions-common-VBoxGuest-freebsd-files_vboxguest b/emulators/virtualbox-ose-72/files/patch-src-VBox-Additions-common-VBoxGuest-freebsd-files_vboxguest index faecf870532b..57eed06c6dbe 100644 --- a/emulators/virtualbox-ose-72/files/patch-src-VBox-Additions-common-VBoxGuest-freebsd-files_vboxguest +++ b/emulators/virtualbox-ose-72/files/patch-src-VBox-Additions-common-VBoxGuest-freebsd-files_vboxguest @@ -1,34 +1,34 @@ ---- src/VBox/Additions/common/VBoxGuest/freebsd/files_vboxguest.orig 2019-01-25 18:12:28 UTC +--- src/VBox/Additions/common/VBoxGuest/freebsd/files_vboxguest.orig 2025-08-13 19:41:14 UTC +++ src/VBox/Additions/common/VBoxGuest/freebsd/files_vboxguest -@@ -63,6 +63,7 @@ FILES_VBOXGUEST_NOBIN=" \ +@@ -74,6 +74,7 @@ FILES_VBOXGUEST_NOBIN=" \ ${PATH_ROOT}/include/iprt/time.h=>include/iprt/time.h \ ${PATH_ROOT}/include/iprt/timer.h=>include/iprt/timer.h \ ${PATH_ROOT}/include/iprt/types.h=>include/iprt/types.h \ + ${PATH_ROOT}/include/iprt/uni.h=>include/iprt/uni.h \ ${PATH_ROOT}/include/iprt/utf16.h=>include/iprt/utf16.h \ ${PATH_ROOT}/include/iprt/uuid.h=>include/iprt/uuid.h \ ${PATH_ROOT}/include/iprt/crc.h=>include/iprt/crc.h \ -@@ -111,6 +112,7 @@ FILES_VBOXGUEST_NOBIN=" \ +@@ -125,6 +126,7 @@ FILES_VBOXGUEST_NOBIN=" \ ${PATH_ROOT}/src/VBox/Runtime/common/misc/handletable.h=>common/misc/handletable.h \ ${PATH_ROOT}/src/VBox/Runtime/common/misc/handletablectx.cpp=>common/misc/handletablectx.c \ ${PATH_ROOT}/src/VBox/Runtime/common/misc/once.cpp=>common/misc/once.c \ + ${PATH_ROOT}/src/VBox/Runtime/common/misc/term.cpp=>common/misc/term.c \ ${PATH_ROOT}/src/VBox/Runtime/common/misc/thread.cpp=>common/misc/thread.c \ ${PATH_ROOT}/src/VBox/Runtime/common/misc/RTAssertMsg1Weak.cpp=>common/misc/RTAssertMsg1Weak.c \ ${PATH_ROOT}/src/VBox/Runtime/common/misc/RTAssertMsg2.cpp=>common/misc/RTAssertMsg2.c \ -@@ -181,6 +183,7 @@ FILES_VBOXGUEST_NOBIN=" \ +@@ -200,6 +202,7 @@ FILES_VBOXGUEST_NOBIN=" \ ${PATH_ROOT}/src/VBox/Runtime/generic/errvars-generic.cpp=>generic/errvars-generic.c \ ${PATH_ROOT}/src/VBox/Runtime/generic/timer-generic.cpp=>generic/timer-generic.c \ ${PATH_ROOT}/src/VBox/Runtime/generic/mppresent-generic.cpp=>generic/mppresent-generic.c \ + ${PATH_ROOT}/src/VBox/Runtime/r0drv/alloc-ef-r0drv.cpp=>r0drv/alloc-ef-r0drv.c \ ${PATH_ROOT}/src/VBox/Runtime/r0drv/alloc-r0drv.cpp=>r0drv/alloc-r0drv.c \ ${PATH_ROOT}/src/VBox/Runtime/r0drv/alloc-r0drv.h=>r0drv/alloc-r0drv.h \ ${PATH_ROOT}/src/VBox/Runtime/r0drv/initterm-r0drv.cpp=>r0drv/initterm-r0drv.c \ -@@ -207,6 +210,7 @@ FILES_VBOXGUEST_NOBIN=" \ +@@ -226,6 +229,7 @@ FILES_VBOXGUEST_NOBIN=" \ ${PATH_ROOT}/src/VBox/Runtime/r0drv/freebsd/sleepqueue-r0drv-freebsd.h=>r0drv/freebsd/sleepqueue-r0drv-freebsd.h \ ${PATH_ROOT}/src/VBox/Runtime/r0drv/generic/semspinmutex-r0drv-generic.c=>r0drv/generic/semspinmutex-r0drv-generic.c \ ${PATH_ROOT}/src/VBox/Runtime/r0drv/generic/mpnotification-r0drv-generic.cpp=>r0drv/generic/mpnotification-r0drv-generic.c \ + ${PATH_ROOT}/src/VBox/Runtime/r0drv/generic/threadctxhooks-r0drv-generic.cpp=>r0drv/generic/threadctxhooks-r0drv-generic.c \ ${PATH_ROOT}/src/VBox/Runtime/r0drv/generic/RTMpIsCpuWorkPending-r0drv-generic.cpp=>r0drv/generic/RTMpIsCpuWorkPending-r0drv-generic.c \ ${PATH_ROOT}/src/VBox/Runtime/r0drv/memobj-r0drv.cpp=>r0drv/memobj-r0drv.c \ ${PATH_ROOT}/src/VBox/Runtime/VBox/log-vbox.cpp=>VBox/log-vbox.c \ diff --git a/emulators/virtualbox-ose-72/files/patch-src-VBox-Additions-x11-Installer-98vboxadd-xclient b/emulators/virtualbox-ose-72/files/patch-src-VBox-Additions-x11-Installer-98vboxadd-xclient index 56225943a922..5ac88befbb88 100644 --- a/emulators/virtualbox-ose-72/files/patch-src-VBox-Additions-x11-Installer-98vboxadd-xclient +++ b/emulators/virtualbox-ose-72/files/patch-src-VBox-Additions-x11-Installer-98vboxadd-xclient @@ -1,25 +1,25 @@ ---- src/VBox/Additions/x11/Installer/98vboxadd-xclient.orig 2025-01-21 19:49:30.000000000 +0700 -+++ src/VBox/Additions/x11/Installer/98vboxadd-xclient 2025-01-23 00:43:43.597269000 +0700 -@@ -42,15 +42,15 @@ +--- src/VBox/Additions/x11/Installer/98vboxadd-xclient.orig 2025-08-13 19:41:21 UTC ++++ src/VBox/Additions/x11/Installer/98vboxadd-xclient +@@ -42,15 +42,15 @@ elif test -z "${SSH_CONNECTION}"; then # not use "exit" here as this script is "source"d, not executed. # Check wheather X11 or Wayland version of VBoxClient should be started. - vbox_wl_check=$(/usr/bin/vboxwl --check 2> /dev/null) + vbox_wl_check=$(/usr/local/bin/vboxwl --check 2> /dev/null) if test "$vbox_wl_check" = "WL"; then - /usr/bin/VBoxClient --wayland + /usr/local/bin/VBoxClient --wayland else - /usr/bin/VBoxClient --clipboard - /usr/bin/VBoxClient --seamless - /usr/bin/VBoxClient --draganddrop + /usr/local/bin/VBoxClient --clipboard + /usr/local/bin/VBoxClient --seamless + /usr/local/bin/VBoxClient --draganddrop fi - /usr/bin/VBoxClient --checkhostversion - /usr/bin/VBoxClient --vmsvga-session # In case VMSVGA emulation is enabled + /usr/local/bin/VBoxClient --checkhostversion + /usr/local/bin/VBoxClient --vmsvga-session # In case VMSVGA emulation is enabled fi diff --git a/emulators/virtualbox-ose-72/files/patch-src-VBox-Devices-Network-slirp-bsd-sys-mbuf.h b/emulators/virtualbox-ose-72/files/patch-src-VBox-Devices-Network-slirp-bsd-sys-mbuf.h deleted file mode 100644 index b6ed2d2915db..000000000000 --- a/emulators/virtualbox-ose-72/files/patch-src-VBox-Devices-Network-slirp-bsd-sys-mbuf.h +++ /dev/null @@ -1,12 +0,0 @@ ---- src/VBox/Devices/Network/slirp/bsd/sys/mbuf.h.orig 2020-05-13 19:42:23 UTC -+++ src/VBox/Devices/Network/slirp/bsd/sys/mbuf.h -@@ -245,6 +245,9 @@ struct mbuf { - #define M_FRAG 0x00000800 /* packet is a fragment of a larger packet */ - #define M_FIRSTFRAG 0x00001000 /* packet is first fragment */ - #define M_LASTFRAG 0x00002000 /* packet is last fragment */ -+#ifdef M_SKIP_FIREWALL -+#undef M_SKIP_FIREWALL -+#endif - #define M_SKIP_FIREWALL 0x00004000 /* skip firewall processing */ - #define M_FREELIST 0x00008000 /* mbuf is on the free list */ - #define M_VLANTAG 0x00010000 /* ether_vtag is valid */ diff --git a/emulators/virtualbox-ose-72/files/patch-src-VBox-HostDrivers-VBoxNetAdp-Makefile.kmk b/emulators/virtualbox-ose-72/files/patch-src-VBox-HostDrivers-VBoxNetAdp-Makefile.kmk index 5b96ab56a61b..2427e708059b 100644 --- a/emulators/virtualbox-ose-72/files/patch-src-VBox-HostDrivers-VBoxNetAdp-Makefile.kmk +++ b/emulators/virtualbox-ose-72/files/patch-src-VBox-HostDrivers-VBoxNetAdp-Makefile.kmk @@ -1,20 +1,20 @@ ---- src/VBox/HostDrivers/VBoxNetAdp/Makefile.kmk.orig 2019-05-13 13:33:07 UTC +--- src/VBox/HostDrivers/VBoxNetAdp/Makefile.kmk.orig 2025-08-13 19:51:10 UTC +++ src/VBox/HostDrivers/VBoxNetAdp/Makefile.kmk -@@ -206,10 +206,14 @@ $$(VBoxNetAdp-src_0_OUTDIR)/Makefile: \ - $$(if $$(eq $$(VBoxNetAdp/freebsd/Makefile_VBOX_HARDENED),$$(VBOX_WITH_HARDENING)),,FORCE) \ - | $$(dir $$@) +@@ -220,10 +220,14 @@ ifeq ($(KBUILD_TARGET),freebsd) + $$(if $$(eq $$(VBoxNetAdp/freebsd/Makefile_VBOX_HARDENED),$$(VBOX_WITH_HARDENING)),,FORCE) \ + | $$(dir $$@) $(QUIET)$(RM) -f -- $@ - ifndef VBOX_WITH_HARDENING - $(QUIET)$(SED) -e "s;VBOX_WITH_HARDENING;;g" --output $@ $< - else $(QUIET)$(CP) -f $< $@ + ifndef VBOX_WITH_HARDENING + $(QUIET)$(SED) -e "s;-DVBOX_WITH_HARDENING;;g" --output $@.tmp $@ + $(QUIET)$(MV) -f $@.tmp $@ + endif + ifndef VBOX_WITH_NETFLT_VIMAGE + $(QUIET)$(SED) -e "s;-DVIMAGE;;g" --output $@.tmp $@ + $(QUIET)$(MV) -f $@.tmp $@ endif endif # freebsd diff --git a/emulators/virtualbox-ose-72/files/patch-src-VBox-HostDrivers-VBoxNetFlt-freebsd-files_vboxnetflt b/emulators/virtualbox-ose-72/files/patch-src-VBox-HostDrivers-VBoxNetFlt-freebsd-files_vboxnetflt index dc4e779fb6b0..1ee95be5b24d 100644 --- a/emulators/virtualbox-ose-72/files/patch-src-VBox-HostDrivers-VBoxNetFlt-freebsd-files_vboxnetflt +++ b/emulators/virtualbox-ose-72/files/patch-src-VBox-HostDrivers-VBoxNetFlt-freebsd-files_vboxnetflt @@ -1,10 +1,10 @@ ---- src/VBox/HostDrivers/VBoxNetFlt/freebsd/files_vboxnetflt.orig 2022-10-06 19:11:15.000000000 +0200 -+++ src/VBox/HostDrivers/VBoxNetFlt/freebsd/files_vboxnetflt 2024-12-26 15:41:50.870345000 +0100 -@@ -72,6 +72,7 @@ +--- src/VBox/HostDrivers/VBoxNetFlt/freebsd/files_vboxnetflt.orig 2025-08-13 19:51:11 UTC ++++ src/VBox/HostDrivers/VBoxNetFlt/freebsd/files_vboxnetflt +@@ -73,6 +73,7 @@ VBOX_VBOXNETFLT_SOURCES=" \ ${PATH_ROOT}/include/iprt/uni.h=>include/iprt/uni.h \ ${PATH_ROOT}/include/iprt/utf16.h=>include/iprt/utf16.h \ ${PATH_ROOT}/include/iprt/uuid.h=>include/iprt/uuid.h \ + ${PATH_ROOT}/include/iprt/x86.h=>include/iprt/x86.h \ ${PATH_ROOT}/include/iprt/x86-helpers.h=>include/iprt/x86-helpers.h \ ${PATH_ROOT}/include/iprt/nocrt/limits.h=>include/iprt/nocrt/limits.h \ ${PATH_ROOT}/include/VBox/cdefs.h=>include/VBox/cdefs.h \ diff --git a/emulators/virtualbox-ose-72/files/patch-src-VBox-Installer-Makefile.kmk b/emulators/virtualbox-ose-72/files/patch-src-VBox-Installer-Makefile.kmk index 45546433c627..f9e9ce8ec516 100644 --- a/emulators/virtualbox-ose-72/files/patch-src-VBox-Installer-Makefile.kmk +++ b/emulators/virtualbox-ose-72/files/patch-src-VBox-Installer-Makefile.kmk @@ -1,14 +1,14 @@ ---- src/VBox/Installer/Makefile.kmk.orig 2020-05-13 19:44:01 UTC +--- src/VBox/Installer/Makefile.kmk.orig 2025-08-13 19:51:15 UTC +++ src/VBox/Installer/Makefile.kmk -@@ -41,9 +41,11 @@ ifndef VBOX_ONLY_SDK +@@ -51,9 +51,11 @@ ifndef VBOX_ONLY_SDK if "$(KBUILD_TARGET)" == "win" && "$(KBUILD_HOST)" == "win" include $(PATH_SUB_CURRENT)/win/Makefile.kmk endif +if 0 if "$(KBUILD_TARGET)" == "freebsd" && "$(KBUILD_HOST)" == "freebsd" include $(PATH_SUB_CURRENT)/freebsd/Makefile.kmk endif +endif endif include $(PATH_SUB_CURRENT)/common/Makefile.kmk diff --git a/emulators/virtualbox-ose-72/files/patch-src-VBox-Main-src-server-VirtualBoxImpl.cpp b/emulators/virtualbox-ose-72/files/patch-src-VBox-Main-src-server-VirtualBoxImpl.cpp index 4cd8b7492ed9..85c886d9ec84 100644 --- a/emulators/virtualbox-ose-72/files/patch-src-VBox-Main-src-server-VirtualBoxImpl.cpp +++ b/emulators/virtualbox-ose-72/files/patch-src-VBox-Main-src-server-VirtualBoxImpl.cpp @@ -1,11 +1,11 @@ ---- src/VBox/Main/src-server/VirtualBoxImpl.cpp.orig 2021-01-07 15:41:43 UTC +--- src/VBox/Main/src-server/VirtualBoxImpl.cpp.orig 2025-08-13 19:51:27 UTC +++ src/VBox/Main/src-server/VirtualBoxImpl.cpp -@@ -2663,7 +2663,7 @@ int VirtualBox::i_encryptSettingBytes(const uint8_t *a +@@ -3097,7 +3097,7 @@ int VirtualBox::i_encryptSettingBytes(const uint8_t *a if (aCiphertextSize < 32) return VERR_INVALID_PARAMETER; - AssertCompile(sizeof(m->SettingsCipherKey) >= 32); + // AssertCompile(sizeof(m->SettingsCipherKey) >= 32); /* store the first 8 bytes of the cipherkey for verification */ for (i = 0, j = 0; i < 8; i++, j++) diff --git a/emulators/virtualbox-ose-72/files/patch-src-VBox-Runtime-r0drv-freebsd-sleepqueue-r0drv-freebsd.h b/emulators/virtualbox-ose-72/files/patch-src-VBox-Runtime-r0drv-freebsd-sleepqueue-r0drv-freebsd.h index c18492ebdf9b..d3f79ede9e50 100644 --- a/emulators/virtualbox-ose-72/files/patch-src-VBox-Runtime-r0drv-freebsd-sleepqueue-r0drv-freebsd.h +++ b/emulators/virtualbox-ose-72/files/patch-src-VBox-Runtime-r0drv-freebsd-sleepqueue-r0drv-freebsd.h @@ -1,39 +1,39 @@ Without the first part of this patch, any waits for periods shorter than a single tick return immediately leading to a lot of unnecessary spinning. For example, I observe that my guest's idle loop does a lot of sleeps with periods slightly shorter than 1 ms (1/hz), e.g. 900us. All that waiting turns into pure spinning and VirtualBox eats 100% of a core. The clamping improves the situation significantly. Also, it (approximately) follows what tvtohz does. The rest of the patch just chases an upstream KPI change. Submitted by: Andriy Gapon ---- src/VBox/Runtime/r0drv/freebsd/sleepqueue-r0drv-freebsd.h.orig 2024-07-29 13:10:32 UTC +--- src/VBox/Runtime/r0drv/freebsd/sleepqueue-r0drv-freebsd.h.orig 2025-08-13 19:51:51 UTC +++ src/VBox/Runtime/r0drv/freebsd/sleepqueue-r0drv-freebsd.h -@@ -84,6 +84,8 @@ DECLINLINE(uint32_t) rtR0SemBsdWaitUpdateTimeout(PRTR0 +@@ -94,6 +94,8 @@ DECLINLINE(uint32_t) rtR0SemBsdWaitUpdateTimeout(PRTR0 uint64_t cTicks = ASMMultU64ByU32DivByU32(uTimeout, hz, UINT32_C(1000000000)); if (cTicks >= INT_MAX) return RTSEMWAIT_FLAGS_INDEFINITE; + else if (cTicks == 0 && uTimeout > 0) + pWait->iTimeout = 1; else pWait->iTimeout = (int)cTicks; #endif -@@ -300,10 +302,16 @@ DECLINLINE(void) rtR0SemBsdSignal(void *pvWaitChan) +@@ -310,10 +312,16 @@ DECLINLINE(void) rtR0SemBsdSignal(void *pvWaitChan) DECLINLINE(void) rtR0SemBsdSignal(void *pvWaitChan) { sleepq_lock(pvWaitChan); +#if __FreeBSD_version < 1500022 int fWakeupSwapProc = sleepq_signal(pvWaitChan, SLEEPQ_CONDVAR, 0, 0); +#else + sleepq_signal(pvWaitChan, SLEEPQ_CONDVAR, 0, 0); +#endif sleepq_release(pvWaitChan); +#if __FreeBSD_version < 1500022 if (fWakeupSwapProc) kick_proc0(); +#endif } /** diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_common_VBoxService_VBoxServiceVMInfo.cpp b/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_common_VBoxService_VBoxServiceVMInfo.cpp index 70b459e94da7..0c463e3d9923 100644 --- a/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_common_VBoxService_VBoxServiceVMInfo.cpp +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_common_VBoxService_VBoxServiceVMInfo.cpp @@ -1,71 +1,71 @@ ---- src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo.cpp.orig 2021-01-07 15:34:20 UTC +--- src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo.cpp.orig 2025-08-13 19:41:16 UTC +++ src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo.cpp -@@ -67,8 +67,8 @@ +@@ -77,8 +77,8 @@ # include # include /* getpwuid */ # include -# if !defined(RT_OS_OS2) && !defined(RT_OS_FREEBSD) && !defined(RT_OS_HAIKU) -# include /** @todo FreeBSD 9 should have this. */ +# if !defined(RT_OS_OS2) && !defined(RT_OS_HAIKU) +# include # endif # ifdef RT_OS_OS2 # include -@@ -528,7 +528,7 @@ static void vgsvcVMInfoWriteFixedProperties(void) +@@ -573,7 +573,7 @@ static void vgsvcVMInfoWriteFixedProperties(void) } -#if defined(VBOX_WITH_DBUS) && defined(RT_OS_LINUX) /* Not yet for Solaris/FreeBSB. */ +#if defined(VBOX_WITH_DBUS) && (defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD)) /* Not yet for Solaris. */ /* - * Simple wrapper to work around compiler-specific va_list madness. + * Simple wrappers to work around compiler-specific va_list madness. */ -@@ -555,12 +555,6 @@ static int vgsvcVMInfoWriteUsers(void) +@@ -702,12 +702,6 @@ static int vgsvcVMInfoWriteUsers(void) #ifdef RT_OS_WINDOWS rc = VGSvcVMInfoWinWriteUsers(&g_VMInfoPropCache, &pszUserList, &cUsersInList); -#elif defined(RT_OS_FREEBSD) - /** @todo FreeBSD: Port logged on user info retrieval. - * However, FreeBSD 9 supports utmpx, so we could use the code - * block below (?). */ - rc = VERR_NOT_IMPLEMENTED; - #elif defined(RT_OS_HAIKU) /** @todo Haiku: Port logged on user info retrieval. */ rc = VERR_NOT_IMPLEMENTED; -@@ -586,7 +580,7 @@ static int vgsvcVMInfoWriteUsers(void) +@@ -733,7 +727,7 @@ static int vgsvcVMInfoWriteUsers(void) while ( (ut_user = getutxent()) && RT_SUCCESS(rc)) { -# ifdef RT_OS_DARWIN /* No ut_user->ut_session on Darwin */ +# if defined(RT_OS_DARWIN) || defined(RT_OS_FREEBSD) /* No ut_user->ut_session on Darwin/FreeBSD */ VGSvcVerbose(4, "Found entry '%s' (type: %d, PID: %RU32)\n", ut_user->ut_user, ut_user->ut_type, ut_user->ut_pid); # else VGSvcVerbose(4, "Found entry '%s' (type: %d, PID: %RU32, session: %RU32)\n", -@@ -621,7 +615,7 @@ static int vgsvcVMInfoWriteUsers(void) +@@ -749,7 +743,7 @@ static int vgsvcVMInfoWriteUsers(void) } # ifdef VBOX_WITH_DBUS -# if defined(RT_OS_LINUX) /* Not yet for Solaris/FreeBSB. */ +# if defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD) /* Not yet for Solaris. */ DBusError dbErr; DBusConnection *pConnection = NULL; int rc2 = RTDBusLoadLib(); -@@ -830,7 +824,7 @@ static int vgsvcVMInfoWriteUsers(void) +@@ -1074,7 +1068,7 @@ static int vgsvcVMInfoWriteUsers(void) if ( fHaveLibDbus && dbus_error_is_set(&dbErr)) dbus_error_free(&dbErr); -# endif /* RT_OS_LINUX */ +# endif /* RT_OS_LINUX || RT_OS_FREEBSD */ # endif /* VBOX_WITH_DBUS */ - /** @todo Fedora/others: Handle systemd-loginctl. */ -@@ -867,7 +861,7 @@ static int vgsvcVMInfoWriteUsers(void) + /* Calc the string length. */ +@@ -1109,7 +1103,7 @@ static int vgsvcVMInfoWriteUsers(void) RTMemFree(papszUsers); endutxent(); /* Close utmpx file. */ -#endif /* !RT_OS_WINDOWS && !RT_OS_FREEBSD && !RT_OS_HAIKU && !RT_OS_OS2 */ +#endif /* !RT_OS_WINDOWS && !RT_OS_HAIKU && !RT_OS_OS2 */ Assert(RT_FAILURE(rc) || cUsersInList == 0 || (pszUserList && *pszUserList)); diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_common_pam_pam__vbox.cpp b/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_common_pam_pam__vbox.cpp index bd667880358f..ff9853417bdd 100644 --- a/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_common_pam_pam__vbox.cpp +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_common_pam_pam__vbox.cpp @@ -1,20 +1,20 @@ ---- src/VBox/Additions/common/pam/pam_vbox.cpp.orig 2021-01-07 15:34:21 UTC +--- src/VBox/Additions/common/pam/pam_vbox.cpp.orig 2025-08-13 19:41:17 UTC +++ src/VBox/Additions/common/pam/pam_vbox.cpp -@@ -104,7 +104,7 @@ static void pam_vbox_writesyslog(char *pszBuf) +@@ -113,7 +113,7 @@ static void pam_vbox_writesyslog(char *pszBuf) openlog("pam_vbox", LOG_PID, LOG_AUTHPRIV); syslog(LOG_ERR, "%s", pszBuf); closelog(); -#elif defined(RT_OS_SOLARIS) +#elif defined(RT_OS_FREEBSD) || defined(RT_OS_SOLARIS) syslog(LOG_ERR, "pam_vbox: %s\n", pszBuf); #endif } -@@ -183,7 +183,7 @@ static int vbox_set_msg(pam_handle_t *hPAM, int iStyle +@@ -192,7 +192,7 @@ static int vbox_set_msg(pam_handle_t *hPAM, int iStyle pam_message msg; msg.msg_style = iStyle; -#ifdef RT_OS_SOLARIS +#if defined(RT_OS_FREEBSD) || defined(RT_OS_SOLARIS) msg.msg = (char*)pszText; #else msg.msg = pszText; diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_Makefile b/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_Makefile index c38d8013a6d6..4f026e38c70a 100644 --- a/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_Makefile +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_Makefile @@ -1,38 +1,38 @@ ---- src/VBox/Additions/freebsd/Makefile.orig 2020-05-13 19:37:06 UTC +--- src/VBox/Additions/freebsd/Makefile.orig 2025-08-13 19:41:17 UTC +++ src/VBox/Additions/freebsd/Makefile -@@ -30,6 +30,14 @@ all: +@@ -40,6 +40,14 @@ all: cp vboxvfs/vboxvfs.ko .; \ fi; \ fi + @echo + @if [ -d mount_vboxvfs ]; then \ + echo "=== Building mount_vboxvfs binary ==="; \ + $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C mount_vboxvfs clean obj depend all; \ + if [ -f mount_vboxvfs ]; then \ + cp mount_vboxvfs/mount_vboxvfs .; \ + fi; \ + fi install: -@@ -37,13 +45,19 @@ install: +@@ -47,13 +55,19 @@ install: @if [ -d vboxvfs ]; then \ $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxvfs install; \ fi + @if [ -d mount_vboxvfs ]; then \ + $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C mount_vboxvfs install; \ + fi clean: @$(MAKE) -C vboxguest clean @if [ -d vboxvfs ]; then \ $(MAKE) -C vboxvfs clean; \ fi - rm -f vboxguest.*o vboxvfs.*o + @if [ -d mount_vboxvfs ]; then \ + $(MAKE) -C mount_vboxvfs clean; \ + fi + rm -f vboxguest.*o vboxvfs.*o mount_vboxvfs load: @/sbin/kldunload vboxvfs || true diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_Makefile.kmk b/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_Makefile.kmk index f9d19d679e4a..821e1fc5d431 100644 --- a/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_Makefile.kmk +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_Makefile.kmk @@ -1,31 +1,31 @@ ---- src/VBox/Additions/freebsd/Makefile.kmk.orig 2021-01-07 15:34:22 UTC +--- src/VBox/Additions/freebsd/Makefile.kmk.orig 2025-08-13 19:41:17 UTC +++ src/VBox/Additions/freebsd/Makefile.kmk -@@ -23,8 +23,9 @@ $(error "The FreeBSD guest additions installer can onl +@@ -33,8 +33,9 @@ endif endif # Include sub-makefiles. -#include $(PATH_SUB_CURRENT)/vboxvfs/Makefile.kmk -include $(PATH_SUB_CURRENT)/drm/Makefile.kmk +include $(PATH_SUB_CURRENT)/vboxvfs/Makefile.kmk +#include $(PATH_SUB_CURRENT)/drm/Makefile.kmk +include $(PATH_SUB_CURRENT)/mount_vboxvfs/Makefile.kmk # # Globals -@@ -66,11 +67,14 @@ VBOX_FBSD_ADD_STRIP_BIN = \ +@@ -76,11 +77,14 @@ VBOX_FBSD_ADD_STRIP_BIN = \ vboxvideo_drv_14.so \ vboxvideo_drv_15.so \ vboxvideo_drv_16.so \ - vboxvideo_drv_17.so + vboxvideo_drv_17.so \ + $(if $(VBOX_WITH_PAM),pam_vbox.so,) \ + VBoxOGL.so \ + mount_vboxvfs VBOX_FBSD_ADD_MODULES = \ vboxguest \ - vboxvideo_drm + vboxvfs # # All the bin files that go into the archives. diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_drm_vboxvideo__drm.c b/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_drm_vboxvideo__drm.c index d4e5f3fc5a33..3ab11cbd1ed7 100644 --- a/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_drm_vboxvideo__drm.c +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_drm_vboxvideo__drm.c @@ -1,17 +1,17 @@ ---- src/VBox/Additions/freebsd/drm/vboxvideo_drm.c.orig 2022-07-26 18:05:21 UTC +--- src/VBox/Additions/freebsd/drm/vboxvideo_drm.c.orig 2025-08-13 19:41:18 UTC +++ src/VBox/Additions/freebsd/drm/vboxvideo_drm.c -@@ -154,10 +154,14 @@ static driver_t vboxvideo_driver = { +@@ -164,10 +164,14 @@ static driver_t vboxvideo_driver = { sizeof(struct drm_device) }; +#if __FreeBSD_version >= 1400058 +DRIVER_MODULE(vboxvideo, vgapci, vboxvideo_driver, 0, 0); +#else extern devclass_t drm_devclass; #if __FreeBSD_version >= 700010 DRIVER_MODULE(vboxvideo, vgapci, vboxvideo_driver, drm_devclass, 0, 0); #else DRIVER_MODULE(vboxvideo, pci, vboxvideo_driver, drm_devclass, 0, 0); +#endif #endif MODULE_DEPEND(vboxvideo, drm, 1, 1, 1); diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_mount__vboxvfs_mount__vboxvfs.8 b/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_mount__vboxvfs_mount__vboxvfs.8 index 88460e155de3..41fcdd6d019b 100644 --- a/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_mount__vboxvfs_mount__vboxvfs.8 +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_mount__vboxvfs_mount__vboxvfs.8 @@ -1,56 +1,56 @@ ---- src/VBox/Additions/freebsd/mount_vboxvfs/mount_vboxvfs.8.orig 1970-01-01 01:00:00.000000000 +0100 -+++ src/VBox/Additions/freebsd/mount_vboxvfs/mount_vboxvfs.8 2017-07-12 19:24:26.106029000 +0200 +--- src/VBox/Additions/freebsd/mount_vboxvfs/mount_vboxvfs.8.orig 2025-08-28 22:09:24 UTC ++++ src/VBox/Additions/freebsd/mount_vboxvfs/mount_vboxvfs.8 @@ -0,0 +1,53 @@ +.\" +.\" Copyright (c) 1992, 1993, 1994 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.Dd August 5, 2013 +.Dt MOUNT_VBOXFS 8 +.Os +.Sh NAME +.Nm mount_vboxfs +.Nd "Mount the VirtualBox shared folder NAME from the host system to MOUNTPOINT" +.Sh SYNOPSIS +.Nm +.Op Fl o Ar options +.Ar NAME +.Ar MOUNTPOINT +.Sh DESCRIPTION +The +.Nm +Mount the VirtualBox shared folder NAME from the host system to MOUNTPOINT +.Pp +The options are as follows: +.Bl -tag -width indent +.Fl w +mount the shared folder writably (the default) +.Fl r +mount the shared folder read-only +.Fl o +OPTION[,OPTION...] use the mount options specified +.El diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_mount__vboxvfs_mount__vboxvfs.c b/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_mount__vboxvfs_mount__vboxvfs.c index 7dd7e6271e03..1f85abc198b9 100644 --- a/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_mount__vboxvfs_mount__vboxvfs.c +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_mount__vboxvfs_mount__vboxvfs.c @@ -1,171 +1,171 @@ ---- src/VBox/Additions/freebsd/mount_vboxvfs/mount_vboxvfs.c.orig 1970-01-01 01:00:00.000000000 +0100 -+++ src/VBox/Additions/freebsd/mount_vboxvfs/mount_vboxvfs.c 2017-07-12 19:24:26.106029000 +0200 +--- src/VBox/Additions/freebsd/mount_vboxvfs/mount_vboxvfs.c.orig 2025-08-28 22:09:24 UTC ++++ src/VBox/Additions/freebsd/mount_vboxvfs/mount_vboxvfs.c @@ -0,0 +1,168 @@ +/* +* Copyright (c) 1992, 1993, 1994 +* The Regents of the University of California. All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions +* are met: +* 1. Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* 2. Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* 4. Neither the name of the University nor the names of its contributors +* may be used to endorse or promote products derived from this software +* without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +* SUCH DAMAGE. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "mntopts.h" + +#define MAX_HOST_NAME 256 +static char mount_point[MAXPATHLEN + 1]; +static char vboxfs_vfsname[] = "vboxvfs"; +static struct mntopt mopts[] = { + MOPT_STDOPTS, + MOPT_END +}; + +static void usage(void) __dead2; + +static void +usage(void) +{ + fprintf(stderr, + "Usage: [OPTIONS] NAME MOUNTPOINT\n" + "Mount the VirtualBox shared folder NAME to MOUNTPOINT.\n" + "\nOptions:\n" + " -w mount the shared folder writable \n" + " -r mount the shared folder read-only (the default)\n"); + exit(1); +} + +int +main(int argc, char *argv[]) +{ + struct iovec *iov; + struct stat st; + char *host_name; + char errmsg[255]; + uid_t uid; + gid_t gid; + mode_t dir_mode, file_mode; + int iovlen; + int ronly = 0; + int error, ch; + int mntflags = 0; + + iov = NULL; + iovlen = 0; + errmsg[0] = '\0'; + uid = (uid_t)-1; + gid = (gid_t)-1; + file_mode = 0; + dir_mode = 0; + + while ((ch = getopt(argc, argv, "rwo:h")) != -1) + switch(ch) { + default: + fprintf(stderr, "unknown option `%c:%#x'\n", ch, ch); + return (1); + + case '?': + case 'h': + usage(); + case 'r': + ronly = 1; + break; + case 'w': + ronly = 0; + break; + case 'o': + getmntopts(optarg, mopts, &mntflags, 0); + break; + } + + if (argc - optind < 2) + usage(); + + host_name = argv[optind]; + realpath(argv[optind+1], mount_point); + + if (stat(mount_point, &st) == -1) + err(EX_OSERR, "could not find mount point %s", mount_point); + + if (!S_ISDIR(st.st_mode)) { + errno = ENOTDIR; + err(EX_OSERR, "can't mount on %s", mount_point); + } + + if (strlen(host_name) > MAX_HOST_NAME - 1) + err(EX_OSERR, "host name is too big %s", host_name); + + if (ronly == 0) + mntflags |= MNT_ASYNC; + if (uid == (uid_t)-1) + uid = st.st_uid; + if (gid == (gid_t)-1) + gid = st.st_gid; + if (file_mode == 0) + file_mode = st.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO); + if (dir_mode == 0) { + dir_mode = file_mode; + if (dir_mode & S_IRUSR) + dir_mode |= S_IXUSR; + if (dir_mode & S_IRGRP) + dir_mode |= S_IXGRP; + if (dir_mode & S_IROTH) + dir_mode |= S_IXOTH; + } + + build_iovec(&iov, &iovlen, "fstype", vboxfs_vfsname, (size_t)-1); + build_iovec(&iov, &iovlen, "fspath", mount_point, (size_t)-1); + build_iovec(&iov, &iovlen, "from", host_name, (size_t)-1); + build_iovec_argf(&iov, &iovlen, "uid", "%d", uid); + build_iovec_argf(&iov, &iovlen, "gid", "%d", gid); + build_iovec_argf(&iov, &iovlen, "file_mode", "%o", file_mode); + build_iovec_argf(&iov, &iovlen, "dir_mode", "%o", dir_mode); + build_iovec(&iov, &iovlen, "errmsg", errmsg, sizeof(errmsg)); + + error = nmount(iov, iovlen, mntflags); + if (error == -1) { + if (errmsg[0] != '\0') + err(1, "%s: error: %s", mount_point, errmsg); + else + err(1, "%s: error %d", mount_point, error); + } + + return (0); +} diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs.h b/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs.h index 858e894c7b6b..46b57e5a9d13 100644 --- a/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs.h +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs.h @@ -1,428 +1,428 @@ ---- src/VBox/Additions/freebsd/vboxvfs/vboxvfs.h.orig 2021-01-07 15:34:22 UTC +--- src/VBox/Additions/freebsd/vboxvfs/vboxvfs.h.orig 2025-08-13 19:41:18 UTC +++ src/VBox/Additions/freebsd/vboxvfs/vboxvfs.h @@ -1,8 +1,3 @@ -/* $Id: vboxvfs.h $ */ -/** @file - * Description. - */ - /* - * Copyright (C) 2010-2020 Oracle Corporation + * Copyright (C) 2010-2025 Oracle and/or its affiliates. * -@@ -24,72 +19,378 @@ +@@ -34,72 +29,378 @@ #define VBOXVFS_VFSNAME "vboxvfs" #define VBOXVFS_VERSION 1 -#define MAX_HOST_NAME 256 -#define MAX_NLS_NAME 32 +#define MAX_HOST_NAME 256 +#define MAX_NLS_NAME 32 +//#define MODEMASK 07777 /* mode bits plus permission bits */ +/** Helper macros */ +#define VFSTOVBOXFS(mp) ((struct vboxfs_mnt *)((mp)->mnt_data)) +#define VP_TO_VBOXFS_NODE(vp) ((struct vboxfs_node *)(vp)->v_data) +#define VBOXTOV(np) ((struct vnode *)(np)->n_vnode) -struct vboxvfs_mount_info { - char name[MAX_HOST_NAME]; - char nls_name[MAX_NLS_NAME]; - int uid; - int gid; - int ttl; -}; +#define ROOTDIR_INO 1 +#define THEFILE_INO 2 +#define THEFILE_NAME "thefile" +#define VBOXFS_NODE_LOCK(node) mtx_lock(&(node)->sf_interlock) +#define VBOXFS_NODE_UNLOCK(node) mtx_unlock(&(node)->sf_interlock) +#define VBOXFS_NODE_MTX(node) (&(node)->sf_interlock) +#define VBOXFS_NODE_ASSERT_LOCKED(node) mtx_assert(VBOXFS_NODE_MTX(node), \ + MA_OWNED) + +#ifdef INVARIANTS +#define VBOXFS_ASSERT_LOCKED(node) do { \ + MPASS(node != NULL); \ + MPASS(node->sf_vnode != NULL); \ + if (!VOP_ISLOCKED(node->sf_vnode) && \ + !mtx_owned(VBOXFS_NODE_MTX(node))) \ + panic("vboxfs: node is not locked: %p", node); \ + } while (0) +#define VBOXFS_ASSERT_ELOCKED(node) do { \ + MPASS((node) != NULL); \ + MPASS((node)->sf_vnode != NULL); \ + mtx_assert(VBOXFS_NODE_MTX(node), MA_OWNED); \ + ASSERT_VOP_LOCKED((node)->sf_vnode, "vboxfs"); \ + } while (0) +#else +#define VBOXFS_ASSERT_LOCKED(node) (void)0 +#define VBOXFS_ASSERT_ELOCKED(node) (void)0 +#endif + +#define VBOXFS_VNODE_ALLOCATING 1 +#define VBOXFS_VNODE_WANT 2 +#define VBOXFS_VNODE_DOOMED 4 +#define VBOXFS_VNODE_WRECLAIM 8 + +MALLOC_DECLARE(M_VBOXVFS); + #ifdef _KERNEL +#ifndef FREEBSD_STYLE +#include "../../../../../include/iprt/nocrt/limits.h" +#include "../../../../../include/iprt/alloc.h" +#include "../../../../../include/iprt/asm.h" +#include "../../../../../include/iprt/asm-amd64-x86.h" +#include "../../../../../include/iprt/asm-math.h" +#include "../../../../../include/iprt/assert.h" +#include "../../../../../include/iprt/cdefs.h" +#include "../../../../../include/iprt/err.h" +#include "../../../../../include/iprt/fs.h" +#include "../../../../../include/iprt/log.h" +#include "../../../../../include/iprt/mem.h" +#include "../../../../../include/iprt/param.h" +#include "../../../../../include/iprt/path.h" +#include "../../../../../include/iprt/semaphore.h" +#include "../../../../../include/iprt/stdarg.h" +#include "../../../../../include/iprt/stdint.h" +#include "../../../../../include/iprt/string.h" +#include "../../../../../include/iprt/time.h" +#include "../../../../../include/iprt/types.h" +#include "../../../../../include/iprt/uni.h" -#include +#else + +#include "iprt/nocrt/limits.h" +#include "iprt/alloc.h" +#include "iprt/asm.h" +#include "iprt/asm-amd64-x86.h" +#include "iprt/asm-math.h" +#include "iprt/assert.h" +#include "iprt/cdefs.h" +#include "iprt/err.h" +#include "iprt/fs.h" +#include "iprt/log.h" +#include "iprt/mem.h" +#include "iprt/param.h" +#include "iprt/path.h" +#include "iprt/semaphore.h" +#include "iprt/stdarg.h" +#include "iprt/stdint.h" +#include "iprt/string.h" +#include "iprt/time.h" +#include "iprt/types.h" +#include "iprt/uni.h" + +#include "common/VBoxGuestLib/SysHlp.h" + +#endif /* !FREEBSD_STYLE */ + #include #include +#include -struct vboxvfsmount { - uid_t uid; - gid_t gid; - mode_t file_mode; - mode_t dir_mode; - struct mount *mp; - struct ucred *owner; - u_int flags; - long nextino; - int caseopt; - int didrele; +#include + +#if __FreeBSD_version >= 1400093 +typedef __enum_uint8(vtype) enum_vtype_t; +#else +typedef enum vtype enum_vtype_t; +#endif + +#define VBOXVFS_DEBUG(lvl, ...) do { \ + if (vboxvfs_debug >= (lvl)) { \ + printf("VBOXVFS[%u]: ", lvl); \ + printf(__VA_ARGS__); \ + printf("\n"); \ + } \ +} while (0) + +/* + * representation of an active mount point + */ +struct sfp_mount { + VBGLSFMAP map; }; -/* structs - stolen from the linux shared module code */ +/* + * Mount / Unmount a shared folder. + * + * sfprov_mount() takes as input the connection pointer and the name of + * the shared folder. On success, it returns zero and supplies an + * sfp_mount_t handle. On failure it returns any relevant errno value. + * + * sfprov_unmount() unmounts the mounted file system. It returns 0 on + * success and any relevant errno on failure. + */ +typedef struct sfp_mount sfp_mount_t; + +struct sfp_file { + SHFLHANDLE handle; + VBGLSFMAP map; /* need this again for the close operation */ +}; + +typedef struct sfp_file sfp_file_t; + +/* + * File operations: open/close/read/write/etc. + * + * open/create can return any relevant errno, however ENOENT + * generally means that the host file didn't exist. + */ +typedef struct sffs_stat { + mode_t sf_mode; + off_t sf_size; + off_t sf_alloc; + struct timespec sf_atime; + struct timespec sf_mtime; + struct timespec sf_ctime; +} sffs_stat_t; + +/* + * Read directory entries. + */ +/* + * a singly linked list of buffers, each containing an array of stat's+dirent's. + * sf_len is length of the sf_entries array, in bytes. + */ +typedef struct sffs_dirents { + struct sffs_dirents *sf_next; + long long sf_len; + struct sffs_dirent { + sffs_stat_t sf_stat; + struct dirent sf_entry; /* this is variable length */ + off_t sf_off; + } sf_entries[1]; +} sffs_dirents_t; + +/* + * Shared Folders filesystem per-mount data structure. + */ +struct vboxfs_mnt { + struct mount *sf_vfsp; /* filesystem's vfs struct */ + sfp_mount_t *sf_handle; /* guest-host communication handle */ + uid_t sf_uid; /* owner of all shared folders */ + gid_t sf_gid; /* group of all shared folders */ + mode_t sf_dmode; /* mode of all directories */ + mode_t sf_fmode; /* mode of all files */ + mode_t sf_dmask; /* mask of all directories */ + mode_t sf_fmask; /* mask of all files */ + int sf_stat_ttl; /* ttl for stat caches (in ms) */ + int sf_fsync; /* whether to honor fsync or not */ + uint64_t sf_ino; /* per FS ino generator */ + uma_zone_t sf_node_pool; + struct vboxfs_node *sf_root; +}; + +/* + * vboxfs_node is the file system dependent vnode data for vboxfs. + * vboxfs_node's also track all files ever accessed, both open and closed. + * It duplicates some of the information in vnode, since it holds + * information for files that may have been completely closed. + * + */ +struct vboxfs_node { + struct vboxfs_mnt *vboxfsmp; /* containing mounted file system */ + char *sf_path; /* full pathname to file or dir */ + uint64_t sf_ino; /* assigned unique ID number */ + struct vnode *sf_vnode; /* vnode if active */ + sfp_file_t *sf_file; /* non NULL if open */ + struct vboxfs_node *sf_parent; /* parent sfnode of this one */ + uint32_t sf_opencnt; /* sf_file reference counter */ + uint16_t sf_children; /* number of children sfnodes */ + uint8_t sf_type; /* VDIR or VREG */ + uint8_t sf_vpstate; /* XXX: ADD COMMENT */ + uint8_t sf_is_stale; /* this is stale and should be purged */ + sffs_stat_t sf_stat; /* cached file attrs for this node */ + uint64_t sf_stat_time; /* last-modified time of sf_stat */ + sffs_dirents_t *sf_dir_list; /* list of entries for this directory */ + + /* interlock to protect sf_vpstate, sf_file and sf_opencnt */ + struct mtx sf_interlock; +}; + +struct vboxfs_mount_info { + char name[MAX_HOST_NAME]; /* share name */ + char nls_name[MAX_NLS_NAME];/* name of an I/O charset */ + int uid; /* user ID for all entries, default 0=root */ + int gid; /* group ID for all entries, default 0=root */ + int ttl; /* time to live */ + int dmode; /* mode for directories if != 0xffffffff */ + int fmode; /* mode for regular files if != 0xffffffff */ + int dmask; /* umask applied to directories */ + int fmask; /* umask applied to regular files */ +}; + struct sf_glob_info { - VBGLSFMAP map; -/* struct nls_table *nls;*/ - int ttl; - int uid; - int gid; - struct vnode *vnode_root; + VBGLSFMAP map; +/* struct nls_table *nls;*/ + int ttl; + int uid; + int gid; + struct vnode *vnode_root; }; +/** Per-file system mount instance data. */ +typedef struct vboxfs_globinfo +{ + VBGLSFMAP Map; + int Ttl; + int Uid; + int Gid; + struct mount *pVFS; + struct vboxfs_node *pVNodeRoot; +} vboxfs_globinfo_t; + struct sf_inode_info { - SHFLSTRING *path; - int force_restat; + SHFLSTRING *path; + int force_restat; }; #if 0 struct sf_dir_info { - struct list_head info_list; + struct list_head info_list; }; #endif struct sf_dir_buf { - size_t nb_entries; - size_t free_bytes; - size_t used_bytes; - void *buf; + size_t nb_entries; + size_t free_bytes; + size_t used_bytes; + void *buf; #if 0 - struct list_head head; + struct list_head head; #endif }; struct sf_reg_info { - SHFLHANDLE handle; + SHFLHANDLE handle; }; +int vboxfs_alloc_vp(struct mount *, struct vboxfs_node *, int, + struct vnode **); +void vboxfs_free_vp(struct vnode *); + +int vboxfs_alloc_node(struct mount *, struct vboxfs_mnt *, const char*, + enum_vtype_t, uid_t, gid_t, mode_t, struct vboxfs_node *, + struct vboxfs_node **); +void vboxfs_free_node(struct vboxfs_mnt *, struct vboxfs_node *); + +/* + * These are the provider interfaces used by sffs to access the underlying + * shared file system. + */ +#define SFPROV_VERSION 1 + +/* + * Initialization and termination. + * sfprov_connect() is called once before any other interfaces and returns + * a handle used in further calls. The argument should be SFPROV_VERSION + * from above. On failure it returns a NULL pointer. + * + * sfprov_disconnect() must only be called after all sf file systems have been + * unmounted. + */ +typedef struct sfp_connection sfp_connection_t; + +extern sfp_connection_t *sfprov_connect(int); +extern void sfprov_disconnect(void); + +extern int sfprov_mount(char *, sfp_mount_t **); +extern int sfprov_unmount(sfp_mount_t *); + +/* + * query information about a mounted file system + */ +typedef struct sffs_fsinfo { + uint64_t blksize; + uint64_t blksused; + uint64_t blksavail; + uint32_t maxnamesize; + uint32_t readonly; + uint32_t serial; +} sffs_fsinfo_t; + +extern int sfprov_get_fsinfo(sfp_mount_t *, sffs_fsinfo_t *); + +extern int sfprov_create(sfp_mount_t *, char *path, mode_t mode, + sffs_stat_t *stat); +extern int sfprov_open(sfp_mount_t *, char *path, sfp_file_t **fp); +extern int sfprov_close(sfp_file_t *fp); +extern int sfprov_read(sfp_file_t *, char * buffer, uint64_t offset, + uint32_t *numbytes, int buflocked); +extern int sfprov_write(sfp_file_t *, char * buffer, uint64_t offset, + uint32_t *numbytes, int buflocked); +extern int sfprov_fsync(sfp_file_t *fp); + + +/* + * get/set information about a file (or directory) using pathname + */ +extern int sfprov_get_mode(sfp_mount_t *, char *, mode_t *); +extern int sfprov_get_size(sfp_mount_t *, char *, uint64_t *); +extern int sfprov_get_atime(sfp_mount_t *, char *, struct timespec *); +extern int sfprov_get_mtime(sfp_mount_t *, char *, struct timespec *); +extern int sfprov_get_ctime(sfp_mount_t *, char *, struct timespec *); +extern int sfprov_get_attr(sfp_mount_t *, char *, sffs_stat_t *); +extern int sfprov_set_attr(sfp_mount_t *, char *, mode_t, + struct timespec, struct timespec, struct timespec); +extern int sfprov_set_size(sfp_mount_t *, char *, uint64_t); + + +/* + * File/Directory operations + */ +extern int sfprov_trunc(sfp_mount_t *, char *); +extern int sfprov_remove(sfp_mount_t *, char *path, u_int is_link); +extern int sfprov_mkdir(sfp_mount_t *, char *path, mode_t mode, + sffs_stat_t *stat); +extern int sfprov_rmdir(sfp_mount_t *, char *path); +extern int sfprov_rename(sfp_mount_t *, char *from, char *to, u_int is_dir); + + +/* + * Symbolic link operations + */ +extern int sfprov_set_show_symlinks(void); +extern int sfprov_readlink(sfp_mount_t *, char *path, char *target, + size_t tgt_size); +extern int sfprov_symlink(sfp_mount_t *, char *linkname, char *target, + sffs_stat_t *stat); + +#define SFFS_DIRENTS_SIZE 8192 +#define SFFS_DIRENTS_OFF (offsetof(sffs_dirents_t, sf_entries[0])) + +extern int sfprov_readdir(sfp_mount_t *mnt, char *path, + sffs_dirents_t **dirents); + #endif /* KERNEL */ #endif /* !GA_INCLUDED_SRC_freebsd_vboxvfs_vboxvfs_h */ - diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__prov.c b/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__prov.c index e606c4f1de6f..1d793f39e3bc 100644 --- a/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__prov.c +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__prov.c @@ -1,1015 +1,1015 @@ ---- src/VBox/Additions/freebsd/vboxvfs/vboxvfs_prov.c.orig 2024-08-15 13:18:37.777504000 +0900 -+++ src/VBox/Additions/freebsd/vboxvfs/vboxvfs_prov.c 2024-08-15 13:18:37.777446000 +0900 +--- src/VBox/Additions/freebsd/vboxvfs/vboxvfs_prov.c.orig 2025-08-28 22:09:24 UTC ++++ src/VBox/Additions/freebsd/vboxvfs/vboxvfs_prov.c @@ -0,0 +1,1012 @@ +/* + * Copyright (C) 2008-2016 Oracle Corporation + * + * This file is part of VirtualBox Open Source Edition (OSE), as + * available from http://www.virtualbox.org. This file is free software; + * you can redistribute it and/or modify it under the terms of the GNU + * General Public License (GPL) as published by the Free Software + * Foundation, in version 2 as it comes in the "COPYING" file of the + * VirtualBox OSE distribution. VirtualBox OSE is distributed in the + * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. + * + * The contents of this file may alternatively be used under the terms + * of the Common Development and Distribution License Version 1.0 + * (CDDL) only, as it comes in the "COPYING.CDDL" file of the + * VirtualBox OSE distribution, in which case the provisions of the + * CDDL are applicable instead of those of the GPL. + * + * You may elect to license modified versions of this file under the + * terms and conditions of either the GPL or the CDDL or both. + */ + +/* + * Provider interfaces for shared folder file system. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "vboxvfs.h" + +#define DIRENT_RECLEN(namelen) \ + ((offsetof(struct dirent, d_name[0]) + 1 + (namelen) + 7) & ~ 7) +#define DIRENT_NAMELEN(reclen) \ + ((reclen) - (offsetof(struct dirent, d_name[0]))) + +static VBGLSFCLIENT vbox_client; + +extern u_int vboxvfs_debug; + +static int +sfprov_vbox2errno(int rc) +{ + if (rc == VERR_ACCESS_DENIED) + return (EACCES); + if (rc == VERR_INVALID_NAME) + return (ENOENT); + return (RTErrConvertToErrno(rc)); +} + +/* + * utility to create strings + */ +static SHFLSTRING * +sfprov_string(char *path, int *sz) +{ + SHFLSTRING *str; + int len = strlen(path); + + *sz = len + 1 + sizeof (*str) - sizeof (str->String); + str = malloc(*sz, M_VBOXVFS, M_WAITOK | M_ZERO); + str->u16Size = len + 1; + str->u16Length = len; + strcpy(str->String.utf8, path); + return (str); +} + +sfp_connection_t * +sfprov_connect(int version) +{ + /* only one version for now, so must match */ + int error = -1; + + if (version != SFPROV_VERSION) { + printf("%s: version mismatch (%d, expected %d)\n", __func__, + version, SFPROV_VERSION); + return (NULL); + } + + if (RT_FAILURE(VbglR0SfInit())) + return (NULL); + + if (RT_FAILURE(VbglR0SfConnect(&vbox_client))) { + VbglR0SfTerm(); + return (NULL); + } + + if (RT_FAILURE(VbglR0SfSetUtf8(&vbox_client))) { + VbglR0SfDisconnect(&vbox_client); + VbglR0SfTerm(); + return (NULL); + } + return ((sfp_connection_t *)&vbox_client); +} + +void +sfprov_disconnect() +{ + VbglR0SfDisconnect(&vbox_client); + VbglR0SfTerm(); +} + +int +sfprov_mount(char *path, sfp_mount_t **mnt) +{ + sfp_mount_t *m; + SHFLSTRING *str; + int size; + int rc; + + VBOXVFS_DEBUG(1, "%s: Enter", __FUNCTION__); + VBOXVFS_DEBUG(1, "%s: path: [%s]", __FUNCTION__, path); + + m = malloc(sizeof (*m), M_VBOXVFS, M_WAITOK | M_ZERO); + str = sfprov_string(path, &size); + + int error; + rc = VbglR0SfMapFolder(&vbox_client, str, &m->map); + if (RT_FAILURE(rc)) { + free(m, M_VBOXVFS); + *mnt = NULL; + error = sfprov_vbox2errno(rc); + } else { + *mnt = m; + error = 0; + } + free(str, M_VBOXVFS); + printf("%s(%s): error=%d rc=%d\n", __func__, path, error, rc); + return (error); +} + +int +sfprov_unmount(sfp_mount_t *mnt) +{ + int rc; + + rc = VbglR0SfUnmapFolder(&vbox_client, &mnt->map); + if (RT_FAILURE(rc)) { + printf("sfprov_unmount: VbglR0SfUnmapFolder() failed rc=%d\n", rc); + rc = sfprov_vbox2errno(rc); + } else { + rc = 0; + } + + free(mnt, M_VBOXVFS); + return (rc); +} + +/* + * query information about a mounted file system + */ +int +sfprov_get_fsinfo(sfp_mount_t *mnt, sffs_fsinfo_t *fsinfo) +{ + int rc; + SHFLVOLINFO info; + uint32_t bytes = sizeof(SHFLVOLINFO); + size_t bytesused; + + rc = VbglR0SfFsInfo(&vbox_client, &mnt->map, 0, + (SHFL_INFO_GET | SHFL_INFO_VOLUME), &bytes, (SHFLDIRINFO *)&info); + if (RT_FAILURE(rc)) + return (sfprov_vbox2errno(rc)); + + fsinfo->blksize = info.ulBytesPerAllocationUnit; + bytesused = + info.ullTotalAllocationBytes - info.ullAvailableAllocationBytes; + fsinfo->blksused = bytesused / info.ulBytesPerAllocationUnit; + fsinfo->blksavail = info.ullAvailableAllocationBytes / + info.ulBytesPerAllocationUnit; + fsinfo->maxnamesize = info.fsProperties.cbMaxComponent; + fsinfo->readonly = info.fsProperties.fReadOnly; + fsinfo->serial = info.ulSerial; + return (0); +} + +/* + * file/directory information conversions. + */ +static void +sfprov_fmode_from_mode(RTFMODE *fMode, mode_t mode) +{ + RTFMODE m = 0; + +#define mode_set(r) ((mode & (S_##r)) ? RTFS_UNIX_##r : 0) + m = mode_set (ISUID); + m |= mode_set (ISGID); + m |= (mode & S_ISVTX) ? RTFS_UNIX_ISTXT : 0; + m |= mode_set (IRUSR); + m |= mode_set (IWUSR); + m |= mode_set (IXUSR); + m |= mode_set (IRGRP); + m |= mode_set (IWGRP); + m |= mode_set (IXGRP); + m |= mode_set (IROTH); + m |= mode_set (IWOTH); + m |= mode_set (IXOTH); + + if (S_ISDIR(mode)) + m |= RTFS_TYPE_DIRECTORY; + else if (S_ISREG(mode)) + m |= RTFS_TYPE_FILE; + else if (S_ISFIFO(mode)) + m |= RTFS_TYPE_FIFO; + else if (S_ISCHR(mode)) + m |= RTFS_TYPE_DEV_CHAR; + else if (S_ISBLK(mode)) + m |= RTFS_TYPE_DEV_BLOCK; + else if (S_ISLNK(mode)) + m |= RTFS_TYPE_SYMLINK; + else if (S_ISSOCK(mode)) + m |= RTFS_TYPE_SOCKET; + else + m |= RTFS_TYPE_FILE; + + *fMode = m; +} + +static void +sfprov_mode_from_fmode(mode_t *mode, RTFMODE fMode) +{ + mode_t m = 0; + + if (RTFS_IS_DIRECTORY(fMode)) + m |= S_IFDIR; + else if (RTFS_IS_FILE(fMode)) + m |= S_IFREG; + else if (RTFS_IS_FIFO(fMode)) + m |= S_IFIFO; + else if (RTFS_IS_DEV_CHAR(fMode)) + m |= S_IFCHR; + else if (RTFS_IS_DEV_BLOCK(fMode)) + m |= S_IFBLK; + else if (RTFS_IS_SYMLINK(fMode)) + m |= S_IFLNK; + else if (RTFS_IS_SOCKET(fMode)) + m |= S_IFSOCK; + + if (fMode & RTFS_UNIX_IRUSR) + m |= S_IRUSR; + if (fMode & RTFS_UNIX_IWUSR) + m |= S_IWUSR; + if (fMode & RTFS_UNIX_IXUSR) + m |= S_IXUSR; + if (fMode & RTFS_UNIX_IRGRP) + m |= S_IRGRP; + if (fMode & RTFS_UNIX_IWGRP) + m |= S_IWGRP; + if (fMode & RTFS_UNIX_IXGRP) + m |= S_IXGRP; + if (fMode & RTFS_UNIX_IROTH) + m |= S_IROTH; + if (fMode & RTFS_UNIX_IWOTH) + m |= S_IWOTH; + if (fMode & RTFS_UNIX_IXOTH) + m |= S_IXOTH; + if (fMode & RTFS_UNIX_ISUID) + m |= S_ISUID; + if (fMode & RTFS_UNIX_ISGID) + m |= S_ISGID; + if (fMode & RTFS_UNIX_ISTXT) + m |= S_ISVTX; + *mode = m; +} + +static void +sfprov_ftime_from_timespec(struct timespec *time, RTTIMESPEC *ts) +{ + uint64_t nanosec = RTTimeSpecGetNano(ts); + time->tv_sec = nanosec / UINT64_C(1000000000); + time->tv_nsec = nanosec % UINT64_C(1000000000); +} + +static void +sfprov_stat_from_info(sffs_stat_t *stat, SHFLFSOBJINFO *info) +{ + sfprov_mode_from_fmode(&stat->sf_mode, info->Attr.fMode); + stat->sf_size = info->cbObject; + stat->sf_alloc = info->cbAllocated; + sfprov_ftime_from_timespec(&stat->sf_atime, &info->AccessTime); + sfprov_ftime_from_timespec(&stat->sf_mtime, &info->ModificationTime); + sfprov_ftime_from_timespec(&stat->sf_ctime, &info->ChangeTime); +} + +/* + * File operations: open/close/read/write/etc. + * + * open/create can return any relevant errno, however ENOENT + * generally means that the host file didn't exist. + */ +int +sfprov_create( + sfp_mount_t *mnt, + char *path, + mode_t mode, + sffs_stat_t *stat) +{ + int rc; + SHFLCREATEPARMS parms; + SHFLSTRING *str; + int size; + sfp_file_t *newfp; + + str = sfprov_string(path, &size); + parms.Handle = SHFL_HANDLE_NIL; + parms.Info.cbObject = 0; + sfprov_fmode_from_mode(&parms.Info.Attr.fMode, mode); + parms.CreateFlags = SHFL_CF_ACT_CREATE_IF_NEW | + SHFL_CF_ACT_REPLACE_IF_EXISTS | SHFL_CF_ACCESS_READWRITE; + rc = VbglR0SfCreate(&vbox_client, &mnt->map, str, &parms); + free(str, M_VBOXVFS); + + if (RT_FAILURE(rc)) + return (sfprov_vbox2errno(rc)); + if (parms.Handle == SHFL_HANDLE_NIL) { + if (parms.Result == SHFL_FILE_EXISTS) + return (EEXIST); + return (ENOENT); + } + (void)VbglR0SfClose(&vbox_client, &mnt->map, parms.Handle); + sfprov_stat_from_info(stat, &parms.Info); + return (0); +} + +int +sfprov_open(sfp_mount_t *mnt, char *path, sfp_file_t **fp) +{ + int rc; + SHFLCREATEPARMS parms; + SHFLSTRING *str; + int size; + sfp_file_t *newfp; + + /* + * First we attempt to open it read/write. If that fails we + * try read only. + */ + bzero(&parms, sizeof(parms)); + str = sfprov_string(path, &size); + parms.Handle = SHFL_HANDLE_NIL; + parms.Info.cbObject = 0; + parms.CreateFlags = SHFL_CF_ACT_FAIL_IF_NEW | SHFL_CF_ACCESS_READWRITE; + rc = VbglR0SfCreate(&vbox_client, &mnt->map, str, &parms); + if (RT_FAILURE(rc) && rc != VERR_ACCESS_DENIED) { + free(str, M_VBOXVFS); + return (sfprov_vbox2errno(rc)); + } + if (parms.Handle == SHFL_HANDLE_NIL) { + if (parms.Result == SHFL_PATH_NOT_FOUND || + parms.Result == SHFL_FILE_NOT_FOUND) { + free(str, M_VBOXVFS); + return (ENOENT); + } + parms.CreateFlags = + SHFL_CF_ACT_FAIL_IF_NEW | SHFL_CF_ACCESS_READ; + rc = VbglR0SfCreate(&vbox_client, &mnt->map, str, &parms); + if (RT_FAILURE(rc)) { + free(str, M_VBOXVFS); + return (sfprov_vbox2errno(rc)); + } + if (parms.Handle == SHFL_HANDLE_NIL) { + free(str, M_VBOXVFS); + return (ENOENT); + } + } + else + free(str, M_VBOXVFS); + newfp = malloc(sizeof(sfp_file_t), M_VBOXVFS, M_WAITOK | M_ZERO); + newfp->handle = parms.Handle; + newfp->map = mnt->map; + *fp = newfp; + return (0); +} + +int +sfprov_trunc(sfp_mount_t *mnt, char *path) +{ + int rc; + SHFLCREATEPARMS parms; + SHFLSTRING *str; + int size; + + /* + * open it read/write. + */ + str = sfprov_string(path, &size); + parms.Handle = 0; + parms.Info.cbObject = 0; + parms.CreateFlags = SHFL_CF_ACT_FAIL_IF_NEW | SHFL_CF_ACCESS_READWRITE | + SHFL_CF_ACT_OVERWRITE_IF_EXISTS; + rc = VbglR0SfCreate(&vbox_client, &mnt->map, str, &parms); + free(str, M_VBOXVFS); + + if (RT_FAILURE(rc)) { + return (sfprov_vbox2errno(rc)); + } + (void)VbglR0SfClose(&vbox_client, &mnt->map, parms.Handle); + return (0); +} + +int +sfprov_close(sfp_file_t *fp) +{ + int rc; + + rc = VbglR0SfClose(&vbox_client, &fp->map, fp->handle); + free(fp, M_VBOXVFS); + return (0); +} + +int +sfprov_read(sfp_file_t *fp, char *buffer, uint64_t offset, uint32_t *numbytes, + int buflocked) +{ + int rc; + + rc = VbglR0SfRead(&vbox_client, &fp->map, fp->handle, offset, + numbytes, (uint8_t *)buffer, buflocked); + if (RT_FAILURE(rc)) + return (sfprov_vbox2errno(rc)); + return (0); +} + +int +sfprov_write(sfp_file_t *fp, char *buffer, uint64_t offset, uint32_t *numbytes, + int buflocked) +{ + int rc; + + rc = VbglR0SfWrite(&vbox_client, &fp->map, fp->handle, offset, + numbytes, (uint8_t *)buffer, buflocked); + if (RT_FAILURE(rc)) + return (sfprov_vbox2errno(rc)); + return (0); +} + +int +sfprov_fsync(sfp_file_t *fp) +{ + int rc; + + rc = VbglR0SfFlush(&vbox_client, &fp->map, fp->handle); + if (RT_FAILURE(rc)) + return (sfprov_vbox2errno(rc)); + return (0); +} + + +static int +sfprov_getinfo(sfp_mount_t *mnt, char *path, PSHFLFSOBJINFO info) +{ + int rc; + SHFLCREATEPARMS parms; + SHFLSTRING *str; + int size; + + str = sfprov_string(path, &size); + parms.Handle = 0; + parms.Info.cbObject = 0; + parms.CreateFlags = SHFL_CF_LOOKUP | SHFL_CF_ACT_FAIL_IF_NEW; + rc = VbglR0SfCreate(&vbox_client, &mnt->map, str, &parms); + free(str, M_VBOXVFS); + + if (RT_FAILURE(rc)) + return (sfprov_vbox2errno(rc)); + if (parms.Result != SHFL_FILE_EXISTS) + return (ENOENT); + *info = parms.Info; + return (0); +} + +/* + * get information about a file (or directory) + */ +int +sfprov_get_mode(sfp_mount_t *mnt, char *path, mode_t *mode) +{ + int rc; + SHFLFSOBJINFO info; + + rc = sfprov_getinfo(mnt, path, &info); + if (rc) + return (rc); + sfprov_mode_from_fmode(mode, info.Attr.fMode); + return (0); +} + +int +sfprov_get_size(sfp_mount_t *mnt, char *path, uint64_t *size) +{ + int rc; + SHFLFSOBJINFO info; + + rc = sfprov_getinfo(mnt, path, &info); + if (rc) + return (rc); + *size = info.cbObject; + return (0); +} + + +int +sfprov_get_atime(sfp_mount_t *mnt, char *path, struct timespec *time) +{ + int rc; + SHFLFSOBJINFO info; + + rc = sfprov_getinfo(mnt, path, &info); + if (rc) + return (rc); + sfprov_ftime_from_timespec(time, &info.AccessTime); + return (0); +} + +int +sfprov_get_mtime(sfp_mount_t *mnt, char *path, struct timespec *time) +{ + int rc; + SHFLFSOBJINFO info; + + rc = sfprov_getinfo(mnt, path, &info); + if (rc) + return (rc); + sfprov_ftime_from_timespec(time, &info.ModificationTime); + return (0); +} + +int +sfprov_get_ctime(sfp_mount_t *mnt, char *path, struct timespec *time) +{ + int rc; + SHFLFSOBJINFO info; + + rc = sfprov_getinfo(mnt, path, &info); + if (rc) + return (rc); + sfprov_ftime_from_timespec(time, &info.ChangeTime); + return (0); +} + +int +sfprov_get_attr(sfp_mount_t *mnt, char *path, sffs_stat_t *attr) +{ + int rc; + SHFLFSOBJINFO info; + + rc = sfprov_getinfo(mnt, path, &info); + if (rc) + return (rc); + sfprov_stat_from_info(attr, &info); + return (0); +} + +static void +sfprov_timespec_from_ftime(RTTIMESPEC *ts, struct timespec time) +{ + uint64_t nanosec = UINT64_C(1000000000) * time.tv_sec + time.tv_nsec; + RTTimeSpecSetNano(ts, nanosec); +} + +int +sfprov_set_attr( + sfp_mount_t *mnt, + char *path, + mode_t mode, + struct timespec atime, + struct timespec mtime, + struct timespec ctime) +{ + int rc, err; + SHFLCREATEPARMS parms; + SHFLSTRING *str; + SHFLFSOBJINFO info; + uint32_t bytes; + int str_size; + + str = sfprov_string(path, &str_size); + parms.Handle = 0; + parms.Info.cbObject = 0; + parms.CreateFlags = SHFL_CF_ACT_OPEN_IF_EXISTS + | SHFL_CF_ACT_FAIL_IF_NEW + | SHFL_CF_ACCESS_ATTR_WRITE; + + rc = VbglR0SfCreate(&vbox_client, &mnt->map, str, &parms); + + if (RT_FAILURE(rc)) { + printf("sfprov_set_attr: VbglR0SfCreate(%s) failed rc=%d\n", + path, rc); + err = sfprov_vbox2errno(rc); + goto fail2; + } + if (parms.Result != SHFL_FILE_EXISTS) { + err = ENOENT; + goto fail1; + } + + RT_ZERO(info); +#if 0 + if (mask & AT_MODE) + sfprov_fmode_from_mode(&info.Attr.fMode, mode); + if (mask & AT_ATIME) + sfprov_timespec_from_ftime(&info.AccessTime, atime); + if (mask & AT_MTIME) + sfprov_timespec_from_ftime(&info.ModificationTime, mtime); + if (mask & AT_CTIME) + sfprov_timespec_from_ftime(&info.ChangeTime, ctime); +#endif + bytes = sizeof(info); + rc = VbglR0SfFsInfo(&vbox_client, &mnt->map, parms.Handle, + (SHFL_INFO_SET | SHFL_INFO_FILE), &bytes, (SHFLDIRINFO *)&info); + if (RT_FAILURE(rc)) { + if (rc != VERR_ACCESS_DENIED && rc != VERR_WRITE_PROTECT) + { + printf("sfprov_set_attr: VbglR0SfFsInfo(%s, FILE) failed rc=%d\n", + path, rc); + } + err = sfprov_vbox2errno(rc); + goto fail1; + } + + err = 0; + +fail1: + rc = VbglR0SfClose(&vbox_client, &mnt->map, parms.Handle); + if (RT_FAILURE(rc)) { + printf("sfprov_set_attr: VbglR0SfClose(%s) failed rc=%d\n", + path, rc); + } +fail2: + free(str, M_VBOXVFS); + return err; +} + +int +sfprov_set_size(sfp_mount_t *mnt, char *path, uint64_t size) +{ + int rc, err; + SHFLCREATEPARMS parms; + SHFLSTRING *str; + SHFLFSOBJINFO info; + uint32_t bytes; + int str_size; + + str = sfprov_string(path, &str_size); + parms.Handle = 0; + parms.Info.cbObject = 0; + parms.CreateFlags = SHFL_CF_ACT_OPEN_IF_EXISTS + | SHFL_CF_ACT_FAIL_IF_NEW + | SHFL_CF_ACCESS_WRITE; + + rc = VbglR0SfCreate(&vbox_client, &mnt->map, str, &parms); + + if (RT_FAILURE(rc)) { + printf("sfprov_set_size: VbglR0SfCreate(%s) failed rc=%d\n", + path, rc); + err = sfprov_vbox2errno(rc); + goto fail2; + } + if (parms.Result != SHFL_FILE_EXISTS) { + err = ENOENT; + goto fail1; + } + + RT_ZERO(info); + info.cbObject = size; + bytes = sizeof(info); + rc = VbglR0SfFsInfo(&vbox_client, &mnt->map, parms.Handle, + (SHFL_INFO_SET | SHFL_INFO_SIZE), &bytes, (SHFLDIRINFO *)&info); + if (RT_FAILURE(rc)) { + printf("sfprov_set_size: VbglR0SfFsInfo(%s, SIZE) failed rc=%d\n", + path, rc); + err = sfprov_vbox2errno(rc); + goto fail1; + } + + err = 0; + +fail1: + rc = VbglR0SfClose(&vbox_client, &mnt->map, parms.Handle); + if (RT_FAILURE(rc)) { + printf("sfprov_set_size: VbglR0SfClose(%s) failed rc=%d\n", + path, rc); + } +fail2: + free(str, M_VBOXVFS); + return err; +} + +/* + * Directory operations + */ +int +sfprov_mkdir( + sfp_mount_t *mnt, + char *path, + mode_t mode, + sffs_stat_t *stat) +{ + int rc; + SHFLCREATEPARMS parms; + SHFLSTRING *str; + int size; + + str = sfprov_string(path, &size); + parms.Handle = SHFL_HANDLE_NIL; + parms.Info.cbObject = 0; + sfprov_fmode_from_mode(&parms.Info.Attr.fMode, mode); + parms.CreateFlags = SHFL_CF_DIRECTORY | SHFL_CF_ACT_CREATE_IF_NEW | + SHFL_CF_ACT_FAIL_IF_EXISTS | SHFL_CF_ACCESS_READ; + rc = VbglR0SfCreate(&vbox_client, &mnt->map, str, &parms); + free(str, M_VBOXVFS); + + if (RT_FAILURE(rc)) + return (sfprov_vbox2errno(rc)); + if (parms.Handle == SHFL_HANDLE_NIL) { + if (parms.Result == SHFL_FILE_EXISTS) + return (EEXIST); + return (ENOENT); + } + (void)VbglR0SfClose(&vbox_client, &mnt->map, parms.Handle); + sfprov_stat_from_info(stat, &parms.Info); + return (0); +} + +int +sfprov_set_show_symlinks(void) +{ + int rc; + + rc = VbglR0SfSetSymlinks(&vbox_client); + if (RT_FAILURE(rc)) + return (sfprov_vbox2errno(rc)); + + return (0); +} + +int +sfprov_remove(sfp_mount_t *mnt, char *path, u_int is_link) +{ + int rc; + SHFLSTRING *str; + int size; + + str = sfprov_string(path, &size); + rc = VbglR0SfRemove(&vbox_client, &mnt->map, str, + SHFL_REMOVE_FILE | (is_link ? SHFL_REMOVE_SYMLINK : 0)); + free(str, M_VBOXVFS); + if (RT_FAILURE(rc)) + return (sfprov_vbox2errno(rc)); + return (0); +} + +int +sfprov_readlink( + sfp_mount_t *mnt, + char *path, + char *target, + size_t tgt_size) +{ + int rc; + SHFLSTRING *str; + int size; + + str = sfprov_string(path, &size); + + rc = VbglR0SfReadLink(&vbox_client, &mnt->map, str, (uint32_t) tgt_size, + target); + if (RT_FAILURE(rc)) + rc = sfprov_vbox2errno(rc); + + free(str, M_VBOXVFS); + return (rc); +} + +int +sfprov_symlink( + sfp_mount_t *mnt, + char *linkname, + char *target, + sffs_stat_t *stat) +{ + int rc; + SHFLSTRING *lnk, *tgt; + int lnk_size, tgt_size; + SHFLFSOBJINFO info; + + lnk = sfprov_string(linkname, &lnk_size); + tgt = sfprov_string(target, &tgt_size); + + rc = VbglR0SfSymlink(&vbox_client, &mnt->map, lnk, tgt, &info); + if (RT_FAILURE(rc)) { + rc = sfprov_vbox2errno(rc); + goto done; + } + + if (stat != NULL) + sfprov_stat_from_info(stat, &info); + +done: + free(lnk, M_VBOXVFS); + free(tgt, M_VBOXVFS); + + return (rc); +} + +int +sfprov_rmdir(sfp_mount_t *mnt, char *path) +{ + int rc; + SHFLSTRING *str; + int size; + + str = sfprov_string(path, &size); + rc = VbglR0SfRemove(&vbox_client, &mnt->map, str, SHFL_REMOVE_DIR); + free(str, M_VBOXVFS); + if (RT_FAILURE(rc)) + return (sfprov_vbox2errno(rc)); + return (0); +} + +int +sfprov_rename(sfp_mount_t *mnt, char *from, char *to, u_int is_dir) +{ + int rc; + SHFLSTRING *old, *new; + int old_size, new_size; + + old = sfprov_string(from, &old_size); + new = sfprov_string(to, &new_size); + rc = VbglR0SfRename(&vbox_client, &mnt->map, old, new, + (is_dir ? SHFL_RENAME_DIR : SHFL_RENAME_FILE) | + SHFL_RENAME_REPLACE_IF_EXISTS); + free(old, M_VBOXVFS); + free(new, M_VBOXVFS); + if (RT_FAILURE(rc)) + return (sfprov_vbox2errno(rc)); + return (0); +} + +/* + * Read all filenames in a directory. + * + * - success - all entries read and returned + * - ENOENT - Couldn't open the directory for reading + * - EINVAL - Internal error of some kind + * + * On successful return, *dirents points to a list of sffs_dirents_t; + * for each dirent, all fields except the d_ino will be set appropriately. + * The caller is responsible for freeing the dirents buffer. + */ +int +sfprov_readdir( + sfp_mount_t *mnt, + char *path, + sffs_dirents_t **dirents) +{ + int error; + char *cp; + int len; + SHFLSTRING *mask_str = NULL; /* must be path with "/" appended */ + int mask_size; + sfp_file_t *fp; + uint32_t infobuff_alloc = 16384; + SHFLDIRINFO *infobuff = NULL, *info; + uint32_t numbytes; + uint32_t nents; + uint32_t size; + off_t offset; + sffs_dirents_t *cur_buf; + struct sffs_dirent *dirent; + unsigned short reclen; + unsigned short entlen; + + *dirents = NULL; + + error = sfprov_open(mnt, path, &fp); + if (error != 0) + return (ENOENT); + + /* + * Allocate the first dirents buffers. + */ + *dirents = malloc(SFFS_DIRENTS_SIZE, M_VBOXVFS, M_WAITOK | M_ZERO); + if (*dirents == NULL) { + error = (ENOSPC); + goto done; + } + cur_buf = *dirents; + cur_buf->sf_next = NULL; + cur_buf->sf_len = 0; + + /* + * Create mask that VBox expects. This needs to be the directory path, + * plus a "*" wildcard to get all files. + */ + len = strlen(path) + 3; + cp = malloc(len, M_VBOXVFS, M_WAITOK | M_ZERO); + if (cp == NULL) { + error = (ENOSPC); + goto done; + } + strcpy(cp, path); + strcat(cp, "/*"); + mask_str = sfprov_string(cp, &mask_size); + free(cp, M_VBOXVFS); + + /* + * Now loop using VbglR0SfDirInfo + */ + infobuff = malloc(infobuff_alloc, M_VBOXVFS, M_WAITOK | M_ZERO); + if (infobuff == NULL) { + error = (ENOSPC); + goto done; + } + + offset = 0; + for (;;) { + numbytes = infobuff_alloc; + error = VbglR0SfDirInfo(&vbox_client, &fp->map, fp->handle, + mask_str, 0, 0, &numbytes, infobuff, &nents); + + switch (error) { + case VINF_SUCCESS: + /* fallthrough */ + case VERR_NO_MORE_FILES: + break; + case VERR_NO_TRANSLATION: + /* XXX ??? */ + break; + default: + error = sfprov_vbox2errno(error); + goto done; + } + + /* + * Create the dirent_t's and save the stats for each name + */ + for (info = infobuff; (char *) info < (char *) infobuff + numbytes; nents--) { + size_t buflen; + + /* expand buffers if we need more space */ + reclen = DIRENT_RECLEN(strlen(info->name.String.utf8)); + entlen = sizeof(struct sffs_dirent) + reclen; + buflen = SFFS_DIRENTS_OFF + cur_buf->sf_len + entlen; + if (buflen > SFFS_DIRENTS_SIZE) { + cur_buf->sf_next = malloc(SFFS_DIRENTS_SIZE, + M_VBOXVFS, M_WAITOK | M_ZERO); + if (cur_buf->sf_next == NULL) { + error = ENOSPC; + goto done; + } + cur_buf = cur_buf->sf_next; + cur_buf->sf_next = NULL; + cur_buf->sf_len = 0; + } + + /* create the dirent with the name, offset, and len */ + dirent = (struct sffs_dirent *) + (((char *) &cur_buf->sf_entries[0]) + cur_buf->sf_len); + strncpy(&dirent->sf_entry.d_name[0], + info->name.String.utf8, DIRENT_NAMELEN(reclen)); + dirent->sf_entry.d_reclen = reclen; + dirent->sf_entry.d_namlen = strlen(info->name.String.utf8); + dirent->sf_entry.d_name[dirent->sf_entry.d_namlen] = 0; + offset += entlen; + dirent->sf_off = offset; + + /* save the stats */ + sfprov_stat_from_info(&dirent->sf_stat, &info->Info); + + /* next info */ + cur_buf->sf_len += entlen; + size = offsetof (SHFLDIRINFO, name.String) + info->name.u16Size; + info = (SHFLDIRINFO *) ((uintptr_t) info + size); + } + KASSERT(nents == 0, ("nents != 0")); + KASSERT((char *) info == (char *) infobuff + numbytes, "(char *) info != (char *) infobuff + numbytes"); + + if (error == VERR_NO_MORE_FILES) + break; + } + error = 0; + +done: + if (error != 0) { + while (*dirents) { + cur_buf = (*dirents)->sf_next; + free(*dirents, M_VBOXVFS); + *dirents = cur_buf; + } + } + if (infobuff != NULL) + free(infobuff, M_VBOXVFS); + if (mask_str != NULL) + free(mask_str, M_VBOXVFS); + sfprov_close(fp); + + return (error); +} diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vfsops.c b/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vfsops.c index 8fa76bdf2b8a..cd272f0205e8 100644 --- a/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vfsops.c +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vfsops.c @@ -1,645 +1,644 @@ ---- src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vfsops.c.orig 2021-04-28 16:24:46 UTC +--- src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vfsops.c.orig 2025-08-13 19:41:18 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 + * Copyright (C) 2008-2025 Oracle and/or its affiliates. * -@@ -14,245 +9,478 @@ - * VirtualBox OSE distribution. VirtualBox OSE is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. +@@ -24,245 +19,478 @@ + * + * SPDX-License-Identifier: GPL-3.0-only */ - -#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 +#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_t 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; + + mp->mnt_kern_flag |= MNTK_LOOKUP_SHARED | MNTK_EXTENDED_SHARED; + 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 +#if __FreeBSD_version >= 1400018 + , bool *mp_busy +#endif + ) { - 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-72/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vnops.c b/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vnops.c index edd43c7c03c7..90a799eef1db 100644 --- a/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vnops.c +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vnops.c @@ -1,1543 +1,1543 @@ ---- src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vnops.c.orig 2023-07-12 15:59:35 UTC +--- src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vnops.c.orig 2025-08-13 19:41:18 UTC +++ src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vnops.c -@@ -14,228 +14,1416 @@ - * VirtualBox OSE distribution. VirtualBox OSE is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. +@@ -24,228 +24,1416 @@ + * + * SPDX-License-Identifier: GPL-3.0-only */ - -#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 -#include -#include +#include +#include "vboxvfs.h" + +#if __FreeBSD_version < 1300063 +#define VN_IS_DOOMED(vp) (((vp)->v_iflag & VI_DOOMED) != 0) +#endif + /* * Prototypes for VBOXVFS vnode operations */ -static vop_create_t vboxvfs_create; -static vop_mknod_t vboxvfs_mknod; -static vop_open_t vboxvfs_open; -static vop_close_t vboxvfs_close; -static vop_access_t vboxvfs_access; -static vop_getattr_t vboxvfs_getattr; -static vop_setattr_t vboxvfs_setattr; -static vop_read_t vboxvfs_read; -static vop_write_t vboxvfs_write; -static vop_fsync_t vboxvfs_fsync; -static vop_remove_t vboxvfs_remove; -static vop_link_t vboxvfs_link; -static vop_lookup_t vboxvfs_lookup; -static vop_rename_t vboxvfs_rename; -static vop_mkdir_t vboxvfs_mkdir; -static vop_rmdir_t vboxvfs_rmdir; -static vop_symlink_t vboxvfs_symlink; -static vop_readdir_t vboxvfs_readdir; -static vop_strategy_t vboxvfs_strategy; -static vop_print_t vboxvfs_print; -static vop_pathconf_t vboxvfs_pathconf; -static vop_advlock_t vboxvfs_advlock; -static vop_getextattr_t vboxvfs_getextattr; -static vop_ioctl_t vboxvfs_ioctl; -static vop_getpages_t vboxvfs_getpages; -static vop_inactive_t vboxvfs_inactive; -static vop_putpages_t vboxvfs_putpages; -static vop_reclaim_t vboxvfs_reclaim; +static vop_create_t vboxfs_create; +static vop_open_t vboxfs_open; +static vop_close_t vboxfs_close; +static vop_access_t vboxfs_access; +static vop_getattr_t vboxfs_getattr; +static vop_setattr_t vboxfs_setattr; +static vop_read_t vboxfs_read; +static vop_readlink_t vboxfs_readlink; +static vop_write_t vboxfs_write; +static vop_fsync_t vboxfs_fsync; +static vop_remove_t vboxfs_remove; +static vop_link_t vboxfs_link; +static vop_lookup_t vboxfs_lookup; +static vop_cachedlookup_t vboxfs_cachedlookup; +static vop_rename_t vboxfs_rename; +static vop_mkdir_t vboxfs_mkdir; +static vop_rmdir_t vboxfs_rmdir; +static vop_symlink_t vboxfs_symlink; +static vop_readdir_t vboxfs_readdir; +static vop_print_t vboxfs_print; +static vop_pathconf_t vboxfs_pathconf; +static vop_advlock_t vboxfs_advlock; +static vop_ioctl_t vboxfs_ioctl; +static vop_inactive_t vboxfs_inactive; +static vop_reclaim_t vboxfs_reclaim; +static vop_vptofh_t vboxfs_vptofh; -struct vop_vector vboxvfs_vnodeops = { - .vop_default = &default_vnodeops, +struct vop_vector vboxfs_vnodeops = { + .vop_default = &default_vnodeops, - .vop_access = vboxvfs_access, - .vop_advlock = vboxvfs_advlock, - .vop_close = vboxvfs_close, - .vop_create = vboxvfs_create, - .vop_fsync = vboxvfs_fsync, - .vop_getattr = vboxvfs_getattr, - .vop_getextattr = vboxvfs_getextattr, - .vop_getpages = vboxvfs_getpages, - .vop_inactive = vboxvfs_inactive, - .vop_ioctl = vboxvfs_ioctl, - .vop_link = vboxvfs_link, - .vop_lookup = vboxvfs_lookup, - .vop_mkdir = vboxvfs_mkdir, - .vop_mknod = vboxvfs_mknod, - .vop_open = vboxvfs_open, - .vop_pathconf = vboxvfs_pathconf, - .vop_print = vboxvfs_print, - .vop_putpages = vboxvfs_putpages, - .vop_read = vboxvfs_read, - .vop_readdir = vboxvfs_readdir, - .vop_reclaim = vboxvfs_reclaim, - .vop_remove = vboxvfs_remove, - .vop_rename = vboxvfs_rename, - .vop_rmdir = vboxvfs_rmdir, - .vop_setattr = vboxvfs_setattr, - .vop_strategy = vboxvfs_strategy, - .vop_symlink = vboxvfs_symlink, - .vop_write = vboxvfs_write, + .vop_access = vboxfs_access, + .vop_advlock = VOP_EOPNOTSUPP, + .vop_close = vboxfs_close, + .vop_create = vboxfs_create, + .vop_fsync = vboxfs_fsync, + .vop_getattr = vboxfs_getattr, + .vop_getextattr = VOP_EOPNOTSUPP, + .vop_inactive = vboxfs_inactive, + .vop_ioctl = vboxfs_ioctl, + .vop_link = vboxfs_link, + .vop_lookup = vboxfs_lookup, + .vop_cachedlookup = vboxfs_cachedlookup, + .vop_mkdir = vboxfs_mkdir, + .vop_mknod = VOP_EOPNOTSUPP, + .vop_open = vboxfs_open, + .vop_pathconf = vboxfs_pathconf, + .vop_print = vboxfs_print, + .vop_read = vboxfs_read, + .vop_readdir = vboxfs_readdir, + .vop_readlink = vboxfs_readlink, + .vop_reclaim = vboxfs_reclaim, + .vop_remove = vboxfs_remove, + .vop_rename = vboxfs_rename, + .vop_rmdir = vboxfs_rmdir, + .vop_setattr = vboxfs_setattr, + .vop_vptofh = vboxfs_vptofh, + .vop_symlink = vboxfs_symlink, + .vop_write = vboxfs_write, + .vop_bmap = VOP_EOPNOTSUPP }; +#if __FreeBSD_version > 1300068 +VFS_VOP_VECTOR_REGISTER(vboxfs_vnodeops); +#endif -static int vboxvfs_access(struct vop_access_args *ap) +static uint64_t +vsfnode_cur_time_usec(void) { - return 0; + struct timeval now; + + getmicrotime(&now); + + return (now.tv_sec*1000 + now.tv_usec); } -static int vboxvfs_open(struct vop_open_args *ap) +static int +vsfnode_stat_cached(struct vboxfs_node *np) { - return 0; + return (vsfnode_cur_time_usec() - np->sf_stat_time) < + np->vboxfsmp->sf_stat_ttl * 1000UL; } -static int vboxvfs_close(struct vop_close_args *ap) +static int +vsfnode_update_stat_cache(struct vboxfs_node *np) { - return 0; + int error; + + error = sfprov_get_attr(np->vboxfsmp->sf_handle, np->sf_path, + &np->sf_stat); +#if 0 + if (error == ENOENT) + sfnode_make_stale(node); +#endif + if (error == 0) + np->sf_stat_time = vsfnode_cur_time_usec(); + + return (error); } -static int vboxvfs_getattr(struct vop_getattr_args *ap) +/* + * Need to clear v_object for insmntque failure. + */ +static void +vboxfs_insmntque_dtr(struct vnode *vp, void *dtr_arg) { - return 0; + + // XXX: vboxfs_destroy_vobject(vp, vp->v_object); + vp->v_object = NULL; + vp->v_data = NULL; + vp->v_op = &dead_vnodeops; + vgone(vp); + vput(vp); } -static int vboxvfs_setattr(struct vop_setattr_args *ap) +/* + * Allocates a new vnode for the node node or returns a new reference to + * an existing one if the node had already a vnode referencing it. The + * resulting locked vnode is returned in *vpp. + * + * Returns zero on success or an appropriate error code on failure. + */ +int +vboxfs_alloc_vp(struct mount *mp, struct vboxfs_node *node, int lkflag, + struct vnode **vpp) { - return 0; + struct vnode *vp; + int error; + + error = 0; +loop: + VBOXFS_NODE_LOCK(node); +loop1: + if ((vp = node->sf_vnode) != NULL) { + MPASS((node->sf_vpstate & VBOXFS_VNODE_DOOMED) == 0); + VI_LOCK(vp); + if ((node->sf_type == VDIR && node->sf_parent == NULL) || + (VN_IS_DOOMED(vp) && + (lkflag & LK_NOWAIT) != 0)) { + VI_UNLOCK(vp); + VBOXFS_NODE_UNLOCK(node); + error = ENOENT; + vp = NULL; + goto out; + } + if (VN_IS_DOOMED(vp)) { + VI_UNLOCK(vp); + node->sf_vpstate |= VBOXFS_VNODE_WRECLAIM; + while ((node->sf_vpstate & VBOXFS_VNODE_WRECLAIM) != 0) { + msleep(&node->sf_vnode, VBOXFS_NODE_MTX(node), + 0, "vsfE", 0); + } + goto loop1; + } + VBOXFS_NODE_UNLOCK(node); +#if __FreeBSD_version < 1300109 + error = vget(vp, lkflag | LK_INTERLOCK, curthread); +#else + error = vget(vp, lkflag | LK_INTERLOCK); +#endif + if (error == ENOENT) + goto loop; + if (error != 0) { + vp = NULL; + goto out; + } + + /* + * Make sure the vnode is still there after + * getting the interlock to avoid racing a free. + */ + if (node->sf_vnode == NULL || node->sf_vnode != vp) { + vput(vp); + goto loop; + } + + goto out; + } + + if ((node->sf_vpstate & VBOXFS_VNODE_DOOMED) || + (node->sf_type == VDIR && node->sf_parent == NULL)) { + VBOXFS_NODE_UNLOCK(node); + error = ENOENT; + vp = NULL; + goto out; + } + + /* + * otherwise lock the vp list while we call getnewvnode + * since that can block. + */ + if (node->sf_vpstate & VBOXFS_VNODE_ALLOCATING) { + node->sf_vpstate |= VBOXFS_VNODE_WANT; + error = msleep((caddr_t) &node->sf_vpstate, + VBOXFS_NODE_MTX(node), PDROP | PCATCH, + "vboxfs_alloc_vp", 0); + if (error) + return error; + + goto loop; + } else + node->sf_vpstate |= VBOXFS_VNODE_ALLOCATING; + + VBOXFS_NODE_UNLOCK(node); + + /* Get a new vnode and associate it with our node. */ + error = getnewvnode("vboxfs", mp, &vboxfs_vnodeops, &vp); + if (error != 0) + goto unlock; + MPASS(vp != NULL); + + /* lkflag is ignored, the lock is exclusive */ + (void) vn_lock(vp, lkflag | LK_RETRY); + + vp->v_data = node; + vp->v_type = node->sf_type; + + /* Type-specific initialization. */ + switch (node->sf_type) { + case VBLK: + /* FALLTHROUGH */ + case VCHR: + /* FALLTHROUGH */ + case VLNK: + /* FALLTHROUGH */ + case VSOCK: + /* FALLTHROUGH */ + case VFIFO: + /* FALLTHROUGH */ + case VREG: + break; + case VDIR: + MPASS(node->sf_parent != NULL); + if (node->sf_parent == node) + vp->v_vflag |= VV_ROOT; + break; + + default: + panic("vboxfs_alloc_vp: type %p %d", node, (int)node->sf_type); + } + + if (vp->v_type != VFIFO) + VN_LOCK_ASHARE(vp); + +#if __FreeBSD_version < 1400051 + error = insmntque1(vp, mp, vboxfs_insmntque_dtr, NULL); +#else + error = insmntque(vp, mp); +#endif + if (error) { +#if __FreeBSD_version >= 1400051 + vboxfs_insmntque_dtr(vp, NULL); +#endif + vp = NULL; + } + +unlock: + VBOXFS_NODE_LOCK(node); + + MPASS(node->sf_vpstate & VBOXFS_VNODE_ALLOCATING); + node->sf_vpstate &= ~VBOXFS_VNODE_ALLOCATING; + node->sf_vnode = vp; + + if (node->sf_vpstate & VBOXFS_VNODE_WANT) { + node->sf_vpstate &= ~VBOXFS_VNODE_WANT; + VBOXFS_NODE_UNLOCK(node); + wakeup((caddr_t) &node->sf_vpstate); + } else + VBOXFS_NODE_UNLOCK(node); + +out: + *vpp = vp; + +#ifdef INVARIANTS + if (error == 0) { + MPASS(*vpp != NULL && VOP_ISLOCKED(*vpp)); + VBOXFS_NODE_LOCK(node); + MPASS(*vpp == node->sf_vnode); + VBOXFS_NODE_UNLOCK(node); + } +#endif + + return error; } -static int vboxvfs_read(struct vop_read_args *ap) +/* + * Destroys the association between the vnode vp and the node it + * references. + */ +void +vboxfs_free_vp(struct vnode *vp) { - return 0; + struct vboxfs_node *node; + + node = VP_TO_VBOXFS_NODE(vp); + + VBOXFS_NODE_ASSERT_LOCKED(node); + node->sf_vnode = NULL; + if ((node->sf_vpstate & VBOXFS_VNODE_WRECLAIM) != 0) + wakeup(&node->sf_vnode); + node->sf_vpstate &= ~VBOXFS_VNODE_WRECLAIM; + vp->v_data = NULL; } -static int vboxvfs_write(struct vop_write_args *ap) +/* + * Allocate new vboxfs_node and vnode for given file + */ +static int +vboxfs_alloc_file(struct vboxfs_mnt *vboxfsmp, const char *fullpath, + enum_vtype_t type, mode_t mode, struct vboxfs_node *parent, + int lkflag, struct vnode **vpp) { - return 0; + int error; + struct vboxfs_node *unode; + + error = vboxfs_alloc_node(vboxfsmp->sf_vfsp, vboxfsmp, fullpath, type, + vboxfsmp->sf_uid, vboxfsmp->sf_gid, mode, parent, &unode); + + if (error) + goto out; + + error = vboxfs_alloc_vp(vboxfsmp->sf_vfsp, unode, lkflag, vpp); + if (error) + vboxfs_free_node(vboxfsmp, unode); + +out: + return (error); } -static int vboxvfs_create(struct vop_create_args *ap) +static int +vboxfs_vn_get_ino_alloc(struct mount *mp, void *arg, int lkflags, + struct vnode **rvp) { - return 0; + + return (vboxfs_alloc_vp(mp, arg, lkflags, rvp)); } -static int vboxvfs_remove(struct vop_remove_args *ap) +/* + * Construct a new pathname given an sfnode plus an optional tail + * component of length len + * This handles ".." and "." + */ +static char * +sfnode_construct_path(struct vboxfs_node *node, char *tail, int len) { - return 0; + char *p; + size_t dstsz; + + if (len <= 2 && tail[0] == '.' && (len == 1 || tail[1] == '.')) + panic("construct path for %s", tail); + dstsz = strlen(node->sf_path) + 1 + len + 1; + p = malloc(dstsz, M_VBOXVFS, M_WAITOK); + strcpy(p, node->sf_path); + strcat(p, "/"); + strlcat(p, tail, dstsz); + return (p); } -static int vboxvfs_rename(struct vop_rename_args *ap) +static int +vboxfs_access(struct vop_access_args *ap) { - return 0; + struct vnode *vp = ap->a_vp; + accmode_t accmode = ap->a_accmode; + struct vboxfs_node *node; + int error; + mode_t m; + + MPASS(VOP_ISLOCKED(vp)); + + node = VP_TO_VBOXFS_NODE(vp); + + if ((accmode & VWRITE) && (vp->v_mount->mnt_flag & MNT_RDONLY)) { + switch (vp->v_type) { + case VDIR: + case VLNK: + case VREG: + return (EROFS); + /* NOT REACHED */ + default: + break; + } + } + + if (vsfnode_stat_cached(node)) + error = 0; + else + error = vsfnode_update_stat_cache(node); + m = (error == 0) ? node->sf_stat.sf_mode : 0; + +#if __FreeBSD_version < 1300105 + return (vaccess(vp->v_type, m, node->vboxfsmp->sf_uid, + node->vboxfsmp->sf_gid, accmode, ap->a_cred, NULL)); +#else + return (vaccess(vp->v_type, m, node->vboxfsmp->sf_uid, + node->vboxfsmp->sf_gid, accmode, ap->a_cred)); +#endif } -static int vboxvfs_link(struct vop_link_args *ap) +/* + * Clears the (cached) directory listing for the node. + */ +static void +vfsnode_clear_dir_list(struct vboxfs_node *np) { - return EOPNOTSUPP; + while (np->sf_dir_list != NULL) { + sffs_dirents_t *next = np->sf_dir_list->sf_next; + free(np->sf_dir_list, M_VBOXVFS); + np->sf_dir_list = next; + } } -static int vboxvfs_symlink(struct vop_symlink_args *ap) +static int +vboxfs_get_sfp_file(struct vboxfs_node *np) { - return EOPNOTSUPP; + sfp_file_t *fp; + int error; + + fp = NULL; + VBOXFS_NODE_LOCK(np); + for (;;) { + if (np->sf_file != NULL) { + if (fp != NULL) + (void) sfprov_close(fp); + np->sf_opencnt++; + fp = np->sf_file; + break; + } else if (fp != NULL) { + np->sf_file = fp; + KASSERT(np->sf_opencnt == 0, + ("np %p opencnt (%d) must be zero.", + np, np->sf_opencnt)); + np->sf_opencnt = 1; + break; + } + VBOXFS_NODE_UNLOCK(np); + error = sfprov_open(np->vboxfsmp->sf_handle, np->sf_path, &fp); + if (error != 0) + return (error); + VBOXFS_NODE_LOCK(np); + } + VBOXFS_NODE_UNLOCK(np); + + return (0); } -static int vboxvfs_mknod(struct vop_mknod_args *ap) +static void +vboxfs_put_sfp_file(struct vboxfs_node *np) { - return EOPNOTSUPP; + VBOXFS_NODE_LOCK(np); + np->sf_opencnt--; + if (np->sf_opencnt == 0) { + (void) sfprov_close(np->sf_file); + np->sf_file = NULL; + } + VBOXFS_NODE_UNLOCK(np); } -static int vboxvfs_mkdir(struct vop_mkdir_args *ap) +static int +vboxfs_open(struct vop_open_args *ap) { - return 0; + struct vboxfs_node *np; + int error; + + MPASS(VOP_ISLOCKED(vp)); + + np = VP_TO_VBOXFS_NODE(ap->a_vp); + error = vboxfs_get_sfp_file(np); + if (error != 0) + goto out; + + vnode_create_vobject(ap->a_vp, 0, ap->a_td); +out: + MPASS(VOP_ISLOCKED(vp)); + + return (error); } -static int vboxvfs_rmdir(struct vop_rmdir_args *ap) +static void +vfsnode_invalidate_stat_cache(struct vboxfs_node *np) { - return 0; + np->sf_stat_time = 0; } -static int vboxvfs_readdir(struct vop_readdir_args *ap) +static int +vboxfs_close(struct vop_close_args *ap) { - return 0; + struct vnode *vp = ap->a_vp; + struct vboxfs_node *np; + + np = VP_TO_VBOXFS_NODE(vp); + + /* + * Free the directory entries for the node. We do this on this call + * here because the directory node may not become inactive for a long + * time after the readdir is over. Case in point, if somebody cd's into + * the directory then it won't become inactive until they cd away again. + * In such a case we would end up with the directory listing not getting + * updated (i.e. the result of 'ls' always being the same) until they + * change the working directory. + */ + vfsnode_clear_dir_list(np); + + vfsnode_invalidate_stat_cache(np); + + vboxfs_put_sfp_file(np); + + return (0); } -static int vboxvfs_fsync(struct vop_fsync_args *ap) +static int +vboxfs_getattr(struct vop_getattr_args *ap) { - return 0; + struct vnode *vp = ap->a_vp; + struct vattr *vap = ap->a_vap; + struct vboxfs_node *np = VP_TO_VBOXFS_NODE(vp); + struct vboxfs_mnt *mp = np->vboxfsmp; + mode_t mode; + int error = 0; + + mode = 0; + vap->va_type = vp->v_type; + + vap->va_nlink = 1; /* number of references to file */ + vap->va_uid = mp->sf_uid; /* owner user id */ + vap->va_gid = mp->sf_gid; /* owner group id */ + vap->va_rdev = NODEV; /* device the special file represents */ + vap->va_gen = VNOVAL; /* generation number of file */ + vap->va_flags = 0; /* flags defined for file */ + vap->va_filerev = 0; /* file modification number */ + vap->va_vaflags = 0; /* operations flags */ + vap->va_fileid = np->sf_ino; /* file id */ + vap->va_fsid = vp->v_mount->mnt_stat.f_fsid.val[0]; + if (vap->va_fileid == 0) + vap->va_fileid = 2; + + vap->va_atime.tv_sec = VNOVAL; + vap->va_atime.tv_nsec = VNOVAL; + vap->va_mtime.tv_sec = VNOVAL; + vap->va_mtime.tv_nsec = VNOVAL; + vap->va_ctime.tv_sec = VNOVAL; + vap->va_ctime.tv_nsec = VNOVAL; + + if (!vsfnode_stat_cached(np)) { + error = vsfnode_update_stat_cache(np); + if (error != 0) + goto done; + } + + vap->va_atime = np->sf_stat.sf_atime; + vap->va_mtime = np->sf_stat.sf_mtime; + vap->va_ctime = np->sf_stat.sf_ctime; + + mode = np->sf_stat.sf_mode; + + vap->va_mode = mode; + if (S_ISDIR(mode)) { + vap->va_type = VDIR; /* vnode type (for create) */ + vap->va_mode = mp->sf_dmode != 0 ? (mp->sf_dmode & 0777) : vap->va_mode; + vap->va_mode &= ~mp->sf_dmask; + vap->va_mode |= S_IFDIR; + } else if (S_ISREG(mode)) { + vap->va_type = VREG; + vap->va_mode = mp->sf_fmode != 0 ? (mp->sf_fmode & 0777) : vap->va_mode; + vap->va_mode &= ~mp->sf_fmask; + vap->va_mode |= S_IFREG; + } else if (S_ISFIFO(mode)) + vap->va_type = VFIFO; + else if (S_ISCHR(mode)) + vap->va_type = VCHR; + else if (S_ISBLK(mode)) + vap->va_type = VBLK; + else if (S_ISLNK(mode)) { + vap->va_type = VLNK; + vap->va_mode = mp->sf_fmode != 0 ? (mp->sf_fmode & 0777) : vap->va_mode; + vap->va_mode &= ~mp->sf_fmask; + vap->va_mode |= S_IFLNK; + } else if (S_ISSOCK(mode)) + vap->va_type = VSOCK; + + vap->va_size = np->sf_stat.sf_size; + vap->va_blocksize = 512; + /* bytes of disk space held by file */ + vap->va_bytes = (np->sf_stat.sf_alloc + 511) / 512; + +done: + return (error); } -static int vboxvfs_print (struct vop_print_args *ap) +static int +vboxfs_setattr(struct vop_setattr_args *ap) { - return 0; + struct vnode *vp = ap->a_vp; + struct vattr *vap = ap->a_vap; + struct vboxfs_node *np = VP_TO_VBOXFS_NODE(vp); + int error; + mode_t mode; + + mode = vap->va_mode; + if (vp->v_type == VREG) + mode |= S_IFREG; + else if (vp->v_type == VDIR) + mode |= S_IFDIR; + else if (vp->v_type == VBLK) + mode |= S_IFBLK; + else if (vp->v_type == VCHR) + mode |= S_IFCHR; + else if (vp->v_type == VLNK) + mode |= S_IFLNK; + else if (vp->v_type == VFIFO) + mode |= S_IFIFO; + else if (vp->v_type == VSOCK) + mode |= S_IFSOCK; + + vfsnode_invalidate_stat_cache(np); + + error = sfprov_set_attr(np->vboxfsmp->sf_handle, np->sf_path, + mode, vap->va_atime, vap->va_mtime, vap->va_ctime); +#if 0 + if (error == ENOENT) + sfnode_make_stale(np); +#endif + if (vap->va_size != (u_quad_t)VNOVAL) { + switch (vp->v_type) { + case VDIR: + return (EISDIR); + case VLNK: + /* FALLTHROUGH */ + case VREG: + error = sfprov_set_size(np->vboxfsmp->sf_handle, np->sf_path, vap->va_size); + break; + case VCHR: + /* FALLTHROUGH */ + case VBLK: + /* FALLTHROUGH */ + case VSOCK: + /* FALLTHROUGH */ + case VFIFO: + /* FALLTHROUGH */ + case VNON: + /* FALLTHROUGH */ + case VBAD: + /* FALLTHROUGH */ + case VMARKER: + return (0); + } + } + + return (error); } -static int vboxvfs_pathconf (struct vop_pathconf_args *ap) +#define blkoff(vboxfsmp, loc) ((loc) & (vboxfsmp)->bmask) + +static int +vboxfs_read(struct vop_read_args *ap) { - return 0; + struct vnode *vp = ap->a_vp; + struct uio *uio = ap->a_uio; + struct vboxfs_node *np = VP_TO_VBOXFS_NODE(vp); + int error = 0; + uint32_t bytes; + uint32_t done; + unsigned long offset; + ssize_t total; + void *tmpbuf; + + if (vp->v_type == VDIR) + return (EISDIR); + + if (vp->v_type != VREG) + return (EINVAL); + + if (uio->uio_offset < 0) + return (EINVAL); + + total = uio->uio_resid; + if (total == 0) + return (0); + + /* + * XXXGONZO: this is just to get things working + * should be optimized + */ + tmpbuf = contigmalloc(PAGE_SIZE, M_DEVBUF, M_WAITOK, 0, ~0, PAGE_SIZE, 0); + if (tmpbuf == 0) + return (ENOMEM); + + /* + * XXX VOP_READ() is called without VOP_OPEN() on exec case. + * We need to ensure the file is opened here. + */ + error = vboxfs_get_sfp_file(np); + if (error != 0) /* Maybe removed on the host. */ + return (EIO); + do { + offset = uio->uio_offset; + done = bytes = min(PAGE_SIZE, uio->uio_resid); + error = sfprov_read(np->sf_file, tmpbuf, + offset, &done, 0); + if (error == 0 && done > 0) + error = uiomove(tmpbuf, done, uio); + } while (error == 0 && uio->uio_resid > 0 && done > 0); + vboxfs_put_sfp_file(np); + + contigfree(tmpbuf, PAGE_SIZE, M_DEVBUF); + + /* a partial read is never an error */ + if (total != uio->uio_resid) + error = 0; + + return (error); } -static int vboxvfs_strategy (struct vop_strategy_args *ap) +static int +vboxfs_write(struct vop_write_args *ap) { - return 0; + struct vnode *vp = ap->a_vp; + struct uio *uio = ap->a_uio; + struct vboxfs_node *np = VP_TO_VBOXFS_NODE(vp); + int error = 0; + uint32_t bytes; + uint32_t done; + unsigned long offset; + ssize_t total; + void *tmpbuf; + + if (vp->v_type == VDIR) + return (EISDIR); + + if (vp->v_type != VREG) + return (EINVAL); + + if (uio->uio_offset < 0) + return (EINVAL); + + total = uio->uio_resid; + if (total == 0) + return (0); + + /* + * XXXGONZO: this is just to get things working + * should be optimized + */ + tmpbuf = contigmalloc(PAGE_SIZE, M_DEVBUF, M_WAITOK, 0, ~0, PAGE_SIZE, 0); + if (tmpbuf == 0) + return (ENOMEM); + + do { + offset = uio->uio_offset; + bytes = min(PAGE_SIZE, uio->uio_resid); + error = uiomove(tmpbuf, bytes, uio); + if (error != 0) + break; + done = bytes; + error = sfprov_write(np->sf_file, tmpbuf, + offset, &done, 0); + if (error != 0) + break; + total -= done; + if (done != bytes) + uio->uio_resid += bytes - done; + } while (error == 0 && uio->uio_resid > 0 && done > 0); + + contigfree(tmpbuf, PAGE_SIZE, M_DEVBUF); + + /* a partial write is never an error */ + if (total != uio->uio_resid) + error = 0; + + return (error); } -static int vboxvfs_ioctl(struct vop_ioctl_args *ap) +static int +vboxfs_create(struct vop_create_args *ap) { - return ENOTTY; + struct vnode *dvp = ap->a_dvp; + struct vnode **vpp = ap->a_vpp; + struct componentname *cnp = ap->a_cnp; + struct vattr *vap = ap->a_vap; + sffs_stat_t stat; + char *fullpath = NULL; + struct vboxfs_node *dir = VP_TO_VBOXFS_NODE(dvp); + int error; + struct vboxfs_mnt *vboxfsmp = dir->vboxfsmp; + + MPASS(vap->va_type == VREG); + + fullpath = sfnode_construct_path(dir, cnp->cn_nameptr, cnp->cn_namelen); + error = sfprov_create(dir->vboxfsmp->sf_handle, fullpath, vap->va_mode, + &stat); + + if (error) + goto out; + + error = vboxfs_alloc_file(vboxfsmp, fullpath, VREG, vap->va_mode, dir, cnp->cn_lkflags, vpp); + +out: + if (fullpath) + free(fullpath, M_VBOXVFS); + + if (error == 0) { + vfsnode_clear_dir_list(dir); + if ((cnp->cn_flags & MAKEENTRY) != 0) + cache_enter(dvp, *vpp, cnp); + } + + return (error); } -static int vboxvfs_getextattr(struct vop_getextattr_args *ap) +static int +vboxfs_remove(struct vop_remove_args *ap) { - return 0; + struct vnode *dvp = ap->a_dvp; + struct vnode *vp = ap->a_vp; + struct vboxfs_node *np, *dir; + + int error; + + MPASS(VOP_ISLOCKED(dvp)); + MPASS(VOP_ISLOCKED(vp)); + + error = 0; + + np = VP_TO_VBOXFS_NODE(vp); + dir = VP_TO_VBOXFS_NODE(vp); + + error = sfprov_remove(np->vboxfsmp->sf_handle, np->sf_path, + np->sf_type == VLNK); + +#if 0 + if (error == ENOENT || error == 0) + sfnode_make_stale(np); +#endif + + if (error == 0) + vfsnode_clear_dir_list(dir); + +out: + return (error); } -static int vboxvfs_advlock(struct vop_advlock_args *ap) +static int +vboxfs_rename(struct vop_rename_args *ap) { - return 0; + struct vnode *fvp; + struct vnode *fdvp; + struct vnode *tvp; + struct vnode *tdvp; + struct componentname *fcnp; + struct componentname *tcnp; + struct vboxfs_node *np; + int ret; + + fvp = ap->a_fvp; + fdvp = ap->a_fdvp; + tvp = ap->a_tvp; + tdvp = ap->a_tdvp; + fcnp = ap->a_fcnp; + tcnp = ap->a_tcnp; + + /* Check for cross-device rename */ + if ((fvp->v_mount != tdvp->v_mount) || + (tvp && (fvp->v_mount != tvp->v_mount))) { + ret = EXDEV; + goto out; + } + np = VP_TO_VBOXFS_NODE(fvp); + if (np == NULL) + return (0); + ret = sfprov_rename(np->vboxfsmp->sf_handle, + fcnp->cn_nameptr, tcnp->cn_nameptr, fvp->v_type == VDIR); +out: + if (tdvp == tvp) + vrele(tdvp); + else + vput(tdvp); + if (tvp) + vput(tvp); + vrele(fdvp); + vrele(fvp); + return (ret); } -static int vboxvfs_lookup(struct vop_lookup_args *ap) +static int +vboxfs_link(struct vop_link_args *ap) { - return 0; + return (EOPNOTSUPP); } -static int vboxvfs_inactive(struct vop_inactive_args *ap) +static int +vboxfs_symlink(struct vop_symlink_args *ap) { - return 0; + struct vnode *dvp = ap->a_dvp; + struct vnode **vpp = ap->a_vpp; + struct componentname *cnp = ap->a_cnp; + struct vattr *vap = ap->a_vap; + sffs_stat_t stat; + char *fullpath = NULL; + struct vboxfs_node *dir = VP_TO_VBOXFS_NODE(dvp); + int error; + struct vboxfs_mnt *vboxfsmp = dir->vboxfsmp; + + MPASS(vap->va_type == VLNK); + + fullpath = sfnode_construct_path(dir, cnp->cn_nameptr, cnp->cn_namelen); + error = sfprov_symlink(dir->vboxfsmp->sf_handle, fullpath, ap->a_target, &stat); + + if (error) + goto out; + + error = vboxfs_alloc_file(vboxfsmp, fullpath, VLNK, vap->va_mode, dir, cnp->cn_lkflags, vpp); + +out: + if (fullpath) + free(fullpath, M_VBOXVFS); + + if (error == 0) + vfsnode_clear_dir_list(dir); + + return (error); } -static int vboxvfs_reclaim(struct vop_reclaim_args *ap) +static int +vboxfs_mkdir(struct vop_mkdir_args *ap) { - return 0; + struct vnode *dvp = ap->a_dvp; + struct vnode **vpp = ap->a_vpp; + struct componentname *cnp = ap->a_cnp; + struct vattr *vap = ap->a_vap; + sffs_stat_t stat; + char *fullpath = NULL; + struct vboxfs_node *dir = VP_TO_VBOXFS_NODE(dvp); + int error; + struct vboxfs_mnt *vboxfsmp = dir->vboxfsmp; + + MPASS(vap->va_type == VDIR); + + fullpath = sfnode_construct_path(dir, cnp->cn_nameptr, cnp->cn_namelen); + error = sfprov_mkdir(dir->vboxfsmp->sf_handle, fullpath, vap->va_mode, + &stat); + + if (error) + goto out; + + error = vboxfs_alloc_file(vboxfsmp, fullpath, VDIR, vap->va_mode, dir, cnp->cn_lkflags, vpp); + +out: + if (fullpath) + free(fullpath, M_VBOXVFS); + + if (error == 0) + vfsnode_clear_dir_list(dir); + + return (error); } -static int vboxvfs_getpages(struct vop_getpages_args *ap) +static int +vboxfs_rmdir(struct vop_rmdir_args *ap) { - return 0; + struct vnode *dvp = ap->a_dvp; + struct vnode *vp = ap->a_vp; + struct vboxfs_node *np, *dir; + + int error; + + MPASS(VOP_ISLOCKED(dvp)); + MPASS(VOP_ISLOCKED(vp)); + + error = 0; + + np = VP_TO_VBOXFS_NODE(vp); + dir = VP_TO_VBOXFS_NODE(vp); + + error = sfprov_rmdir(np->vboxfsmp->sf_handle, np->sf_path); + +#if 0 + if (error == ENOENT || error == 0) + sfnode_make_stale(np); +#endif + + if (error == 0) + vfsnode_clear_dir_list(dir); + +out: + return (error); } -static int vboxvfs_putpages(struct vop_putpages_args *ap) +static int +vboxfs_readdir(struct vop_readdir_args *ap) { - return 0; + int *eofp = ap->a_eofflag; + struct vnode *vp = ap->a_vp; + struct uio *uio = ap->a_uio; + struct vboxfs_node *dir = VP_TO_VBOXFS_NODE(vp); + struct vboxfs_node *node = NULL; + struct sffs_dirent *dirent = NULL; + sffs_dirents_t *cur_buf; + off_t offset = 0; + off_t orig_off = uio->uio_offset; + int error = 0; + int dummy_eof; + + if (vp->v_type != VDIR) + return (ENOTDIR); + + if (eofp == NULL) + eofp = &dummy_eof; + *eofp = 0; + + /* + * Get the directory entry names from the host. This gets all + * entries. These are stored in a linked list of sffs_dirents_t + * buffers, each of which contains a list of dirent64_t's. + */ + if (dir->sf_dir_list == NULL) { + error = sfprov_readdir(dir->vboxfsmp->sf_handle, dir->sf_path, + &dir->sf_dir_list); + if (error != 0) + goto done; + } + + /* + * Validate and skip to the desired offset. + */ + cur_buf = dir->sf_dir_list; + offset = 0; + + while (cur_buf != NULL && offset + cur_buf->sf_len <= uio->uio_offset) { + offset += cur_buf->sf_len; + cur_buf = cur_buf->sf_next; + } + + if (cur_buf == NULL && offset != uio->uio_offset) { + error = EINVAL; + goto done; + } + + if (cur_buf != NULL && offset != uio->uio_offset) { + off_t off = offset; + int step; + dirent = &cur_buf->sf_entries[0]; + + while (off < uio->uio_offset) { + if (dirent->sf_off == uio->uio_offset) + break; + step = sizeof(struct sffs_dirent) + dirent->sf_entry.d_reclen; + dirent = (struct sffs_dirent *) (((char *) dirent) + step); + off += step; + } + + if (off >= uio->uio_offset) { + error = EINVAL; + goto done; + } + } + + offset = uio->uio_offset - offset; + + /* + * Lookup each of the names, so that we have ino's, and copy to + * result buffer. + */ + while (cur_buf != NULL) { + if (offset >= cur_buf->sf_len) { + cur_buf = cur_buf->sf_next; + offset = 0; + continue; + } + + dirent = (struct sffs_dirent *) + (((char *) &cur_buf->sf_entries[0]) + offset); + if (dirent->sf_entry.d_reclen > uio->uio_resid) + break; + + if (strcmp(dirent->sf_entry.d_name, ".") == 0) { + node = dir; + } else if (strcmp(dirent->sf_entry.d_name, "..") == 0) { + node = dir->sf_parent; + if (node == NULL) + node = dir; + } else { +#if 0 + node = vsfnode_lookup(dir, dirent->sf_entry.d_name, VNON, + 0, &dirent->sf_stat, vsfnode_cur_time_usec(), NULL); + if (node == NULL) + panic("sffs_readdir() lookup failed"); +#endif + } + + if (node) + dirent->sf_entry.d_fileno = node->sf_ino; + else + dirent->sf_entry.d_fileno = 0xdeadbeef; + + error = uiomove(&dirent->sf_entry, dirent->sf_entry.d_reclen, uio); + if (error != 0) + break; + + uio->uio_offset = dirent->sf_off; + offset += sizeof(struct sffs_dirent) + dirent->sf_entry.d_reclen; + } + + if (error == 0 && cur_buf == NULL) + *eofp = 1; +done: + if (error != 0) + uio->uio_offset = orig_off; + return (error); } +static int +vboxfs_readlink(struct vop_readlink_args *v) +{ + struct vnode *vp = v->a_vp; + struct uio *uio = v->a_uio; + + int error; + struct vboxfs_node *np; + void *tmpbuf; + + MPASS(uio->uio_offset == 0); + MPASS(vp->v_type == VLNK); + + np = VP_TO_VBOXFS_NODE(vp); + + tmpbuf = contigmalloc(MAXPATHLEN, M_DEVBUF, M_WAITOK, 0, ~0, 1, 0); + if (tmpbuf == NULL) + return (ENOMEM); + + error = sfprov_readlink(np->vboxfsmp->sf_handle, np->sf_path, tmpbuf, + MAXPATHLEN); + if (error) + goto done; + + error = uiomove(tmpbuf, strlen(tmpbuf), uio); + +done: + if (tmpbuf) + contigfree(tmpbuf, MAXPATHLEN, M_DEVBUF); + return (error); +} + +static int +vboxfs_fsync(struct vop_fsync_args *ap) +{ + struct vnode *vp; + struct vboxfs_node *np; + int ret; + + vp = ap->a_vp; + np = VP_TO_VBOXFS_NODE(vp); + if (np == NULL) + return (0); + ret = sfprov_fsync(np->sf_file); + return (ret); +} + +static int +vboxfs_print(struct vop_print_args *ap) +{ + struct vnode *vp = ap->a_vp; + struct vboxfs_node *np; + + np = VP_TO_VBOXFS_NODE(vp); + + if (np == NULL) { + printf("No vboxfs_node data\n"); + return (0); + } + + printf("\tpath = %s, parent = %p", np->sf_path, + np->sf_parent ? np->sf_parent : NULL); + printf("\n"); + return (0); +} + +static int +vboxfs_pathconf(struct vop_pathconf_args *ap) +{ + register_t *retval = ap->a_retval; + int error = 0; + + switch (ap->a_name) { + case _PC_LINK_MAX: + *retval = 65535; + break; + case _PC_NAME_MAX: + *retval = NAME_MAX; + break; + case _PC_PATH_MAX: + *retval = PATH_MAX; + break; + default: + error = EINVAL; + break; + } + return (error); +} + +/* + * File specific ioctls. + */ +static int +vboxfs_ioctl(struct vop_ioctl_args *ap) +{ + return (ENOTTY); +} + +/* + * Lookup an entry in a directory and create a new vnode if found. + */ +static int +vboxfs_lookup1(struct vnode *dvp, struct vnode **vpp, + struct componentname *cnp) +{ + char *nameptr = cnp->cn_nameptr; /* the name of the file or directory */ + struct vnode *tdp = NULL; + struct vboxfs_node *node = VP_TO_VBOXFS_NODE(dvp); + struct vboxfs_mnt *vboxfsmp = node->vboxfsmp; + u_long nameiop = cnp->cn_nameiop; + u_long flags = cnp->cn_flags; + sffs_stat_t stat; + //long namelen; + ino_t id = 0; + int ltype, type, error = 0; + int lkflags = cnp->cn_lkflags; + char *fullpath = NULL; + + *vpp = NULLVP; + error = ENOENT; + if (cnp->cn_flags & ISDOTDOT) { + error = vn_vget_ino_gen(dvp, vboxfs_vn_get_ino_alloc, + node->sf_parent, cnp->cn_lkflags, vpp); + error = ENOENT; + if (error != 0) + goto out; + + } else if (cnp->cn_namelen == 1 && cnp->cn_nameptr[0] == '.') { + VREF(dvp); + *vpp = dvp; + error = 0; + } else { + mode_t m; + type = VNON; + fullpath = sfnode_construct_path(node, cnp->cn_nameptr, cnp->cn_namelen); + error = sfprov_get_attr(node->vboxfsmp->sf_handle, + fullpath, &stat); + // stat_time = vsfnode_cur_time_usec(); + + m = stat.sf_mode; + if (error != 0) { + /* The entry was not found in the directory. + * This is OK if we are creating or renaming an + * entry and are working on the last component of + * the path name. */ + if ((cnp->cn_flags & ISLASTCN) && + (cnp->cn_nameiop == CREATE || \ + cnp->cn_nameiop == RENAME || + (cnp->cn_nameiop == DELETE && + cnp->cn_flags & DOWHITEOUT && + cnp->cn_flags & ISWHITEOUT))) { + error = VOP_ACCESS(dvp, VWRITE, cnp->cn_cred, +#if __FreeBSD_version < 1400037 + cnp->cn_thread); +#else + curthread); +#endif + if (error != 0) + goto out; + +#if __FreeBSD_version < 1400068 + /* Keep the component name in the buffer for + * future uses. */ + cnp->cn_flags |= SAVENAME; +#endif + + error = EJUSTRETURN; + } else + error = ENOENT; + } + else { + if (S_ISDIR(m)) + type = VDIR; + else if (S_ISREG(m)) + type = VREG; + else if (S_ISLNK(m)) + type = VLNK; + error = vboxfs_alloc_file(vboxfsmp, fullpath, type, 0755, node, cnp->cn_lkflags, vpp); + } + } + + if ((cnp->cn_flags & MAKEENTRY) != 0) + cache_enter(dvp, *vpp, cnp); +out: + if (fullpath) + free(fullpath, M_VBOXVFS); + + return (error); +} + +static int +vboxfs_cachedlookup(struct vop_cachedlookup_args *ap) +{ + return (vboxfs_lookup1(ap->a_dvp, ap->a_vpp, ap->a_cnp)); +} + +static int +vboxfs_lookup(struct vop_lookup_args *ap) +{ + struct vnode *dvp = ap->a_dvp; + struct componentname *cnp = ap->a_cnp; + struct vboxfs_node *np = VP_TO_VBOXFS_NODE(dvp); + struct timespec mtime; + int flags = cnp->cn_flags; + int error; + + if (dvp->v_type != VDIR) + return (ENOTDIR); + + if ((flags & ISLASTCN) && (dvp->v_mount->mnt_flag & MNT_RDONLY) && + (cnp->cn_nameiop == DELETE || cnp->cn_nameiop == RENAME)) + return (EROFS); + + error = vn_dir_check_exec(dvp, cnp); + if (error != 0) + return (error); + + /* Check if the directory is unmodified on the host. */ + mtime = np->sf_stat.sf_mtime; + error = vsfnode_update_stat_cache(np); + if (error == 0) { + if (mtime.tv_sec == np->sf_stat.sf_mtime.tv_sec && + mtime.tv_nsec == np->sf_stat.sf_mtime.tv_nsec) + return (vfs_cache_lookup(ap)); + } + + cache_purge(dvp); + + return (vboxfs_lookup1(ap->a_dvp, ap->a_vpp, ap->a_cnp)); +} + +static int +vboxfs_inactive(struct vop_inactive_args *ap) +{ + return (0); +} + +static int +vboxfs_reclaim(struct vop_reclaim_args *ap) +{ + struct vnode *vp; + struct vboxfs_node *node; + struct vboxfs_mnt *vboxfsmp; + + vp = ap->a_vp; + node = VP_TO_VBOXFS_NODE(vp); + vboxfsmp = node->vboxfsmp; + + vnode_destroy_vobject(vp); + vp->v_object = NULL; + cache_purge(vp); + + VBOXFS_NODE_LOCK(node); + VBOXFS_ASSERT_ELOCKED(node); + vboxfs_free_vp(vp); + + /* If the node referenced by this vnode was deleted by the user, + * we must free its associated data structures (now that the vnode + * is being reclaimed). */ + if ((node->sf_vpstate & VBOXFS_VNODE_ALLOCATING) == 0) { + node->sf_vpstate = VBOXFS_VNODE_DOOMED; + VBOXFS_NODE_UNLOCK(node); + vboxfs_free_node(vboxfsmp, node); + } else + VBOXFS_NODE_UNLOCK(node); + + MPASS(vp->v_data == NULL); + + return (0); +} + +static int +vboxfs_vptofh(struct vop_vptofh_args *ap) +{ + + return (EOPNOTSUPP); +} diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_x11_vboxmouse_Makefile.kmk b/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_x11_vboxmouse_Makefile.kmk index afb19c804d7a..bd5e626ecea2 100644 --- a/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_x11_vboxmouse_Makefile.kmk +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Additions_x11_vboxmouse_Makefile.kmk @@ -1,29 +1,29 @@ ---- src/VBox/Additions/x11/vboxmouse/Makefile.kmk.orig 2019-01-25 18:24:30 UTC +--- src/VBox/Additions/x11/vboxmouse/Makefile.kmk.orig 2025-08-13 19:41:22 UTC +++ src/VBox/Additions/x11/vboxmouse/Makefile.kmk -@@ -227,10 +227,22 @@ endif # neq ($(KBUILD_TARGET),linux) +@@ -237,10 +237,22 @@ ifdef VBOX_USE_SYSTEM_XORG_HEADERS ifdef VBOX_USE_SYSTEM_XORG_HEADERS - # As vboxmouse_drv is not needed at all for X.Org Server 1.7 and later do not - # build it in this case. - DLLS := $(filter-out vboxmouse_drv_%,$(DLLS)) - SYSMODS := $(filter-out vboxmouse_drv%,$(SYSMODS)) + ifeq ($(KBUILD_TARGET),freebsd) + DLLS += vboxmouse_drv_system + vboxmouse_drv_system_TEMPLATE = VBOXGUESTR3XORGMOD + vboxmouse_drv_system_DEFS := $(vboxmouse_drv_70_DEFS) NO_ANSIC + vboxmouse_drv_system_INCS := \ + /usr/local/include/pixman-1 \ + /usr/local/include/xorg \ + $(PATH_SUB_CURRENT) + vboxmouse_drv_system_SOURCES = \ + vboxmouse.c + else + # As vboxmouse_drv is not needed at all for X.Org Server 1.7 and later do not + # build it in this case. + DLLS := $(filter-out vboxmouse_drv_%,$(DLLS)) + SYSMODS := $(filter-out vboxmouse_drv%,$(SYSMODS)) + endif endif diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA.cpp b/emulators/virtualbox-ose-72/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA.cpp index 5ce43e5ce2d0..de5a81911c03 100644 --- a/emulators/virtualbox-ose-72/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA.cpp +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA.cpp @@ -1,20 +1,20 @@ ---- src/VBox/Devices/Graphics/DevVGA-SVGA.cpp.orig 2025-04-14 17:55:41 UTC +--- src/VBox/Devices/Graphics/DevVGA-SVGA.cpp.orig 2025-08-13 19:47:43 UTC +++ src/VBox/Devices/Graphics/DevVGA-SVGA.cpp @@ -178,7 +178,7 @@ # ifdef RT_OS_DARWIN # include "DevVGA-SVGA3d-cocoa.h" # endif -# ifdef RT_OS_LINUX +# if defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX) # ifdef IN_RING3 # include "DevVGA-SVGA3d-glLdr.h" # endif -@@ -7685,7 +7685,7 @@ static void vmsvgaR3PowerOnDevice(PPDMDEVINS pDevIns, +@@ -7949,7 +7949,7 @@ static void vmsvgaR3PowerOnDevice(PPDMDEVINS pDevIns, } # endif -# if defined(VBOX_WITH_VMSVGA3D) && defined(RT_OS_LINUX) +# if defined(VBOX_WITH_VMSVGA3D) && (defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX)) if (pThis->svga.f3DEnabled) { /* The FIFO thread may use X API for accelerated screen output. */ diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA3d-dx-dx11.cpp b/emulators/virtualbox-ose-72/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA3d-dx-dx11.cpp index 3a0a22e2ef76..4d74ec64cec0 100644 --- a/emulators/virtualbox-ose-72/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA3d-dx-dx11.cpp +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA3d-dx-dx11.cpp @@ -1,11 +1,11 @@ ---- src/VBox/Devices/Graphics/DevVGA-SVGA3d-dx-dx11.cpp.orig 2025-05-12 17:49:35 UTC +--- src/VBox/Devices/Graphics/DevVGA-SVGA3d-dx-dx11.cpp.orig 2025-08-13 19:47:43 UTC +++ src/VBox/Devices/Graphics/DevVGA-SVGA3d-dx-dx11.cpp -@@ -3363,7 +3363,7 @@ static DECLCALLBACK(int) vmsvga3dBackInit(PPDMDEVINS p +@@ -3021,7 +3021,7 @@ static DECLCALLBACK(int) vmsvga3dBackInit(PPDMDEVINS p RT_NOREF(pDevIns, pThis); int rc; -#ifdef RT_OS_LINUX /** @todo Remove, this is currently needed for loading the X11 library in order to call XInitThreads(). */ +#if defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX) /** @todo Remove, this is currently needed for loading the X11 library in order to call XInitThreads(). */ rc = glLdrInit(pDevIns); if (RT_FAILURE(rc)) { diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Devices_Makefile.kmk b/emulators/virtualbox-ose-72/files/patch-src_VBox_Devices_Makefile.kmk index 021d004d5a00..b66a828f5eb2 100644 --- a/emulators/virtualbox-ose-72/files/patch-src_VBox_Devices_Makefile.kmk +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Devices_Makefile.kmk @@ -1,44 +1,44 @@ ---- src/VBox/Devices/Makefile.kmk.orig 2024-10-10 20:29:17.000000000 +0200 -+++ src/VBox/Devices/Makefile.kmk 2024-12-27 13:26:17.132294000 +0100 -@@ -132,6 +132,7 @@ +--- src/VBox/Devices/Makefile.kmk.orig 2025-08-13 19:48:02 UTC ++++ src/VBox/Devices/Makefile.kmk +@@ -135,6 +135,7 @@ if !defined(VBOX_ONLY_EXTPACKS) VBoxDDU_LDFLAGS.darwin += -framework IOKit endif + VBoxDDU_LDFLAGS.freebsd = $(VBOX_GCC_NO_UNDEFINED) VBoxDDU_LDFLAGS.linux = $(VBOX_GCC_NO_UNDEFINED) $(call VBOX_SET_VER_INFO_DLL,VBoxDDU,VirtualBox VMM Devices and Drivers Utilities) -@@ -286,6 +287,7 @@ +@@ -290,6 +291,7 @@ if !defined(VBOX_ONLY_EXTPACKS) && "$(intersects $(KBU -framework SystemConfiguration \ -framework AVFoundation \ -framework Foundation + VBoxDD_LDFLAGS.freebsd = $(VBOX_GCC_NO_UNDEFINED) VBoxDD_LDFLAGS.linux = $(VBOX_GCC_NO_UNDEFINED) # --- Tracing bits. --- -@@ -331,7 +333,7 @@ +@@ -334,7 +336,7 @@ if !defined(VBOX_ONLY_EXTPACKS) && "$(intersects $(KBU Graphics/DevVGA-SVGA-cmd.cpp endif ifdef VBOX_WITH_VMSVGA3D - if1of ($(KBUILD_TARGET), linux win) + if1of ($(KBUILD_TARGET), linux win freebsd) # Dynamically load 3D library (opengl32, libGL). # This is a temporary solution. In future the 3D backend will be in a separate library. VBOX_WITH_VMSVGA3D_DYNAMIC_LOAD = 1 -@@ -390,6 +392,7 @@ +@@ -410,6 +412,7 @@ if !defined(VBOX_ONLY_EXTPACKS) && "$(intersects $(KBU Graphics/DevVGA-SVGA3d-glLdr.cpp else VBoxDD_LIBS.linux += X11 GL + VBoxDD_LIBS.freebsd += X11 GL VBoxDD_LIBS.win += $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/Opengl32.lib endif VBoxDD_LDFLAGS.darwin += -framework OpenGL -@@ -1701,6 +1704,8 @@ +@@ -1523,6 +1526,8 @@ if defined(VBOX_WITH_VMSVGA3D) && !defined(VBOX_ONLY_E VBoxSVGA3D_INCS = $(VBOX_GRAPHICS_INCS) VBoxSVGA3D_INCS.win := \ Graphics/shaderlib/libWineStub/include + VBoxSVGA3D_INCS.freebsd := \ + Graphics/shaderlib/wine/include VBoxSVGA3D_INCS.linux := \ Graphics/shaderlib/wine/include VBoxSVGA3D_INCS.darwin := \ diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Devices_Network_DrvNAT.cpp b/emulators/virtualbox-ose-72/files/patch-src_VBox_Devices_Network_DrvNAT.cpp index 11ee43504054..088c8e1fe3c1 100644 --- a/emulators/virtualbox-ose-72/files/patch-src_VBox_Devices_Network_DrvNAT.cpp +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Devices_Network_DrvNAT.cpp @@ -1,10 +1,10 @@ ---- src/VBox/Devices/Network/DrvNATlibslirp.cpp.orig 2025-01-25 00:56:57.537046000 +0700 -+++ src/VBox/Devices/Network/DrvNATlibslirp.cpp 2025-01-25 00:58:05.112538000 +0700 +--- src/VBox/Devices/Network/DrvNAT.cpp.orig 2025-08-13 19:48:03 UTC ++++ src/VBox/Devices/Network/DrvNAT.cpp @@ -57,6 +57,7 @@ #ifdef RT_OS_FREEBSD # include +# include #endif #include diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Devices_PC_ipxe_Makefile.kmk b/emulators/virtualbox-ose-72/files/patch-src_VBox_Devices_PC_ipxe_Makefile.kmk index d59d98da3b83..fa3a87062c6c 100644 --- a/emulators/virtualbox-ose-72/files/patch-src_VBox_Devices_PC_ipxe_Makefile.kmk +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Devices_PC_ipxe_Makefile.kmk @@ -1,29 +1,29 @@ ---- src/VBox/Devices/PC/ipxe/Makefile.kmk.orig 2025-01-21 19:56:40.000000000 +0700 -+++ src/VBox/Devices/PC/ipxe/Makefile.kmk 2025-01-23 00:47:50.818978000 +0700 -@@ -45,7 +45,7 @@ +--- src/VBox/Devices/PC/ipxe/Makefile.kmk.orig 2025-08-13 19:48:06 UTC ++++ src/VBox/Devices/PC/ipxe/Makefile.kmk +@@ -45,7 +45,7 @@ iPxeBiosBin_CLEAN = \ iPxeBiosBin_CLEAN = \ $(iPxeBiosBin_0_OUTDIR)/iPxeBiosBin.c \ -if1of ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH), darwin.amd64 darwin.arm64 linux.arm64 os2.x86 solaris.amd64 win.amd64 win.arm64) +if1of ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH), darwin.amd64 darwin.arm64 linux.arm64 os2.x86 solaris.amd64 win.amd64 win.arm64 linux.amd64 freebsd.amd64) $$(iPxeBiosBin_0_OUTDIR)/iPxeBiosBin.c: $(PATH_SUB_CURRENT)/iPxeBiosBin.rom $(VBOX_BIN2C) | $$(dir $$@) $(call MSG_TOOL,bin2c,iPxeBiosBin,$<,$@) $(QUIET)$(VBOX_BIN2C) -min 32 -max 56 -mask 0x1ff -export NetBiosBinary $< $@ -@@ -131,7 +131,7 @@ +@@ -131,7 +131,7 @@ endif -falign-loops=1 \ -Os \ -falign-functions=1 \ - -mpreferred-stack-boundary=2 \ + -mstack-alignment=2 \ -mregparm=3 \ -mrtd \ -freg-struct-return \ -@@ -154,7 +154,7 @@ +@@ -154,7 +154,7 @@ endif -falign-jumps=1 \ -falign-loops=1 \ -falign-functions=1 \ - -mpreferred-stack-boundary=2 \ + -mstack-alignment=2 \ -mregparm=3 \ -mrtd \ -freg-struct-return \ diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Devices_USB_freebsd_USBProxyDevice-freebsd.cpp b/emulators/virtualbox-ose-72/files/patch-src_VBox_Devices_USB_freebsd_USBProxyDevice-freebsd.cpp index 045e328d5c48..8258164501b2 100644 --- a/emulators/virtualbox-ose-72/files/patch-src_VBox_Devices_USB_freebsd_USBProxyDevice-freebsd.cpp +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Devices_USB_freebsd_USBProxyDevice-freebsd.cpp @@ -1,11 +1,11 @@ ---- src/VBox/Devices/USB/freebsd/USBProxyDevice-freebsd.cpp.orig 2024-01-11 12:23:15 UTC +--- src/VBox/Devices/USB/freebsd/USBProxyDevice-freebsd.cpp.orig 2025-08-13 19:49:01 UTC +++ src/VBox/Devices/USB/freebsd/USBProxyDevice-freebsd.cpp -@@ -57,7 +57,7 @@ +@@ -67,7 +67,7 @@ #include "../USBProxyDevice.h" /** Maximum endpoints supported. */ -#define USBFBSD_MAXENDPOINTS 127 +#define USBFBSD_MAXENDPOINTS 126 #define USBFBSD_MAXFRAMES 56 /** This really needs to be defined in vusb.h! */ diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_ExtPacks_VNC_VBoxVNC.cpp b/emulators/virtualbox-ose-72/files/patch-src_VBox_ExtPacks_VNC_VBoxVNC.cpp index f364e261f40b..d4bae4a6c016 100644 --- a/emulators/virtualbox-ose-72/files/patch-src_VBox_ExtPacks_VNC_VBoxVNC.cpp +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_ExtPacks_VNC_VBoxVNC.cpp @@ -1,58 +1,58 @@ ---- src/VBox/ExtPacks/VNC/VBoxVNC.cpp.orig 2024-01-11 12:24:04 UTC +--- src/VBox/ExtPacks/VNC/VBoxVNC.cpp.orig 2025-08-13 19:50:02 UTC +++ src/VBox/ExtPacks/VNC/VBoxVNC.cpp -@@ -45,7 +45,7 @@ +@@ -55,7 +55,7 @@ #ifdef LIBVNCSERVER_IPv6 // enable manually! -// #define VBOX_USE_IPV6 +#define VBOX_USE_IPV6 #endif -@@ -421,7 +421,7 @@ DECLCALLBACK(int) VNCServerImpl::VRDEEnableConnections +@@ -431,7 +431,7 @@ DECLCALLBACK(int) VNCServerImpl::VRDEEnableConnections // get address char *pszTCPAddress = (char *)RTMemTmpAllocZ(VNC_ADDRESS_OPTION_MAX); - rc = instance->mCallbacks->VRDECallbackProperty(instance->mCallback, + int rc = instance->mCallbacks->VRDECallbackProperty(instance->mCallback, VRDE_QP_NETWORK_ADDRESS, pszTCPAddress, VNC_ADDRESS_OPTION_MAX, -@@ -582,19 +582,35 @@ DECLCALLBACK(int) VNCServerImpl::VRDEEnableConnections +@@ -592,19 +592,35 @@ DECLCALLBACK(int) VNCServerImpl::VRDEEnableConnections pszServerAddress6 = szIPv6ListenAll; } - if (pszVNCPort4 && uServerPort4 == 0) + if (strlen(pszVNCPort4) > 0 && uServerPort4 == 0) { rc = RTStrToUInt32Ex(pszVNCPort4, NULL, 10, &uServerPort4); if (!RT_SUCCESS(rc) || uServerPort4 > 65535) uServerPort4 = 0; } - if (pszVNCPort6 && uServerPort6 == 0) + if (strlen(pszVNCPort6) > 0 && uServerPort6 == 0) { rc = RTStrToUInt32Ex(pszVNCPort6, NULL, 10, &uServerPort6); if (!RT_SUCCESS(rc) || uServerPort6 > 65535) uServerPort6 = 0; } + +/* Backward compatibility with set port in "TCP/Ports" only { */ + if (uServerPort4 == 0 && strlen(pszTCPPort) > 0) + { + rc = RTStrToUInt32Ex(pszTCPPort, NULL, 10, &uServerPort4); + if (!RT_SUCCESS(rc) || uServerPort4 > 65535) + uServerPort4 = 0; + } + + if (uServerPort6 == 0 && strlen(pszTCPPort) > 0) + { + rc = RTStrToUInt32Ex(pszTCPPort, NULL, 10, &uServerPort6); + if (!RT_SUCCESS(rc) || uServerPort6 > 65535) + uServerPort6 = 0; + } +/* } */ if (uServerPort4 == 0 || uServerPort6 == 0) vncServer->autoPort = 1; diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Frontends_VBoxHeadless_VBoxHeadless.cpp b/emulators/virtualbox-ose-72/files/patch-src_VBox_Frontends_VBoxHeadless_VBoxHeadless.cpp index ca03e57922b4..ed1f32e0ce97 100644 --- a/emulators/virtualbox-ose-72/files/patch-src_VBox_Frontends_VBoxHeadless_VBoxHeadless.cpp +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Frontends_VBoxHeadless_VBoxHeadless.cpp @@ -1,11 +1,11 @@ ---- src/VBox/Frontends/VBoxHeadless/VBoxHeadless.cpp.orig 2024-12-26 22:32:13.106542000 +0100 -+++ src/VBox/Frontends/VBoxHeadless/VBoxHeadless.cpp 2024-12-26 22:32:32.805126000 +0100 -@@ -61,7 +61,7 @@ +--- src/VBox/Frontends/VBoxHeadless/VBoxHeadless.cpp.orig 2025-08-13 19:50:04 UTC ++++ src/VBox/Frontends/VBoxHeadless/VBoxHeadless.cpp +@@ -63,7 +63,7 @@ using namespace com; # include #endif -#if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) +#if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) # include #endif diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Frontends_VBoxManage_VBoxManageModifyVM.cpp b/emulators/virtualbox-ose-72/files/patch-src_VBox_Frontends_VBoxManage_VBoxManageModifyVM.cpp index fc1639b58302..838da1e0f15d 100644 --- a/emulators/virtualbox-ose-72/files/patch-src_VBox_Frontends_VBoxManage_VBoxManageModifyVM.cpp +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Frontends_VBoxManage_VBoxManageModifyVM.cpp @@ -1,29 +1,29 @@ ---- src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp.orig 2022-10-06 19:10:28.000000000 +0200 -+++ src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp 2024-12-26 16:08:30.624183000 +0100 -@@ -170,7 +170,7 @@ +--- src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp.orig 2025-08-13 19:50:05 UTC ++++ src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp +@@ -151,7 +151,7 @@ enum MODIFYVM_UARTMODE, MODIFYVM_UARTTYPE, MODIFYVM_UART, -#if defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS) +#if defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS) MODIFYVM_LPTMODE, MODIFYVM_LPT, #endif -@@ -382,7 +382,7 @@ +@@ -393,7 +393,7 @@ static const RTGETOPTDEF g_aModifyVMOptions[] = OPT2("--uart-mode", "--uartmode", MODIFYVM_UARTMODE, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX), OPT2("--uart-type", "--uarttype", MODIFYVM_UARTTYPE, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX), OPT1("--uart", MODIFYVM_UART, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX), -#if defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS) +#if defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS) || defined(RT_OS_FREEBSD) OPT2("--lpt-mode", "--lptmode", MODIFYVM_LPTMODE, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX), OPT1("--lpt", MODIFYVM_LPT, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX), #endif -@@ -2496,7 +2496,7 @@ +@@ -2680,7 +2680,7 @@ RTEXITCODE handleModifyVM(HandlerArg *a) break; } -#if defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS) +#if defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS) case MODIFYVM_LPTMODE: { ComPtr lpt; diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Frontends_VirtualBox_src_manager_UIVirtualBoxManager.cpp b/emulators/virtualbox-ose-72/files/patch-src_VBox_Frontends_VirtualBox_src_manager_UIVirtualBoxManager.cpp new file mode 100644 index 000000000000..7f18eb80356b --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Frontends_VirtualBox_src_manager_UIVirtualBoxManager.cpp @@ -0,0 +1,46 @@ +--- src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp.orig 2025-08-13 19:50:55 UTC ++++ src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp +@@ -2402,6 +2402,9 @@ void UIVirtualBoxManager::prepare() + qApp->installEventFilter(this); + #endif + ++ /* Prepare notification-center invisibvle way: */ ++ prepareNotificationCenter(); ++ + /* Cache media data early if necessary: */ + if (uiCommon().agressiveCaching()) + gpMediumEnumerator->enumerateMedia(); +@@ -2446,6 +2449,12 @@ void UIVirtualBoxManager::prepare() + #endif /* VBOX_GUI_WITH_NETWORK_MANAGER && VBOX_WITH_UPDATE_REQUEST */ + } + ++void UIVirtualBoxManager::prepareNotificationCenter() ++{ ++ UINotificationCenter::create(); ++ ++} ++ + void UIVirtualBoxManager::prepareCloudMachineManager() + { + UICloudMachineManager::create(); +@@ -2805,6 +2814,12 @@ void UIVirtualBoxManager::cleanupCloudMachineManager() + UICloudMachineManager::destroy(); + } + ++void UIVirtualBoxManager::cleanupNotificationCenter() ++{ ++ UINotificationCenter::destroy(); ++ ++} ++ + void UIVirtualBoxManager::cleanup() + { + /* Ask sub-dialogs to commit data: */ +@@ -2814,6 +2829,7 @@ void UIVirtualBoxManager::cleanup() + cleanupWidgets(); + cleanupMenuBar(); + cleanupCloudMachineManager(); ++ cleanupNotificationCenter(); + } + + UIVirtualMachineItem *UIVirtualBoxManager::currentItem() const diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Frontends_VirtualBox_src_manager_UIVirtualBoxManager.h b/emulators/virtualbox-ose-72/files/patch-src_VBox_Frontends_VirtualBox_src_manager_UIVirtualBoxManager.h new file mode 100644 index 000000000000..80daea0c318c --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Frontends_VirtualBox_src_manager_UIVirtualBoxManager.h @@ -0,0 +1,20 @@ +--- src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.h.orig 2025-08-13 19:50:55 UTC ++++ src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.h +@@ -341,6 +341,8 @@ private slots: (private) + * @{ */ + /** Prepares window. */ + void prepare(); ++ /** Prepares notification-center. */ ++ void prepareNotificationCenter(); + /** Prepares cloud machine manager. */ + void prepareCloudMachineManager(); + /** Prepares icon. */ +@@ -366,6 +368,8 @@ private slots: (private) + void cleanupMenuBar(); + /** Cleanups cloud machine manager. */ + void cleanupCloudMachineManager(); ++ /** Cleanups notification-center. */ ++ void cleanupNotificationCenter(); + /** Cleanups window. */ + void cleanup(); + /** @} */ diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Frontends_VirtualBox_src_manager_UIVirtualBoxWidget.cpp b/emulators/virtualbox-ose-72/files/patch-src_VBox_Frontends_VirtualBox_src_manager_UIVirtualBoxWidget.cpp new file mode 100644 index 000000000000..52f736783c17 --- /dev/null +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Frontends_VirtualBox_src_manager_UIVirtualBoxWidget.cpp @@ -0,0 +1,24 @@ +--- src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxWidget.cpp.orig 2025-08-13 19:50:55 UTC ++++ src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxWidget.cpp +@@ -399,8 +399,8 @@ void UIVirtualBoxWidget::prepareWidgets() + } + } + +- /* Create notification-center: */ +- UINotificationCenter::create(this); ++ /* Reparent notification-center: */ ++ gpNotificationCenter->setParent(this); + + /* Update toolbar finally: */ + updateToolbar(); +@@ -746,8 +746,8 @@ void UIVirtualBoxWidget::cleanup() + + void UIVirtualBoxWidget::cleanup() + { +- /* Destroy notification-center: */ +- UINotificationCenter::destroy(); ++ /* Reparent notification-center: */ ++ gpNotificationCenter->setParent(0); + } + + UIGlobalToolsWidget *UIVirtualBoxWidget::globalToolsWidget() const diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_Support_SUPDrv.cpp b/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_Support_SUPDrv.cpp index 4139a88a9929..9c25da533123 100644 --- a/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_Support_SUPDrv.cpp +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_Support_SUPDrv.cpp @@ -1,13 +1,13 @@ ---- src/VBox/HostDrivers/Support/SUPDrv.cpp.orig 2024-12-27 08:34:02.157677000 +0100 -+++ src/VBox/HostDrivers/Support/SUPDrv.cpp 2024-12-27 08:34:25.419134000 +0100 -@@ -317,8 +317,8 @@ +--- src/VBox/HostDrivers/Support/SUPDrv.cpp.orig 2025-08-13 19:51:08 UTC ++++ src/VBox/HostDrivers/Support/SUPDrv.cpp +@@ -322,8 +322,8 @@ static SUPFUNC g_aFunctions[] = SUPEXP_STK_BACK( 2, SUPR0PageFree), SUPEXP_STK_BACK( 6, SUPR0PageMapKernel), SUPEXP_STK_BACK( 6, SUPR0PageProtect), -#if defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) - SUPEXP_STK_OKAY( 2, SUPR0HCPhysToVirt), /* only-linux, only-solaris, only-freebsd */ +#if defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) + SUPEXP_STK_OKAY( 2, SUPR0HCPhysToVirt), /* only-linux, only-solaris */ #endif SUPEXP_STK_BACK( 2, SUPR0PrintfV), SUPEXP_STK_BACK( 1, SUPR0GetSessionGVM), diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_Support_SUPDrvInternal.h b/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_Support_SUPDrvInternal.h index 7376ad6fbddd..df4d3cd76817 100644 --- a/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_Support_SUPDrvInternal.h +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_Support_SUPDrvInternal.h @@ -1,11 +1,11 @@ ---- src/VBox/HostDrivers/Support/SUPDrvInternal.h.orig 2021-01-07 15:41:25 UTC +--- src/VBox/HostDrivers/Support/SUPDrvInternal.h.orig 2025-08-13 19:51:08 UTC +++ src/VBox/HostDrivers/Support/SUPDrvInternal.h -@@ -217,7 +217,7 @@ +@@ -368,7 +368,7 @@ # define SUPDRV_WITHOUT_MSR_PROBER #endif -#if 1 +#if 0 /** @def SUPDRV_USE_TSC_DELTA_THREAD * Use a dedicated kernel thread to service TSC-delta measurement requests. * @todo Test on servers with many CPUs and sockets. */ diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_Support_freebsd_Makefile b/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_Support_freebsd_Makefile index a3b6a032b529..f0d605f2addd 100644 --- a/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_Support_freebsd_Makefile +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_Support_freebsd_Makefile @@ -1,30 +1,30 @@ ---- src/VBox/HostDrivers/Support/freebsd/Makefile.orig 2025-01-21 19:58:52.000000000 +0700 -+++ src/VBox/HostDrivers/Support/freebsd/Makefile 2025-03-22 22:28:21.276497000 +0700 -@@ -93,6 +93,7 @@ +--- src/VBox/HostDrivers/Support/freebsd/Makefile.orig 2025-08-13 19:51:09 UTC ++++ src/VBox/HostDrivers/Support/freebsd/Makefile +@@ -93,6 +93,7 @@ SRCS += \ assert.c \ handletable.c \ handletablectx.c \ + handletablesimple.c \ once.c \ term.c \ thread.c -@@ -117,7 +118,8 @@ +@@ -117,7 +118,8 @@ SRCS += \ strprintf2-ellipsis.c \ strtonum.c \ memchr.c \ - stringalloc.c + stringalloc.c \ + utf-8.c .PATH: ${.CURDIR}/common/rand SRCS += \ -@@ -163,7 +165,8 @@ +@@ -163,7 +165,8 @@ SRCS += \ rtStrFormatKernelAddress-generic.c \ errvars-generic.c \ mppresent-generic.c \ - timer-generic.c + timer-generic.c \ + system-page-size-generic.c .PATH: ${.CURDIR}/r0drv SRCS += \ diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_Support_freebsd_SUPLib-freebsd.cpp b/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_Support_freebsd_SUPLib-freebsd.cpp index 95cbe0e2a32c..11813244f938 100644 --- a/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_Support_freebsd_SUPLib-freebsd.cpp +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_Support_freebsd_SUPLib-freebsd.cpp @@ -1,11 +1,11 @@ ---- src/VBox/HostDrivers/Support/freebsd/SUPLib-freebsd.cpp.orig 2024-10-10 20:31:28.000000000 +0200 -+++ src/VBox/HostDrivers/Support/freebsd/SUPLib-freebsd.cpp 2024-11-17 18:27:46.400938000 +0100 -@@ -88,7 +88,7 @@ +--- src/VBox/HostDrivers/Support/freebsd/SUPLib-freebsd.cpp.orig 2025-08-13 19:51:09 UTC ++++ src/VBox/HostDrivers/Support/freebsd/SUPLib-freebsd.cpp +@@ -88,7 +88,7 @@ DECLHIDDEN(int) suplibOsInit(PSUPLIBDATA pThis, bool f /* * Try open the BSD device. */ - const char * const *pszDeviceNm = fFlags & SUPR3INIT_F_UNRESTRICTED ? DEVICE_NAME_SYS : DEVICE_NAME_USR; + const char * pszDeviceNm = fFlags & SUPR3INIT_F_UNRESTRICTED ? DEVICE_NAME_SYS : DEVICE_NAME_USR; int hDevice = open(pszDeviceNm, O_RDWR, 0); if (hDevice < 0) { diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_Support_freebsd_files__vboxdrv b/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_Support_freebsd_files__vboxdrv index c5abc9bfadd1..013a5e605910 100644 --- a/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_Support_freebsd_files__vboxdrv +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_Support_freebsd_files__vboxdrv @@ -1,34 +1,34 @@ ---- src/VBox/HostDrivers/Support/freebsd//files_vboxdrv.orig 2025-01-21 19:58:53.000000000 +0700 -+++ src/VBox/HostDrivers/Support/freebsd//files_vboxdrv 2025-03-17 00:31:16.880317000 +0700 -@@ -71,6 +71,7 @@ +--- src/VBox/HostDrivers/Support/freebsd/files_vboxdrv.orig 2025-08-13 19:51:09 UTC ++++ src/VBox/HostDrivers/Support/freebsd/files_vboxdrv +@@ -71,6 +71,7 @@ FILES_VBOXDRV_NOBIN=" \ ${PATH_ROOT}/include/iprt/stdarg.h=>include/iprt/stdarg.h \ ${PATH_ROOT}/include/iprt/stdint.h=>include/iprt/stdint.h \ ${PATH_ROOT}/include/iprt/string.h=>include/iprt/string.h \ + ${PATH_ROOT}/include/iprt/system.h=>include/iprt/system.h \ ${PATH_ROOT}/include/iprt/thread.h=>include/iprt/thread.h \ ${PATH_ROOT}/include/iprt/time.h=>include/iprt/time.h \ ${PATH_ROOT}/include/iprt/timer.h=>include/iprt/timer.h \ -@@ -133,6 +134,7 @@ +@@ -133,6 +134,7 @@ FILES_VBOXDRV_NOBIN=" \ ${PATH_ROOT}/src/VBox/Runtime/common/misc/handletable.cpp=>common/misc/handletable.c \ ${PATH_ROOT}/src/VBox/Runtime/common/misc/handletable.h=>common/misc/handletable.h \ ${PATH_ROOT}/src/VBox/Runtime/common/misc/handletablectx.cpp=>common/misc/handletablectx.c \ + ${PATH_ROOT}/src/VBox/Runtime/common/misc/handletablesimple.cpp=>common/misc/handletablesimple.c \ ${PATH_ROOT}/src/VBox/Runtime/common/misc/once.cpp=>common/misc/once.c \ ${PATH_ROOT}/src/VBox/Runtime/common/misc/term.cpp=>common/misc/term.c \ ${PATH_ROOT}/src/VBox/Runtime/common/misc/thread.cpp=>common/misc/thread.c \ -@@ -154,6 +156,7 @@ +@@ -154,6 +156,7 @@ FILES_VBOXDRV_NOBIN=" \ ${PATH_ROOT}/src/VBox/Runtime/common/string/strprintf2-ellipsis.cpp=>common/string/strprintf2-ellipsis.c \ ${PATH_ROOT}/src/VBox/Runtime/common/string/strtonum.cpp=>common/string/strtonum.c \ ${PATH_ROOT}/src/VBox/Runtime/common/string/memchr.cpp=>common/string/memchr.c \ + ${PATH_ROOT}/src/VBox/Runtime/common/string/utf-8.cpp=>common/string/utf-8.c \ ${PATH_ROOT}/src/VBox/Runtime/common/string/stringalloc.cpp=>common/string/stringalloc.c \ ${PATH_ROOT}/src/VBox/Runtime/common/rand/rand.cpp=>common/rand/rand.c \ ${PATH_ROOT}/src/VBox/Runtime/common/rand/randadv.cpp=>common/rand/randadv.c \ -@@ -200,6 +203,7 @@ +@@ -200,6 +203,7 @@ FILES_VBOXDRV_NOBIN=" \ ${PATH_ROOT}/src/VBox/Runtime/generic/RTMpOnPair-generic.cpp=>generic/RTMpOnPair-generic.c \ ${PATH_ROOT}/src/VBox/Runtime/generic/errvars-generic.cpp=>generic/errvars-generic.c \ ${PATH_ROOT}/src/VBox/Runtime/generic/mppresent-generic.cpp=>generic/mppresent-generic.c \ + ${PATH_ROOT}/src/VBox/Runtime/generic/system-page-size-generic.cpp=>generic/system-page-size-generic.c \ ${PATH_ROOT}/src/VBox/Runtime/generic/timer-generic.cpp=>generic/timer-generic.c \ ${PATH_ROOT}/src/VBox/Runtime/generic/uuid-generic.cpp=>generic/uuid-generic.c \ ${PATH_ROOT}/src/VBox/Runtime/r0drv/alloc-r0drv.cpp=>r0drv/alloc-r0drv.c \ diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_VBoxNetAdp_freebsd_Makefile b/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_VBoxNetAdp_freebsd_Makefile index e94dc6f85e27..7275c942126d 100644 --- a/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_VBoxNetAdp_freebsd_Makefile +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_VBoxNetAdp_freebsd_Makefile @@ -1,11 +1,11 @@ ---- src/VBox/HostDrivers/VBoxNetAdp/freebsd/Makefile.orig 2019-05-13 13:33:07 UTC +--- src/VBox/HostDrivers/VBoxNetAdp/freebsd/Makefile.orig 2025-08-13 19:51:10 UTC +++ src/VBox/HostDrivers/VBoxNetAdp/freebsd/Makefile -@@ -26,7 +26,7 @@ +@@ -36,7 +36,7 @@ KMOD = vboxnetadp KMOD = vboxnetadp -CFLAGS += -DRT_OS_FREEBSD -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX -Iinclude -I. -Ir0drv -w -DVBOX_WITH_HARDENING -DVIMAGE +CFLAGS += -DRT_OS_FREEBSD -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX -DVBOX_WITH_HARDENING -DVBOX_WITH_64_BITS_GUESTS -DVIMAGE -Iinclude -I. -Ir0drv -w .if (${MACHINE_ARCH} == "i386") CFLAGS += -DRT_ARCH_X86 diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_VBoxNetFlt_Makefile.kmk b/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_VBoxNetFlt_Makefile.kmk index 9c7ab624c52a..1bf366252bc2 100644 --- a/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_VBoxNetFlt_Makefile.kmk +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_VBoxNetFlt_Makefile.kmk @@ -1,11 +1,11 @@ ---- src/VBox/HostDrivers/VBoxNetFlt/Makefile.kmk.orig 2019-05-13 13:33:07 UTC +--- src/VBox/HostDrivers/VBoxNetFlt/Makefile.kmk.orig 2025-08-13 19:51:11 UTC +++ src/VBox/HostDrivers/VBoxNetFlt/Makefile.kmk -@@ -565,7 +565,7 @@ $(PATH_OUT)/opt_netgraph.h: +@@ -337,7 +337,7 @@ ifeq ($(KBUILD_TARGET),freebsd) $(QUIET)$(RM) -f -- $@ $(QUIET)$(CP) -f $< $@ ifndef VBOX_WITH_HARDENING - $(QUIET)$(SED) -e "s;VBOX_WITH_HARDENING;;g" --output $@.tmp $@ + $(QUIET)$(SED) -e "s;-DVBOX_WITH_HARDENING;;g" --output $@.tmp $@ ${QUIET}$(MV) -f $@.tmp $@ endif ifndef VBOX_WITH_NETFLT_VIMAGE diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_VBoxNetFlt_freebsd_Makefile b/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_VBoxNetFlt_freebsd_Makefile index e819561ab9a8..e1db154e2347 100644 --- a/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_VBoxNetFlt_freebsd_Makefile +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_VBoxNetFlt_freebsd_Makefile @@ -1,11 +1,11 @@ ---- src/VBox/HostDrivers/VBoxNetFlt/freebsd/Makefile.orig 2019-05-13 13:33:07 UTC +--- src/VBox/HostDrivers/VBoxNetFlt/freebsd/Makefile.orig 2025-08-13 19:51:11 UTC +++ src/VBox/HostDrivers/VBoxNetFlt/freebsd/Makefile -@@ -26,7 +26,7 @@ +@@ -36,7 +36,7 @@ KMOD = vboxnetflt KMOD = vboxnetflt -CFLAGS += -DRT_OS_FREEBSD -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX -Iinclude -I. -Ir0drv -w -DVBOX_WITH_HARDENING -DVIMAGE +CFLAGS += -DRT_OS_FREEBSD -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX -DVBOX_WITH_HARDENING -DVBOX_WITH_64_BITS_GUESTS -DVIMAGE -Iinclude -I. -Ir0drv -w .if (${MACHINE_ARCH} == "i386") CFLAGS += -DRT_ARCH_X86 diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_adpctl_VBoxNetAdpCtl.cpp b/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_adpctl_VBoxNetAdpCtl.cpp index 67573dc080a4..2c13b666afaf 100644 --- a/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_adpctl_VBoxNetAdpCtl.cpp +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_HostDrivers_adpctl_VBoxNetAdpCtl.cpp @@ -1,11 +1,11 @@ ---- src/VBox/HostDrivers/adpctl/VBoxNetAdpCtl.cpp.orig 2022-01-13 18:57:40 UTC +--- src/VBox/HostDrivers/adpctl/VBoxNetAdpCtl.cpp.orig 2025-08-13 19:51:12 UTC +++ src/VBox/HostDrivers/adpctl/VBoxNetAdpCtl.cpp -@@ -737,7 +737,7 @@ int Adapter::doIOCtl(unsigned long iCmd, VBOXNETADPREQ +@@ -759,7 +759,7 @@ int Adapter::doIOCtl(unsigned long iCmd, VBOXNETADPREQ * Global config file implementation * *********************************************************************************************************************************/ -#define VBOX_GLOBAL_NETWORK_CONFIG_PATH "/etc/vbox/networks.conf" +#define VBOX_GLOBAL_NETWORK_CONFIG_PATH "%%VBOX_ETC%%/networks.conf" #define VBOXNET_DEFAULT_IPV4MASK "255.255.255.0" class NetworkAddress diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Main_Makefile.kmk b/emulators/virtualbox-ose-72/files/patch-src_VBox_Main_Makefile.kmk index f5693ffb72b4..48ced38ac98c 100644 --- a/emulators/virtualbox-ose-72/files/patch-src_VBox_Main_Makefile.kmk +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Main_Makefile.kmk @@ -1,10 +1,10 @@ ---- src/VBox/Main/Makefile.kmk.orig 2024-10-10 20:31:38.000000000 +0200 -+++ src/VBox/Main/Makefile.kmk 2024-12-27 13:32:31.610875000 +0100 -@@ -761,6 +761,7 @@ +--- src/VBox/Main/Makefile.kmk.orig 2025-08-13 19:51:19 UTC ++++ src/VBox/Main/Makefile.kmk +@@ -771,6 +771,7 @@ if !defined(VBOX_ONLY_SDK) && !defined(VBOX_ONLY_EXTPA VBoxSVC_SOURCES.freebsd = \ src-server/freebsd/HostHardwareFreeBSD.cpp \ + $(if $(VBOX_WITH_DBUS),src-server/linux/HostPowerLinux.cpp) \ src-server/HostDnsServiceResolvConf.cpp VBoxSVC_LDFLAGS.freebsd += -lcam diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Main_include_HostPower.h b/emulators/virtualbox-ose-72/files/patch-src_VBox_Main_include_HostPower.h index 5718fe987ce4..90bd737f000d 100644 --- a/emulators/virtualbox-ose-72/files/patch-src_VBox_Main_include_HostPower.h +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Main_include_HostPower.h @@ -1,20 +1,20 @@ ---- src/VBox/Main/include/HostPower.h.orig 2021-01-07 15:41:38 UTC +--- src/VBox/Main/include/HostPower.h.orig 2025-08-13 19:51:21 UTC +++ src/VBox/Main/include/HostPower.h -@@ -31,7 +31,7 @@ +@@ -41,7 +41,7 @@ #include -#ifdef RT_OS_LINUX +#if defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD) # include #endif -@@ -67,7 +67,7 @@ class HostPowerServiceWin : public HostPowerService (p +@@ -77,7 +77,7 @@ class HostPowerServiceWin : public HostPowerService (p RTTHREAD mThread; }; # endif -# if defined(RT_OS_LINUX) || defined(DOXYGEN_RUNNING) +# if defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD) || defined(DOXYGEN_RUNNING) /** * The Linux hosted Power Service. */ diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Main_src-server_HostImpl.cpp b/emulators/virtualbox-ose-72/files/patch-src_VBox_Main_src-server_HostImpl.cpp index d4c018b2fc23..3327edf47c79 100644 --- a/emulators/virtualbox-ose-72/files/patch-src_VBox_Main_src-server_HostImpl.cpp +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Main_src-server_HostImpl.cpp @@ -1,11 +1,11 @@ ---- src/VBox/Main/src-server/HostImpl.cpp.orig 2021-01-07 15:41:42 UTC +--- src/VBox/Main/src-server/HostImpl.cpp.orig 2025-08-13 19:51:26 UTC +++ src/VBox/Main/src-server/HostImpl.cpp -@@ -286,7 +286,7 @@ HRESULT Host::init(VirtualBox *aParent) +@@ -339,7 +339,7 @@ HRESULT Host::init(VirtualBox *aParent) #if defined(RT_OS_WINDOWS) m->pHostPowerService = new HostPowerServiceWin(m->pParent); -#elif defined(RT_OS_LINUX) && defined(VBOX_WITH_DBUS) +#elif (defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD)) && defined(VBOX_WITH_DBUS) m->pHostPowerService = new HostPowerServiceLinux(m->pParent); #elif defined(RT_OS_DARWIN) m->pHostPowerService = new HostPowerServiceDarwin(m->pParent); diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Main_src-server_freebsd_PerformanceFreeBSD.cpp b/emulators/virtualbox-ose-72/files/patch-src_VBox_Main_src-server_freebsd_PerformanceFreeBSD.cpp index 631547ac9cee..ec8a2226f1c9 100644 --- a/emulators/virtualbox-ose-72/files/patch-src_VBox_Main_src-server_freebsd_PerformanceFreeBSD.cpp +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Main_src-server_freebsd_PerformanceFreeBSD.cpp @@ -1,24 +1,24 @@ ---- src/VBox/Main/src-server/freebsd/PerformanceFreeBSD.cpp.orig 2017-07-27 13:18:27 UTC +--- src/VBox/Main/src-server/freebsd/PerformanceFreeBSD.cpp.orig 2025-08-13 19:51:28 UTC +++ src/VBox/Main/src-server/freebsd/PerformanceFreeBSD.cpp -@@ -80,8 +80,10 @@ int CollectorFreeBSD::getHostMemoryUsage(ULONG *total, +@@ -90,8 +90,10 @@ int CollectorFreeBSD::getHostMemoryUsage(ULONG *total, cbParameter = sizeof(cPagesMemInactive); if (!sysctlbyname("vm.stats.vm.v_inactive_count", &cPagesMemInactive, &cbParameter, NULL, 0)) cProcessed++; +#if __FreeBSD_version < 1200016 cbParameter = sizeof(cPagesMemCached); if (!sysctlbyname("vm.stats.vm.v_cache_count", &cPagesMemCached, &cbParameter, NULL, 0)) +#endif cProcessed++; cbParameter = sizeof(cbPage); if (!sysctlbyname("hw.pagesize", &cbPage, &cbParameter, NULL, 0)) -@@ -90,8 +92,8 @@ int CollectorFreeBSD::getHostMemoryUsage(ULONG *total, +@@ -100,8 +102,8 @@ int CollectorFreeBSD::getHostMemoryUsage(ULONG *total, if (cProcessed == 6) { *total = cbMemPhys / _1K; - *used = cPagesMemUsed * (cbPage / _1K); - *available = (cPagesMemFree + cPagesMemInactive + cPagesMemCached ) * (cbPage / _1K); + *used = (uint64_t)cPagesMemUsed * (cbPage / _1K); + *available = ((uint64_t)cPagesMemFree + cPagesMemInactive + cPagesMemCached) * (cbPage / _1K); } else - rc = VERR_NOT_SUPPORTED; + vrc = VERR_NOT_SUPPORTED; diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_Makefile.kmk b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_Makefile.kmk index 3133e4cbd207..7d80c20cb908 100644 --- a/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_Makefile.kmk +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_Makefile.kmk @@ -1,29 +1,29 @@ ---- src/VBox/Runtime/Makefile.kmk.orig 2025-01-21 19:59:19.000000000 +0700 -+++ src/VBox/Runtime/Makefile.kmk 2025-03-23 20:54:34.250024000 +0700 -@@ -225,6 +225,9 @@ +--- src/VBox/Runtime/Makefile.kmk.orig 2025-08-28 22:09:24 UTC ++++ src/VBox/Runtime/Makefile.kmk +@@ -233,6 +233,9 @@ $(IPRT_OUT_DIR)/oiddb.h.ts +| $(IPRT_OUT_DIR)/oiddb.h: $(QUIET)$(oiddb2c_1_TARGET) "$@" $(filter %.cfg,$^) $(QUIET)$(CP) --changed -fv "$@" "$(IPRT_OUT_DIR)/oiddb.h" +# Set the defines that utf8-posix.cpp needs. It's used by several targets. +# +r3/posix/utf8-posix.cpp_DEFS.freebsd = $(VBOX_ICONV_DEFS) # # Unicode Specification reader used to regenerate unidata-*.cpp. -@@ -1468,6 +1471,7 @@ +@@ -1516,6 +1519,7 @@ RuntimeBaseR3_SOURCES.freebsd = \ generic/RTProcDaemonize-generic.cpp \ generic/RTProcIsRunningByName-generic.cpp \ generic/RTThreadGetNativeState-generic.cpp \ + generic/system-page-size-generic.cpp \ r3/freebsd/fileaio-freebsd.cpp \ r3/freebsd/RTFileQuerySectorSize-freebsd.cpp \ r3/freebsd/mp-freebsd.cpp \ -@@ -3011,6 +3015,8 @@ +@@ -3072,6 +3076,8 @@ VBoxRT_LDFLAGS.win = /MANIFEST \ /delayload:ole32.dll \ /delayload:oleaut32.dll \ /delayload:advapi32.dll +VBoxRT_LDFLAGS.freebsd = \ + -Wl,--allow-multiple-definition if1of (VBoxRT, $(DLLS)) $(call VBOX_SET_VER_INFO_DLL,VBoxRT,VirtualBox Runtime) diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_alloc-r0drv-freebsd.c b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_alloc-r0drv-freebsd.c index 0ae2d847c0f6..564b70a0f108 100644 --- a/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_alloc-r0drv-freebsd.c +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_alloc-r0drv-freebsd.c @@ -1,58 +1,58 @@ ---- src/VBox/Runtime/r0drv/freebsd/alloc-r0drv-freebsd.c.orig 2024-10-10 20:32:14.000000000 +0200 -+++ src/VBox/Runtime/r0drv/freebsd/alloc-r0drv-freebsd.c 2024-12-27 13:39:49.059878000 +0100 -@@ -88,6 +88,7 @@ +--- src/VBox/Runtime/r0drv/freebsd/alloc-r0drv-freebsd.c.orig 2025-08-13 19:51:51 UTC ++++ src/VBox/Runtime/r0drv/freebsd/alloc-r0drv-freebsd.c +@@ -88,6 +88,7 @@ DECLHIDDEN(int) rtR0MemAllocEx(size_t cb, uint32_t fFl DECLHIDDEN(int) rtR0MemAllocEx(size_t cb, uint32_t fFlags, PRTMEMHDR *ppHdr) { + IPRT_FREEBSD_SAVE_EFL_AC(); size_t cbAllocated = cb; PRTMEMHDR pHdr = (PRTMEMHDR)malloc(cb + sizeof(RTMEMHDR), M_IPRTHEAP, fFlags & RTMEMHDR_FLAG_ZEROED ? M_NOWAIT | M_ZERO : M_NOWAIT); -@@ -99,21 +100,28 @@ +@@ -99,21 +100,28 @@ DECLHIDDEN(int) rtR0MemAllocEx(size_t cb, uint32_t fFl pHdr->cbReq = cb; *ppHdr = pHdr; + IPRT_FREEBSD_RESTORE_EFL_AC(); return VINF_SUCCESS; - } + } + + IPRT_FREEBSD_RESTORE_EFL_AC(); return VERR_NO_MEMORY; } DECLHIDDEN(void) rtR0MemFree(PRTMEMHDR pHdr) { + IPRT_FREEBSD_SAVE_EFL_AC(); + pHdr->u32Magic += 1; free(pHdr, M_IPRTHEAP); + IPRT_FREEBSD_RESTORE_EFL_AC(); } RTR0DECL(void *) RTMemContAlloc(PRTCCPHYS pPhys, size_t cb) { + IPRT_FREEBSD_SAVE_EFL_AC(); void *pv; /* -@@ -138,6 +146,7 @@ +@@ -138,6 +146,7 @@ RTR0DECL(void *) RTMemContAlloc(PRTCCPHYS pPhys, size_ *pPhys = vtophys(pv); Assert(!(*pPhys & PAGE_OFFSET_MASK)); } + IPRT_FREEBSD_RESTORE_EFL_AC(); return pv; } -@@ -147,7 +156,9 @@ +@@ -147,7 +156,9 @@ RTR0DECL(void) RTMemContFree(void *pv, size_t cb) if (pv) { AssertMsg(!((uintptr_t)pv & PAGE_OFFSET_MASK), ("pv=%p\n", pv)); + IPRT_FREEBSD_SAVE_EFL_AC(); contigfree(pv, cb, M_IPRTCONT); + IPRT_FREEBSD_RESTORE_EFL_AC(); } } diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_assert-r0drv-freebsd.c b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_assert-r0drv-freebsd.c index 4c628cbe47a5..53f7659961b2 100644 --- a/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_assert-r0drv-freebsd.c +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_assert-r0drv-freebsd.c @@ -1,29 +1,29 @@ ---- src/VBox/Runtime/r0drv/freebsd/assert-r0drv-freebsd.c.orig 2021-01-07 15:42:08 UTC +--- src/VBox/Runtime/r0drv/freebsd/assert-r0drv-freebsd.c.orig 2025-08-13 19:51:51 UTC +++ src/VBox/Runtime/r0drv/freebsd/assert-r0drv-freebsd.c -@@ -68,15 +68,18 @@ +@@ -78,15 +78,18 @@ DECLHIDDEN(void) rtR0AssertNativeMsg1(const char *pszE DECLHIDDEN(void) rtR0AssertNativeMsg1(const char *pszExpr, unsigned uLine, const char *pszFile, const char *pszFunction) { + IPRT_FREEBSD_SAVE_EFL_AC(); printf("\r\n!!Assertion Failed!!\r\n" "Expression: %s\r\n" "Location : %s(%d) %s\r\n", pszExpr, pszFile, uLine, pszFunction); + IPRT_FREEBSD_RESTORE_EFL_AC(); } DECLHIDDEN(void) rtR0AssertNativeMsg2V(bool fInitial, const char *pszFormat, va_list va) { + IPRT_FREEBSD_SAVE_EFL_AC(); char szMsg[256]; RTStrPrintfV(szMsg, sizeof(szMsg) - 1, pszFormat, va); -@@ -84,6 +87,7 @@ DECLHIDDEN(void) rtR0AssertNativeMsg2V(bool fInitial, +@@ -94,6 +97,7 @@ DECLHIDDEN(void) rtR0AssertNativeMsg2V(bool fInitial, printf("%s", szMsg); NOREF(fInitial); + IPRT_FREEBSD_RESTORE_EFL_AC(); } diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_memuserkernel-r0drv-freebsd.c b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_memuserkernel-r0drv-freebsd.c index 53bac187bde0..637f67bbe59a 100644 --- a/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_memuserkernel-r0drv-freebsd.c +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_memuserkernel-r0drv-freebsd.c @@ -1,22 +1,22 @@ ---- src/VBox/Runtime/r0drv/freebsd/memuserkernel-r0drv-freebsd.c.orig 2018-10-15 14:31:31 UTC +--- src/VBox/Runtime/r0drv/freebsd/memuserkernel-r0drv-freebsd.c.orig 2025-08-13 19:51:51 UTC +++ src/VBox/Runtime/r0drv/freebsd/memuserkernel-r0drv-freebsd.c -@@ -36,7 +36,9 @@ +@@ -46,7 +46,9 @@ RTR0DECL(int) RTR0MemUserCopyFrom(void *pvDst, RTR3PTR RTR0DECL(int) RTR0MemUserCopyFrom(void *pvDst, RTR3PTR R3PtrSrc, size_t cb) { + IPRT_FREEBSD_SAVE_EFL_AC(); int rc = copyin((const void *)R3PtrSrc, pvDst, cb); + IPRT_FREEBSD_RESTORE_EFL_AC(); if (RT_LIKELY(rc == 0)) return VINF_SUCCESS; return VERR_ACCESS_DENIED; -@@ -45,7 +47,9 @@ RTR0DECL(int) RTR0MemUserCopyFrom(void *pvDst, RTR3PTR +@@ -55,7 +57,9 @@ RTR0DECL(int) RTR0MemUserCopyTo(RTR3PTR R3PtrDst, void RTR0DECL(int) RTR0MemUserCopyTo(RTR3PTR R3PtrDst, void const *pvSrc, size_t cb) { + IPRT_FREEBSD_SAVE_EFL_AC(); int rc = copyout(pvSrc, (void *)R3PtrDst, cb); + IPRT_FREEBSD_RESTORE_EFL_AC(); if (RT_LIKELY(rc == 0)) return VINF_SUCCESS; return VERR_ACCESS_DENIED; diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_mp-r0drv-freebsd.c b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_mp-r0drv-freebsd.c index 8c68cae63a34..5548551e9ab5 100644 --- a/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_mp-r0drv-freebsd.c +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_mp-r0drv-freebsd.c @@ -1,92 +1,92 @@ ---- src/VBox/Runtime/r0drv/freebsd/mp-r0drv-freebsd.c.orig 2019-04-16 10:17:21 UTC +--- src/VBox/Runtime/r0drv/freebsd/mp-r0drv-freebsd.c.orig 2025-08-13 19:51:51 UTC +++ src/VBox/Runtime/r0drv/freebsd/mp-r0drv-freebsd.c -@@ -147,7 +147,9 @@ RTDECL(RTCPUID) RTMpGetOnlineCount(void) +@@ -157,7 +157,9 @@ static void rtmpOnAllFreeBSDWrapper(void *pvArg) static void rtmpOnAllFreeBSDWrapper(void *pvArg) { PRTMPARGS pArgs = (PRTMPARGS)pvArg; + IPRT_FREEBSD_SAVE_EFL_AC(); pArgs->pfnWorker(curcpu, pArgs->pvUser1, pArgs->pvUser2); + IPRT_FREEBSD_RESTORE_EFL_AC(); } -@@ -159,7 +161,9 @@ RTDECL(int) RTMpOnAll(PFNRTMPWORKER pfnWorker, void *p +@@ -169,7 +171,9 @@ RTDECL(int) RTMpOnAll(PFNRTMPWORKER pfnWorker, void *p Args.pvUser2 = pvUser2; Args.idCpu = NIL_RTCPUID; Args.cHits = 0; + IPRT_FREEBSD_SAVE_EFL_AC(); smp_rendezvous(NULL, rtmpOnAllFreeBSDWrapper, smp_no_rendezvous_barrier, &Args); + IPRT_FREEBSD_RESTORE_EFL_AC(); return VINF_SUCCESS; } -@@ -175,7 +179,11 @@ static void rtmpOnOthersFreeBSDWrapper(void *pvArg) +@@ -185,7 +189,11 @@ static void rtmpOnOthersFreeBSDWrapper(void *pvArg) PRTMPARGS pArgs = (PRTMPARGS)pvArg; RTCPUID idCpu = curcpu; if (pArgs->idCpu != idCpu) + { + IPRT_FREEBSD_SAVE_EFL_AC(); pArgs->pfnWorker(idCpu, pArgs->pvUser1, pArgs->pvUser2); + IPRT_FREEBSD_RESTORE_EFL_AC(); + } } -@@ -196,6 +204,7 @@ RTDECL(int) RTMpOnOthers(PFNRTMPWORKER pfnWorker, void +@@ -206,6 +214,7 @@ RTDECL(int) RTMpOnOthers(PFNRTMPWORKER pfnWorker, void Args.pvUser2 = pvUser2; Args.idCpu = RTMpCpuId(); Args.cHits = 0; + IPRT_FREEBSD_SAVE_EFL_AC(); #if __FreeBSD_version >= 700000 # if __FreeBSD_version >= 900000 Mask = all_cpus; -@@ -207,6 +216,7 @@ RTDECL(int) RTMpOnOthers(PFNRTMPWORKER pfnWorker, void +@@ -217,6 +226,7 @@ RTDECL(int) RTMpOnOthers(PFNRTMPWORKER pfnWorker, void #else smp_rendezvous(NULL, rtmpOnOthersFreeBSDWrapper, NULL, &Args); #endif + IPRT_FREEBSD_RESTORE_EFL_AC(); } return VINF_SUCCESS; } -@@ -224,8 +234,10 @@ static void rtmpOnSpecificFreeBSDWrapper(void *pvArg) +@@ -234,8 +244,10 @@ static void rtmpOnSpecificFreeBSDWrapper(void *pvArg) RTCPUID idCpu = curcpu; if (pArgs->idCpu == idCpu) { + IPRT_FREEBSD_SAVE_EFL_AC(); pArgs->pfnWorker(idCpu, pArgs->pvUser1, pArgs->pvUser2); ASMAtomicIncU32(&pArgs->cHits); + IPRT_FREEBSD_RESTORE_EFL_AC(); } } -@@ -248,6 +260,7 @@ RTDECL(int) RTMpOnSpecific(RTCPUID idCpu, PFNRTMPWORKE +@@ -258,6 +270,7 @@ RTDECL(int) RTMpOnSpecific(RTCPUID idCpu, PFNRTMPWORKE Args.pvUser2 = pvUser2; Args.idCpu = idCpu; Args.cHits = 0; + IPRT_FREEBSD_SAVE_EFL_AC(); #if __FreeBSD_version >= 700000 # if __FreeBSD_version >= 900000 CPU_SETOF(idCpu, &Mask); -@@ -258,6 +271,7 @@ RTDECL(int) RTMpOnSpecific(RTCPUID idCpu, PFNRTMPWORKE +@@ -268,6 +281,7 @@ RTDECL(int) RTMpOnSpecific(RTCPUID idCpu, PFNRTMPWORKE #else smp_rendezvous(NULL, rtmpOnSpecificFreeBSDWrapper, NULL, &Args); #endif + IPRT_FREEBSD_RESTORE_EFL_AC(); return Args.cHits == 1 ? VINF_SUCCESS : VERR_CPU_NOT_FOUND; -@@ -287,12 +301,14 @@ RTDECL(int) RTMpPokeCpu(RTCPUID idCpu) +@@ -297,12 +311,14 @@ RTDECL(int) RTMpPokeCpu(RTCPUID idCpu) if (!RTMpIsCpuOnline(idCpu)) return VERR_CPU_NOT_FOUND; + IPRT_FREEBSD_SAVE_EFL_AC(); # if __FreeBSD_version >= 900000 CPU_SETOF(idCpu, &Mask); # else Mask = (cpumask_t)1 << idCpu; # endif smp_rendezvous_cpus(Mask, NULL, rtmpFreeBSDPokeCallback, smp_no_rendezvous_barrier, NULL); + IPRT_FREEBSD_RESTORE_EFL_AC(); return VINF_SUCCESS; } diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_semevent-r0drv-freebsd.c b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_semevent-r0drv-freebsd.c index c84313e2f5e2..cb5deba5ce97 100644 --- a/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_semevent-r0drv-freebsd.c +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_semevent-r0drv-freebsd.c @@ -1,53 +1,53 @@ ---- src/VBox/Runtime/r0drv/freebsd/semevent-r0drv-freebsd.c.orig 2021-01-07 15:42:08 UTC +--- src/VBox/Runtime/r0drv/freebsd/semevent-r0drv-freebsd.c.orig 2025-08-13 19:51:51 UTC +++ src/VBox/Runtime/r0drv/freebsd/semevent-r0drv-freebsd.c -@@ -101,7 +101,9 @@ RTDECL(int) RTSemEventCreateEx(PRTSEMEVENT phEventSem +@@ -111,7 +111,9 @@ RTDECL(int) RTSemEventCreateEx(PRTSEMEVENT phEventSem Assert(!(fFlags & RTSEMEVENT_FLAGS_BOOTSTRAP_HACK) || (fFlags & RTSEMEVENT_FLAGS_NO_LOCK_VAL)); AssertPtrReturn(phEventSem, VERR_INVALID_POINTER); + IPRT_FREEBSD_SAVE_EFL_AC(); PRTSEMEVENTINTERNAL pThis = (PRTSEMEVENTINTERNAL)RTMemAllocZ(sizeof(*pThis)); + IPRT_FREEBSD_RESTORE_EFL_AC(); if (!pThis) return VERR_NO_MEMORY; -@@ -152,10 +154,12 @@ RTDECL(int) RTSemEventDestroy(RTSEMEVENT hEventSem) +@@ -162,10 +164,12 @@ RTDECL(int) RTSemEventDestroy(RTSEMEVENT hEventSem) /* * Invalidate it and signal the object just in case. */ + IPRT_FREEBSD_SAVE_EFL_AC(); ASMAtomicWriteU32(&pThis->u32Magic, ~RTSEMEVENT_MAGIC); ASMAtomicWriteU32(&pThis->fState, 0); rtR0SemBsdBroadcast(pThis); rtR0SemEventBsdRelease(pThis); + IPRT_FREEBSD_RESTORE_EFL_AC(); return VINF_SUCCESS; } -@@ -173,9 +177,11 @@ RTDECL(int) RTSemEventSignal(RTSEMEVENT hEventSem) +@@ -183,9 +187,11 @@ RTDECL(int) RTSemEventSignal(RTSEMEVENT hEventSem) /* * Signal the event object. */ + IPRT_FREEBSD_SAVE_EFL_AC(); ASMAtomicWriteU32(&pThis->fState, 1); rtR0SemBsdSignal(pThis); rtR0SemEventBsdRelease(pThis); + IPRT_FREEBSD_RESTORE_EFL_AC(); return VINF_SUCCESS; } -@@ -199,6 +205,7 @@ static int rtR0SemEventWait(PRTSEMEVENTINTERNAL pThis, +@@ -209,6 +215,7 @@ static int rtR0SemEventWait(PRTSEMEVENTINTERNAL pThis, AssertPtrReturn(pThis, VERR_INVALID_PARAMETER); AssertMsgReturn(pThis->u32Magic == RTSEMEVENT_MAGIC, ("%p u32Magic=%RX32\n", pThis, pThis->u32Magic), VERR_INVALID_PARAMETER); AssertReturn(RTSEMWAIT_FLAGS_ARE_VALID(fFlags), VERR_INVALID_PARAMETER); + IPRT_FREEBSD_SAVE_EFL_AC(); rtR0SemEventBsdRetain(pThis); /* -@@ -248,6 +255,7 @@ static int rtR0SemEventWait(PRTSEMEVENTINTERNAL pThis, +@@ -258,6 +265,7 @@ static int rtR0SemEventWait(PRTSEMEVENTINTERNAL pThis, } rtR0SemEventBsdRelease(pThis); + IPRT_FREEBSD_RESTORE_EFL_AC(); return rc; } diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_semeventmulti-r0drv-freebsd.c b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_semeventmulti-r0drv-freebsd.c index d3571a937b1f..dab1b22fcd36 100644 --- a/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_semeventmulti-r0drv-freebsd.c +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_semeventmulti-r0drv-freebsd.c @@ -1,73 +1,73 @@ ---- src/VBox/Runtime/r0drv/freebsd/semeventmulti-r0drv-freebsd.c.orig 2021-01-07 15:42:08 UTC +--- src/VBox/Runtime/r0drv/freebsd/semeventmulti-r0drv-freebsd.c.orig 2025-08-13 19:51:51 UTC +++ src/VBox/Runtime/r0drv/freebsd/semeventmulti-r0drv-freebsd.c -@@ -120,7 +120,9 @@ RTDECL(int) RTSemEventMultiCreateEx(PRTSEMEVENTMULTI +@@ -130,7 +130,9 @@ RTDECL(int) RTSemEventMultiCreateEx(PRTSEMEVENTMULTI PRTSEMEVENTMULTIINTERNAL pThis; AssertReturn(!(fFlags & ~RTSEMEVENTMULTI_FLAGS_NO_LOCK_VAL), VERR_INVALID_PARAMETER); + IPRT_FREEBSD_SAVE_EFL_AC(); pThis = (PRTSEMEVENTMULTIINTERNAL)RTMemAlloc(sizeof(*pThis)); + IPRT_FREEBSD_RESTORE_EFL_AC(); if (pThis) { pThis->u32Magic = RTSEMEVENTMULTI_MAGIC; -@@ -176,10 +178,12 @@ RTDECL(int) RTSemEventMultiDestroy(RTSEMEVENTMULTI hE +@@ -186,10 +188,12 @@ RTDECL(int) RTSemEventMultiDestroy(RTSEMEVENTMULTI hE /* * Invalidate it and signal the object just in case. */ + IPRT_FREEBSD_SAVE_EFL_AC(); ASMAtomicWriteU32(&pThis->u32Magic, ~RTSEMEVENTMULTI_MAGIC); ASMAtomicAndU32(&pThis->fStateAndGen, RTSEMEVENTMULTIBSD_GEN_MASK); rtR0SemBsdBroadcast(pThis); rtR0SemEventMultiBsdRelease(pThis); + IPRT_FREEBSD_RESTORE_EFL_AC(); return VINF_SUCCESS; } -@@ -188,6 +192,7 @@ RTDECL(int) RTSemEventMultiSignal(RTSEMEVENTMULTI hEv +@@ -198,6 +202,7 @@ RTDECL(int) RTSemEventMultiSignal(RTSEMEVENTMULTI hEv { uint32_t fNew; uint32_t fOld; + IPRT_FREEBSD_SAVE_EFL_AC(); /* * Validate input. -@@ -214,12 +219,15 @@ RTDECL(int) RTSemEventMultiSignal(RTSEMEVENTMULTI hEv +@@ -224,12 +229,15 @@ RTDECL(int) RTSemEventMultiSignal(RTSEMEVENTMULTI hEv rtR0SemBsdBroadcast(pThis); rtR0SemEventMultiBsdRelease(pThis); + IPRT_FREEBSD_RESTORE_EFL_AC(); return VINF_SUCCESS; } RTDECL(int) RTSemEventMultiReset(RTSEMEVENTMULTI hEventMultiSem) { + IPRT_FREEBSD_SAVE_EFL_AC(); + /* * Validate input. */ -@@ -236,6 +244,7 @@ RTDECL(int) RTSemEventMultiReset(RTSEMEVENTMULTI hEve +@@ -246,6 +254,7 @@ RTDECL(int) RTSemEventMultiReset(RTSEMEVENTMULTI hEve ASMAtomicAndU32(&pThis->fStateAndGen, ~RTSEMEVENTMULTIBSD_STATE_MASK); rtR0SemEventMultiBsdRelease(pThis); + IPRT_FREEBSD_RESTORE_EFL_AC(); return VINF_SUCCESS; } -@@ -252,6 +261,7 @@ RTDECL(int) RTSemEventMultiReset(RTSEMEVENTMULTI hEve +@@ -262,6 +271,7 @@ static int rtR0SemEventMultiBsdWait(PRTSEMEVENTMULTIIN static int rtR0SemEventMultiBsdWait(PRTSEMEVENTMULTIINTERNAL pThis, uint32_t fFlags, uint64_t uTimeout, PCRTLOCKVALSRCPOS pSrcPos) { + IPRT_FREEBSD_SAVE_EFL_AC(); uint32_t fOrgStateAndGen; int rc; -@@ -311,6 +321,7 @@ static int rtR0SemEventMultiBsdWait(PRTSEMEVENTMULTIIN +@@ -321,6 +331,7 @@ static int rtR0SemEventMultiBsdWait(PRTSEMEVENTMULTIIN } rtR0SemEventMultiBsdRelease(pThis); + IPRT_FREEBSD_RESTORE_EFL_AC(); return rc; } diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_semfastmutex-r0drv-freebsd.c b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_semfastmutex-r0drv-freebsd.c index aeab0a76e37c..21c03b87326e 100644 --- a/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_semfastmutex-r0drv-freebsd.c +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_semfastmutex-r0drv-freebsd.c @@ -1,59 +1,59 @@ ---- src/VBox/Runtime/r0drv/freebsd/semfastmutex-r0drv-freebsd.c.orig 2021-01-07 15:42:08 UTC +--- src/VBox/Runtime/r0drv/freebsd/semfastmutex-r0drv-freebsd.c.orig 2025-08-13 19:51:51 UTC +++ src/VBox/Runtime/r0drv/freebsd/semfastmutex-r0drv-freebsd.c -@@ -86,6 +86,7 @@ RTDECL(int) RTSemFastMutexCreate(PRTSEMFASTMUTEX phFa +@@ -96,6 +96,7 @@ RTDECL(int) RTSemFastMutexCreate(PRTSEMFASTMUTEX phFa { AssertCompile(sizeof(RTSEMFASTMUTEXINTERNAL) > sizeof(void *)); AssertPtrReturn(phFastMtx, VERR_INVALID_POINTER); + IPRT_FREEBSD_SAVE_EFL_AC(); PRTSEMFASTMUTEXINTERNAL pThis = (PRTSEMFASTMUTEXINTERNAL)RTMemAllocZ(sizeof(*pThis)); if (pThis) -@@ -94,8 +95,10 @@ RTDECL(int) RTSemFastMutexCreate(PRTSEMFASTMUTEX phFa +@@ -104,8 +105,10 @@ RTDECL(int) RTSemFastMutexCreate(PRTSEMFASTMUTEX phFa sx_init_flags(&pThis->SxLock, "IPRT Fast Mutex Semaphore", SX_DUPOK); *phFastMtx = pThis; + IPRT_FREEBSD_RESTORE_EFL_AC(); return VINF_SUCCESS; } + IPRT_FREEBSD_RESTORE_EFL_AC(); return VERR_NO_MEMORY; } -@@ -107,11 +110,13 @@ RTDECL(int) RTSemFastMutexDestroy(RTSEMFASTMUTEX hFas +@@ -117,11 +120,13 @@ RTDECL(int) RTSemFastMutexDestroy(RTSEMFASTMUTEX hFas return VINF_SUCCESS; AssertPtrReturn(pThis, VERR_INVALID_HANDLE); AssertMsgReturn(pThis->u32Magic == RTSEMFASTMUTEX_MAGIC, ("%p: u32Magic=%RX32\n", pThis, pThis->u32Magic), VERR_INVALID_HANDLE); + IPRT_FREEBSD_SAVE_EFL_AC(); ASMAtomicWriteU32(&pThis->u32Magic, RTSEMFASTMUTEX_MAGIC_DEAD); sx_destroy(&pThis->SxLock); RTMemFree(pThis); + IPRT_FREEBSD_RESTORE_EFL_AC(); return VINF_SUCCESS; } -@@ -121,8 +126,11 @@ RTDECL(int) RTSemFastMutexRequest(RTSEMFASTMUTEX hFas +@@ -131,8 +136,11 @@ RTDECL(int) RTSemFastMutexRequest(RTSEMFASTMUTEX hFas PRTSEMFASTMUTEXINTERNAL pThis = hFastMtx; AssertPtrReturn(pThis, VERR_INVALID_HANDLE); AssertMsgReturn(pThis->u32Magic == RTSEMFASTMUTEX_MAGIC, ("%p: u32Magic=%RX32\n", pThis, pThis->u32Magic), VERR_INVALID_HANDLE); + IPRT_FREEBSD_SAVE_EFL_AC(); sx_xlock(&pThis->SxLock); + + IPRT_FREEBSD_RESTORE_EFL_AC(); return VINF_SUCCESS; } -@@ -132,8 +140,11 @@ RTDECL(int) RTSemFastMutexRelease(RTSEMFASTMUTEX hFas +@@ -142,8 +150,11 @@ RTDECL(int) RTSemFastMutexRelease(RTSEMFASTMUTEX hFas PRTSEMFASTMUTEXINTERNAL pThis = hFastMtx; AssertPtrReturn(pThis, VERR_INVALID_HANDLE); AssertMsgReturn(pThis->u32Magic == RTSEMFASTMUTEX_MAGIC, ("%p: u32Magic=%RX32\n", pThis, pThis->u32Magic), VERR_INVALID_HANDLE); + IPRT_FREEBSD_SAVE_EFL_AC(); sx_xunlock(&pThis->SxLock); + + IPRT_FREEBSD_RESTORE_EFL_AC(); return VINF_SUCCESS; } diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_semmutex-r0drv-freebsd.c b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_semmutex-r0drv-freebsd.c index 6345ae10c562..048d345398eb 100644 --- a/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_semmutex-r0drv-freebsd.c +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_semmutex-r0drv-freebsd.c @@ -1,80 +1,80 @@ ---- src/VBox/Runtime/r0drv/freebsd/semmutex-r0drv-freebsd.c.orig 2018-10-15 14:31:31 UTC +--- src/VBox/Runtime/r0drv/freebsd/semmutex-r0drv-freebsd.c.orig 2025-08-13 19:51:51 UTC +++ src/VBox/Runtime/r0drv/freebsd/semmutex-r0drv-freebsd.c -@@ -62,6 +62,7 @@ RTDECL(int) RTSemMutexCreate(PRTSEMMUTEX phMutexSem) +@@ -72,6 +72,7 @@ RTDECL(int) RTSemMutexCreate(PRTSEMMUTEX phMutexSem) { AssertCompile(sizeof(RTSEMMUTEXINTERNAL) > sizeof(void *)); AssertPtrReturn(phMutexSem, VERR_INVALID_POINTER); + IPRT_FREEBSD_SAVE_EFL_AC(); PRTSEMMUTEXINTERNAL pThis = (PRTSEMMUTEXINTERNAL)RTMemAllocZ(sizeof(*pThis)); if (pThis) -@@ -70,8 +71,10 @@ RTDECL(int) RTSemMutexCreate(PRTSEMMUTEX phMutexSem) +@@ -80,8 +81,10 @@ RTDECL(int) RTSemMutexCreate(PRTSEMMUTEX phMutexSem) sx_init_flags(&pThis->SxLock, "IPRT Mutex Semaphore", SX_RECURSE); *phMutexSem = pThis; + IPRT_FREEBSD_RESTORE_EFL_AC(); return VINF_SUCCESS; } + IPRT_FREEBSD_RESTORE_EFL_AC(); return VERR_NO_MEMORY; } -@@ -83,12 +86,14 @@ RTDECL(int) RTSemMutexDestroy(RTSEMMUTEX hMutexSem) +@@ -93,12 +96,14 @@ RTDECL(int) RTSemMutexDestroy(RTSEMMUTEX hMutexSem) return VINF_SUCCESS; AssertPtrReturn(pThis, VERR_INVALID_HANDLE); AssertMsgReturn(pThis->u32Magic == RTSEMMUTEX_MAGIC, ("%p: u32Magic=%RX32\n", pThis, pThis->u32Magic), VERR_INVALID_HANDLE); + IPRT_FREEBSD_SAVE_EFL_AC(); AssertReturn(ASMAtomicCmpXchgU32(&pThis->u32Magic, RTSEMMUTEX_MAGIC_DEAD, RTSEMMUTEX_MAGIC), VERR_INVALID_HANDLE); sx_destroy(&pThis->SxLock); RTMemFree(pThis); + IPRT_FREEBSD_RESTORE_EFL_AC(); return VINF_SUCCESS; } -@@ -99,6 +104,7 @@ RTDECL(int) RTSemMutexRequest(RTSEMMUTEX hMutexSem, R +@@ -109,6 +114,7 @@ RTDECL(int) RTSemMutexRequest(RTSEMMUTEX hMutexSem, R int rc; AssertPtrReturn(pThis, VERR_INVALID_HANDLE); AssertMsgReturn(pThis->u32Magic == RTSEMMUTEX_MAGIC, ("%p: u32Magic=%RX32\n", pThis, pThis->u32Magic), VERR_INVALID_HANDLE); + IPRT_FREEBSD_SAVE_EFL_AC(); if (cMillies == RT_INDEFINITE_WAIT) { -@@ -133,6 +139,7 @@ RTDECL(int) RTSemMutexRequest(RTSEMMUTEX hMutexSem, R +@@ -143,6 +149,7 @@ RTDECL(int) RTSemMutexRequest(RTSEMMUTEX hMutexSem, R } while (RTTimeSystemMilliTS() - StartTS < cMillies); } + IPRT_FREEBSD_RESTORE_EFL_ONLY_AC(); return VINF_SUCCESS; } -@@ -149,6 +156,7 @@ RTDECL(int) RTSemMutexRequestNoResume(RTSEMMUTEX hMut +@@ -159,6 +166,7 @@ RTDECL(int) RTSemMutexRequestNoResume(RTSEMMUTEX hMut int rc; AssertPtrReturn(pThis, VERR_INVALID_HANDLE); AssertMsgReturn(pThis->u32Magic == RTSEMMUTEX_MAGIC, ("%p: u32Magic=%RX32\n", pThis, pThis->u32Magic), VERR_INVALID_HANDLE); + IPRT_FREEBSD_SAVE_EFL_AC(); if (cMillies == RT_INDEFINITE_WAIT) { -@@ -186,6 +194,7 @@ RTDECL(int) RTSemMutexRequestNoResume(RTSEMMUTEX hMut +@@ -196,6 +204,7 @@ RTDECL(int) RTSemMutexRequestNoResume(RTSEMMUTEX hMut } while (RTTimeSystemMilliTS() - StartTS < cMillies); } + IPRT_FREEBSD_RESTORE_EFL_ONLY_AC(); return VINF_SUCCESS; } -@@ -201,8 +210,11 @@ RTDECL(int) RTSemMutexRelease(RTSEMMUTEX hMutexSem) +@@ -211,8 +220,11 @@ RTDECL(int) RTSemMutexRelease(RTSEMMUTEX hMutexSem) PRTSEMMUTEXINTERNAL pThis = hMutexSem; AssertPtrReturn(pThis, VERR_INVALID_HANDLE); AssertMsgReturn(pThis->u32Magic == RTSEMMUTEX_MAGIC, ("%p: u32Magic=%RX32\n", pThis, pThis->u32Magic), VERR_INVALID_HANDLE); + IPRT_FREEBSD_SAVE_EFL_AC(); sx_xunlock(&pThis->SxLock); + + IPRT_FREEBSD_RESTORE_EFL_ONLY_AC(); return VINF_SUCCESS; } diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_spinlock-r0drv-freebsd.c b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_spinlock-r0drv-freebsd.c index 4a86a2e38eb2..442c6e1c243d 100644 --- a/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_spinlock-r0drv-freebsd.c +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_spinlock-r0drv-freebsd.c @@ -1,30 +1,30 @@ ---- src/VBox/Runtime/r0drv/freebsd/spinlock-r0drv-freebsd.c.orig 2021-01-07 15:42:09 UTC +--- src/VBox/Runtime/r0drv/freebsd/spinlock-r0drv-freebsd.c.orig 2025-08-13 19:51:51 UTC +++ src/VBox/Runtime/r0drv/freebsd/spinlock-r0drv-freebsd.c -@@ -106,7 +106,9 @@ RTDECL(int) RTSpinlockCreate(PRTSPINLOCK pSpinlock, u +@@ -116,7 +116,9 @@ RTDECL(int) RTSpinlockCreate(PRTSPINLOCK pSpinlock, u * Allocate. */ AssertCompile(sizeof(RTSPINLOCKINTERNAL) > sizeof(void *)); + IPRT_FREEBSD_SAVE_EFL_AC(); PRTSPINLOCKINTERNAL pThis = (PRTSPINLOCKINTERNAL)RTMemAllocZ(sizeof(*pThis)); + IPRT_FREEBSD_RESTORE_EFL_AC(); if (!pThis) return VERR_NO_MEMORY; -@@ -140,7 +142,9 @@ RTDECL(int) RTSpinlockDestroy(RTSPINLOCK Spinlock) +@@ -150,7 +152,9 @@ RTDECL(int) RTSpinlockDestroy(RTSPINLOCK Spinlock) * Make the lock invalid and release the memory. */ ASMAtomicIncU32(&pThis->u32Magic); + IPRT_FREEBSD_SAVE_EFL_AC(); RTMemFree(pThis); + IPRT_FREEBSD_RESTORE_EFL_AC(); return VINF_SUCCESS; } -@@ -166,6 +170,7 @@ RTDECL(void) RTSpinlockAcquire(RTSPINLOCK Spinlock) +@@ -176,6 +180,7 @@ RTDECL(void) RTSpinlockAcquire(RTSPINLOCK Spinlock) { RT_ASSERT_PREEMPT_CPUID_SPIN_ACQUIRED(pThis); pThis->fIntSaved = fIntSaved; + IPRT_FREEBSD_RESTORE_EFL_ONLY_AC_EX(fIntSaved); return; } if (--c <= 0) diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_thread-r0drv-freebsd.c b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_thread-r0drv-freebsd.c index c1ba2d811cde..73a0eab649ad 100644 --- a/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_thread-r0drv-freebsd.c +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_thread-r0drv-freebsd.c @@ -1,91 +1,91 @@ ---- 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.orig 2025-08-13 19:51:51 UTC +++ src/VBox/Runtime/r0drv/freebsd/thread-r0drv-freebsd.c -@@ -49,7 +49,6 @@ RTDECL(RTNATIVETHREAD) RTThreadNativeSelf(void) +@@ -59,7 +59,6 @@ static int rtR0ThreadFbsdSleepCommon(RTMSINTERVAL cMil static int rtR0ThreadFbsdSleepCommon(RTMSINTERVAL cMillies) { int rc; - int cTicks; /* * 0 ms sleep -> yield. -@@ -60,30 +59,34 @@ static int rtR0ThreadFbsdSleepCommon(RTMSINTERVAL cMil +@@ -70,30 +69,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 (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 - 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 +117,13 @@ RTDECL(int) RTThreadSleepNoLog(RTMSINTERVAL cMillies) +@@ -124,11 +127,13 @@ RTDECL(bool) RTThreadYield(void) 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 +172,14 @@ RTDECL(void) RTThreadPreemptDisable(PRTTHREADPREEMPTST +@@ -177,12 +182,14 @@ RTDECL(void) RTThreadPreemptRestore(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 */ } diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_thread2-r0drv-freebsd.c b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_thread2-r0drv-freebsd.c index c9cd05c42397..2af30cf1e27a 100644 --- a/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_thread2-r0drv-freebsd.c +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_thread2-r0drv-freebsd.c @@ -1,35 +1,35 @@ ---- src/VBox/Runtime/r0drv/freebsd/thread2-r0drv-freebsd.c.orig 2021-01-07 15:42:09 UTC +--- src/VBox/Runtime/r0drv/freebsd/thread2-r0drv-freebsd.c.orig 2025-08-13 19:51:51 UTC +++ src/VBox/Runtime/r0drv/freebsd/thread2-r0drv-freebsd.c -@@ -94,6 +94,8 @@ DECLHIDDEN(int) rtThreadNativeSetPriority(PRTTHREADINT +@@ -104,6 +104,8 @@ DECLHIDDEN(int) rtThreadNativeSetPriority(PRTTHREADINT return VERR_INVALID_PARAMETER; } + IPRT_FREEBSD_SAVE_EFL_AC(); + #if __FreeBSD_version < 700000 /* Do like they're doing in subr_ntoskrnl.c... */ mtx_lock_spin(&sched_lock); -@@ -110,6 +112,7 @@ DECLHIDDEN(int) rtThreadNativeSetPriority(PRTTHREADINT +@@ -120,6 +122,7 @@ DECLHIDDEN(int) rtThreadNativeSetPriority(PRTTHREADINT thread_unlock(curthread); #endif + IPRT_FREEBSD_RESTORE_EFL_AC(); return VINF_SUCCESS; } -@@ -159,6 +162,7 @@ static void rtThreadNativeMain(void *pvThreadInt) +@@ -169,6 +172,7 @@ DECLHIDDEN(int) rtThreadNativeCreate(PRTTHREADINT pThr DECLHIDDEN(int) rtThreadNativeCreate(PRTTHREADINT pThreadInt, PRTNATIVETHREAD pNativeThread) { + IPRT_FREEBSD_SAVE_EFL_AC(); int rc; struct proc *pProc; -@@ -174,6 +178,7 @@ DECLHIDDEN(int) rtThreadNativeCreate(PRTTHREADINT pThr +@@ -184,6 +188,7 @@ DECLHIDDEN(int) rtThreadNativeCreate(PRTTHREADINT pThr } else rc = RTErrConvertFromErrno(rc); + IPRT_FREEBSD_RESTORE_EFL_AC(); return rc; } diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_time-r0drv-freebsd.c b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_time-r0drv-freebsd.c index 399328e16faa..cf453e69a1f9 100644 --- a/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_time-r0drv-freebsd.c +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_time-r0drv-freebsd.c @@ -1,43 +1,43 @@ ---- src/VBox/Runtime/r0drv/freebsd/time-r0drv-freebsd.c.orig 2021-01-07 15:42:09 UTC +--- src/VBox/Runtime/r0drv/freebsd/time-r0drv-freebsd.c.orig 2025-08-13 19:51:51 UTC +++ src/VBox/Runtime/r0drv/freebsd/time-r0drv-freebsd.c -@@ -64,16 +64,23 @@ +@@ -74,16 +74,23 @@ RTDECL(uint64_t) RTTimeNanoTS(void) RTDECL(uint64_t) RTTimeNanoTS(void) { - struct timespec tsp; - nanouptime(&tsp); - return tsp.tv_sec * RT_NS_1SEC_64 - + tsp.tv_nsec; + struct bintime bt; + uint64_t ns; + binuptime(&bt); + ns = RT_NS_1SEC_64 * bt.sec; + ns += (RT_NS_1SEC_64 * (uint32_t)(bt.frac >> 32)) >> 32; + return ns; } RTDECL(uint64_t) RTTimeMilliTS(void) { - return RTTimeNanoTS() / RT_NS_1MS; + struct bintime bt; + uint64_t ms; + binuptime(&bt); + ms = RT_MS_1SEC_64 * bt.sec; + ms += (RT_MS_1SEC_64 * (uint32_t)(bt.frac >> 32)) >> 32; + return ms; } -@@ -91,8 +98,7 @@ RTDECL(uint64_t) RTTimeSystemMilliTS(void) +@@ -101,8 +108,7 @@ RTDECL(PRTTIMESPEC) RTTimeNow(PRTTIMESPEC pTime) RTDECL(PRTTIMESPEC) RTTimeNow(PRTTIMESPEC pTime) { - struct timespec tsp; - nanotime(&tsp); - return RTTimeSpecSetTimespec(pTime, &tsp); + struct timespec ts; + nanotime(&ts); + return RTTimeSpecSetTimespec(pTime, &ts); } - diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_timer-r0drv-freebsd.c b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_timer-r0drv-freebsd.c index ee5b90f13c51..537199743da8 100644 --- a/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_timer-r0drv-freebsd.c +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r0drv_freebsd_timer-r0drv-freebsd.c @@ -1,68 +1,68 @@ ---- src/VBox/Runtime/r0drv/freebsd/timer-r0drv-freebsd.c.orig 2021-01-07 15:42:09 UTC +--- src/VBox/Runtime/r0drv/freebsd/timer-r0drv-freebsd.c.orig 2025-08-13 19:51:51 UTC +++ src/VBox/Runtime/r0drv/freebsd/timer-r0drv-freebsd.c -@@ -116,6 +116,7 @@ static void rtTimerFreeBSDCallback(void *pvTimer); +@@ -126,6 +126,7 @@ RTDECL(int) RTTimerCreateEx(PRTTIMER *ppTimer, uint64_ RTDECL(int) RTTimerCreateEx(PRTTIMER *ppTimer, uint64_t u64NanoInterval, uint32_t fFlags, PFNRTTIMER pfnTimer, void *pvUser) { *ppTimer = NULL; + IPRT_FREEBSD_SAVE_EFL_AC(); /* * Validate flags. -@@ -145,6 +146,7 @@ RTDECL(int) RTTimerCreateEx(PRTTIMER *ppTimer, uint64_ +@@ -155,6 +156,7 @@ RTDECL(int) RTTimerCreateEx(PRTTIMER *ppTimer, uint64_ callout_init(&pTimer->Callout, CALLOUT_MPSAFE); *ppTimer = pTimer; + IPRT_FREEBSD_RESTORE_EFL_AC(); return VINF_SUCCESS; } -@@ -165,6 +167,8 @@ DECLINLINE(bool) rtTimerIsValid(PRTTIMER pTimer) +@@ -175,6 +177,8 @@ RTDECL(int) RTTimerDestroy(PRTTIMER pTimer) RTDECL(int) RTTimerDestroy(PRTTIMER pTimer) { + IPRT_FREEBSD_SAVE_EFL_AC(); + /* It's ok to pass NULL pointer. */ if (pTimer == /*NIL_RTTIMER*/ NULL) return VINF_SUCCESS; -@@ -177,6 +181,8 @@ RTDECL(int) RTTimerDestroy(PRTTIMER pTimer) +@@ -187,6 +191,8 @@ RTDECL(int) RTTimerDestroy(PRTTIMER pTimer) pTimer->u32Magic++; callout_stop(&pTimer->Callout); RTMemFree(pTimer); + + IPRT_FREEBSD_RESTORE_EFL_AC(); return VINF_SUCCESS; } -@@ -184,6 +190,7 @@ RTDECL(int) RTTimerDestroy(PRTTIMER pTimer) +@@ -194,6 +200,7 @@ RTDECL(int) RTTimerStart(PRTTIMER pTimer, uint64_t u64 RTDECL(int) RTTimerStart(PRTTIMER pTimer, uint64_t u64First) { struct timeval tv; + IPRT_FREEBSD_SAVE_EFL_AC(); if (!rtTimerIsValid(pTimer)) return VERR_INVALID_HANDLE; -@@ -207,12 +214,15 @@ RTDECL(int) RTTimerStart(PRTTIMER pTimer, uint64_t u64 +@@ -217,12 +224,15 @@ RTDECL(int) RTTimerStart(PRTTIMER pTimer, uint64_t u64 tv.tv_usec = (u64First % 1000000000) / 1000; callout_reset(&pTimer->Callout, tvtohz(&tv), rtTimerFreeBSDCallback, pTimer); + IPRT_FREEBSD_RESTORE_EFL_AC(); return VINF_SUCCESS; } RTDECL(int) RTTimerStop(PRTTIMER pTimer) { + IPRT_FREEBSD_SAVE_EFL_AC(); + if (!rtTimerIsValid(pTimer)) return VERR_INVALID_HANDLE; if (pTimer->fSuspended) -@@ -224,6 +234,7 @@ RTDECL(int) RTTimerStop(PRTTIMER pTimer) +@@ -234,6 +244,7 @@ RTDECL(int) RTTimerStop(PRTTIMER pTimer) pTimer->fSuspended = true; callout_stop(&pTimer->Callout); + IPRT_FREEBSD_RESTORE_EFL_AC(); return VINF_SUCCESS; } diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r3_posix_process-creation-posix.cpp b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r3_posix_process-creation-posix.cpp index 83cabcb77b97..06bfba5d3dac 100644 --- a/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r3_posix_process-creation-posix.cpp +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_Runtime_r3_posix_process-creation-posix.cpp @@ -1,38 +1,38 @@ ---- src/VBox/Runtime/r3/posix/process-creation-posix.cpp.orig 2022-01-13 18:58:24 UTC +--- src/VBox/Runtime/r3/posix/process-creation-posix.cpp.orig 2025-08-13 19:51:58 UTC +++ src/VBox/Runtime/r3/posix/process-creation-posix.cpp -@@ -30,7 +30,7 @@ +@@ -40,7 +40,7 @@ *********************************************************************************************************************************/ #define LOG_GROUP RTLOGGROUP_PROCESS #include -#ifdef RT_OS_LINUX +#if defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD) # define IPRT_WITH_DYNAMIC_CRYPT_R #endif #if (defined(RT_OS_LINUX) || defined(RT_OS_OS2)) && !defined(_GNU_SOURCE) -@@ -69,7 +69,7 @@ - # include +@@ -85,7 +85,7 @@ + # include /* for newlocale() */ #endif -#if defined(RT_OS_LINUX) || defined(RT_OS_OS2) +#if defined(RT_OS_LINUX) || defined(RT_OS_OS2) || defined(RT_OS_FREEBSD) /* While Solaris has posix_spawn() of course we don't want to use it as * we need to have the child in a different process contract, no matter * whether it is started detached or not. */ -@@ -157,7 +157,7 @@ +@@ -174,7 +174,7 @@ # define IPRT_LIBPAM_FILE_3 "libpam.1.dylib" # define IPRT_LIBPAM_FILE_3_FIRST_VER 0 # define IPRT_LIBPAM_FILE_3_END_VER 0 -# elif RT_OS_LINUX +# elif RT_OS_LINUX || RT_OS_FREEBSD # define IPRT_LIBPAM_FILE_1 "libpam.so.0" # define IPRT_LIBPAM_FILE_1_FIRST_VER 0 # define IPRT_LIBPAM_FILE_1_END_VER 0 -@@ -572,7 +572,7 @@ static int rtCheckCredentials(const char *pszUser, con +@@ -681,7 +681,7 @@ static int rtCheckCredentials(const char *pszUser, con if (pPw->pw_passwd && *pPw->pw_passwd) # endif { -# if defined(RT_OS_LINUX) || defined(RT_OS_OS2) +# if defined(RT_OS_LINUX) || defined(RT_OS_OS2) || defined(RT_OS_FREEBSD) # ifdef IPRT_WITH_DYNAMIC_CRYPT_R size_t const cbCryptData = RT_MAX(sizeof(struct crypt_data) * 2, _256K); # else diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_VMM_Config.kmk b/emulators/virtualbox-ose-72/files/patch-src_VBox_VMM_Config.kmk index 1c44352c9409..cb294d7cd898 100644 --- a/emulators/virtualbox-ose-72/files/patch-src_VBox_VMM_Config.kmk +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_VMM_Config.kmk @@ -1,11 +1,11 @@ ---- src/VBox/VMM/Config.kmk.orig 2024-12-27 03:55:34.269311000 +0100 -+++ src/VBox/VMM/Config.kmk 2024-12-27 03:42:41.858673000 +0100 -@@ -91,7 +91,7 @@ +--- src/VBox/VMM/Config.kmk.orig 2025-08-13 19:52:06 UTC ++++ src/VBox/VMM/Config.kmk +@@ -133,7 +133,7 @@ endif VMM_COMMON_DEFS += VBOX_WITH_NATIVE_NEM VBOX_WITH_NEM_R0 endif endif -if1of ($(KBUILD_TARGET), freebsd linux solaris) # Hosts that implements SUPR0HCPhysToVirt. +if1of ($(KBUILD_TARGET), linux solaris) # Hosts that implements SUPR0HCPhysToVirt. VMM_COMMON_DEFS += VBOX_WITH_LINEAR_HOST_PHYS_MEM endif diff --git a/emulators/virtualbox-ose-72/files/patch-src_VBox_VMM_VMMR3_PDMAsyncCompletionFileNormal.cpp b/emulators/virtualbox-ose-72/files/patch-src_VBox_VMM_VMMR3_PDMAsyncCompletionFileNormal.cpp index b04b05811f86..b460847d13f0 100644 --- a/emulators/virtualbox-ose-72/files/patch-src_VBox_VMM_VMMR3_PDMAsyncCompletionFileNormal.cpp +++ b/emulators/virtualbox-ose-72/files/patch-src_VBox_VMM_VMMR3_PDMAsyncCompletionFileNormal.cpp @@ -1,59 +1,59 @@ ---- src/VBox/VMM/VMMR3/PDMAsyncCompletionFileNormal.cpp.orig 2021-04-19 21:33:04.000000000 -0700 -+++ src/VBox/VMM/VMMR3/PDMAsyncCompletionFileNormal.cpp 2021-05-18 11:45:08.396136000 -0700 -@@ -27,6 +27,13 @@ +--- src/VBox/VMM/VMMR3/PDMAsyncCompletionFileNormal.cpp.orig 2025-08-13 19:52:13 UTC ++++ src/VBox/VMM/VMMR3/PDMAsyncCompletionFileNormal.cpp +@@ -37,6 +37,13 @@ #include #include #include +/* TBR: we need a complicated crawl through the data structure to get the AIO system limits + to check when considering growing the number of active AIO requests.... */ +/* We need the PDMInternal *before* the UVM, or it isn't visible afterwards. (src/VBox/VMM/include/PDMInternal.h) */ +#include +#include +#include +/* TBR: end of extra includes. */ #include "PDMAsyncCompletionFileInternal.h" -@@ -1120,8 +1127,40 @@ +@@ -1119,8 +1126,40 @@ static int pdmacFileAioMgrNormalProcessTaskList(PPDMAC */ pdmacFileAioMgrNormalBalanceLoad(pAioMgr); #else - /* Grow the I/O manager */ - pAioMgr->enmState = PDMACEPFILEMGRSTATE_GROWING; + /* TBR: Check the global AIO system limit before growing. + This is the complicateds crawl through the data structure mentioned + near the start of this file. + There HAS to be a better way and better time to get this limit! */ + PPDMASYNCCOMPLETIONEPCLASS pEpClass = NULL; + PCPDMASYNCCOMPLETIONEPCLASSOPS pEndpointOps = NULL; + PDMASYNCCOMPLETIONEPCLASSTYPE enmClassType; + PPDMASYNCCOMPLETIONEPCLASSFILE pEpClassFile = NULL; + PVM pVM = NULL; + PUVM pUVM = NULL; + unsigned int aio_system_reqests_max = RTFILEAIO_UNLIMITED_REQS; + pEpClass = pEndpoint->Core.pEpClass; + AssertMsg((NULL != pEpClass),("ep->class is NULL")); + pEndpointOps = pEpClass->pEndpointOps; + AssertMsg((NULL != pEndpointOps),("ep->class->ops is NULL")); + enmClassType = pEndpointOps->enmClassType; + AssertMsg((PDMASYNCCOMPLETIONEPCLASSTYPE_FILE == enmClassType), + ("ep->class->ops->type != PDMASYNCCOMPLETIONEPCLASSTYPE_FILE")); + pVM = pEpClass->pVM; + AssertMsg((NULL != pVM),("ep->class->VM is NULL")); + pUVM = pVM->pUVM; + AssertMsg((NULL != pUVM),("ep->class->VM->UVM is NULL")); + pEpClassFile = (PPDMASYNCCOMPLETIONEPCLASSFILE) (pUVM->pdm.s.apAsyncCompletionEndpointClass[enmClassType]); + AssertMsg((NULL != pEpClassFile),("ep->class->VM->UVM->pdn[globals] is NULL")); + aio_system_reqests_max = pEpClassFile->cReqsOutstandingMax; +#if 0 + /* A one time check during development to verify getting the right number. */ + AssertMsg((256 != aio_system_reqests_max), + ("aio_system_reqests_max != 256 (val=%u)",aio_system_reqests_max)); +#endif + if (RT_UNLIKELY( aio_system_reqests_max == RTFILEAIO_UNLIMITED_REQS + || (pAioMgr->cRequestsActiveMax+PDMACEPFILEMGR_REQS_STEP) <= aio_system_reqests_max)) + /* Grow the I/O manager */ + pAioMgr->enmState = PDMACEPFILEMGRSTATE_GROWING; #endif } } diff --git a/emulators/virtualbox-ose-72/files/patch-src_libs_xpcom18a4_Makefile.kmk b/emulators/virtualbox-ose-72/files/patch-src_libs_xpcom18a4_Makefile.kmk index c87ba535edb0..95f5972ce7f8 100644 --- a/emulators/virtualbox-ose-72/files/patch-src_libs_xpcom18a4_Makefile.kmk +++ b/emulators/virtualbox-ose-72/files/patch-src_libs_xpcom18a4_Makefile.kmk @@ -1,11 +1,11 @@ ---- src/libs/xpcom18a4/Makefile.kmk.orig 2021-01-07 15:44:04 UTC +--- src/libs/xpcom18a4/Makefile.kmk.orig 2025-08-13 19:56:45 UTC +++ src/libs/xpcom18a4/Makefile.kmk -@@ -985,6 +985,8 @@ VBoxXPCOM_LIBS = \ +@@ -601,6 +601,8 @@ VBoxXPCOM_LIBS = \ $(VBox-xpcom-proxy_1_TARGET) \ $(VBox-xpcom-nspr_1_TARGET) \ $(VBoxXPCOMGlue_s_1_TARGET) +VBoxXPCOM_LIBS.freebsd = \ + pthread VBoxXPCOM_LIBS.linux = \ pthread dl diff --git a/emulators/virtualbox-ose-72/files/patch-src_libs_xpcom18a4_nsprpub_pr_src_pthreads_ptsynch.c b/emulators/virtualbox-ose-72/files/patch-src_libs_xpcom18a4_nsprpub_pr_src_pthreads_ptsynch.c index 4d556c7cf5a0..6bd41290d6ee 100644 --- a/emulators/virtualbox-ose-72/files/patch-src_libs_xpcom18a4_nsprpub_pr_src_pthreads_ptsynch.c +++ b/emulators/virtualbox-ose-72/files/patch-src_libs_xpcom18a4_nsprpub_pr_src_pthreads_ptsynch.c @@ -1,13 +1,13 @@ ---- src/libs/xpcom18a4/nsprpub/pr/src/pthreads/ptsynch.c.orig 2025-01-21 20:03:59.000000000 +0700 -+++ src/libs/xpcom18a4/nsprpub/pr/src/pthreads/ptsynch.c 2025-01-23 01:00:59.324267000 +0700 +--- src/libs/xpcom18a4/nsprpub/pr/src/pthreads/ptsynch.c.orig 2025-08-13 19:56:47 UTC ++++ src/libs/xpcom18a4/nsprpub/pr/src/pthreads/ptsynch.c @@ -45,6 +45,10 @@ #include #include #include +#ifdef FREEBSD +#include +#endif + #include #include diff --git a/emulators/virtualbox-ose-72/files/patch-src_libs_xpcom18a4_xpcom_io_nsLocalFileUnix.h b/emulators/virtualbox-ose-72/files/patch-src_libs_xpcom18a4_xpcom_io_nsLocalFileUnix.h index 13af9aa6bffa..50f117437106 100644 --- a/emulators/virtualbox-ose-72/files/patch-src_libs_xpcom18a4_xpcom_io_nsLocalFileUnix.h +++ b/emulators/virtualbox-ose-72/files/patch-src_libs_xpcom18a4_xpcom_io_nsLocalFileUnix.h @@ -1,17 +1,17 @@ ---- src/libs/xpcom18a4/xpcom/io/nsLocalFileUnix.h.orig 2020-05-13 19:46:34 UTC +--- src/libs/xpcom18a4/xpcom/io/nsLocalFileUnix.h.orig 2025-08-13 19:56:51 UTC +++ src/libs/xpcom18a4/xpcom/io/nsLocalFileUnix.h -@@ -72,14 +72,6 @@ +@@ -74,14 +74,6 @@ #define STATFS statfs #endif -// so we can statfs on freebsd -#if defined(__FreeBSD__) - #define HAVE_SYS_STATFS_H - #define STATFS statfs - #include - #include -#endif - class NS_COM nsLocalFile : public nsILocalFile { public: diff --git a/emulators/virtualbox-ose-72/pkg-plist b/emulators/virtualbox-ose-72/pkg-plist index 426fd6b55c60..d2dfcb82d4d5 100644 --- a/emulators/virtualbox-ose-72/pkg-plist +++ b/emulators/virtualbox-ose-72/pkg-plist @@ -1,449 +1,452 @@ bin/VBoxAutostart bin/VBoxBalloonCtrl bin/VBoxBugReport bin/VBoxHeadless bin/VBoxManage bin/VBoxVRDP %%QT%%bin/VirtualBox %%QT%%bin/VirtualBoxVM bin/vboxautostart bin/vboxballoonctrl bin/vboxbugreport bin/vboxheadless %%VBOXIMG%%bin/vboximg-mount bin/vboxmanage %%WEBSERVICE%%bin/vboxwebsrv %%QT%%bin/virtualbox %%QT%%bin/virtualboxvm include/virtualbox/VirtualBox_XPCOM.h include/virtualbox/ipcIClientObserver.h include/virtualbox/ipcIDConnectService.h include/virtualbox/ipcIMessageObserver.h include/virtualbox/ipcIService.h include/virtualbox/ipcd/ipcCID.h include/virtualbox/ipcd/ipcdclient.h include/virtualbox/nsIArray.h include/virtualbox/nsIAtom.h include/virtualbox/nsIAtomService.h include/virtualbox/nsIBinaryInputStream.h include/virtualbox/nsIBinaryOutputStream.h include/virtualbox/nsICategoryManager.h include/virtualbox/nsIClassInfo.h include/virtualbox/nsICollection.h include/virtualbox/nsIComponentLoader.h include/virtualbox/nsIComponentLoaderManager.h include/virtualbox/nsIComponentManager.h include/virtualbox/nsIComponentManagerObsolete.h include/virtualbox/nsIComponentRegistrar.h include/virtualbox/nsIDebug.h include/virtualbox/nsIDirectoryEnumerator.h include/virtualbox/nsIDirectoryService.h include/virtualbox/nsIEnumerator.h include/virtualbox/nsIErrorService.h include/virtualbox/nsIEventQueue.h include/virtualbox/nsIEventQueueService.h include/virtualbox/nsIEventTarget.h include/virtualbox/nsIException.h include/virtualbox/nsIExceptionService.h include/virtualbox/nsIFactory.h include/virtualbox/nsIFile.h include/virtualbox/nsIHashable.h include/virtualbox/nsIInputStream.h include/virtualbox/nsIInterfaceInfo.h include/virtualbox/nsIInterfaceInfoManager.h include/virtualbox/nsIInterfaceRequestor.h include/virtualbox/nsILocalFile.h include/virtualbox/nsILocalFileMac.h include/virtualbox/nsIModule.h include/virtualbox/nsINativeComponentLoader.h include/virtualbox/nsIObjectInputStream.h include/virtualbox/nsIObjectOutputStream.h include/virtualbox/nsIObserver.h include/virtualbox/nsIObserverService.h include/virtualbox/nsIOutputStream.h include/virtualbox/nsIProgrammingLanguage.h include/virtualbox/nsIProperties.h include/virtualbox/nsIProxyObjectManager.h include/virtualbox/nsIRunnable.h include/virtualbox/nsISerializable.h include/virtualbox/nsIServiceManager.h include/virtualbox/nsISimpleEnumerator.h include/virtualbox/nsIStringEnumerator.h include/virtualbox/nsISupports.h include/virtualbox/nsISupportsArray.h include/virtualbox/nsISupportsIterators.h include/virtualbox/nsISupportsPrimitives.h include/virtualbox/nsITraceRefcnt.h include/virtualbox/nsIVariant.h include/virtualbox/nsIWeakReference.h include/virtualbox/nsIXPTLoader.h include/virtualbox/nsprpub/nspr.h include/virtualbox/nsprpub/plarena.h include/virtualbox/nsprpub/plarenas.h include/virtualbox/nsprpub/plhash.h include/virtualbox/nsprpub/prbit.h include/virtualbox/nsprpub/prcpucfg.h include/virtualbox/nsprpub/prlong.h include/virtualbox/nsprpub/prmem.h include/virtualbox/nsprpub/prmon.h include/virtualbox/nsprpub/prtime.h include/virtualbox/nsprpub/prtypes.h include/virtualbox/nsrootidl.h include/virtualbox/string/nsAString.h include/virtualbox/string/nsAlgorithm.h include/virtualbox/string/nsCharTraits.h include/virtualbox/string/nsDependentString.h include/virtualbox/string/nsDependentSubstring.h include/virtualbox/string/nsEmbedString.h include/virtualbox/string/nsLiteralString.h include/virtualbox/string/nsObsoleteAString.h include/virtualbox/string/nsPrintfCString.h include/virtualbox/string/nsPromiseFlatString.h include/virtualbox/string/nsReadableUtils.h include/virtualbox/string/nsString.h include/virtualbox/string/nsStringAPI.h include/virtualbox/string/nsStringFwd.h include/virtualbox/string/nsStringIterator.h include/virtualbox/string/nsSubstring.h include/virtualbox/string/nsSubstringTuple.h include/virtualbox/string/nsTAString.h include/virtualbox/string/nsTDependentString.h include/virtualbox/string/nsTDependentSubstring.h include/virtualbox/string/nsTObsoleteAString.h include/virtualbox/string/nsTPromiseFlatString.h include/virtualbox/string/nsTString.h include/virtualbox/string/nsTSubstring.h include/virtualbox/string/nsTSubstringTuple.h include/virtualbox/string/nsUTF8Utils.h include/virtualbox/string/nsXPIDLString.h include/virtualbox/string/string-template-def-char.h include/virtualbox/string/string-template-def-unichar.h include/virtualbox/string/string-template-undef.h include/virtualbox/xpcom/nsAgg.h include/virtualbox/xpcom/nsAppDirectoryServiceDefs.h include/virtualbox/xpcom/nsArray.h include/virtualbox/xpcom/nsArrayEnumerator.h include/virtualbox/xpcom/nsAtomService.h include/virtualbox/xpcom/nsAutoLock.h include/virtualbox/xpcom/nsAutoPtr.h include/virtualbox/xpcom/nsBaseHashtable.h include/virtualbox/xpcom/nsCOMArray.h include/virtualbox/xpcom/nsCOMPtr.h include/virtualbox/xpcom/nsCRT.h include/virtualbox/xpcom/nsCategoryManagerUtils.h include/virtualbox/xpcom/nsClassHashtable.h include/virtualbox/xpcom/nsComponentManagerObsolete.h include/virtualbox/xpcom/nsComponentManagerUtils.h include/virtualbox/xpcom/nsDataHashtable.h include/virtualbox/xpcom/nsDebug.h include/virtualbox/xpcom/nsDebugImpl.h include/virtualbox/xpcom/nsDeque.h include/virtualbox/xpcom/nsDirectoryService.h include/virtualbox/xpcom/nsDirectoryServiceDefs.h include/virtualbox/xpcom/nsDirectoryServiceUtils.h include/virtualbox/xpcom/nsDoubleHashtable.h include/virtualbox/xpcom/nsEnumeratorUtils.h include/virtualbox/xpcom/nsError.h include/virtualbox/xpcom/nsEventQueueUtils.h include/virtualbox/xpcom/nsGenericFactory.h include/virtualbox/xpcom/nsHashKeys.h include/virtualbox/xpcom/nsHashSets.h include/virtualbox/xpcom/nsHashtable.h include/virtualbox/xpcom/nsID.h include/virtualbox/xpcom/nsIGenericFactory.h include/virtualbox/xpcom/nsIID.h include/virtualbox/xpcom/nsIInterfaceRequestorUtils.h include/virtualbox/xpcom/nsIServiceManagerObsolete.h include/virtualbox/xpcom/nsIServiceManagerUtils.h include/virtualbox/xpcom/nsISupportsBase.h include/virtualbox/xpcom/nsISupportsImpl.h include/virtualbox/xpcom/nsISupportsUtils.h include/virtualbox/xpcom/nsIWeakReferenceUtils.h include/virtualbox/xpcom/nsInt64.h include/virtualbox/xpcom/nsInterfaceHashtable.h include/virtualbox/xpcom/nsLocalFile.h include/virtualbox/xpcom/nsLocalFileUnix.h include/virtualbox/xpcom/nsMemory.h include/virtualbox/xpcom/nsModule.h include/virtualbox/xpcom/nsNativeCharsetUtils.h include/virtualbox/xpcom/nsNativeComponentLoader.h include/virtualbox/xpcom/nsObserverService.h include/virtualbox/xpcom/nsObsoleteModuleLoading.h include/virtualbox/xpcom/nsProxiedService.h include/virtualbox/xpcom/nsProxyEvent.h include/virtualbox/xpcom/nsProxyRelease.h include/virtualbox/xpcom/nsRefPtrHashtable.h include/virtualbox/xpcom/nsStaticAtom.h include/virtualbox/xpcom/nsStaticComponent.h include/virtualbox/xpcom/nsStringEnumerator.h include/virtualbox/xpcom/nsStringIO.h include/virtualbox/xpcom/nsSupportsArray.h include/virtualbox/xpcom/nsSupportsPrimitives.h include/virtualbox/xpcom/nsTHashtable.h include/virtualbox/xpcom/nsTraceRefcnt.h include/virtualbox/xpcom/nsTraceRefcntImpl.h include/virtualbox/xpcom/nsVariant.h include/virtualbox/xpcom/nsVoidArray.h include/virtualbox/xpcom/nsWeakPtr.h include/virtualbox/xpcom/nsWeakReference.h include/virtualbox/xpcom/nsXPCOM.h include/virtualbox/xpcom/nsXPCOMCID.h include/virtualbox/xpcom/nsXPCOMGlue.h include/virtualbox/xpcom/nscore.h include/virtualbox/xpcom/pldhash.h include/virtualbox/xpcom/plevent.h include/virtualbox/xpcom/xcDll.h include/virtualbox/xpcom/xpcom-config.h include/virtualbox/xpcom/xpt_arena.h include/virtualbox/xpcom/xpt_struct.h include/virtualbox/xpcom/xpt_xdr.h include/virtualbox/xpcom/xptcall.h include/virtualbox/xpcom/xptcstubsdecl.inc include/virtualbox/xpcom/xptcstubsdef.inc include/virtualbox/xpcom/xptinfo.h %%PYTHON%%%%PYTHON_SITELIBDIR%%/vboxapi-1-py%%PYTHON_VER%%.egg-info/PKG-INFO %%PYTHON%%%%PYTHON_SITELIBDIR%%/vboxapi-1-py%%PYTHON_VER%%.egg-info/SOURCES.txt %%PYTHON%%%%PYTHON_SITELIBDIR%%/vboxapi-1-py%%PYTHON_VER%%.egg-info/dependency_links.txt %%PYTHON%%%%PYTHON_SITELIBDIR%%/vboxapi-1-py%%PYTHON_VER%%.egg-info/requires.txt %%PYTHON%%%%PYTHON_SITELIBDIR%%/vboxapi-1-py%%PYTHON_VER%%.egg-info/top_level.txt %%PYTHON%%%%PYTHON_SITELIBDIR%%/vboxapi/VirtualBox_constants.py %%PYTHON%%%%PYTHON_SITELIBDIR%%/vboxapi%%PYTHON_PYCDIR%%VirtualBox_constants%%PYTHON_PYCEXT%% %%PYTHON%%%%PYTHON_SITELIBDIR%%/vboxapi/__init__.py %%PYTHON%%%%PYTHON_SITELIBDIR%%/vboxapi%%PYTHON_PYCDIR%%__init__%%PYTHON_PYCEXT%% %%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/__init__.py %%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom%%PYTHON_PYCDIR%%__init__%%PYTHON_PYCEXT%% %%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/components.py %%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom%%PYTHON_PYCDIR%%components%%PYTHON_PYCEXT%% %%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/nsError.py %%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom%%PYTHON_PYCDIR%%nsError%%PYTHON_PYCEXT%% %%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/primitives.py %%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom%%PYTHON_PYCDIR%%primitives%%PYTHON_PYCEXT%% %%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/vboxxpcom.py %%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom%%PYTHON_PYCDIR%%vboxxpcom%%PYTHON_PYCEXT%% %%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/xpcom_consts.py %%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom%%PYTHON_PYCDIR%%xpcom_consts%%PYTHON_PYCEXT%% %%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/xpt.py %%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom%%PYTHON_PYCDIR%%xpt%%PYTHON_PYCEXT%% %%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/client/__init__.py %%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/client%%PYTHON_PYCDIR%%__init__%%PYTHON_PYCEXT%% %%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/server/__init__.py %%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/server%%PYTHON_PYCDIR%%__init__%%PYTHON_PYCEXT%% %%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/server/enumerator.py %%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/server%%PYTHON_PYCDIR%%enumerator%%PYTHON_PYCEXT%% %%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/server/factory.py %%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/server%%PYTHON_PYCDIR%%factory%%PYTHON_PYCEXT%% %%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/server/loader.py %%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/server%%PYTHON_PYCDIR%%loader%%PYTHON_PYCEXT%% %%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/server/module.py %%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/server%%PYTHON_PYCDIR%%module%%PYTHON_PYCEXT%% %%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/server/policy.py %%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/server%%PYTHON_PYCDIR%%policy%%PYTHON_PYCEXT%% %%QT%%lib/virtualbox/DbgPlugInDiggers.so lib/virtualbox/VBox.sh lib/virtualbox/VBoxAuth.so lib/virtualbox/VBoxAuthSimple.so lib/virtualbox/VBoxAutostart lib/virtualbox/VBoxBalloonCtrl lib/virtualbox/VBoxBugReport lib/virtualbox/VBoxDD.so lib/virtualbox/VBoxDD2.so lib/virtualbox/VBoxDDR0.r0 lib/virtualbox/VBoxDDU.so %%QT%%lib/virtualbox/UICommon.so %%QT%%lib/virtualbox/VBoxDbg.so %%QT%%lib/virtualbox/VBoxDragAndDropSvc.so -lib/virtualbox/VBoxEFI32.fd -lib/virtualbox/VBoxEFI64.fd +lib/virtualbox/VBoxEFI-amd64.fd +lib/virtualbox/VBoxEFI-arm32.fd +lib/virtualbox/VBoxEFI-arm64.fd +lib/virtualbox/VBoxEFI-x86.fd lib/virtualbox/VBoxExtPackHelperApp lib/virtualbox/VBoxGuestControlSvc.so lib/virtualbox/VBoxGuestPropSvc.so @(root,%%VBOXGROUP%%,4510) lib/virtualbox/VBoxHeadless lib/virtualbox/VBoxHeadless.so lib/virtualbox/VBoxHostChannel.so %%QT%%lib/virtualbox/VBoxKeyboard.so lib/virtualbox/VBoxManage @(root,%%VBOXGROUP%%,4510) lib/virtualbox/VBoxNetAdpCtl @(root,%%VBOXGROUP%%,4510) lib/virtualbox/VBoxNetDHCP lib/virtualbox/VBoxNetDHCP.so @(root,%%VBOXGROUP%%,4510) lib/virtualbox/VBoxNetNAT lib/virtualbox/VBoxNetNAT.so %%PYTHON%%lib/virtualbox/VBoxPython3.so %%PYTHON%%lib/virtualbox/VBoxPython3m.so lib/virtualbox/VBoxRT.so lib/virtualbox/VBoxSVC %%X11%%lib/virtualbox/VBoxSVGA3D.so lib/virtualbox/VBoxSharedClipboard.so lib/virtualbox/VBoxSharedFolders.so lib/virtualbox/VBoxTraceLogDecoders.so lib/virtualbox/VBoxVMM.so +lib/virtualbox/VBoxVMMArm.so lib/virtualbox/VBoxVMMPreload.so lib/virtualbox/VBoxXPCOM.so lib/virtualbox/VBoxXPCOMC.so lib/virtualbox/VBoxXPCOMIPCD.so lib/virtualbox/VMMR0.r0 %%QT%%lib/virtualbox/VirtualBox %%QT%%@(root,%%VBOXGROUP%%,4510) lib/virtualbox/VirtualBoxVM %%QT%%lib/virtualbox/VirtualBoxVM.so %%SDK%%lib/virtualbox/sdk %%VBOXIMG%%lib/virtualbox/vboximg-mount %%WEBSERVICE%%lib/virtualbox/vboxwebsrv %%WEBSERVICE%%lib/virtualbox/webtest %%VNC%%lib/virtualbox/ExtensionPacks/VNC/ExtPack-license.html %%VNC%%lib/virtualbox/ExtensionPacks/VNC/ExtPack-license.rtf %%VNC%%lib/virtualbox/ExtensionPacks/VNC/ExtPack-license.txt %%VNC%%lib/virtualbox/ExtensionPacks/VNC/ExtPack.xml %%VNC%%lib/virtualbox/ExtensionPacks/VNC/%%ARCH%%/VBoxVNC.so %%VNC%%lib/virtualbox/ExtensionPacks/VNC/%%ARCH%%/VBoxVNCMain.so %%GUESTADDITIONS%%lib/virtualbox/additions/VBoxGuestAdditions.iso %%GUESTADDITIONS%%lib/virtualbox/additions/VBoxGuestAdditions_%%GUEST_VER%%.iso lib/virtualbox/components/VBoxC.so lib/virtualbox/components/VBoxSVCM.so lib/virtualbox/components/VBoxXPCOMBase.xpt lib/virtualbox/components/VBoxXPCOMIPCC.so lib/virtualbox/components/VirtualBox_XPCOM.xpt %%QT%%share/applications/virtualbox.desktop %%DOCS%%%%DOCSDIR%%/UserManual.pdf %%QT%%share/pixmaps/VBox.png %%DATADIR%%/idl/VirtualBox_XPCOM.idl %%DATADIR%%/idl/ipcIClientObserver.idl %%DATADIR%%/idl/ipcIDConnectService.idl %%DATADIR%%/idl/ipcIMessageObserver.idl %%DATADIR%%/idl/ipcIService.idl %%DATADIR%%/idl/nsIArray.idl %%DATADIR%%/idl/nsIAtom.idl %%DATADIR%%/idl/nsIAtomService.idl %%DATADIR%%/idl/nsIBinaryInputStream.idl %%DATADIR%%/idl/nsIBinaryOutputStream.idl %%DATADIR%%/idl/nsICategoryManager.idl %%DATADIR%%/idl/nsIClassInfo.idl %%DATADIR%%/idl/nsICollection.idl %%DATADIR%%/idl/nsIComponentLoader.idl %%DATADIR%%/idl/nsIComponentLoaderManager.idl %%DATADIR%%/idl/nsIComponentManager.idl %%DATADIR%%/idl/nsIComponentManagerObsolete.idl %%DATADIR%%/idl/nsIComponentRegistrar.idl %%DATADIR%%/idl/nsIDebug.idl %%DATADIR%%/idl/nsIDirectoryEnumerator.idl %%DATADIR%%/idl/nsIDirectoryService.idl %%DATADIR%%/idl/nsIEnumerator.idl %%DATADIR%%/idl/nsIErrorService.idl %%DATADIR%%/idl/nsIEventQueue.idl %%DATADIR%%/idl/nsIEventQueueService.idl %%DATADIR%%/idl/nsIEventTarget.idl %%DATADIR%%/idl/nsIException.idl %%DATADIR%%/idl/nsIExceptionService.idl %%DATADIR%%/idl/nsIFactory.idl %%DATADIR%%/idl/nsIFile.idl %%DATADIR%%/idl/nsIHashable.idl %%DATADIR%%/idl/nsIInputStream.idl %%DATADIR%%/idl/nsIInterfaceInfo.idl %%DATADIR%%/idl/nsIInterfaceInfoManager.idl %%DATADIR%%/idl/nsIInterfaceRequestor.idl %%DATADIR%%/idl/nsILocalFile.idl %%DATADIR%%/idl/nsILocalFileMac.idl %%DATADIR%%/idl/nsIModule.idl %%DATADIR%%/idl/nsINativeComponentLoader.idl %%DATADIR%%/idl/nsIObjectInputStream.idl %%DATADIR%%/idl/nsIObjectOutputStream.idl %%DATADIR%%/idl/nsIObserver.idl %%DATADIR%%/idl/nsIObserverService.idl %%DATADIR%%/idl/nsIOutputStream.idl %%DATADIR%%/idl/nsIProgrammingLanguage.idl %%DATADIR%%/idl/nsIProperties.idl %%DATADIR%%/idl/nsIProxyObjectManager.idl %%DATADIR%%/idl/nsIRunnable.idl %%DATADIR%%/idl/nsISerializable.idl %%DATADIR%%/idl/nsIServiceManager.idl %%DATADIR%%/idl/nsISimpleEnumerator.idl %%DATADIR%%/idl/nsIStringEnumerator.idl %%DATADIR%%/idl/nsISupports.idl %%DATADIR%%/idl/nsISupportsArray.idl %%DATADIR%%/idl/nsISupportsIterators.idl %%DATADIR%%/idl/nsISupportsPrimitives.idl %%DATADIR%%/idl/nsITraceRefcnt.idl %%DATADIR%%/idl/nsIVariant.idl %%DATADIR%%/idl/nsIWeakReference.idl %%DATADIR%%/idl/nsIXPTLoader.idl %%DATADIR%%/idl/nsrootidl.idl %%NLS%%%%DATADIR%%/nls/VirtualBox_bg.qm %%NLS%%%%DATADIR%%/nls/VirtualBox_ca.qm %%NLS%%%%DATADIR%%/nls/VirtualBox_ca_VA.qm %%NLS%%%%DATADIR%%/nls/VirtualBox_cs.qm %%NLS%%%%DATADIR%%/nls/VirtualBox_da.qm %%NLS%%%%DATADIR%%/nls/VirtualBox_de.qm %%NLS%%%%DATADIR%%/nls/VirtualBox_el.qm %%NLS%%%%DATADIR%%/nls/VirtualBox_en.qm %%NLS%%%%DATADIR%%/nls/VirtualBox_es.qm %%NLS%%%%DATADIR%%/nls/VirtualBox_eu.qm %%NLS%%%%DATADIR%%/nls/VirtualBox_fa.qm %%NLS%%%%DATADIR%%/nls/VirtualBox_fi.qm %%NLS%%%%DATADIR%%/nls/VirtualBox_fr.qm %%NLS%%%%DATADIR%%/nls/VirtualBox_gl.qm %%NLS%%%%DATADIR%%/nls/VirtualBox_he.qm %%NLS%%%%DATADIR%%/nls/VirtualBox_hr_HR.qm %%NLS%%%%DATADIR%%/nls/VirtualBox_hu.qm %%NLS%%%%DATADIR%%/nls/VirtualBox_id.qm %%NLS%%%%DATADIR%%/nls/VirtualBox_it.qm %%NLS%%%%DATADIR%%/nls/VirtualBox_ja.qm %%NLS%%%%DATADIR%%/nls/VirtualBox_ka.qm %%NLS%%%%DATADIR%%/nls/VirtualBox_km_KH.qm %%NLS%%%%DATADIR%%/nls/VirtualBox_ko.qm %%NLS%%%%DATADIR%%/nls/VirtualBox_lt.qm %%NLS%%%%DATADIR%%/nls/VirtualBox_nl.qm %%NLS%%%%DATADIR%%/nls/VirtualBox_pl.qm %%NLS%%%%DATADIR%%/nls/VirtualBox_pt.qm %%NLS%%%%DATADIR%%/nls/VirtualBox_pt_BR.qm %%NLS%%%%DATADIR%%/nls/VirtualBox_ro.qm %%NLS%%%%DATADIR%%/nls/VirtualBox_ru.qm %%NLS%%%%DATADIR%%/nls/VirtualBox_sk.qm %%NLS%%%%DATADIR%%/nls/VirtualBox_sl.qm %%NLS%%%%DATADIR%%/nls/VirtualBox_sr.qm %%NLS%%%%DATADIR%%/nls/VirtualBox_sv.qm %%NLS%%%%DATADIR%%/nls/VirtualBox_th.qm %%NLS%%%%DATADIR%%/nls/VirtualBox_tr.qm %%NLS%%%%DATADIR%%/nls/VirtualBox_uk.qm %%NLS%%%%DATADIR%%/nls/VirtualBox_zh_CN.qm %%NLS%%%%DATADIR%%/nls/VirtualBox_zh_TW.qm %%NLS%%%%DATADIR%%/nls/qt_bg.qm %%NLS%%%%DATADIR%%/nls/qt_ca.qm %%NLS%%%%DATADIR%%/nls/qt_ca_VA.qm %%NLS%%%%DATADIR%%/nls/qt_cs.qm %%NLS%%%%DATADIR%%/nls/qt_da.qm %%NLS%%%%DATADIR%%/nls/qt_de.qm %%NLS%%%%DATADIR%%/nls/qt_el.qm %%NLS%%%%DATADIR%%/nls/qt_en.qm %%NLS%%%%DATADIR%%/nls/qt_es.qm %%NLS%%%%DATADIR%%/nls/qt_eu.qm %%NLS%%%%DATADIR%%/nls/qt_fa.qm %%NLS%%%%DATADIR%%/nls/qt_fi.qm %%NLS%%%%DATADIR%%/nls/qt_fr.qm %%NLS%%%%DATADIR%%/nls/qt_gl.qm %%NLS%%%%DATADIR%%/nls/qt_he.qm %%NLS%%%%DATADIR%%/nls/qt_hr_HR.qm %%NLS%%%%DATADIR%%/nls/qt_hu.qm %%NLS%%%%DATADIR%%/nls/qt_id.qm %%NLS%%%%DATADIR%%/nls/qt_it.qm %%NLS%%%%DATADIR%%/nls/qt_ja.qm %%NLS%%%%DATADIR%%/nls/qt_ka.qm %%NLS%%%%DATADIR%%/nls/qt_km_KH.qm %%NLS%%%%DATADIR%%/nls/qt_ko.qm %%NLS%%%%DATADIR%%/nls/qt_lt.qm %%NLS%%%%DATADIR%%/nls/qt_nl.qm %%NLS%%%%DATADIR%%/nls/qt_pl.qm %%NLS%%%%DATADIR%%/nls/qt_pt.qm %%NLS%%%%DATADIR%%/nls/qt_pt_BR.qm %%NLS%%%%DATADIR%%/nls/qt_ro.qm %%NLS%%%%DATADIR%%/nls/qt_ru.qm %%NLS%%%%DATADIR%%/nls/qt_sk.qm %%NLS%%%%DATADIR%%/nls/qt_sl.qm %%NLS%%%%DATADIR%%/nls/qt_sr.qm %%NLS%%%%DATADIR%%/nls/qt_sv.qm %%NLS%%%%DATADIR%%/nls/qt_th.qm %%NLS%%%%DATADIR%%/nls/qt_tr.qm %%NLS%%%%DATADIR%%/nls/qt_uk.qm %%NLS%%%%DATADIR%%/nls/qt_zh_CN.qm %%NLS%%%%DATADIR%%/nls/qt_zh_TW.qm %%DATADIR%%/samples/Makefile %%DATADIR%%/samples/tstVBoxAPIXPCOM.cpp %%WEBSERVICE%%%%DATADIR%%/sdk/bindings/webservice/vboxweb.wsdl %%PYTHON%%%%DATADIR%%/sdk/bindings/xpcom/python/xpcom diff --git a/emulators/virtualbox-ose-kmod-72/Makefile b/emulators/virtualbox-ose-kmod-72/Makefile index 75f20dc887fc..0990aebfbc08 100644 --- a/emulators/virtualbox-ose-kmod-72/Makefile +++ b/emulators/virtualbox-ose-kmod-72/Makefile @@ -1,115 +1,114 @@ PORTNAME= virtualbox-ose -DISTVERSION= 7.1.12 +DISTVERSION= 7.2.0 CATEGORIES= emulators MASTER_SITES= https://download.virtualbox.org/virtualbox/${DISTVERSION}/ -PKGNAMESUFFIX= -kmod-71 +PKGNAMESUFFIX= -kmod-72 DISTNAME= VirtualBox-${DISTVERSION} MAINTAINER= vbox@FreeBSD.org COMMENT= VirtualBox kernel module for FreeBSD WWW= https://www.virtualbox.org/ LICENSE= GPLv2 LICENSE_FILE= ${WRKSRC}/COPYING ONLY_FOR_ARCHS= amd64 BUILD_DEPENDS= kmk:devel/kBuild USES= cpe compiler:c++17-lang kmod tar:bzip2 CPE_VENDOR= oracle CPE_PRODUCT= vm_virtualbox USE_RC_SUBR= vboxnet 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-legacy \ virtualbox-ose-kmod \ - virtualbox-ose-kmod-70 \ - virtualbox-ose-kmod-72 + virtualbox-ose-kmod-70 -PATCHDIR= ${.CURDIR}/../${PORTNAME}-71/files -PORTSCOUT= limit:^7\.1\. +PATCHDIR= ${.CURDIR}/../${PORTNAME}-72/files +PORTSCOUT= limit:^7\.2\. SUB_FILES= pkg-message SUB_LIST= OPSYS=${OPSYS} OSREL=${OSREL} WRKSRC= ${WRKDIR}/VirtualBox-${DISTVERSION} OPTIONS_DEFINE= DEBUG INVARIANTS VIMAGE OPTIONS_DEFAULT= VIMAGE OPTIONS_SUB= yes DEBUG_DESC= Debug symbols, additional logs and assertions INVARIANTS_DESC= Use if kernel is compiled with INVARIANTS option VIMAGE_DESC= VIMAGE virtual networking support INVARIANTS_CFLAGS= -DINVARIANTS .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; s|which \$$\*|which \$$1|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-72/distinfo b/emulators/virtualbox-ose-kmod-72/distinfo index fb7394d7745c..c67534681918 100644 --- a/emulators/virtualbox-ose-kmod-72/distinfo +++ b/emulators/virtualbox-ose-kmod-72/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1752700000 -SHA256 (VirtualBox-7.1.12.tar.bz2) = 6f9618f39168898134975f51df7c2d6d5129c0aa82b6ae11cf47f920c70df276 -SIZE (VirtualBox-7.1.12.tar.bz2) = 214691769 +TIMESTAMP = 1755276527 +SHA256 (VirtualBox-7.2.0.tar.bz2) = 4f2804ff27848ea772aee6b637bb1e10ee74ec2da117c257413e2d2c4f670ba0 +SIZE (VirtualBox-7.2.0.tar.bz2) = 206755781 diff --git a/emulators/virtualbox-ose-nox11-72/Makefile b/emulators/virtualbox-ose-nox11-72/Makefile index bd1a0035d424..d415932ea096 100644 --- a/emulators/virtualbox-ose-nox11-72/Makefile +++ b/emulators/virtualbox-ose-nox11-72/Makefile @@ -1,11 +1,11 @@ PORTREVISION= 0 -PKGNAMESUFFIX= -nox11-71 +PKGNAMESUFFIX= -nox11-72 -MASTERDIR= ${.CURDIR}/../virtualbox-ose-71 +MASTERDIR= ${.CURDIR}/../virtualbox-ose-72 OPTIONS_EXCLUDE= ALSA DBUS DEBUG GUESTADDITIONS DOCS NLS OGG PULSEAUDIO \ QT6 VORBIS VPX X11 SLAVE_PORT= yes .include "${MASTERDIR}/Makefile"