PDMGCDevice.cpp revision 73dfebace7e93189b94f88808326284834d15b7d
/* $Id$ */
/** @file
* PDM - Pluggable Device and Driver Manager, GC Device parts.
*/
/*
* 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_DEVICE
#include "PDMInternal.h"
/*******************************************************************************
* Defined Constants And Macros *
*******************************************************************************/
/** @def PDMDEV_ASSERT_DEVINS
* Asserts the validity of the driver instance.
*/
#ifdef VBOX_STRICT
} while (0)
#else
# define PDMDEV_ASSERT_DEVINS(pDevIns) do { } while (0)
#endif
/*******************************************************************************
* Global Variables *
*******************************************************************************/
/*******************************************************************************
* Internal Functions *
*******************************************************************************/
/** @name GC Device Helpers
* @{
*/
static DECLCALLBACK(void) pdmGCDevHlp_PhysRead(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, void *pvBuf, size_t cbRead);
static DECLCALLBACK(void) pdmGCDevHlp_PhysWrite(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, const void *pvBuf, size_t cbWrite);
static DECLCALLBACK(int) pdmGCDevHlp_VMSetError(PPDMDEVINS pDevIns, int rc, RT_SRC_POS_DECL, const char *pszFormat, ...);
static DECLCALLBACK(int) pdmGCDevHlp_VMSetErrorV(PPDMDEVINS pDevIns, int rc, RT_SRC_POS_DECL, const char *pszFormat, va_list va);
static DECLCALLBACK(int) pdmGCDevHlp_VMSetRuntimeError(PPDMDEVINS pDevIns, bool fFatal, const char *pszErrorID, const char *pszFormat, ...);
static DECLCALLBACK(int) pdmGCDevHlp_VMSetRuntimeErrorV(PPDMDEVINS pDevIns, bool fFatal, const char *pszErrorID, const char *pszFormat, va_list va);
static DECLCALLBACK(int) pdmGCDevHlp_PATMSetMMIOPatchInfo(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, RTGCPTR pCachedData);
/** @} */
/** @name PIC GC Helpers
* @{
*/
/** @} */
/** @name APIC RC Helpers
* @{
*/
/** @} */
/** @name I/O APIC RC Helpers
* @{
*/
static DECLCALLBACK(void) pdmRCIoApicHlp_ApicBusDeliver(PPDMDEVINS pDevIns, uint8_t u8Dest, uint8_t u8DestMode, uint8_t u8DeliveryMode,
/** @} */
/** @name PCI Bus RC Helpers
* @{
*/
/** @} */
/**
* The Guest Context Device Helper Callbacks.
*/
{
};
/**
* The Raw-Mode Context PIC Helper Callbacks.
*/
{
};
/**
* The Raw-Mode Context APIC Helper Callbacks.
*/
{
};
/**
* The Raw-Mode Context I/O APIC Helper Callbacks.
*/
{
};
/**
* The Raw-Mode Context PCI Bus Helper Callbacks.
*/
{
PDM_PCIHLPRC_VERSION, /* the end */
};
/** @copydoc PDMDEVHLPGC::pfnPCISetIrq */
{
LogFlow(("pdmGCDevHlp_PCISetIrq: caller=%p/%d: iIrq=%d iLevel=%d\n", pDevIns, pDevIns->iInstance, iIrq, iLevel));
if ( pPciDev
&& pPciBus
{
}
else
{
/* queue for ring-3 execution. */
if (pTask)
{
}
else
AssertMsgFailed(("We're out of devhlp queue items!!!\n"));
}
}
/** @copydoc PDMDEVHLPGC::pfnPCISetIrq */
{
LogFlow(("pdmGCDevHlp_ISASetIrq: caller=%p/%d: iIrq=%d iLevel=%d\n", pDevIns, pDevIns->iInstance, iIrq, iLevel));
}
/** @copydoc PDMDEVHLPGC::pfnPhysRead */
static DECLCALLBACK(void) pdmGCDevHlp_PhysRead(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, void *pvBuf, size_t cbRead)
{
LogFlow(("pdmGCDevHlp_PhysRead: caller=%p/%d: GCPhys=%VGp pvBuf=%p cbRead=%#x\n",
}
/** @copydoc PDMDEVHLPGC::pfnPhysWrite */
static DECLCALLBACK(void) pdmGCDevHlp_PhysWrite(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, const void *pvBuf, size_t cbWrite)
{
LogFlow(("pdmGCDevHlp_PhysWrite: caller=%p/%d: GCPhys=%VGp pvBuf=%p cbWrite=%#x\n",
}
/** @copydoc PDMDEVHLPGC::pfnA20IsEnabled */
{
Log(("pdmGCDevHlp_A20IsEnabled: caller=%p/%d: returns %RTbool\n", pDevIns, pDevIns->iInstance, fEnabled));
return fEnabled;
}
/** @copydoc PDMDEVHLPGC::pfnVMSetError */
static DECLCALLBACK(int) pdmGCDevHlp_VMSetError(PPDMDEVINS pDevIns, int rc, RT_SRC_POS_DECL, const char *pszFormat, ...)
{
int rc2 = VMSetErrorV(pDevIns->Internal.s.pVMGC, rc, RT_SRC_POS_ARGS, pszFormat, args); Assert(rc2 == rc); NOREF(rc2);
return rc;
}
/** @copydoc PDMDEVHLPGC::pfnVMSetErrorV */
static DECLCALLBACK(int) pdmGCDevHlp_VMSetErrorV(PPDMDEVINS pDevIns, int rc, RT_SRC_POS_DECL, const char *pszFormat, va_list va)
{
int rc2 = VMSetErrorV(pDevIns->Internal.s.pVMGC, rc, RT_SRC_POS_ARGS, pszFormat, va); Assert(rc2 == rc); NOREF(rc2);
return rc;
}
/** @copydoc PDMDEVHLPGC::pfnVMSetRuntimeError */
static DECLCALLBACK(int) pdmGCDevHlp_VMSetRuntimeError(PPDMDEVINS pDevIns, bool fFatal, const char *pszErrorID, const char *pszFormat, ...)
{
return rc;
}
/** @copydoc PDMDEVHLPGC::pfnVMSetErrorV */
static DECLCALLBACK(int) pdmGCDevHlp_VMSetRuntimeErrorV(PPDMDEVINS pDevIns, bool fFatal, const char *pszErrorID, const char *pszFormat, va_list va)
{
return rc;
}
/** @copydoc PDMDEVHLPGC::pdmGCDevHlp_PATMSetMMIOPatchInfo */
static DECLCALLBACK(int) pdmGCDevHlp_PATMSetMMIOPatchInfo(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, RTGCPTR pCachedData)
{
}
/** @copydoc PDMPICHLPGC::pfnSetInterruptFF */
{
LogFlow(("pdmRCPicHlp_SetInterruptFF: caller=%p/%d: VM_FF_INTERRUPT_PIC %d -> 1\n",
}
/** @copydoc PDMPICHLPGC::pfnClearInterruptFF */
{
LogFlow(("pdmRCPicHlp_ClearInterruptFF: caller=%p/%d: VM_FF_INTERRUPT_PIC %d -> 0\n",
}
/** @copydoc PDMPICHLPGC::pfnLock */
{
}
/** @copydoc PDMPICHLPGC::pfnUnlock */
{
}
/** @copydoc PDMAPICHLPGC::pfnSetInterruptFF */
{
LogFlow(("pdmRCApicHlp_SetInterruptFF: caller=%p/%d: VM_FF_INTERRUPT %d -> 1\n",
}
/** @copydoc PDMAPICHLPGC::pfnClearInterruptFF */
{
LogFlow(("pdmRCApicHlp_ClearInterruptFF: caller=%p/%d: VM_FF_INTERRUPT %d -> 0\n",
}
/** @copydoc PDMAPICHLPGC::pfnChangeFeature */
{
LogFlow(("pdmRCApicHlp_ChangeFeature: caller=%p/%d: fEnabled=%RTbool\n", pDevIns, pDevIns->iInstance, fEnabled));
if (fEnabled)
else
}
/** @copydoc PDMAPICHLPGC::pfnLock */
{
}
/** @copydoc PDMAPICHLPGC::pfnUnlock */
{
}
/** @copydoc PDMIOAPICHLPGC::pfnApicBusDeliver */
static DECLCALLBACK(void) pdmRCIoApicHlp_ApicBusDeliver(PPDMDEVINS pDevIns, uint8_t u8Dest, uint8_t u8DestMode, uint8_t u8DeliveryMode,
{
LogFlow(("pdmRCIoApicHlp_ApicBusDeliver: caller=%p/%d: u8Dest=%RX8 u8DestMode=%RX8 u8DeliveryMode=%RX8 iVector=%RX8 u8Polarity=%RX8 u8TriggerMode=%RX8\n",
pDevIns, pDevIns->iInstance, u8Dest, u8DestMode, u8DeliveryMode, iVector, u8Polarity, u8TriggerMode));
pVM->pdm.s.Apic.pfnBusDeliverRC(pVM->pdm.s.Apic.pDevInsRC, u8Dest, u8DestMode, u8DeliveryMode, iVector, u8Polarity, u8TriggerMode);
}
/** @copydoc PDMIOAPICHLPGC::pfnLock */
{
}
/** @copydoc PDMIOAPICHLPGC::pfnUnlock */
{
}
/** @copydoc PDMPCIHLPGC::pfnIsaSetIrq */
{
}
/** @copydoc PDMPCIHLPGC::pfnIoApicSetIrq */
{
}
/** @copydoc PDMPCIHLPGC::pfnLock */
{
}
/** @copydoc PDMPCIHLPGC::pfnUnlock */
{
}
/**
* Sets an irq on the I/O APIC.
*
* @param pVM The VM handle.
* @param iIrq The irq.
* @param iLevel The new level.
*/
{
{
}
else
{
/* queue for ring-3 execution. */
if (pTask)
{
}
else
AssertMsgFailed(("We're out of devhlp queue items!!!\n"));
}
}
/**
* Sets an irq on the I/O APIC.
*
* @param pVM The VM handle.
* @param iIrq The irq.
* @param iLevel The new level.
*/
{
{
}
{
/* queue for ring-3 execution. */
if (pTask)
{
}
else
AssertMsgFailed(("We're out of devhlp queue items!!!\n"));
}
}