PDMR0Device.cpp revision c50100d1513854735d4e3593b3b385c007f6d8b6
c97989161fbe75bc14cea477a5443bbf474dd3advboxsync * PDM - Pluggable Device and Driver Manager, R0 Device parts.
c97989161fbe75bc14cea477a5443bbf474dd3advboxsync * Copyright (C) 2006-2007 Sun Microsystems, Inc.
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync * available from http://www.virtualbox.org. This file is free software;
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync * you can redistribute it and/or modify it under the terms of the GNU
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync * General Public License (GPL) as published by the Free Software
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
cf57145d4697dceca3f0542b370c20f7a2c5c6e8vboxsync * Clara, CA 95054 USA or visit http://www.sun.com if you need
cf57145d4697dceca3f0542b370c20f7a2c5c6e8vboxsync * additional information or have any questions.
881b5ff6bc55e1fb0f4ef42f9782ccec79c0a138vboxsync/*******************************************************************************
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync* Header Files *
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync*******************************************************************************/
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync/*******************************************************************************
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync* Defined Constants And Macros *
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync*******************************************************************************/
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync/** @def PDMDEV_ASSERT_DEVINS
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync * Asserts the validity of the driver instance.
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync# define PDMDEV_ASSERT_DEVINS(pDevIns) do { Assert(VALID_PTR(pDevIns)); \
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync Assert(pDevIns->u32Version == PDM_DEVINS_VERSION); \
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync Assert(pDevIns->pvInstanceDataR0 == (void *)&pDevIns->achInstanceData[0]); \
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync } while (0)
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync# define PDMDEV_ASSERT_DEVINS(pDevIns) do { } while (0)
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync/*******************************************************************************
c5d2523548cc57504b829f53f1362b848a84542cvboxsync* Global Variables *
c5d2523548cc57504b829f53f1362b848a84542cvboxsync*******************************************************************************/
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsyncextern DECLEXPORT(const PDMAPICHLPR0) g_pdmR0ApicHlp;
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsyncextern DECLEXPORT(const PDMIOAPICHLPR0) g_pdmR0IoApicHlp;
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync/*******************************************************************************
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync* Internal Functions *
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync*******************************************************************************/
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync/** @name GC Device Helpers
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsyncstatic DECLCALLBACK(void) pdmR0DevHlp_PCISetIrq(PPDMDEVINS pDevIns, int iIrq, int iLevel);
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsyncstatic DECLCALLBACK(void) pdmR0DevHlp_ISASetIrq(PPDMDEVINS pDevIns, int iIrq, int iLevel);
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsyncstatic DECLCALLBACK(void) pdmR0DevHlp_PhysRead(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, void *pvBuf, size_t cbRead);
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsyncstatic DECLCALLBACK(void) pdmR0DevHlp_PhysWrite(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, const void *pvBuf, size_t cbWrite);
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsyncstatic DECLCALLBACK(bool) pdmR0DevHlp_A20IsEnabled(PPDMDEVINS pDevIns);
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsyncstatic DECLCALLBACK(int) pdmR0DevHlp_VMSetError(PPDMDEVINS pDevIns, int rc, RT_SRC_POS_DECL, const char *pszFormat, ...);
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsyncstatic DECLCALLBACK(int) pdmR0DevHlp_VMSetErrorV(PPDMDEVINS pDevIns, int rc, RT_SRC_POS_DECL, const char *pszFormat, va_list va);
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsyncstatic DECLCALLBACK(int) pdmR0DevHlp_VMSetRuntimeError(PPDMDEVINS pDevIns, bool fFatal, const char *pszErrorID, const char *pszFormat, ...);
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsyncstatic DECLCALLBACK(int) pdmR0DevHlp_VMSetRuntimeErrorV(PPDMDEVINS pDevIns, bool fFatal, const char *pszErrorID, const char *pszFormat, va_list va);
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsyncstatic DECLCALLBACK(int) pdmR0DevHlp_PATMSetMMIOPatchInfo(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, RTGCPTR pCachedData);
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync/** @name PIC GC Helpers
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsyncstatic DECLCALLBACK(void) pdmR0PicHlp_SetInterruptFF(PPDMDEVINS pDevIns);
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsyncstatic DECLCALLBACK(void) pdmR0PicHlp_ClearInterruptFF(PPDMDEVINS pDevIns);
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsyncstatic DECLCALLBACK(int) pdmR0PicHlp_Lock(PPDMDEVINS pDevIns, int rc);
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsyncstatic DECLCALLBACK(void) pdmR0PicHlp_Unlock(PPDMDEVINS pDevIns);
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync/** @name APIC GC Helpers
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsyncstatic DECLCALLBACK(void) pdmR0ApicHlp_SetInterruptFF(PPDMDEVINS pDevIns, VMCPUID idCpu);
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsyncstatic DECLCALLBACK(void) pdmR0ApicHlp_ClearInterruptFF(PPDMDEVINS pDevIns, VMCPUID idCpu);
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsyncstatic DECLCALLBACK(void) pdmR0ApicHlp_ChangeFeature(PPDMDEVINS pDevIns, PDMAPICVERSION enmVersion);
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsyncstatic DECLCALLBACK(int) pdmR0ApicHlp_Lock(PPDMDEVINS pDevIns, int rc);
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsyncstatic DECLCALLBACK(void) pdmR0ApicHlp_Unlock(PPDMDEVINS pDevIns);
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsyncstatic DECLCALLBACK(VMCPUID) pdmR0ApicHlp_GetCpuId(PPDMDEVINS pDevIns);
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync/** @name I/O APIC GC Helpers
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsyncstatic DECLCALLBACK(void) pdmR0IoApicHlp_ApicBusDeliver(PPDMDEVINS pDevIns, uint8_t u8Dest, uint8_t u8DestMode, uint8_t u8DeliveryMode,
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync uint8_t iVector, uint8_t u8Polarity, uint8_t u8TriggerMode);
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsyncstatic DECLCALLBACK(int) pdmR0IoApicHlp_Lock(PPDMDEVINS pDevIns, int rc);
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsyncstatic DECLCALLBACK(void) pdmR0IoApicHlp_Unlock(PPDMDEVINS pDevIns);
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync/** @name PCI Bus GC Helpers
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsyncstatic DECLCALLBACK(void) pdmR0PciHlp_IsaSetIrq(PPDMDEVINS pDevIns, int iIrq, int iLevel);
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsyncstatic DECLCALLBACK(void) pdmR0PciHlp_IoApicSetIrq(PPDMDEVINS pDevIns, int iIrq, int iLevel);
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsyncstatic DECLCALLBACK(int) pdmR0PciHlp_Lock(PPDMDEVINS pDevIns, int rc);
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsyncstatic DECLCALLBACK(void) pdmR0PciHlp_Unlock(PPDMDEVINS pDevIns);
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsyncstatic void pdmR0IsaSetIrq(PVM pVM, int iIrq, int iLevel);
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsyncstatic void pdmR0IoApicSetIrq(PVM pVM, int iIrq, int iLevel);
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync * The Guest Context Device Helper Callbacks.
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsyncextern DECLEXPORT(const PDMDEVHLPR0) g_pdmR0DevHlp =
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync * The Guest Context PIC Helper Callbacks.
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsyncextern DECLEXPORT(const PDMPICHLPR0) g_pdmR0PicHlp =
c5d2523548cc57504b829f53f1362b848a84542cvboxsync * The Guest Context APIC Helper Callbacks.
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsyncextern DECLEXPORT(const PDMAPICHLPR0) g_pdmR0ApicHlp =
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync * The Guest Context I/O APIC Helper Callbacks.
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsyncextern DECLEXPORT(const PDMIOAPICHLPR0) g_pdmR0IoApicHlp =
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync * The Guest Context PCI Bus Helper Callbacks.
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsyncextern DECLEXPORT(const PDMPCIHLPR0) g_pdmR0PciHlp =
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync/** @copydoc PDMDEVHLPR0::pfnPCISetIrq */
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsyncstatic DECLCALLBACK(void) pdmR0DevHlp_PCISetIrq(PPDMDEVINS pDevIns, int iIrq, int iLevel)
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync LogFlow(("pdmR0DevHlp_PCISetIrq: caller=%p/%d: iIrq=%d iLevel=%d\n", pDevIns, pDevIns->iInstance, iIrq, iLevel));
fa7c9928985ad8dc74ae6931809083c2af135250vboxsync PPCIDEVICE pPciDev = pDevIns->Internal.s.pPciDeviceR0;
fa7c9928985ad8dc74ae6931809083c2af135250vboxsync PPDMPCIBUS pPciBus = pDevIns->Internal.s.pPciBusR0;
fa7c9928985ad8dc74ae6931809083c2af135250vboxsync pPciBus->pfnSetIrqR0(pPciBus->pDevInsR0, pPciDev, iIrq, iLevel);
fa7c9928985ad8dc74ae6931809083c2af135250vboxsync /* queue for ring-3 execution. */
fa7c9928985ad8dc74ae6931809083c2af135250vboxsync PPDMDEVHLPTASK pTask = (PPDMDEVHLPTASK)PDMQueueAlloc(pVM->pdm.s.pDevHlpQueueHC);
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync PDMQueueInsertEx(pVM->pdm.s.pDevHlpQueueHC, &pTask->Core, 0);
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync AssertMsgFailed(("We're out of devhlp queue items!!!\n"));
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync LogFlow(("pdmR0DevHlp_PCISetIrq: caller=%p/%d: returns void\n", pDevIns, pDevIns->iInstance));
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync/** @copydoc PDMDEVHLPR0::pfnPCISetIrq */
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsyncstatic DECLCALLBACK(void) pdmR0DevHlp_ISASetIrq(PPDMDEVINS pDevIns, int iIrq, int iLevel)
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync LogFlow(("pdmR0DevHlp_ISASetIrq: caller=%p/%d: iIrq=%d iLevel=%d\n", pDevIns, pDevIns->iInstance, iIrq, iLevel));
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync pdmR0IsaSetIrq(pDevIns->Internal.s.pVMR0, iIrq, iLevel);
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync LogFlow(("pdmR0DevHlp_ISASetIrq: caller=%p/%d: returns void\n", pDevIns, pDevIns->iInstance));
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync/** @copydoc PDMDEVHLPR0::pfnPhysRead */
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsyncstatic DECLCALLBACK(void) pdmR0DevHlp_PhysRead(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, void *pvBuf, size_t cbRead)
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync LogFlow(("pdmR0DevHlp_PhysRead: caller=%p/%d: GCPhys=%VGp pvBuf=%p cbRead=%#x\n",
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync pDevIns, pDevIns->iInstance, GCPhys, pvBuf, cbRead));
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync PGMPhysRead(pDevIns->Internal.s.pVMR0, GCPhys, pvBuf, cbRead);
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync Log(("pdmR0DevHlp_PhysRead: caller=%p/%d: returns void\n", pDevIns, pDevIns->iInstance));
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync/** @copydoc PDMDEVHLPR0::pfnPhysWrite */
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsyncstatic DECLCALLBACK(void) pdmR0DevHlp_PhysWrite(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, const void *pvBuf, size_t cbWrite)
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync LogFlow(("pdmR0DevHlp_PhysWrite: caller=%p/%d: GCPhys=%VGp pvBuf=%p cbWrite=%#x\n",
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync pDevIns, pDevIns->iInstance, GCPhys, pvBuf, cbWrite));
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync PGMPhysWrite(pDevIns->Internal.s.pVMR0, GCPhys, pvBuf, cbWrite);
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync Log(("pdmR0DevHlp_PhysWrite: caller=%p/%d: returns void\n", pDevIns, pDevIns->iInstance));
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync/** @copydoc PDMDEVHLPR0::pfnA20IsEnabled */
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsyncstatic DECLCALLBACK(bool) pdmR0DevHlp_A20IsEnabled(PPDMDEVINS pDevIns)
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync LogFlow(("pdmR0DevHlp_A20IsEnabled: caller=%p/%d:\n", pDevIns, pDevIns->iInstance));
fa7c9928985ad8dc74ae6931809083c2af135250vboxsync bool fEnabled = PGMPhysIsA20Enabled(pDevIns->Internal.s.pVMR0);
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync Log(("pdmR0DevHlp_A20IsEnabled: caller=%p/%d: returns %RTbool\n", pDevIns, pDevIns->iInstance, fEnabled));
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync/** @copydoc PDMDEVHLPR0::pfnVMSetError */
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsyncstatic DECLCALLBACK(int) pdmR0DevHlp_VMSetError(PPDMDEVINS pDevIns, int rc, RT_SRC_POS_DECL, const char *pszFormat, ...)
c5d2523548cc57504b829f53f1362b848a84542cvboxsync int rc2 = VMSetErrorV(pDevIns->Internal.s.pVMR0, rc, RT_SRC_POS_ARGS, pszFormat, args); Assert(rc2 == rc); NOREF(rc2);
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync/** @copydoc PDMDEVHLPR0::pfnVMSetErrorV */
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsyncstatic DECLCALLBACK(int) pdmR0DevHlp_VMSetErrorV(PPDMDEVINS pDevIns, int rc, RT_SRC_POS_DECL, const char *pszFormat, va_list va)
c5d2523548cc57504b829f53f1362b848a84542cvboxsync int rc2 = VMSetErrorV(pDevIns->Internal.s.pVMR0, rc, RT_SRC_POS_ARGS, pszFormat, va); Assert(rc2 == rc); NOREF(rc2);
c5d2523548cc57504b829f53f1362b848a84542cvboxsync/** @copydoc PDMDEVHLPR0::pfnVMSetRuntimeError */
c5d2523548cc57504b829f53f1362b848a84542cvboxsyncstatic DECLCALLBACK(int) pdmR0DevHlp_VMSetRuntimeError(PPDMDEVINS pDevIns, bool fFatal, const char *pszErrorID, const char *pszFormat, ...)
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync int rc = VMSetRuntimeErrorV(pDevIns->Internal.s.pVMR0, fFatal, pszErrorID, pszFormat, args);
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync/** @copydoc PDMDEVHLPR0::pfnVMSetRuntimeErrorV */
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsyncstatic DECLCALLBACK(int) pdmR0DevHlp_VMSetRuntimeErrorV(PPDMDEVINS pDevIns, bool fFatal, const char *pszErrorID, const char *pszFormat, va_list va)
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync int rc = VMSetRuntimeErrorV(pDevIns->Internal.s.pVMR0, fFatal, pszErrorID, pszFormat, va);
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync/** @copydoc PDMDEVHLPR0::pdmR0DevHlp_PATMSetMMIOPatchInfo*/
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsyncstatic DECLCALLBACK(int) pdmR0DevHlp_PATMSetMMIOPatchInfo(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, RTGCPTR pCachedData)
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync LogFlow(("pdmR0DevHlp_PATMSetMMIOPatchInfo: caller=%p/%d:\n", pDevIns, pDevIns->iInstance));
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync/* return PATMSetMMIOPatchInfo(pDevIns->Internal.s.pVMR0, GCPhys, pCachedData); */
c5d2523548cc57504b829f53f1362b848a84542cvboxsync/** @copydoc PDMPICHLPR0::pfnSetInterruptFF */
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsyncstatic DECLCALLBACK(void) pdmR0PicHlp_SetInterruptFF(PPDMDEVINS pDevIns)
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync LogFlow(("pdmR0PicHlp_SetInterruptFF: caller=%p/%d: VM_FF_INTERRUPT_PIC %d -> 1\n",
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync pDevIns, pDevIns->iInstance, VMCPU_FF_ISSET(pDevIns->Internal.s.pVMR0, 0, VM_FF_INTERRUPT_PIC)));
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync /* for PIC we always deliver to CPU 0, MP use APIC */
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync VMCPU_FF_SET(pDevIns->Internal.s.pVMR0, 0, VM_FF_INTERRUPT_PIC);
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync/** @copydoc PDMPICHLPR0::pfnClearInterruptFF */
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsyncstatic DECLCALLBACK(void) pdmR0PicHlp_ClearInterruptFF(PPDMDEVINS pDevIns)
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync LogFlow(("pdmR0PicHlp_ClearInterruptFF: caller=%p/%d: VM_FF_INTERRUPT_PIC %d -> 0\n",
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync pDevIns, pDevIns->iInstance, VMCPU_FF_ISSET(pDevIns->Internal.s.pVMR0, 0, VM_FF_INTERRUPT_PIC)));
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync /* for PIC we always deliver to CPU 0, MP use APIC */
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync VMCPU_FF_CLEAR(pDevIns->Internal.s.pVMR0, 0, VM_FF_INTERRUPT_PIC);
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync/** @copydoc PDMPICHLPR0::pfnLock */
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsyncstatic DECLCALLBACK(int) pdmR0PicHlp_Lock(PPDMDEVINS pDevIns, int rc)
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync/** @copydoc PDMPICHLPR0::pfnUnlock */
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsyncstatic DECLCALLBACK(void) pdmR0PicHlp_Unlock(PPDMDEVINS pDevIns)
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync/** @copydoc PDMAPICHLPR0::pfnSetInterruptFF */
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsyncstatic DECLCALLBACK(void) pdmR0ApicHlp_SetInterruptFF(PPDMDEVINS pDevIns, VMCPUID idCpu)
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync LogFlow(("pdmR0ApicHlp_SetInterruptFF: caller=%p/%d: VM_FF_INTERRUPT %d -> 1\n",
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync pDevIns, pDevIns->iInstance, VMCPU_FF_ISSET(pDevIns->Internal.s.pVMR0, idCpu, VM_FF_INTERRUPT_APIC)));
b4f03aea544c9a58d8959658b31f7bd716a3f097vboxsync VMCPU_FF_SET(pDevIns->Internal.s.pVMR0, idCpu, VM_FF_INTERRUPT_APIC);
pDevIns, pDevIns->iInstance, VMCPU_FF_ISSET(pDevIns->Internal.s.pVMR0, idCpu, VM_FF_INTERRUPT_APIC)));
LogFlow(("pdmR0ApicHlp_ChangeFeature: caller=%p/%d: version=%d\n", pDevIns, pDevIns->iInstance, (int)enmVersion));
switch (enmVersion)
case PDMAPICVERSION_NONE:
case PDMAPICVERSION_APIC:
case PDMAPICVERSION_X2APIC:
static DECLCALLBACK(void) pdmR0IoApicHlp_ApicBusDeliver(PPDMDEVINS pDevIns, uint8_t u8Dest, uint8_t u8DestMode, uint8_t u8DeliveryMode,
LogFlow(("pdmR0IoApicHlp_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.pfnBusDeliverR0(pVM->pdm.s.Apic.pDevInsR0, u8Dest, u8DestMode, u8DeliveryMode, iVector, u8Polarity, u8TriggerMode);
if (pTask)
if (pTask)