VBoxMPShgsmi.cpp revision e6ad2e18e663b076aeabfec994947514566a7acc
/* $Id$ */
/** @file
* VBox WDDM Miniport driver
*/
/*
* Copyright (C) 2011 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* 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.
*/
#include "VBoxMPWddm.h"
#include <iprt/semaphore.h>
/* SHGSMI */
{
}
{
}
{
if(!cRefs)
}
DECLCALLBACK(void) vboxSHGSMICompletionSetEvent(struct _HGSMIHEAP * pHeap, void *pvCmd, void *pvContext)
{
}
DECLCALLBACK(void) vboxSHGSMICompletionCommandRelease(struct _HGSMIHEAP * pHeap, void *pvCmd, void *pvContext)
{
}
/* do not wait for completion */
DECLINLINE(const VBOXSHGSMIHEADER*) vboxSHGSMICommandPrepAsynch (struct _HGSMIHEAP * pHeap, PVBOXSHGSMIHEADER pHeader)
{
/* ensure the command is not removed until we're processing it */
return pHeader;
}
DECLINLINE(void) vboxSHGSMICommandDoneAsynch (struct _HGSMIHEAP * pHeap, const VBOXSHGSMIHEADER* pHeader)
{
{
if (pfnCompletion)
}
}
const VBOXSHGSMIHEADER* VBoxSHGSMICommandPrepAsynchEvent (struct _HGSMIHEAP * pHeap, PVOID pvBuff, RTSEMEVENT hEventSem)
{
}
{
if (RT_SUCCESS(rc))
{
}
return NULL;
}
{
}
{
if (RT_SUCCESS(rc))
return rc;
}
{
}
{
}
const VBOXSHGSMIHEADER* VBoxSHGSMICommandPrepAsynch (struct _HGSMIHEAP * pHeap, PVOID pvBuff, PFNVBOXSHGSMICMDCOMPLETION pfnCompletion, PVOID pvCompletion, uint32_t fFlags)
{
}
const VBOXSHGSMIHEADER* VBoxSHGSMICommandPrepAsynchIrq (struct _HGSMIHEAP * pHeap, PVOID pvBuff, PFNVBOXSHGSMICMDCOMPLETION_IRQ pfnCompletion, PVOID pvCompletion, uint32_t fFlags)
{
/* we must assign rather than or because flags field does not get zeroed on command creation */
}
void* VBoxSHGSMICommandAlloc (struct _HGSMIHEAP * pHeap, HGSMISIZE cbData, uint8_t u8Channel, uint16_t u16ChannelInfo)
{
/* Issue the flush command. */
PVBOXSHGSMIHEADER pHeader = (PVBOXSHGSMIHEADER)HGSMIHeapAlloc (pHeap, cbData + sizeof (VBOXSHGSMIHEADER), u8Channel, u16ChannelInfo);
if (pHeader)
{
return VBoxSHGSMIBufferData(pHeader);
}
return NULL;
}
{
}
//int VBoxSHGSMISetup (PVBOXSHGSMIHEAP pHeap,
// void *pvBase,
// HGSMISIZE cbArea,
// HGSMIOFFSET offBase,
// bool fOffsetBased,
// PFNVBOXSHGSMINOTIFYHOST pfnNotifyHost,
// PFNVBOXSHGSMINOTIFYHOST pvNotifyHost)
//{
// /* Setup a HGSMI heap within the adapter information area. */
// return HGSMIHeapSetup (&pHeap->Heap,
// pvBuffer,
// cbBuffer,
// offBuffer,
// false /*fOffsetBased*/);
//}
//
//int VBoxSHGSMIDestroy (PVBOXSHGSMIHEAP pHeap)
//{
// HGSMIHeapDestroy (pHeap);
// return VINF_SUCCESS;
//}
#define VBOXSHGSMI_LISTENTRY2CMD(_pEntry) ( (PVBOXSHGSMIHEADER)((uint8_t *)(_pEntry) - RT_OFFSETOF(VBOXSHGSMIHEADER, pvNext)) )
int VBoxSHGSMICommandProcessCompletion (struct _HGSMIHEAP * pHeap, VBOXSHGSMIHEADER* pCur, bool bIrq, PVBOXVTLIST pPostProcessList)
{
int rc = VINF_SUCCESS;
do
{
{
void *pvCompletion;
if (pfnCompletion)
{
}
else
{
/* nothing to do with this command */
break;
}
}
if (!bIrq)
{
}
else
} while (0);
return rc;
}
int VBoxSHGSMICommandPostprocessCompletion (struct _HGSMIHEAP * pHeap, PVBOXVTLIST pPostProcessList)
{
{
/* need to save next since the command may be released in a pfnCallback and thus its data might be invalid */
}
return VINF_SUCCESS;
}