VMMDevInterface.cpp revision 0db6a029780d9f9b347500e117320a8d5661efe5
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync * VBox frontends: Basic Frontend (BFE):
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync * Implementation of VMMDev: driver interface to VMM device
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync * Copyright (C) 2006-2010 Sun Microsystems, Inc.
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync * available from http://www.virtualbox.org. This file is free software;
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync * you can redistribute it and/or modify it under the terms of the GNU
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync * General Public License (GPL) as published by the Free Software
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync * Clara, CA 95054 USA or visit http://www.sun.com if you need
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync * additional information or have any questions.
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync * VMMDev driver instance data.
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync /** Pointer to the VMMDev object. */
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync /** Pointer to the driver instance structure. */
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync /** Pointer to the VMMDev port interface of the driver/device above us. */
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync /** Our VMM device connector interface. */
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync /** Pointer to the HGCM port interface of the driver/device above us. */
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync /** Our HGCM connector interface. */
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync/** Converts PDMIVMMDEVCONNECTOR pointer to a DRVMAINVMMDEV pointer. */
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync#define PDMIVMMDEVCONNECTOR_2_MAINVMMDEV(pInterface) ( (PDRVMAINVMMDEV) ((uintptr_t)pInterface - RT_OFFSETOF(DRVMAINVMMDEV, Connector)) )
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync/** Converts PDMIHGCMCONNECTOR pointer to a DRVMAINVMMDEV pointer. */
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync#define PDMIHGCMCONNECTOR_2_MAINVMMDEV(pInterface) ( (PDRVMAINVMMDEV) ((uintptr_t)pInterface - RT_OFFSETOF(DRVMAINVMMDEV, HGCMConnector)) )
03532efdc331b598d3dedc8cc7477641c3b0dd12vboxsync#endif /* VBOX_WITH_HGCM */
DECLCALLBACK(void) VMMDev::UpdateGuestVersion(PPDMIVMMDEVCONNECTOR pInterface, VBoxGuestInfo *guestInfo)
DECLCALLBACK(void) VMMDev::UpdateGuestCapabilities(PPDMIVMMDEVCONNECTOR pInterface, uint32_t newCapabilities)
DECLCALLBACK(void) VMMDev::UpdateMouseCapabilities(PPDMIVMMDEVCONNECTOR pInterface, uint32_t newCapabilities)
if (gMouse)
if (gConsole)
* This is called when the mouse pointer shape changes or pointer is hidden/displaying.
DECLCALLBACK(void) VMMDev::UpdatePointerShape(PPDMIVMMDEVCONNECTOR pInterface, bool fVisible, bool fAlpha,
void *pShape)
if (gConsole)
DECLCALLBACK(int) iface_VideoAccelEnable(PPDMIVMMDEVCONNECTOR pInterface, bool fEnable, VBVAMEMORY *pVbvaMemory)
if (gDisplay)
return VINF_SUCCESS;
if (gDisplay)
DECLCALLBACK(int) iface_SetVisibleRegion(PPDMIVMMDEVCONNECTOR pInterface, uint32_t cRect, PRTRECT pRect)
return VINF_SUCCESS;
DECLCALLBACK(int) iface_QueryVisibleRegion(PPDMIVMMDEVCONNECTOR pInterface, uint32_t *pcRect, PRTRECT pRect)
return VINF_SUCCESS;
DECLCALLBACK(int) VMMDev::VideoModeSupported(PPDMIVMMDEVCONNECTOR pInterface, uint32_t width, uint32_t height,
(void)pDrv;
if (!fSupported)
return VERR_INVALID_PARAMETER;
*fSupported = true;
return VINF_SUCCESS;
DECLCALLBACK(int) VMMDev::GetHeightReduction(PPDMIVMMDEVCONNECTOR pInterface, uint32_t *heightReduction)
(void)pDrv;
if (!heightReduction)
return VERR_INVALID_PARAMETER;
return VINF_SUCCESS;
#ifdef VBOX_WITH_HGCM
static DECLCALLBACK(int) iface_hgcmConnect (PPDMIHGCMCONNECTOR pInterface, PVBOXHGCMCMD pCmd, PHGCMSERVICELOCATION pServiceLocation, uint32_t *pu32ClientID)
if ( !pServiceLocation
return VERR_INVALID_PARAMETER;
static DECLCALLBACK(int) iface_hgcmDisconnect (PPDMIHGCMCONNECTOR pInterface, PVBOXHGCMCMD pCmd, uint32_t u32ClientID)
static DECLCALLBACK(int) iface_hgcmCall (PPDMIHGCMCONNECTOR pInterface, PVBOXHGCMCMD pCmd, uint32_t u32ClientID, uint32_t u32Function,
static DECLCALLBACK(int) iface_hgcmLoad(PPDMDRVINS pDrvIns, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass)
#ifdef VBOX_WITH_HGCM
PDMIBASE_RETURN_INTERFACE(pszIID, PDMIHGCMCONNECTOR, fActivateHGCM() ? &pDrv->HGCMConnector : NULL);
return NULL;
/*PDRVMAINVMMDEV pData = PDMINS_2_DATA(pDrvIns, PDRVMAINVMMDEV); - unused variables makes gcc bitch. */
#ifdef VBOX_WITH_HGCM
if (fActivateHGCM())
AssertMsgReturn(pData->pUpPort, ("Configuration error: No VMMDev port interface above!\n"), VERR_PDM_MISSING_INTERFACE_ABOVE);
#ifdef VBOX_WITH_HGCM
if (fActivateHGCM())
AssertMsgReturn(pData->pHGCMPort, ("Configuration error: No HGCM port interface above!\n"), VERR_PDM_MISSING_INTERFACE_ABOVE);
void *pv;
return rc;
#ifdef VBOX_WITH_HGCM
if (fActivateHGCM())
return rc;
return VINF_SUCCESS;
sizeof(DRVMAINVMMDEV),
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,