PDMAllQueue.cpp revision 3ec2b25f77f15eeb71c2ad7569854e5cce4280a3
/* $Id$ */
/** @file
* PDM Queue - Transport data and tasks to EMT and R3.
*/
/*
* Copyright (C) 2006-2007 Sun Microsystems, Inc.
*
* 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.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
* Clara, CA 95054 USA or visit http://www.sun.com if you need
* additional information or have any questions.
*/
/*******************************************************************************
* Header Files *
*******************************************************************************/
#define LOG_GROUP LOG_GROUP_PDM_QUEUE
#include "PDMInternal.h"
#ifndef IN_RC
#endif
/**
* Allocate an item from a queue.
* The allocated item must be handed on to PDMR3QueueInsert() after the
* data have been filled in.
*
* @returns Pointer to allocated queue item.
* @returns NULL on failure. The queue is exhausted.
* @param pQueue The queue handle.
* @thread Any thread.
*/
{
uint32_t i;
do
{
return NULL;
return pNew;
}
/**
* Queue an item.
* The item must have been obtained using PDMQueueAlloc(). Once the item
* have been passed to this function it must not be touched!
*
* @param pQueue The queue handle.
* @param pItem The item to insert.
* @thread Any thread.
*/
{
do
{
{
#ifdef IN_RING3
REMR3NotifyQueuePending(pVM); /** @todo r=bird: we can remove REMR3NotifyQueuePending and let VMR3NotifyFF do the work. */
#endif
}
}
/**
* Queue an item.
* The item must have been obtained using PDMQueueAlloc(). Once the item
* have been passed to this function it must not be touched!
*
* @param pQueue The queue handle.
* @param pItem The item to insert.
* @param NanoMaxDelay The maximum delay before processing the queue, in nanoseconds.
* This applies only to GC.
* @thread Any thread.
*/
{
#ifdef IN_RC
/** @todo figure out where to put this, the next bit should go there too.
if (NanoMaxDelay)
{
}
else */
{
Log2(("PDMQueueInsertEx: Setting VMCPU_FF_TO_R3\n"));
}
#endif
}
/**
* Gets the RC pointer for the specified queue.
*
* @returns The RC address of the queue.
* @returns NULL if pQueue is invalid.
* @param pQueue The queue handle.
*/
{
#ifdef IN_RC
return pQueue;
#else
#endif
}
/**
* Gets the ring-0 pointer for the specified queue.
*
* @returns The ring-0 address of the queue.
* @returns NULL if pQueue is invalid.
* @param pQueue The queue handle.
*/
{
#ifdef IN_RING0
return pQueue;
#else
#endif
}
/**
* Flushes a PDM queue.
*
* @param pQueue The queue handle.
*/
{
#else /* IN_RING3: */
VMR3ReqCall(pVM, VMCPUID_ANY, &pReq, RT_INDEFINITE_WAIT, (PFNRT)PDMR3QueueFlushWorker, 2, pVM, pQueue);
#endif
}