VirtualBox

Changeset 11219 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Aug 7, 2008 6:05:58 PM (16 years ago)
Author:
vboxsync
Message:

#1865: DevAPIC.

Location:
trunk/src/VBox/VMM
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/PDM.cpp

    r10202 r11219  
    275275     * The registered APIC.
    276276     */
    277     if (pVM->pdm.s.Apic.pDevInsGC)
    278     {
    279         pVM->pdm.s.Apic.pDevInsGC           += offDelta;
    280         pVM->pdm.s.Apic.pfnGetInterruptGC   += offDelta;
    281         pVM->pdm.s.Apic.pfnSetBaseGC        += offDelta;
    282         pVM->pdm.s.Apic.pfnGetBaseGC        += offDelta;
    283         pVM->pdm.s.Apic.pfnSetTPRGC         += offDelta;
    284         pVM->pdm.s.Apic.pfnGetTPRGC         += offDelta;
    285         pVM->pdm.s.Apic.pfnBusDeliverGC     += offDelta;
     277    if (pVM->pdm.s.Apic.pDevInsRC)
     278    {
     279        pVM->pdm.s.Apic.pDevInsRC           += offDelta;
     280        pVM->pdm.s.Apic.pfnGetInterruptRC   += offDelta;
     281        pVM->pdm.s.Apic.pfnSetBaseRC        += offDelta;
     282        pVM->pdm.s.Apic.pfnGetBaseRC        += offDelta;
     283        pVM->pdm.s.Apic.pfnSetTPRRC         += offDelta;
     284        pVM->pdm.s.Apic.pfnGetTPRRC         += offDelta;
     285        pVM->pdm.s.Apic.pfnBusDeliverRC     += offDelta;
    286286    }
    287287
     
    289289     * The registered I/O APIC.
    290290     */
    291     if (pVM->pdm.s.IoApic.pDevInsGC)
    292     {
    293         pVM->pdm.s.IoApic.pDevInsGC         += offDelta;
    294         pVM->pdm.s.IoApic.pfnSetIrqGC       += offDelta;
     291    if (pVM->pdm.s.IoApic.pDevInsRC)
     292    {
     293        pVM->pdm.s.IoApic.pDevInsRC         += offDelta;
     294        pVM->pdm.s.IoApic.pfnSetIrqRC       += offDelta;
    295295    }
    296296
  • trunk/src/VBox/VMM/PDMDevice.cpp

    r11169 r11219  
    235235static DECLCALLBACK(int) pdmR3ApicHlp_Lock(PPDMDEVINS pDevIns, int rc);
    236236static DECLCALLBACK(void) pdmR3ApicHlp_Unlock(PPDMDEVINS pDevIns);
    237 static DECLCALLBACK(PCPDMAPICHLPGC) pdmR3ApicHlp_GetGCHelpers(PPDMDEVINS pDevIns);
     237static DECLCALLBACK(PCPDMAPICHLPRC) pdmR3ApicHlp_GetRCHelpers(PPDMDEVINS pDevIns);
    238238static DECLCALLBACK(PCPDMAPICHLPR0) pdmR3ApicHlp_GetR0Helpers(PPDMDEVINS pDevIns);
    239239/** @} */
     
    247247static DECLCALLBACK(int) pdmR3IoApicHlp_Lock(PPDMDEVINS pDevIns, int rc);
    248248static DECLCALLBACK(void) pdmR3IoApicHlp_Unlock(PPDMDEVINS pDevIns);
    249 static DECLCALLBACK(PCPDMIOAPICHLPGC) pdmR3IoApicHlp_GetGCHelpers(PPDMDEVINS pDevIns);
     249static DECLCALLBACK(PCPDMIOAPICHLPRC) pdmR3IoApicHlp_GetRCHelpers(PPDMDEVINS pDevIns);
    250250static DECLCALLBACK(PCPDMIOAPICHLPR0) pdmR3IoApicHlp_GetR0Helpers(PPDMDEVINS pDevIns);
    251251/** @} */
     
    505505    pdmR3ApicHlp_Lock,
    506506    pdmR3ApicHlp_Unlock,
    507     pdmR3ApicHlp_GetGCHelpers,
     507    pdmR3ApicHlp_GetRCHelpers,
    508508    pdmR3ApicHlp_GetR0Helpers,
    509509    PDM_APICHLPR3_VERSION /* the end */
     
    520520    pdmR3IoApicHlp_Lock,
    521521    pdmR3IoApicHlp_Unlock,
    522     pdmR3IoApicHlp_GetGCHelpers,
     522    pdmR3IoApicHlp_GetRCHelpers,
    523523    pdmR3IoApicHlp_GetR0Helpers,
    524524    PDM_IOAPICHLPR3_VERSION /* the end */
     
    26262626    PDMDEV_ASSERT_DEVINS(pDevIns);
    26272627    VM_ASSERT_EMT(pDevIns->Internal.s.pVMHC);
    2628     LogFlow(("pdmR3DevHlp_APICRegister: caller='%s'/%d: pApicReg=%p:{.u32Version=%#x, .pfnGetInterruptHC=%p, .pfnSetBaseHC=%p, .pfnGetBaseHC=%p, "
    2629              ".pfnSetTPRHC=%p, .pfnGetTPRHC=%p, .pfnBusDeliverHC=%p, pszGetInterruptGC=%p:{%s}, pszSetBaseGC=%p:{%s}, pszGetBaseGC=%p:{%s}, "
    2630              ".pszSetTPRGC=%p:{%s}, .pszGetTPRGC=%p:{%s}, .pszBusDeliverGC=%p:{%s}} ppApicHlpR3=%p\n",
    2631              pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, pApicReg, pApicReg->u32Version, pApicReg->pfnGetInterruptHC, pApicReg->pfnSetBaseHC,
    2632              pApicReg->pfnGetBaseHC, pApicReg->pfnSetTPRHC, pApicReg->pfnGetTPRHC, pApicReg->pfnBusDeliverHC, pApicReg->pszGetInterruptGC,
    2633              pApicReg->pszGetInterruptGC, pApicReg->pszSetBaseGC, pApicReg->pszSetBaseGC, pApicReg->pszGetBaseGC, pApicReg->pszGetBaseGC,
    2634              pApicReg->pszSetTPRGC, pApicReg->pszSetTPRGC, pApicReg->pszGetTPRGC, pApicReg->pszGetTPRGC, pApicReg->pszBusDeliverGC,
    2635              pApicReg->pszBusDeliverGC, ppApicHlpR3));
     2628    LogFlow(("pdmR3DevHlp_APICRegister: caller='%s'/%d: pApicReg=%p:{.u32Version=%#x, .pfnGetInterruptR3=%p, .pfnSetBaseR3=%p, .pfnGetBaseR3=%p, "
     2629             ".pfnSetTPRR3=%p, .pfnGetTPRR3=%p, .pfnBusDeliverR3=%p, pszGetInterruptRC=%p:{%s}, pszSetBaseRC=%p:{%s}, pszGetBaseRC=%p:{%s}, "
     2630             ".pszSetTPRRC=%p:{%s}, .pszGetTPRRC=%p:{%s}, .pszBusDeliverRC=%p:{%s}} ppApicHlpR3=%p\n",
     2631             pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, pApicReg, pApicReg->u32Version, pApicReg->pfnGetInterruptR3, pApicReg->pfnSetBaseR3,
     2632             pApicReg->pfnGetBaseR3, pApicReg->pfnSetTPRR3, pApicReg->pfnGetTPRR3, pApicReg->pfnBusDeliverR3, pApicReg->pszGetInterruptRC,
     2633             pApicReg->pszGetInterruptRC, pApicReg->pszSetBaseRC, pApicReg->pszSetBaseRC, pApicReg->pszGetBaseRC, pApicReg->pszGetBaseRC,
     2634             pApicReg->pszSetTPRRC, pApicReg->pszSetTPRRC, pApicReg->pszGetTPRRC, pApicReg->pszGetTPRRC, pApicReg->pszBusDeliverRC,
     2635             pApicReg->pszBusDeliverRC, ppApicHlpR3));
    26362636
    26372637    /*
     
    26442644        return VERR_INVALID_PARAMETER;
    26452645    }
    2646     if (    !pApicReg->pfnGetInterruptHC
    2647         ||  !pApicReg->pfnHasPendingIrqHC
    2648         ||  !pApicReg->pfnSetBaseHC
    2649         ||  !pApicReg->pfnGetBaseHC
    2650         ||  !pApicReg->pfnSetTPRHC
    2651         ||  !pApicReg->pfnGetTPRHC
    2652         ||  !pApicReg->pfnBusDeliverHC)
    2653     {
    2654         Assert(pApicReg->pfnGetInterruptHC);
    2655         Assert(pApicReg->pfnHasPendingIrqHC);
    2656         Assert(pApicReg->pfnSetBaseHC);
    2657         Assert(pApicReg->pfnGetBaseHC);
    2658         Assert(pApicReg->pfnSetTPRHC);
    2659         Assert(pApicReg->pfnGetTPRHC);
    2660         Assert(pApicReg->pfnBusDeliverHC);
    2661         LogFlow(("pdmR3DevHlp_APICRegister: caller='%s'/%d: returns %Vrc (HC callbacks)\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, VERR_INVALID_PARAMETER));
     2646    if (    !pApicReg->pfnGetInterruptR3
     2647        ||  !pApicReg->pfnHasPendingIrqR3
     2648        ||  !pApicReg->pfnSetBaseR3
     2649        ||  !pApicReg->pfnGetBaseR3
     2650        ||  !pApicReg->pfnSetTPRR3
     2651        ||  !pApicReg->pfnGetTPRR3
     2652        ||  !pApicReg->pfnBusDeliverR3)
     2653    {
     2654        Assert(pApicReg->pfnGetInterruptR3);
     2655        Assert(pApicReg->pfnHasPendingIrqR3);
     2656        Assert(pApicReg->pfnSetBaseR3);
     2657        Assert(pApicReg->pfnGetBaseR3);
     2658        Assert(pApicReg->pfnSetTPRR3);
     2659        Assert(pApicReg->pfnGetTPRR3);
     2660        Assert(pApicReg->pfnBusDeliverR3);
     2661        LogFlow(("pdmR3DevHlp_APICRegister: caller='%s'/%d: returns %Vrc (R3 callbacks)\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, VERR_INVALID_PARAMETER));
    26622662        return VERR_INVALID_PARAMETER;
    26632663    }
    2664     if (   (    pApicReg->pszGetInterruptGC
    2665             ||  pApicReg->pszHasPendingIrqGC
    2666             ||  pApicReg->pszSetBaseGC
    2667             ||  pApicReg->pszGetBaseGC
    2668             ||  pApicReg->pszSetTPRGC
    2669             ||  pApicReg->pszGetTPRGC
    2670             ||  pApicReg->pszBusDeliverGC)
    2671         &&  (   !VALID_PTR(pApicReg->pszGetInterruptGC)
    2672             ||  !VALID_PTR(pApicReg->pszHasPendingIrqGC)
    2673             ||  !VALID_PTR(pApicReg->pszSetBaseGC)
    2674             ||  !VALID_PTR(pApicReg->pszGetBaseGC)
    2675             ||  !VALID_PTR(pApicReg->pszSetTPRGC)
    2676             ||  !VALID_PTR(pApicReg->pszGetTPRGC)
    2677             ||  !VALID_PTR(pApicReg->pszBusDeliverGC))
     2664    if (   (    pApicReg->pszGetInterruptRC
     2665            ||  pApicReg->pszHasPendingIrqRC
     2666            ||  pApicReg->pszSetBaseRC
     2667            ||  pApicReg->pszGetBaseRC
     2668            ||  pApicReg->pszSetTPRRC
     2669            ||  pApicReg->pszGetTPRRC
     2670            ||  pApicReg->pszBusDeliverRC)
     2671        &&  (   !VALID_PTR(pApicReg->pszGetInterruptRC)
     2672            ||  !VALID_PTR(pApicReg->pszHasPendingIrqRC)
     2673            ||  !VALID_PTR(pApicReg->pszSetBaseRC)
     2674            ||  !VALID_PTR(pApicReg->pszGetBaseRC)
     2675            ||  !VALID_PTR(pApicReg->pszSetTPRRC)
     2676            ||  !VALID_PTR(pApicReg->pszGetTPRRC)
     2677            ||  !VALID_PTR(pApicReg->pszBusDeliverRC))
    26782678       )
    26792679    {
    2680         Assert(VALID_PTR(pApicReg->pszGetInterruptGC));
    2681         Assert(VALID_PTR(pApicReg->pszHasPendingIrqGC));
    2682         Assert(VALID_PTR(pApicReg->pszSetBaseGC));
    2683         Assert(VALID_PTR(pApicReg->pszGetBaseGC));
    2684         Assert(VALID_PTR(pApicReg->pszSetTPRGC));
    2685         Assert(VALID_PTR(pApicReg->pszGetTPRGC));
    2686         Assert(VALID_PTR(pApicReg->pszBusDeliverGC));
    2687         LogFlow(("pdmR3DevHlp_APICRegister: caller='%s'/%d: returns %Vrc (GC callbacks)\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, VERR_INVALID_PARAMETER));
     2680        Assert(VALID_PTR(pApicReg->pszGetInterruptRC));
     2681        Assert(VALID_PTR(pApicReg->pszHasPendingIrqRC));
     2682        Assert(VALID_PTR(pApicReg->pszSetBaseRC));
     2683        Assert(VALID_PTR(pApicReg->pszGetBaseRC));
     2684        Assert(VALID_PTR(pApicReg->pszSetTPRRC));
     2685        Assert(VALID_PTR(pApicReg->pszGetTPRRC));
     2686        Assert(VALID_PTR(pApicReg->pszBusDeliverRC));
     2687        LogFlow(("pdmR3DevHlp_APICRegister: caller='%s'/%d: returns %Vrc (RC callbacks)\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, VERR_INVALID_PARAMETER));
    26882688        return VERR_INVALID_PARAMETER;
    26892689    }
     
    27332733
    27342734    /*
    2735      * Resolve & initialize the GC bits.
    2736      */
    2737     if (pApicReg->pszGetInterruptGC)
    2738     {
    2739         int rc = PDMR3GetSymbolGCLazy(pVM, pDevIns->pDevReg->szGCMod, pApicReg->pszGetInterruptGC, &pVM->pdm.s.Apic.pfnGetInterruptGC);
    2740         AssertMsgRC(rc, ("%s::%s rc=%Vrc\n", pDevIns->pDevReg->szGCMod, pApicReg->pszGetInterruptGC, rc));
     2735     * Resolve & initialize the RC bits.
     2736     */
     2737    if (pApicReg->pszGetInterruptRC)
     2738    {
     2739        int rc = PDMR3GetSymbolGCLazy(pVM, pDevIns->pDevReg->szGCMod, pApicReg->pszGetInterruptRC, &pVM->pdm.s.Apic.pfnGetInterruptRC);
     2740        AssertMsgRC(rc, ("%s::%s rc=%Vrc\n", pDevIns->pDevReg->szGCMod, pApicReg->pszGetInterruptRC, rc));
    27412741        if (RT_SUCCESS(rc))
    27422742        {
    2743             rc = PDMR3GetSymbolGCLazy(pVM, pDevIns->pDevReg->szGCMod, pApicReg->pszHasPendingIrqGC, &pVM->pdm.s.Apic.pfnHasPendingIrqGC);
    2744             AssertMsgRC(rc, ("%s::%s rc=%Vrc\n", pDevIns->pDevReg->szGCMod, pApicReg->pszHasPendingIrqGC, rc));
     2743            rc = PDMR3GetSymbolGCLazy(pVM, pDevIns->pDevReg->szGCMod, pApicReg->pszHasPendingIrqRC, &pVM->pdm.s.Apic.pfnHasPendingIrqRC);
     2744            AssertMsgRC(rc, ("%s::%s rc=%Vrc\n", pDevIns->pDevReg->szGCMod, pApicReg->pszHasPendingIrqRC, rc));
    27452745        }
    27462746        if (RT_SUCCESS(rc))
    27472747        {
    2748             rc = PDMR3GetSymbolGCLazy(pVM, pDevIns->pDevReg->szGCMod, pApicReg->pszSetBaseGC, &pVM->pdm.s.Apic.pfnSetBaseGC);
    2749             AssertMsgRC(rc, ("%s::%s rc=%Vrc\n", pDevIns->pDevReg->szGCMod, pApicReg->pszSetBaseGC, rc));
     2748            rc = PDMR3GetSymbolGCLazy(pVM, pDevIns->pDevReg->szGCMod, pApicReg->pszSetBaseRC, &pVM->pdm.s.Apic.pfnSetBaseRC);
     2749            AssertMsgRC(rc, ("%s::%s rc=%Vrc\n", pDevIns->pDevReg->szGCMod, pApicReg->pszSetBaseRC, rc));
    27502750        }
    27512751        if (RT_SUCCESS(rc))
    27522752        {
    2753             rc = PDMR3GetSymbolGCLazy(pVM, pDevIns->pDevReg->szGCMod, pApicReg->pszGetBaseGC, &pVM->pdm.s.Apic.pfnGetBaseGC);
    2754             AssertMsgRC(rc, ("%s::%s rc=%Vrc\n", pDevIns->pDevReg->szGCMod, pApicReg->pszGetBaseGC, rc));
     2753            rc = PDMR3GetSymbolGCLazy(pVM, pDevIns->pDevReg->szGCMod, pApicReg->pszGetBaseRC, &pVM->pdm.s.Apic.pfnGetBaseRC);
     2754            AssertMsgRC(rc, ("%s::%s rc=%Vrc\n", pDevIns->pDevReg->szGCMod, pApicReg->pszGetBaseRC, rc));
    27552755        }
    27562756        if (RT_SUCCESS(rc))
    27572757        {
    2758             rc = PDMR3GetSymbolGCLazy(pVM, pDevIns->pDevReg->szGCMod, pApicReg->pszSetTPRGC, &pVM->pdm.s.Apic.pfnSetTPRGC);
    2759             AssertMsgRC(rc, ("%s::%s rc=%Vrc\n", pDevIns->pDevReg->szGCMod, pApicReg->pszSetTPRGC, rc));
     2758            rc = PDMR3GetSymbolGCLazy(pVM, pDevIns->pDevReg->szGCMod, pApicReg->pszSetTPRRC, &pVM->pdm.s.Apic.pfnSetTPRRC);
     2759            AssertMsgRC(rc, ("%s::%s rc=%Vrc\n", pDevIns->pDevReg->szGCMod, pApicReg->pszSetTPRRC, rc));
    27602760        }
    27612761        if (RT_SUCCESS(rc))
    27622762        {
    2763             rc = PDMR3GetSymbolGCLazy(pVM, pDevIns->pDevReg->szGCMod, pApicReg->pszGetTPRGC, &pVM->pdm.s.Apic.pfnGetTPRGC);
    2764             AssertMsgRC(rc, ("%s::%s rc=%Vrc\n", pDevIns->pDevReg->szGCMod, pApicReg->pszGetTPRGC, rc));
     2763            rc = PDMR3GetSymbolGCLazy(pVM, pDevIns->pDevReg->szGCMod, pApicReg->pszGetTPRRC, &pVM->pdm.s.Apic.pfnGetTPRRC);
     2764            AssertMsgRC(rc, ("%s::%s rc=%Vrc\n", pDevIns->pDevReg->szGCMod, pApicReg->pszGetTPRRC, rc));
    27652765        }
    27662766        if (RT_SUCCESS(rc))
    27672767        {
    2768             rc = PDMR3GetSymbolGCLazy(pVM, pDevIns->pDevReg->szGCMod, pApicReg->pszBusDeliverGC, &pVM->pdm.s.Apic.pfnBusDeliverGC);
    2769             AssertMsgRC(rc, ("%s::%s rc=%Vrc\n", pDevIns->pDevReg->szGCMod, pApicReg->pszBusDeliverGC, rc));
     2768            rc = PDMR3GetSymbolGCLazy(pVM, pDevIns->pDevReg->szGCMod, pApicReg->pszBusDeliverRC, &pVM->pdm.s.Apic.pfnBusDeliverRC);
     2769            AssertMsgRC(rc, ("%s::%s rc=%Vrc\n", pDevIns->pDevReg->szGCMod, pApicReg->pszBusDeliverRC, rc));
    27702770        }
    27712771        if (VBOX_FAILURE(rc))
     
    27742774            return rc;
    27752775        }
    2776         pVM->pdm.s.Apic.pDevInsGC = PDMDEVINS_2_GCPTR(pDevIns);
     2776        pVM->pdm.s.Apic.pDevInsRC = PDMDEVINS_2_RCPTR(pDevIns);
    27772777    }
    27782778    else
    27792779    {
    2780         pVM->pdm.s.Apic.pDevInsGC           = 0;
    2781         pVM->pdm.s.Apic.pfnGetInterruptGC   = 0;
    2782         pVM->pdm.s.Apic.pfnHasPendingIrqGC  = 0;
    2783         pVM->pdm.s.Apic.pfnSetBaseGC        = 0;
    2784         pVM->pdm.s.Apic.pfnGetBaseGC        = 0;
    2785         pVM->pdm.s.Apic.pfnSetTPRGC         = 0;
    2786         pVM->pdm.s.Apic.pfnGetTPRGC         = 0;
    2787         pVM->pdm.s.Apic.pfnBusDeliverGC     = 0;
     2780        pVM->pdm.s.Apic.pDevInsRC           = 0;
     2781        pVM->pdm.s.Apic.pfnGetInterruptRC   = 0;
     2782        pVM->pdm.s.Apic.pfnHasPendingIrqRC  = 0;
     2783        pVM->pdm.s.Apic.pfnSetBaseRC        = 0;
     2784        pVM->pdm.s.Apic.pfnGetBaseRC        = 0;
     2785        pVM->pdm.s.Apic.pfnSetTPRRC         = 0;
     2786        pVM->pdm.s.Apic.pfnGetTPRRC         = 0;
     2787        pVM->pdm.s.Apic.pfnBusDeliverRC     = 0;
    27882788    }
    27892789
     
    28492849     */
    28502850    pVM->pdm.s.Apic.pDevInsR3           = pDevIns;
    2851     pVM->pdm.s.Apic.pfnGetInterruptR3   = pApicReg->pfnGetInterruptHC;
    2852     pVM->pdm.s.Apic.pfnHasPendingIrqR3  = pApicReg->pfnHasPendingIrqHC;
    2853     pVM->pdm.s.Apic.pfnSetBaseR3        = pApicReg->pfnSetBaseHC;
    2854     pVM->pdm.s.Apic.pfnGetBaseR3        = pApicReg->pfnGetBaseHC;
    2855     pVM->pdm.s.Apic.pfnSetTPRR3         = pApicReg->pfnSetTPRHC;
    2856     pVM->pdm.s.Apic.pfnGetTPRR3         = pApicReg->pfnGetTPRHC;
    2857     pVM->pdm.s.Apic.pfnBusDeliverR3     = pApicReg->pfnBusDeliverHC;
     2851    pVM->pdm.s.Apic.pfnGetInterruptR3   = pApicReg->pfnGetInterruptR3;
     2852    pVM->pdm.s.Apic.pfnHasPendingIrqR3  = pApicReg->pfnHasPendingIrqR3;
     2853    pVM->pdm.s.Apic.pfnSetBaseR3        = pApicReg->pfnSetBaseR3;
     2854    pVM->pdm.s.Apic.pfnGetBaseR3        = pApicReg->pfnGetBaseR3;
     2855    pVM->pdm.s.Apic.pfnSetTPRR3         = pApicReg->pfnSetTPRR3;
     2856    pVM->pdm.s.Apic.pfnGetTPRR3         = pApicReg->pfnGetTPRR3;
     2857    pVM->pdm.s.Apic.pfnBusDeliverR3     = pApicReg->pfnBusDeliverR3;
    28582858    Log(("PDM: Registered APIC device '%s'/%d pDevIns=%p\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, pDevIns));
    28592859
     
    28702870    PDMDEV_ASSERT_DEVINS(pDevIns);
    28712871    VM_ASSERT_EMT(pDevIns->Internal.s.pVMHC);
    2872     LogFlow(("pdmR3DevHlp_IOAPICRegister: caller='%s'/%d: pIoApicReg=%p:{.u32Version=%#x, .pfnSetIrqHC=%p, .pszSetIrqGC=%p:{%s}} ppIoApicHlpR3=%p\n",
    2873              pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, pIoApicReg, pIoApicReg->u32Version, pIoApicReg->pfnSetIrqHC, pIoApicReg->pszSetIrqGC,
    2874              pIoApicReg->pszSetIrqGC, ppIoApicHlpR3));
     2872    LogFlow(("pdmR3DevHlp_IOAPICRegister: caller='%s'/%d: pIoApicReg=%p:{.u32Version=%#x, .pfnSetIrqR3=%p, .pszSetIrqRC=%p:{%s}, .pszSetIrqR0=%p:{%s}} ppIoApicHlpR3=%p\n",
     2873             pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, pIoApicReg, pIoApicReg->u32Version, pIoApicReg->pfnSetIrqR3,
     2874             pIoApicReg->pszSetIrqRC, pIoApicReg->pszSetIrqRC, pIoApicReg->pszSetIrqR0, pIoApicReg->pszSetIrqR0, ppIoApicHlpR3));
    28752875
    28762876    /*
     
    28832883        return VERR_INVALID_PARAMETER;
    28842884    }
    2885     if (!pIoApicReg->pfnSetIrqHC)
    2886     {
    2887         Assert(pIoApicReg->pfnSetIrqHC);
    2888         LogFlow(("pdmR3DevHlp_IOAPICRegister: caller='%s'/%d: returns %Vrc (HC callbacks)\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, VERR_INVALID_PARAMETER));
     2885    if (!pIoApicReg->pfnSetIrqR3)
     2886    {
     2887        Assert(pIoApicReg->pfnSetIrqR3);
     2888        LogFlow(("pdmR3DevHlp_IOAPICRegister: caller='%s'/%d: returns %Vrc (R3 callbacks)\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, VERR_INVALID_PARAMETER));
    28892889        return VERR_INVALID_PARAMETER;
    28902890    }
    2891     if (    pIoApicReg->pszSetIrqGC
    2892         &&  !VALID_PTR(pIoApicReg->pszSetIrqGC))
    2893     {
    2894         Assert(VALID_PTR(pIoApicReg->pszSetIrqGC));
     2891    if (    pIoApicReg->pszSetIrqRC
     2892        &&  !VALID_PTR(pIoApicReg->pszSetIrqRC))
     2893    {
     2894        Assert(VALID_PTR(pIoApicReg->pszSetIrqRC));
    28952895        LogFlow(("pdmR3DevHlp_IOAPICRegister: caller='%s'/%d: returns %Vrc (GC callbacks)\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, VERR_INVALID_PARAMETER));
    28962896        return VERR_INVALID_PARAMETER;
     
    29212921        return VERR_INVALID_PARAMETER;
    29222922    }
    2923     if (    pIoApicReg->pszSetIrqGC
    2924         &&  !pVM->pdm.s.Apic.pDevInsGC)
     2923    if (    pIoApicReg->pszSetIrqRC
     2924        &&  !pVM->pdm.s.Apic.pDevInsRC)
    29252925    {
    29262926        AssertMsgFailed(("Configuration error! APIC doesn't do GC, I/O APIC does!\n"));
     
    29422942     * Resolve & initialize the GC bits.
    29432943     */
    2944     if (pIoApicReg->pszSetIrqGC)
    2945     {
    2946         int rc = PDMR3GetSymbolGCLazy(pVM, pDevIns->pDevReg->szGCMod, pIoApicReg->pszSetIrqGC, &pVM->pdm.s.IoApic.pfnSetIrqGC);
    2947         AssertMsgRC(rc, ("%s::%s rc=%Vrc\n", pDevIns->pDevReg->szGCMod, pIoApicReg->pszSetIrqGC, rc));
     2944    if (pIoApicReg->pszSetIrqRC)
     2945    {
     2946        int rc = PDMR3GetSymbolGCLazy(pVM, pDevIns->pDevReg->szGCMod, pIoApicReg->pszSetIrqRC, &pVM->pdm.s.IoApic.pfnSetIrqRC);
     2947        AssertMsgRC(rc, ("%s::%s rc=%Vrc\n", pDevIns->pDevReg->szGCMod, pIoApicReg->pszSetIrqRC, rc));
    29482948        if (VBOX_FAILURE(rc))
    29492949        {
     
    29512951            return rc;
    29522952        }
    2953         pVM->pdm.s.IoApic.pDevInsGC = PDMDEVINS_2_GCPTR(pDevIns);
     2953        pVM->pdm.s.IoApic.pDevInsRC = PDMDEVINS_2_RCPTR(pDevIns);
    29542954    }
    29552955    else
    29562956    {
    2957         pVM->pdm.s.IoApic.pDevInsGC   = 0;
    2958         pVM->pdm.s.IoApic.pfnSetIrqGC = 0;
     2957        pVM->pdm.s.IoApic.pDevInsRC   = 0;
     2958        pVM->pdm.s.IoApic.pfnSetIrqRC = 0;
    29592959    }
    29602960
     
    29812981
    29822982    /*
    2983      * Initialize the HC bits.
     2983     * Initialize the R3 bits.
    29842984     */
    29852985    pVM->pdm.s.IoApic.pDevInsR3   = pDevIns;
    2986     pVM->pdm.s.IoApic.pfnSetIrqR3 = pIoApicReg->pfnSetIrqHC;
     2986    pVM->pdm.s.IoApic.pfnSetIrqR3 = pIoApicReg->pfnSetIrqR3;
    29872987    Log(("PDM: Registered I/O APIC device '%s'/%d pDevIns=%p\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, pDevIns));
    29882988
     
    41204120
    41214121
    4122 /** @copydoc PDMAPICHLPR3::pfnGetGCHelpers */
    4123 static DECLCALLBACK(PCPDMAPICHLPGC) pdmR3ApicHlp_GetGCHelpers(PPDMDEVINS pDevIns)
     4122/** @copydoc PDMAPICHLPR3::pfnGetRCHelpers */
     4123static DECLCALLBACK(PCPDMAPICHLPRC) pdmR3ApicHlp_GetRCHelpers(PPDMDEVINS pDevIns)
    41244124{
    41254125    PDMDEV_ASSERT_DEVINS(pDevIns);
    41264126    VM_ASSERT_EMT(pDevIns->Internal.s.pVMHC);
    4127     RTGCPTR32 pGCHelpers = 0;
    4128     int rc = PDMR3GetSymbolGC(pDevIns->Internal.s.pVMHC, NULL, "g_pdmGCApicHlp", &pGCHelpers);
     4127    RTRCPTR pRCHelpers = 0;
     4128    int rc = PDMR3GetSymbolGC(pDevIns->Internal.s.pVMHC, NULL, "g_pdmRCApicHlp", &pRCHelpers);
    41294129    AssertReleaseRC(rc);
    4130     AssertRelease(pGCHelpers);
    4131     LogFlow(("pdmR3ApicHlp_GetGCHelpers: caller='%s'/%d: returns %VGv\n",
    4132              pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, pGCHelpers));
    4133     return pGCHelpers;
     4130    AssertRelease(pRCHelpers);
     4131    LogFlow(("pdmR3ApicHlp_GetRCHelpers: caller='%s'/%d: returns %VGv\n",
     4132             pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, pRCHelpers));
     4133    return pRCHelpers;
    41344134}
    41354135
     
    41794179
    41804180
    4181 /** @copydoc PDMIOAPICHLPR3::pfnGetGCHelpers */
    4182 static DECLCALLBACK(PCPDMIOAPICHLPGC) pdmR3IoApicHlp_GetGCHelpers(PPDMDEVINS pDevIns)
     4181/** @copydoc PDMIOAPICHLPR3::pfnGetRCHelpers */
     4182static DECLCALLBACK(PCPDMIOAPICHLPRC) pdmR3IoApicHlp_GetRCHelpers(PPDMDEVINS pDevIns)
    41834183{
    41844184    PDMDEV_ASSERT_DEVINS(pDevIns);
    41854185    VM_ASSERT_EMT(pDevIns->Internal.s.pVMHC);
    4186     RTGCPTR32 pGCHelpers = 0;
    4187     int rc = PDMR3GetSymbolGC(pDevIns->Internal.s.pVMHC, NULL, "g_pdmGCIoApicHlp", &pGCHelpers);
     4186    RTRCPTR pRCHelpers = 0;
     4187    int rc = PDMR3GetSymbolGC(pDevIns->Internal.s.pVMHC, NULL, "g_pdmRCIoApicHlp", &pRCHelpers);
    41884188    AssertReleaseRC(rc);
    4189     AssertRelease(pGCHelpers);
    4190     LogFlow(("pdmR3IoApicHlp_GetGCHelpers: caller='%s'/%d: returns %VGv\n",
    4191              pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, pGCHelpers));
    4192     return pGCHelpers;
     4189    AssertRelease(pRCHelpers);
     4190    LogFlow(("pdmR3IoApicHlp_GetRCHelpers: caller='%s'/%d: returns %VGv\n",
     4191             pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, pRCHelpers));
     4192    return pRCHelpers;
    41934193}
    41944194
  • trunk/src/VBox/VMM/PDMInternal.h

    r10640 r11219  
    384384typedef struct PDMAPIC
    385385{
    386     /** Pointer to the APIC device instance - HC Ptr. */
     386    /** Pointer to the APIC device instance - R3 Ptr. */
    387387    PPDMDEVINSR3                    pDevInsR3;
    388     /** @copydoc PDMAPICREG::pfnGetInterruptHC */
     388    /** @copydoc PDMAPICREG::pfnGetInterruptR3 */
    389389    DECLR3CALLBACKMEMBER(int,       pfnGetInterruptR3,(PPDMDEVINS pDevIns));
    390     /** @copydoc PDMAPICREG::pfnHasPendingIrqHC */
     390    /** @copydoc PDMAPICREG::pfnHasPendingIrqR3 */
    391391    DECLR3CALLBACKMEMBER(bool,      pfnHasPendingIrqR3,(PPDMDEVINS pDevIns));
    392     /** @copydoc PDMAPICREG::pfnSetBaseHC */
     392    /** @copydoc PDMAPICREG::pfnSetBaseR3 */
    393393    DECLR3CALLBACKMEMBER(void,      pfnSetBaseR3,(PPDMDEVINS pDevIns, uint64_t u64Base));
    394     /** @copydoc PDMAPICREG::pfnGetBaseHC */
     394    /** @copydoc PDMAPICREG::pfnGetBaseR3 */
    395395    DECLR3CALLBACKMEMBER(uint64_t,  pfnGetBaseR3,(PPDMDEVINS pDevIns));
    396     /** @copydoc PDMAPICREG::pfnSetTPRHC */
     396    /** @copydoc PDMAPICREG::pfnSetTPRR3 */
    397397    DECLR3CALLBACKMEMBER(void,      pfnSetTPRR3,(PPDMDEVINS pDevIns, uint8_t u8TPR));
    398     /** @copydoc PDMAPICREG::pfnGetTPRHC */
     398    /** @copydoc PDMAPICREG::pfnGetTPRR3 */
    399399    DECLR3CALLBACKMEMBER(uint8_t,   pfnGetTPRR3,(PPDMDEVINS pDevIns));
    400     /** @copydoc PDMAPICREG::pfnBusDeliverHC */
     400    /** @copydoc PDMAPICREG::pfnBusDeliverR3 */
    401401    DECLR3CALLBACKMEMBER(void,      pfnBusDeliverR3,(PPDMDEVINS pDevIns, uint8_t u8Dest, uint8_t u8DestMode, uint8_t u8DeliveryMode,
    402402                                                     uint8_t iVector, uint8_t u8Polarity, uint8_t u8TriggerMode));
     
    404404    /** Pointer to the APIC device instance - R0. */
    405405    R0PTRTYPE(PPDMDEVINS)           pDevInsR0;
    406     /** @copydoc PDMAPICREG::pfnGetInterruptHC */
     406    /** @copydoc PDMAPICREG::pfnGetInterruptR3 */
    407407    DECLR0CALLBACKMEMBER(int,       pfnGetInterruptR0,(PPDMDEVINS pDevIns));
    408     /** @copydoc PDMAPICREG::pfnHasPendingIrqHC */
     408    /** @copydoc PDMAPICREG::pfnHasPendingIrqR3 */
    409409    DECLR0CALLBACKMEMBER(bool,      pfnHasPendingIrqR0,(PPDMDEVINS pDevIns));
    410     /** @copydoc PDMAPICREG::pfnSetBaseHC */
     410    /** @copydoc PDMAPICREG::pfnSetBaseR3 */
    411411    DECLR0CALLBACKMEMBER(void,      pfnSetBaseR0,(PPDMDEVINS pDevIns, uint64_t u64Base));
    412     /** @copydoc PDMAPICREG::pfnGetBaseHC */
     412    /** @copydoc PDMAPICREG::pfnGetBaseR3 */
    413413    DECLR0CALLBACKMEMBER(uint64_t,  pfnGetBaseR0,(PPDMDEVINS pDevIns));
    414     /** @copydoc PDMAPICREG::pfnSetTPRHC */
     414    /** @copydoc PDMAPICREG::pfnSetTPRR3 */
    415415    DECLR0CALLBACKMEMBER(void,      pfnSetTPRR0,(PPDMDEVINS pDevIns, uint8_t u8TPR));
    416     /** @copydoc PDMAPICREG::pfnGetTPRHC */
     416    /** @copydoc PDMAPICREG::pfnGetTPRR3 */
    417417    DECLR0CALLBACKMEMBER(uint8_t,   pfnGetTPRR0,(PPDMDEVINS pDevIns));
    418     /** @copydoc PDMAPICREG::pfnBusDeliverHC */
     418    /** @copydoc PDMAPICREG::pfnBusDeliverR3 */
    419419    DECLR0CALLBACKMEMBER(void,      pfnBusDeliverR0,(PPDMDEVINS pDevIns, uint8_t u8Dest, uint8_t u8DestMode, uint8_t u8DeliveryMode,
    420420                                                     uint8_t iVector, uint8_t u8Polarity, uint8_t u8TriggerMode));
    421421
    422     /** Pointer to the APIC device instance - GC Ptr. */
    423     PPDMDEVINSGC                    pDevInsGC;
    424     /** @copydoc PDMAPICREG::pfnGetInterruptHC */
    425     DECLGCCALLBACKMEMBER(int,       pfnGetInterruptGC,(PPDMDEVINS pDevIns));
    426     /** @copydoc PDMAPICREG::pfnHasPendingIrqHC */
    427     DECLGCCALLBACKMEMBER(bool,      pfnHasPendingIrqGC,(PPDMDEVINS pDevIns));
    428     /** @copydoc PDMAPICREG::pfnSetBaseHC */
    429     DECLGCCALLBACKMEMBER(void,      pfnSetBaseGC,(PPDMDEVINS pDevIns, uint64_t u64Base));
    430     /** @copydoc PDMAPICREG::pfnGetBaseHC */
    431     DECLGCCALLBACKMEMBER(uint64_t,  pfnGetBaseGC,(PPDMDEVINS pDevIns));
    432     /** @copydoc PDMAPICREG::pfnSetTPRHC */
    433     DECLGCCALLBACKMEMBER(void,      pfnSetTPRGC,(PPDMDEVINS pDevIns, uint8_t u8TPR));
    434     /** @copydoc PDMAPICREG::pfnGetTPRHC */
    435     DECLGCCALLBACKMEMBER(uint8_t,   pfnGetTPRGC,(PPDMDEVINS pDevIns));
    436     /** @copydoc PDMAPICREG::pfnBusDeliverHC */
    437     DECLGCCALLBACKMEMBER(void,      pfnBusDeliverGC,(PPDMDEVINS pDevIns, uint8_t u8Dest, uint8_t u8DestMode, uint8_t u8DeliveryMode,
     422    /** Pointer to the APIC device instance - RC Ptr. */
     423    PPDMDEVINSRC                    pDevInsRC;
     424    /** @copydoc PDMAPICREG::pfnGetInterruptR3 */
     425    DECLRCCALLBACKMEMBER(int,       pfnGetInterruptRC,(PPDMDEVINS pDevIns));
     426    /** @copydoc PDMAPICREG::pfnHasPendingIrqR3 */
     427    DECLRCCALLBACKMEMBER(bool,      pfnHasPendingIrqRC,(PPDMDEVINS pDevIns));
     428    /** @copydoc PDMAPICREG::pfnSetBaseR3 */
     429    DECLRCCALLBACKMEMBER(void,      pfnSetBaseRC,(PPDMDEVINS pDevIns, uint64_t u64Base));
     430    /** @copydoc PDMAPICREG::pfnGetBaseR3 */
     431    DECLRCCALLBACKMEMBER(uint64_t,  pfnGetBaseRC,(PPDMDEVINS pDevIns));
     432    /** @copydoc PDMAPICREG::pfnSetTPRR3 */
     433    DECLRCCALLBACKMEMBER(void,      pfnSetTPRRC,(PPDMDEVINS pDevIns, uint8_t u8TPR));
     434    /** @copydoc PDMAPICREG::pfnGetTPRR3 */
     435    DECLRCCALLBACKMEMBER(uint8_t,   pfnGetTPRRC,(PPDMDEVINS pDevIns));
     436    /** @copydoc PDMAPICREG::pfnBusDeliverR3 */
     437    DECLRCCALLBACKMEMBER(void,      pfnBusDeliverRC,(PPDMDEVINS pDevIns, uint8_t u8Dest, uint8_t u8DestMode, uint8_t u8DeliveryMode,
    438438                                                     uint8_t iVector, uint8_t u8Polarity, uint8_t u8TriggerMode));
    439439} PDMAPIC;
     
    445445typedef struct PDMIOAPIC
    446446{
    447     /** Pointer to the APIC device instance - HC Ptr. */
     447    /** Pointer to the APIC device instance - R3 Ptr. */
    448448    PPDMDEVINSR3                    pDevInsR3;
    449     /** @copydoc PDMIOAPICREG::pfnSetIrqHC */
     449    /** @copydoc PDMIOAPICREG::pfnSetIrqR3 */
    450450    DECLR3CALLBACKMEMBER(void,      pfnSetIrqR3,(PPDMDEVINS pDevIns, int iIrq, int iLevel));
    451451
    452452    /** Pointer to the PIC device instance - R0. */
    453453    R0PTRTYPE(PPDMDEVINS)   pDevInsR0;
    454     /** @copydoc PDMIOAPICREG::pfnSetIrqHC */
     454    /** @copydoc PDMIOAPICREG::pfnSetIrqR3 */
    455455    DECLR0CALLBACKMEMBER(void,      pfnSetIrqR0,(PPDMDEVINS pDevIns, int iIrq, int iLevel));
    456456
    457457    /** Pointer to the APIC device instance - GC Ptr. */
    458     PPDMDEVINSGC                    pDevInsGC;
    459     /** @copydoc PDMIOAPICREG::pfnSetIrqHC */
    460     DECLGCCALLBACKMEMBER(void,      pfnSetIrqGC,(PPDMDEVINS pDevIns, int iIrq, int iLevel));
     458    PPDMDEVINSGC                    pDevInsRC;
     459    /** @copydoc PDMIOAPICREG::pfnSetIrqR3 */
     460    DECLGCCALLBACKMEMBER(void,      pfnSetIrqRC,(PPDMDEVINS pDevIns, int iIrq, int iLevel));
    461461} PDMIOAPIC;
    462462
  • trunk/src/VBox/VMM/VMMAll/PDMAll.cpp

    r10661 r11219  
    5353    {
    5454        VM_FF_CLEAR(pVM, VM_FF_INTERRUPT_APIC);
    55         Assert(pVM->pdm.s.Apic.CTXALLSUFF(pDevIns));
    56         Assert(pVM->pdm.s.Apic.CTXALLSUFF(pfnGetInterrupt));
    57         int i = pVM->pdm.s.Apic.CTXALLSUFF(pfnGetInterrupt)(pVM->pdm.s.Apic.CTXALLSUFF(pDevIns));
     55        Assert(pVM->pdm.s.Apic.CTX_SUFF(pDevIns));
     56        Assert(pVM->pdm.s.Apic.CTX_SUFF(pfnGetInterrupt));
     57        int i = pVM->pdm.s.Apic.CTX_SUFF(pfnGetInterrupt)(pVM->pdm.s.Apic.CTX_SUFF(pDevIns));
    5858        AssertMsg(i <= 255 && i >= 0, ("i=%d\n", i));
    5959        if (i >= 0)
     
    110110    }
    111111
    112     if (pVM->pdm.s.IoApic.CTXALLSUFF(pDevIns))
    113     {
    114         Assert(pVM->pdm.s.IoApic.CTXALLSUFF(pfnSetIrq));
    115         pVM->pdm.s.IoApic.CTXALLSUFF(pfnSetIrq)(pVM->pdm.s.IoApic.CTXALLSUFF(pDevIns), u8Irq, u8Level);
     112    if (pVM->pdm.s.IoApic.CTX_SUFF(pDevIns))
     113    {
     114        Assert(pVM->pdm.s.IoApic.CTX_SUFF(pfnSetIrq));
     115        pVM->pdm.s.IoApic.CTX_SUFF(pfnSetIrq)(pVM->pdm.s.IoApic.CTX_SUFF(pDevIns), u8Irq, u8Level);
    116116        rc = VINF_SUCCESS;
    117117    }
     
    132132PDMDECL(int) PDMIoApicSetIrq(PVM pVM, uint8_t u8Irq, uint8_t u8Level)
    133133{
    134     if (pVM->pdm.s.IoApic.CTXALLSUFF(pDevIns))
    135     {
    136         Assert(pVM->pdm.s.IoApic.CTXALLSUFF(pfnSetIrq));
    137         pdmLock(pVM);
    138         pVM->pdm.s.IoApic.CTXALLSUFF(pfnSetIrq)(pVM->pdm.s.IoApic.CTXALLSUFF(pDevIns), u8Irq, u8Level);
     134    if (pVM->pdm.s.IoApic.CTX_SUFF(pDevIns))
     135    {
     136        Assert(pVM->pdm.s.IoApic.CTX_SUFF(pfnSetIrq));
     137        pdmLock(pVM);
     138        pVM->pdm.s.IoApic.CTX_SUFF(pfnSetIrq)(pVM->pdm.s.IoApic.CTX_SUFF(pDevIns), u8Irq, u8Level);
    139139        pdmUnlock(pVM);
    140140        return VINF_SUCCESS;
     
    153153PDMDECL(int) PDMApicSetBase(PVM pVM, uint64_t u64Base)
    154154{
    155     if (pVM->pdm.s.Apic.CTXALLSUFF(pDevIns))
    156     {
    157         Assert(pVM->pdm.s.Apic.CTXALLSUFF(pfnSetBase));
    158         pdmLock(pVM);
    159         pVM->pdm.s.Apic.CTXALLSUFF(pfnSetBase)(pVM->pdm.s.Apic.CTXALLSUFF(pDevIns), u64Base);
     155    if (pVM->pdm.s.Apic.CTX_SUFF(pDevIns))
     156    {
     157        Assert(pVM->pdm.s.Apic.CTX_SUFF(pfnSetBase));
     158        pdmLock(pVM);
     159        pVM->pdm.s.Apic.CTX_SUFF(pfnSetBase)(pVM->pdm.s.Apic.CTX_SUFF(pDevIns), u64Base);
    160160        pdmUnlock(pVM);
    161161        return VINF_SUCCESS;
     
    174174PDMDECL(int) PDMApicGetBase(PVM pVM, uint64_t *pu64Base)
    175175{
    176     if (pVM->pdm.s.Apic.CTXALLSUFF(pDevIns))
    177     {
    178         Assert(pVM->pdm.s.Apic.CTXALLSUFF(pfnGetBase));
    179         pdmLock(pVM);
    180         *pu64Base = pVM->pdm.s.Apic.CTXALLSUFF(pfnGetBase)(pVM->pdm.s.Apic.CTXALLSUFF(pDevIns));
     176    if (pVM->pdm.s.Apic.CTX_SUFF(pDevIns))
     177    {
     178        Assert(pVM->pdm.s.Apic.CTX_SUFF(pfnGetBase));
     179        pdmLock(pVM);
     180        *pu64Base = pVM->pdm.s.Apic.CTX_SUFF(pfnGetBase)(pVM->pdm.s.Apic.CTX_SUFF(pDevIns));
    181181        pdmUnlock(pVM);
    182182        return VINF_SUCCESS;
     
    196196PDMDECL(int) PDMApicHasPendingIrq(PVM pVM, bool *pfPending)
    197197{
    198     if (pVM->pdm.s.Apic.CTXALLSUFF(pDevIns))
    199     {
    200         Assert(pVM->pdm.s.Apic.CTXALLSUFF(pfnSetTPR));
    201         pdmLock(pVM);
    202         *pfPending = pVM->pdm.s.Apic.CTXALLSUFF(pfnHasPendingIrq)(pVM->pdm.s.Apic.CTXALLSUFF(pDevIns));
     198    if (pVM->pdm.s.Apic.CTX_SUFF(pDevIns))
     199    {
     200        Assert(pVM->pdm.s.Apic.CTX_SUFF(pfnSetTPR));
     201        pdmLock(pVM);
     202        *pfPending = pVM->pdm.s.Apic.CTX_SUFF(pfnHasPendingIrq)(pVM->pdm.s.Apic.CTX_SUFF(pDevIns));
    203203        pdmUnlock(pVM);
    204204        return VINF_SUCCESS;
     
    217217PDMDECL(int) PDMApicSetTPR(PVM pVM, uint8_t u8TPR)
    218218{
    219     if (pVM->pdm.s.Apic.CTXALLSUFF(pDevIns))
    220     {
    221         Assert(pVM->pdm.s.Apic.CTXALLSUFF(pfnSetTPR));
    222         pdmLock(pVM);
    223         pVM->pdm.s.Apic.CTXALLSUFF(pfnSetTPR)(pVM->pdm.s.Apic.CTXALLSUFF(pDevIns), u8TPR);
     219    if (pVM->pdm.s.Apic.CTX_SUFF(pDevIns))
     220    {
     221        Assert(pVM->pdm.s.Apic.CTX_SUFF(pfnSetTPR));
     222        pdmLock(pVM);
     223        pVM->pdm.s.Apic.CTX_SUFF(pfnSetTPR)(pVM->pdm.s.Apic.CTX_SUFF(pDevIns), u8TPR);
    224224        pdmUnlock(pVM);
    225225        return VINF_SUCCESS;
     
    239239PDMDECL(int) PDMApicGetTPR(PVM pVM, uint8_t *pu8TPR, bool *pfPending)
    240240{
    241     if (pVM->pdm.s.Apic.CTXALLSUFF(pDevIns))
    242     {
    243         Assert(pVM->pdm.s.Apic.CTXALLSUFF(pfnGetTPR));
    244         pdmLock(pVM);
    245         *pu8TPR = pVM->pdm.s.Apic.CTXALLSUFF(pfnGetTPR)(pVM->pdm.s.Apic.CTXALLSUFF(pDevIns));
     241    if (pVM->pdm.s.Apic.CTX_SUFF(pDevIns))
     242    {
     243        Assert(pVM->pdm.s.Apic.CTX_SUFF(pfnGetTPR));
     244        pdmLock(pVM);
     245        *pu8TPR = pVM->pdm.s.Apic.CTX_SUFF(pfnGetTPR)(pVM->pdm.s.Apic.CTX_SUFF(pDevIns));
    246246        if (pfPending)
    247             *pfPending = pVM->pdm.s.Apic.CTXALLSUFF(pfnHasPendingIrq)(pVM->pdm.s.Apic.CTXALLSUFF(pDevIns));
     247            *pfPending = pVM->pdm.s.Apic.CTX_SUFF(pfnHasPendingIrq)(pVM->pdm.s.Apic.CTX_SUFF(pDevIns));
    248248        pdmUnlock(pVM);
    249249        return VINF_SUCCESS;
  • trunk/src/VBox/VMM/VMMGC/PDMGCDevice.cpp

    r11169 r11219  
    6161extern DECLEXPORT(const PDMDEVHLPGC)    g_pdmGCDevHlp;
    6262extern DECLEXPORT(const PDMPICHLPGC)    g_pdmGCPicHlp;
    63 extern DECLEXPORT(const PDMAPICHLPGC)   g_pdmGCApicHlp;
    64 extern DECLEXPORT(const PDMIOAPICHLPGC) g_pdmGCIoApicHlp;
     63extern DECLEXPORT(const PDMAPICHLPRC)   g_pdmRCApicHlp;
     64extern DECLEXPORT(const PDMIOAPICHLPRC) g_pdmRCIoApicHlp;
    6565extern DECLEXPORT(const PDMPCIHLPRC)    g_pdmRCPciHlp;
    6666__END_DECLS
     
    9696
    9797
    98 /** @name APIC GC Helpers
     98/** @name APIC RC Helpers
    9999 * @{
    100100 */
    101 static DECLCALLBACK(void) pdmGCApicHlp_SetInterruptFF(PPDMDEVINS pDevIns);
    102 static DECLCALLBACK(void) pdmGCApicHlp_ClearInterruptFF(PPDMDEVINS pDevIns);
    103 static DECLCALLBACK(void) pdmGCApicHlp_ChangeFeature(PPDMDEVINS pDevIns, bool fEnabled);
    104 static DECLCALLBACK(int) pdmGCApicHlp_Lock(PPDMDEVINS pDevIns, int rc);
    105 static DECLCALLBACK(void) pdmGCApicHlp_Unlock(PPDMDEVINS pDevIns);
     101static DECLCALLBACK(void) pdmRCApicHlp_SetInterruptFF(PPDMDEVINS pDevIns);
     102static DECLCALLBACK(void) pdmRCApicHlp_ClearInterruptFF(PPDMDEVINS pDevIns);
     103static DECLCALLBACK(void) pdmRCApicHlp_ChangeFeature(PPDMDEVINS pDevIns, bool fEnabled);
     104static DECLCALLBACK(int) pdmRCApicHlp_Lock(PPDMDEVINS pDevIns, int rc);
     105static DECLCALLBACK(void) pdmRCApicHlp_Unlock(PPDMDEVINS pDevIns);
    106106/** @} */
    107107
    108108
    109 /** @name I/O APIC GC Helpers
     109/** @name I/O APIC RC Helpers
    110110 * @{
    111111 */
    112 static DECLCALLBACK(void) pdmGCIoApicHlp_ApicBusDeliver(PPDMDEVINS pDevIns, uint8_t u8Dest, uint8_t u8DestMode, uint8_t u8DeliveryMode,
     112static DECLCALLBACK(void) pdmRCIoApicHlp_ApicBusDeliver(PPDMDEVINS pDevIns, uint8_t u8Dest, uint8_t u8DestMode, uint8_t u8DeliveryMode,
    113113                                                        uint8_t iVector, uint8_t u8Polarity, uint8_t u8TriggerMode);
    114 static DECLCALLBACK(int) pdmGCIoApicHlp_Lock(PPDMDEVINS pDevIns, int rc);
    115 static DECLCALLBACK(void) pdmGCIoApicHlp_Unlock(PPDMDEVINS pDevIns);
     114static DECLCALLBACK(int) pdmRCIoApicHlp_Lock(PPDMDEVINS pDevIns, int rc);
     115static DECLCALLBACK(void) pdmRCIoApicHlp_Unlock(PPDMDEVINS pDevIns);
    116116/** @} */
    117117
     
    166166
    167167/**
    168  * The Guest Context APIC Helper Callbacks.
    169  */
    170 extern DECLEXPORT(const PDMAPICHLPGC) g_pdmGCApicHlp =
    171 {
    172     PDM_APICHLPGC_VERSION,
    173     pdmGCApicHlp_SetInterruptFF,
    174     pdmGCApicHlp_ClearInterruptFF,
    175     pdmGCApicHlp_ChangeFeature,
    176     pdmGCApicHlp_Lock,
    177     pdmGCApicHlp_Unlock,
    178     PDM_APICHLPGC_VERSION
     168 * The Raw-Mode Context APIC Helper Callbacks.
     169 */
     170extern DECLEXPORT(const PDMAPICHLPRC) g_pdmRCApicHlp =
     171{
     172    PDM_APICHLPRC_VERSION,
     173    pdmRCApicHlp_SetInterruptFF,
     174    pdmRCApicHlp_ClearInterruptFF,
     175    pdmRCApicHlp_ChangeFeature,
     176    pdmRCApicHlp_Lock,
     177    pdmRCApicHlp_Unlock,
     178    PDM_APICHLPRC_VERSION
    179179};
    180180
    181181
    182182/**
    183  * The Guest Context I/O APIC Helper Callbacks.
    184  */
    185 extern DECLEXPORT(const PDMIOAPICHLPGC) g_pdmGCIoApicHlp =
    186 {
    187     PDM_IOAPICHLPGC_VERSION,
    188     pdmGCIoApicHlp_ApicBusDeliver,
    189     pdmGCIoApicHlp_Lock,
    190     pdmGCIoApicHlp_Unlock,
    191     PDM_IOAPICHLPGC_VERSION
     183 * The Raw-Mode Context I/O APIC Helper Callbacks.
     184 */
     185extern DECLEXPORT(const PDMIOAPICHLPRC) g_pdmRCIoApicHlp =
     186{
     187    PDM_IOAPICHLPRC_VERSION,
     188    pdmRCIoApicHlp_ApicBusDeliver,
     189    pdmRCIoApicHlp_Lock,
     190    pdmRCIoApicHlp_Unlock,
     191    PDM_IOAPICHLPRC_VERSION
    192192};
    193193
     
    391391
    392392/** @copydoc PDMAPICHLPGC::pfnSetInterruptFF */
    393 static DECLCALLBACK(void) pdmGCApicHlp_SetInterruptFF(PPDMDEVINS pDevIns)
    394 {
    395     PDMDEV_ASSERT_DEVINS(pDevIns);
    396     LogFlow(("pdmGCApicHlp_SetInterruptFF: caller=%p/%d: VM_FF_INTERRUPT %d -> 1\n",
     393static DECLCALLBACK(void) pdmRCApicHlp_SetInterruptFF(PPDMDEVINS pDevIns)
     394{
     395    PDMDEV_ASSERT_DEVINS(pDevIns);
     396    LogFlow(("pdmRCApicHlp_SetInterruptFF: caller=%p/%d: VM_FF_INTERRUPT %d -> 1\n",
    397397             pDevIns, pDevIns->iInstance, VM_FF_ISSET(pDevIns->Internal.s.pVMGC, VM_FF_INTERRUPT_APIC)));
    398398    VM_FF_SET(pDevIns->Internal.s.pVMGC, VM_FF_INTERRUPT_APIC);
     
    401401
    402402/** @copydoc PDMAPICHLPGC::pfnClearInterruptFF */
    403 static DECLCALLBACK(void) pdmGCApicHlp_ClearInterruptFF(PPDMDEVINS pDevIns)
    404 {
    405     PDMDEV_ASSERT_DEVINS(pDevIns);
    406     LogFlow(("pdmGCApicHlp_ClearInterruptFF: caller=%p/%d: VM_FF_INTERRUPT %d -> 0\n",
     403static DECLCALLBACK(void) pdmRCApicHlp_ClearInterruptFF(PPDMDEVINS pDevIns)
     404{
     405    PDMDEV_ASSERT_DEVINS(pDevIns);
     406    LogFlow(("pdmRCApicHlp_ClearInterruptFF: caller=%p/%d: VM_FF_INTERRUPT %d -> 0\n",
    407407             pDevIns, pDevIns->iInstance, VM_FF_ISSET(pDevIns->Internal.s.pVMGC, VM_FF_INTERRUPT_APIC)));
    408408    VM_FF_CLEAR(pDevIns->Internal.s.pVMGC, VM_FF_INTERRUPT_APIC);
     
    411411
    412412/** @copydoc PDMAPICHLPGC::pfnChangeFeature */
    413 static DECLCALLBACK(void) pdmGCApicHlp_ChangeFeature(PPDMDEVINS pDevIns, bool fEnabled)
    414 {
    415     PDMDEV_ASSERT_DEVINS(pDevIns);
    416     LogFlow(("pdmGCApicHlp_ChangeFeature: caller=%p/%d: fEnabled=%RTbool\n", pDevIns, pDevIns->iInstance, fEnabled));
     413static DECLCALLBACK(void) pdmRCApicHlp_ChangeFeature(PPDMDEVINS pDevIns, bool fEnabled)
     414{
     415    PDMDEV_ASSERT_DEVINS(pDevIns);
     416    LogFlow(("pdmRCApicHlp_ChangeFeature: caller=%p/%d: fEnabled=%RTbool\n", pDevIns, pDevIns->iInstance, fEnabled));
    417417    if (fEnabled)
    418418        CPUMSetGuestCpuIdFeature(pDevIns->Internal.s.pVMGC, CPUMCPUIDFEATURE_APIC);
     
    423423
    424424/** @copydoc PDMAPICHLPGC::pfnLock */
    425 static DECLCALLBACK(int) pdmGCApicHlp_Lock(PPDMDEVINS pDevIns, int rc)
     425static DECLCALLBACK(int) pdmRCApicHlp_Lock(PPDMDEVINS pDevIns, int rc)
    426426{
    427427    PDMDEV_ASSERT_DEVINS(pDevIns);
     
    431431
    432432/** @copydoc PDMAPICHLPGC::pfnUnlock */
    433 static DECLCALLBACK(void) pdmGCApicHlp_Unlock(PPDMDEVINS pDevIns)
     433static DECLCALLBACK(void) pdmRCApicHlp_Unlock(PPDMDEVINS pDevIns)
    434434{
    435435    PDMDEV_ASSERT_DEVINS(pDevIns);
     
    441441
    442442/** @copydoc PDMIOAPICHLPGC::pfnApicBusDeliver */
    443 static DECLCALLBACK(void) pdmGCIoApicHlp_ApicBusDeliver(PPDMDEVINS pDevIns, uint8_t u8Dest, uint8_t u8DestMode, uint8_t u8DeliveryMode,
     443static DECLCALLBACK(void) pdmRCIoApicHlp_ApicBusDeliver(PPDMDEVINS pDevIns, uint8_t u8Dest, uint8_t u8DestMode, uint8_t u8DeliveryMode,
    444444                                                        uint8_t iVector, uint8_t u8Polarity, uint8_t u8TriggerMode)
    445445{
    446446    PDMDEV_ASSERT_DEVINS(pDevIns);
    447447    PVM pVM = pDevIns->Internal.s.pVMGC;
    448     LogFlow(("pdmGCIoApicHlp_ApicBusDeliver: caller=%p/%d: u8Dest=%RX8 u8DestMode=%RX8 u8DeliveryMode=%RX8 iVector=%RX8 u8Polarity=%RX8 u8TriggerMode=%RX8\n",
     448    LogFlow(("pdmRCIoApicHlp_ApicBusDeliver: caller=%p/%d: u8Dest=%RX8 u8DestMode=%RX8 u8DeliveryMode=%RX8 iVector=%RX8 u8Polarity=%RX8 u8TriggerMode=%RX8\n",
    449449             pDevIns, pDevIns->iInstance, u8Dest, u8DestMode, u8DeliveryMode, iVector, u8Polarity, u8TriggerMode));
    450     if (pVM->pdm.s.Apic.pfnBusDeliverGC)
    451         pVM->pdm.s.Apic.pfnBusDeliverGC(pVM->pdm.s.Apic.pDevInsGC, u8Dest, u8DestMode, u8DeliveryMode, iVector, u8Polarity, u8TriggerMode);
     450    if (pVM->pdm.s.Apic.pfnBusDeliverRC)
     451        pVM->pdm.s.Apic.pfnBusDeliverRC(pVM->pdm.s.Apic.pDevInsRC, u8Dest, u8DestMode, u8DeliveryMode, iVector, u8Polarity, u8TriggerMode);
    452452}
    453453
    454454
    455455/** @copydoc PDMIOAPICHLPGC::pfnLock */
    456 static DECLCALLBACK(int) pdmGCIoApicHlp_Lock(PPDMDEVINS pDevIns, int rc)
     456static DECLCALLBACK(int) pdmRCIoApicHlp_Lock(PPDMDEVINS pDevIns, int rc)
    457457{
    458458    PDMDEV_ASSERT_DEVINS(pDevIns);
     
    462462
    463463/** @copydoc PDMIOAPICHLPGC::pfnUnlock */
    464 static DECLCALLBACK(void) pdmGCIoApicHlp_Unlock(PPDMDEVINS pDevIns)
     464static DECLCALLBACK(void) pdmRCIoApicHlp_Unlock(PPDMDEVINS pDevIns)
    465465{
    466466    PDMDEV_ASSERT_DEVINS(pDevIns);
     
    516516static void pdmGCIsaSetIrq(PVM pVM, int iIrq, int iLevel)
    517517{
    518     if (    (   pVM->pdm.s.IoApic.pDevInsGC
     518    if (    (   pVM->pdm.s.IoApic.pDevInsRC
    519519             || !pVM->pdm.s.IoApic.pDevInsR3)
    520520        &&  (   pVM->pdm.s.Pic.pDevInsGC
     
    524524        if (pVM->pdm.s.Pic.pDevInsGC)
    525525            pVM->pdm.s.Pic.pfnSetIrqGC(pVM->pdm.s.Pic.pDevInsGC, iIrq, iLevel);
    526         if (pVM->pdm.s.IoApic.pDevInsGC)
    527             pVM->pdm.s.IoApic.pfnSetIrqGC(pVM->pdm.s.IoApic.pDevInsGC, iIrq, iLevel);
     526        if (pVM->pdm.s.IoApic.pDevInsRC)
     527            pVM->pdm.s.IoApic.pfnSetIrqRC(pVM->pdm.s.IoApic.pDevInsRC, iIrq, iLevel);
    528528        pdmUnlock(pVM);
    529529    }
     
    556556static void pdmGCIoApicSetIrq(PVM pVM, int iIrq, int iLevel)
    557557{
    558     if (pVM->pdm.s.IoApic.pDevInsGC)
     558    if (pVM->pdm.s.IoApic.pDevInsRC)
    559559    {
    560560        pdmLock(pVM);
    561         pVM->pdm.s.IoApic.pfnSetIrqGC(pVM->pdm.s.IoApic.pDevInsGC, iIrq, iLevel);
     561        pVM->pdm.s.IoApic.pfnSetIrqRC(pVM->pdm.s.IoApic.pDevInsRC, iIrq, iLevel);
    562562        pdmUnlock(pVM);
    563563    }
  • trunk/src/VBox/VMM/testcase/tstVMStructGC.cpp

    r10202 r11219  
    275275    GEN_CHECK_OFF(PDM, Apic.pfnGetTPRR0);
    276276    GEN_CHECK_OFF(PDM, Apic.pfnBusDeliverR0);
    277     GEN_CHECK_OFF(PDM, Apic.pDevInsGC);
    278     GEN_CHECK_OFF(PDM, Apic.pfnGetInterruptGC);
    279     GEN_CHECK_OFF(PDM, Apic.pfnSetBaseGC);
    280     GEN_CHECK_OFF(PDM, Apic.pfnGetBaseGC);
    281     GEN_CHECK_OFF(PDM, Apic.pfnSetTPRGC);
    282     GEN_CHECK_OFF(PDM, Apic.pfnGetTPRGC);
    283     GEN_CHECK_OFF(PDM, Apic.pfnBusDeliverGC);
     277    GEN_CHECK_OFF(PDM, Apic.pDevInsRC);
     278    GEN_CHECK_OFF(PDM, Apic.pfnGetInterruptRC);
     279    GEN_CHECK_OFF(PDM, Apic.pfnSetBaseRC);
     280    GEN_CHECK_OFF(PDM, Apic.pfnGetBaseRC);
     281    GEN_CHECK_OFF(PDM, Apic.pfnSetTPRRC);
     282    GEN_CHECK_OFF(PDM, Apic.pfnGetTPRRC);
     283    GEN_CHECK_OFF(PDM, Apic.pfnBusDeliverRC);
    284284    GEN_CHECK_OFF(PDM, IoApic);
    285285    GEN_CHECK_OFF(PDM, IoApic.pDevInsR3);
     
    287287    GEN_CHECK_OFF(PDM, IoApic.pDevInsR0);
    288288    GEN_CHECK_OFF(PDM, IoApic.pfnSetIrqR0);
    289     GEN_CHECK_OFF(PDM, IoApic.pDevInsGC);
    290     GEN_CHECK_OFF(PDM, IoApic.pfnSetIrqGC);
     289    GEN_CHECK_OFF(PDM, IoApic.pDevInsRC);
     290    GEN_CHECK_OFF(PDM, IoApic.pfnSetIrqRC);
    291291    GEN_CHECK_OFF(PDM, pDmac);
    292292    GEN_CHECK_OFF(PDM, pRtc);
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