summaryrefslogtreecommitdiff
path: root/emulators/virtualbox-ose-70/files/patch-src-VBox-Additions-common-VBoxGuest-VBoxGuest-freebsd.c
diff options
context:
space:
mode:
authorVladimir Druzenko <vvd@FreeBSD.org>2025-02-03 02:19:31 +0300
committerVladimir Druzenko <vvd@FreeBSD.org>2025-02-03 02:19:31 +0300
commitf24fdd9f85160185dfe981a8bba587246e7db148 (patch)
treec2c4612ba9cdd16d6fb0e5ddd1a2bec18044082b /emulators/virtualbox-ose-70/files/patch-src-VBox-Additions-common-VBoxGuest-VBoxGuest-freebsd.c
parentemulators/virtualbox-ose{,-kmod,-nox11}-70: Repocopy from emulators/virtualbo... (diff)
emulators/virtualbox-ose{,-kmod,-nox11}-70: Add new ports VirtualBox 7.0.24
General status: * VirtualBox 7.1.x is still not fully ported to FreeBSD, so we are adding 7.0.x in experimental/test mode. * 7.0.x is being tested on hosts of several FreeBSD developers and users. * As far as we know, 7.0.x has the same system requirements as 6.1.x - amd64 with VT-x (we even tested it on Core 2 Duo E6xxx), so after confirming stability with more users, 7.0.x is expected to replace 6.1.x. * The following ports also need to be created for this replacement: - emulators/virtualbox-ose-additions-70; - emulators/virtualbox-ose-additions-nox11-70; - www/phpvirtualbox-70. * If 7.1.x has the same system requirements, then when we port 7.1.x, it will replace 7.0.x. This patch is a joint effort by several FreeBSD developers and users. Thanks to everyone involved! Changelog: https://www.virtualbox.org/wiki/Changelog-7.0 PR: 271146
Diffstat (limited to 'emulators/virtualbox-ose-70/files/patch-src-VBox-Additions-common-VBoxGuest-VBoxGuest-freebsd.c')
-rw-r--r--emulators/virtualbox-ose-70/files/patch-src-VBox-Additions-common-VBoxGuest-VBoxGuest-freebsd.c52
1 files changed, 23 insertions, 29 deletions
diff --git a/emulators/virtualbox-ose-70/files/patch-src-VBox-Additions-common-VBoxGuest-VBoxGuest-freebsd.c b/emulators/virtualbox-ose-70/files/patch-src-VBox-Additions-common-VBoxGuest-VBoxGuest-freebsd.c
index 8fd24bda91f1..e790f372f95f 100644
--- a/emulators/virtualbox-ose-70/files/patch-src-VBox-Additions-common-VBoxGuest-VBoxGuest-freebsd.c
+++ b/emulators/virtualbox-ose-70/files/patch-src-VBox-Additions-common-VBoxGuest-VBoxGuest-freebsd.c
@@ -1,6 +1,6 @@
---- src/VBox/Additions/common/VBoxGuest/VBoxGuest-freebsd.c.orig 2022-03-22 23:37:46 UTC
-+++ src/VBox/Additions/common/VBoxGuest/VBoxGuest-freebsd.c
-@@ -45,6 +45,7 @@
+--- 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
+@@ -55,6 +55,7 @@
#include <sys/uio.h>
#include <sys/bus.h>
#include <sys/poll.h>
@@ -8,7 +8,7 @@
#include <sys/selinfo.h>
#include <sys/queue.h>
#include <sys/lock.h>
-@@ -61,6 +62,7 @@
+@@ -71,6 +72,7 @@
#include <VBox/version.h>
#include <VBox/log.h>
#include <iprt/assert.h>
@@ -16,7 +16,7 @@
#include <iprt/initterm.h>
#include <iprt/process.h>
#include <iprt/string.h>
-@@ -102,8 +104,6 @@ struct VBoxGuestDeviceState
+@@ -112,8 +114,6 @@
struct resource *pIrqRes;
/** Pointer to the IRQ handler. */
void *pfnIrqHandler;
@@ -25,7 +25,7 @@
};
-@@ -113,8 +113,7 @@ struct VBoxGuestDeviceState
+@@ -123,8 +123,7 @@
/*
* Character device file handlers.
*/
@@ -35,7 +35,7 @@
static d_ioctl_t vgdrvFreeBSDIOCtl;
static int vgdrvFreeBSDIOCtlSlow(PVBOXGUESTSESSION pSession, u_long ulCmd, caddr_t pvData, struct thread *pTd);
static d_write_t vgdrvFreeBSDWrite;
-@@ -145,8 +144,7 @@ static struct cdevsw g_vgdrvFreeBSDChrDevSW =
+@@ -155,8 +154,7 @@
{
.d_version = D_VERSION,
.d_flags = D_TRACKCLOSE | D_NEEDMINOR,
@@ -45,7 +45,7 @@
.d_ioctl = vgdrvFreeBSDIOCtl,
.d_read = vgdrvFreeBSDRead,
.d_write = vgdrvFreeBSDWrite,
-@@ -154,81 +152,28 @@ static struct cdevsw g_vgdrvFreeBSDChrDevSW =
+@@ -164,81 +162,28 @@
.d_name = "vboxguest"
};
@@ -134,7 +134,7 @@
{
int rc;
PVBOXGUESTSESSION pSession;
-@@ -240,12 +185,6 @@ static int vgdrvFreeBSDOpen(struct cdev *pDev, int fOp
+@@ -250,12 +195,6 @@
LogFlow(("vgdrvFreeBSDOpen:\n"));
/*
@@ -147,7 +147,7 @@
* Create a new session.
*/
fRequestor = VMMDEV_REQUESTOR_USERMODE | VMMDEV_REQUESTOR_TRUST_NOT_GIVEN;
-@@ -262,14 +201,13 @@ static int vgdrvFreeBSDOpen(struct cdev *pDev, int fOp
+@@ -272,47 +211,20 @@
rc = VGDrvCommonCreateUserSession(&g_DevExt, fRequestor, &pSession);
if (RT_SUCCESS(rc))
{
@@ -168,10 +168,10 @@
}
LogRel(("vgdrvFreeBSDOpen: failed. rc=%d\n", rc));
-@@ -277,33 +215,6 @@ static int vgdrvFreeBSDOpen(struct cdev *pDev, int fOp
+ return RTErrConvertToErrno(rc);
}
- /**
+-/**
- * File close handler
- *
- */
@@ -179,11 +179,11 @@
-{
- 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 (VALID_PTR(pSession))
+- if (RT_VALID_PTR(pSession))
- {
- VGDrvCommonCloseSession(&g_DevExt, pSession);
- if (!ASMAtomicCmpXchgPtr(&pDev->si_drv1, NULL, pSession))
@@ -198,11 +198,10 @@
-}
-
-
--/**
+ /**
* I/O control request.
*
- * @returns depends...
-@@ -316,8 +227,12 @@ static int vgdrvFreeBSDIOCtl(struct cdev *pDev, u_long
+@@ -326,8 +238,12 @@
static int vgdrvFreeBSDIOCtl(struct cdev *pDev, u_long ulCmd, caddr_t pvData, int fFile, struct thread *pTd)
{
PVBOXGUESTSESSION pSession;
@@ -216,25 +215,20 @@
/*
* Deal with the fast ioctl path first.
*/
-@@ -512,12 +427,14 @@ static int vgdrvFreeBSDPoll(struct cdev *pDev, int fEv
-
- static int vgdrvFreeBSDPoll(struct cdev *pDev, int fEvents, struct thread *td)
- {
-- int fEventsProcessed;
-+ PVBOXGUESTSESSION pSession;
-+ int fEventsProcessed, rc;
+@@ -526,8 +442,10 @@
LogFlow(("vgdrvFreeBSDPoll: fEvents=%d\n", fEvents));
- PVBOXGUESTSESSION pSession = (PVBOXGUESTSESSION)pDev->si_drv1;
-- if (RT_UNLIKELY(!VALID_PTR(pSession))) {
+- 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));
}
-@@ -558,11 +475,8 @@ static int vgdrvFreeBSDDetach(device_t pDevice)
+@@ -568,11 +486,8 @@
/*
* Reverse what we did in vgdrvFreeBSDAttach.
*/
@@ -247,7 +241,7 @@
vgdrvFreeBSDRemoveIRQ(pDevice, pState);
if (pState->pVMMDevMemRes)
-@@ -727,18 +641,21 @@ static int vgdrvFreeBSDAttach(device_t pDevice)
+@@ -737,18 +652,21 @@
VGDrvCommonProcessOptionsFromHost(&g_DevExt);
/*
@@ -275,7 +269,7 @@
vgdrvFreeBSDRemoveIRQ(pDevice, pState);
}
else
-@@ -782,8 +699,12 @@ static driver_t vgdrvFreeBSDDriver =
+@@ -792,8 +710,12 @@
sizeof(struct VBoxGuestDeviceState),
};