VirtualBox

Changeset 68470 in vbox for trunk/src/VBox/VMM/VMMRC


Ignore:
Timestamp:
Aug 18, 2017 2:05:49 PM (7 years ago)
Author:
vboxsync
Message:

PDM: add new PDM device helper for sending a MSI directly (from all contexts, as all contexts support such interrupt delivery)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMRC/PDMRCDevice.cpp

    r65338 r68470  
    204204    pdmUnlock(pVM);
    205205    LogFlow(("pdmRCDevHlp_ISASetIrq: caller=%p/%d: returns void; uTagSrc=%#x\n", pDevIns, pDevIns->iInstance, uTagSrc));
     206}
     207
     208
     209/** @interface_method_impl{PDMDEVHLPRC,pfnIoApicSendMsi} */
     210static DECLCALLBACK(void) pdmRCDevHlp_IoApicSendMsi(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, uint32_t uValue)
     211{
     212    PDMDEV_ASSERT_DEVINS(pDevIns);
     213    LogFlow(("pdmRCDevHlp_IoApicSendMsi: caller=%p/%d: GCPhys=%RGp uValue=%#x\n", pDevIns, pDevIns->iInstance, GCPhys, uValue));
     214    PVM pVM = pDevIns->Internal.s.pVMRC;
     215
     216    uint32_t uTagSrc;
     217    pDevIns->Internal.s.uLastIrqTag = uTagSrc = pdmCalcIrqTag(pVM, pDevIns->idTracing);
     218    VBOXVMM_PDM_IRQ_HILO(VMMGetCpu(pVM), RT_LOWORD(uTagSrc), RT_HIWORD(uTagSrc));
     219
     220    if (pVM->pdm.s.IoApic.pDevInsRC)
     221        pVM->pdm.s.IoApic.pfnSendMsiRC(pVM->pdm.s.IoApic.pDevInsRC, GCPhys, uValue, uTagSrc);
     222    else
     223        AssertFatalMsgFailed(("Lazy bastards!"));
     224
     225    LogFlow(("pdmRCDevHlp_IoApicSendMsi: caller=%p/%d: returns void; uTagSrc=%#x\n", pDevIns, pDevIns->iInstance, uTagSrc));
    206226}
    207227
     
    405425    pdmRCDevHlp_TMTimeVirtGetNano,
    406426    pdmRCDevHlp_DBGFTraceBuf,
    407     NULL,
     427    pdmRCDevHlp_IoApicSendMsi,
    408428    NULL,
    409429    NULL,
     
    587607        pVM->pdm.s.IoApic.pfnSendMsiRC(pVM->pdm.s.IoApic.pDevInsRC, GCPhys, uValue, uTagSrc);
    588608    else
    589         AssertFatalMsgFailed(("Lazy bastarts!"));
     609        AssertFatalMsgFailed(("Lazy bastards!"));
    590610}
    591611
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette