Changeset 11219 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Aug 7, 2008 6:05:58 PM (16 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/PDM.cpp
r10202 r11219 275 275 * The registered APIC. 276 276 */ 277 if (pVM->pdm.s.Apic.pDevIns GC)278 { 279 pVM->pdm.s.Apic.pDevIns GC += offDelta;280 pVM->pdm.s.Apic.pfnGetInterrupt GC += offDelta;281 pVM->pdm.s.Apic.pfnSetBase GC += offDelta;282 pVM->pdm.s.Apic.pfnGetBase GC += offDelta;283 pVM->pdm.s.Apic.pfnSetTPR GC += offDelta;284 pVM->pdm.s.Apic.pfnGetTPR GC += offDelta;285 pVM->pdm.s.Apic.pfnBusDeliver GC += 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; 286 286 } 287 287 … … 289 289 * The registered I/O APIC. 290 290 */ 291 if (pVM->pdm.s.IoApic.pDevIns GC)292 { 293 pVM->pdm.s.IoApic.pDevIns GC += offDelta;294 pVM->pdm.s.IoApic.pfnSetIrq GC += offDelta;291 if (pVM->pdm.s.IoApic.pDevInsRC) 292 { 293 pVM->pdm.s.IoApic.pDevInsRC += offDelta; 294 pVM->pdm.s.IoApic.pfnSetIrqRC += offDelta; 295 295 } 296 296 -
trunk/src/VBox/VMM/PDMDevice.cpp
r11169 r11219 235 235 static DECLCALLBACK(int) pdmR3ApicHlp_Lock(PPDMDEVINS pDevIns, int rc); 236 236 static DECLCALLBACK(void) pdmR3ApicHlp_Unlock(PPDMDEVINS pDevIns); 237 static DECLCALLBACK(PCPDMAPICHLP GC) pdmR3ApicHlp_GetGCHelpers(PPDMDEVINS pDevIns);237 static DECLCALLBACK(PCPDMAPICHLPRC) pdmR3ApicHlp_GetRCHelpers(PPDMDEVINS pDevIns); 238 238 static DECLCALLBACK(PCPDMAPICHLPR0) pdmR3ApicHlp_GetR0Helpers(PPDMDEVINS pDevIns); 239 239 /** @} */ … … 247 247 static DECLCALLBACK(int) pdmR3IoApicHlp_Lock(PPDMDEVINS pDevIns, int rc); 248 248 static DECLCALLBACK(void) pdmR3IoApicHlp_Unlock(PPDMDEVINS pDevIns); 249 static DECLCALLBACK(PCPDMIOAPICHLP GC) pdmR3IoApicHlp_GetGCHelpers(PPDMDEVINS pDevIns);249 static DECLCALLBACK(PCPDMIOAPICHLPRC) pdmR3IoApicHlp_GetRCHelpers(PPDMDEVINS pDevIns); 250 250 static DECLCALLBACK(PCPDMIOAPICHLPR0) pdmR3IoApicHlp_GetR0Helpers(PPDMDEVINS pDevIns); 251 251 /** @} */ … … 505 505 pdmR3ApicHlp_Lock, 506 506 pdmR3ApicHlp_Unlock, 507 pdmR3ApicHlp_Get GCHelpers,507 pdmR3ApicHlp_GetRCHelpers, 508 508 pdmR3ApicHlp_GetR0Helpers, 509 509 PDM_APICHLPR3_VERSION /* the end */ … … 520 520 pdmR3IoApicHlp_Lock, 521 521 pdmR3IoApicHlp_Unlock, 522 pdmR3IoApicHlp_Get GCHelpers,522 pdmR3IoApicHlp_GetRCHelpers, 523 523 pdmR3IoApicHlp_GetR0Helpers, 524 524 PDM_IOAPICHLPR3_VERSION /* the end */ … … 2626 2626 PDMDEV_ASSERT_DEVINS(pDevIns); 2627 2627 VM_ASSERT_EMT(pDevIns->Internal.s.pVMHC); 2628 LogFlow(("pdmR3DevHlp_APICRegister: caller='%s'/%d: pApicReg=%p:{.u32Version=%#x, .pfnGetInterrupt HC=%p, .pfnSetBaseHC=%p, .pfnGetBaseHC=%p, "2629 ".pfnSetTPR HC=%p, .pfnGetTPRHC=%p, .pfnBusDeliverHC=%p, pszGetInterruptGC=%p:{%s}, pszSetBaseGC=%p:{%s}, pszGetBaseGC=%p:{%s}, "2630 ".pszSetTPR GC=%p:{%s}, .pszGetTPRGC=%p:{%s}, .pszBusDeliverGC=%p:{%s}} ppApicHlpR3=%p\n",2631 pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, pApicReg, pApicReg->u32Version, pApicReg->pfnGetInterrupt HC, pApicReg->pfnSetBaseHC,2632 pApicReg->pfnGetBase HC, pApicReg->pfnSetTPRHC, pApicReg->pfnGetTPRHC, pApicReg->pfnBusDeliverHC, pApicReg->pszGetInterruptGC,2633 pApicReg->pszGetInterrupt GC, pApicReg->pszSetBaseGC, pApicReg->pszSetBaseGC, pApicReg->pszGetBaseGC, pApicReg->pszGetBaseGC,2634 pApicReg->pszSetTPR GC, pApicReg->pszSetTPRGC, pApicReg->pszGetTPRGC, pApicReg->pszGetTPRGC, pApicReg->pszBusDeliverGC,2635 pApicReg->pszBusDeliver GC, 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)); 2636 2636 2637 2637 /* … … 2644 2644 return VERR_INVALID_PARAMETER; 2645 2645 } 2646 if ( !pApicReg->pfnGetInterrupt HC2647 || !pApicReg->pfnHasPendingIrq HC2648 || !pApicReg->pfnSetBase HC2649 || !pApicReg->pfnGetBase HC2650 || !pApicReg->pfnSetTPR HC2651 || !pApicReg->pfnGetTPR HC2652 || !pApicReg->pfnBusDeliver HC)2653 { 2654 Assert(pApicReg->pfnGetInterrupt HC);2655 Assert(pApicReg->pfnHasPendingIrq HC);2656 Assert(pApicReg->pfnSetBase HC);2657 Assert(pApicReg->pfnGetBase HC);2658 Assert(pApicReg->pfnSetTPR HC);2659 Assert(pApicReg->pfnGetTPR HC);2660 Assert(pApicReg->pfnBusDeliver HC);2661 LogFlow(("pdmR3DevHlp_APICRegister: caller='%s'/%d: returns %Vrc ( HCcallbacks)\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)); 2662 2662 return VERR_INVALID_PARAMETER; 2663 2663 } 2664 if ( ( pApicReg->pszGetInterrupt GC2665 || pApicReg->pszHasPendingIrq GC2666 || pApicReg->pszSetBase GC2667 || pApicReg->pszGetBase GC2668 || pApicReg->pszSetTPR GC2669 || pApicReg->pszGetTPR GC2670 || pApicReg->pszBusDeliver GC)2671 && ( !VALID_PTR(pApicReg->pszGetInterrupt GC)2672 || !VALID_PTR(pApicReg->pszHasPendingIrq GC)2673 || !VALID_PTR(pApicReg->pszSetBase GC)2674 || !VALID_PTR(pApicReg->pszGetBase GC)2675 || !VALID_PTR(pApicReg->pszSetTPR GC)2676 || !VALID_PTR(pApicReg->pszGetTPR GC)2677 || !VALID_PTR(pApicReg->pszBusDeliver GC))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)) 2678 2678 ) 2679 2679 { 2680 Assert(VALID_PTR(pApicReg->pszGetInterrupt GC));2681 Assert(VALID_PTR(pApicReg->pszHasPendingIrq GC));2682 Assert(VALID_PTR(pApicReg->pszSetBase GC));2683 Assert(VALID_PTR(pApicReg->pszGetBase GC));2684 Assert(VALID_PTR(pApicReg->pszSetTPR GC));2685 Assert(VALID_PTR(pApicReg->pszGetTPR GC));2686 Assert(VALID_PTR(pApicReg->pszBusDeliver GC));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)); 2688 2688 return VERR_INVALID_PARAMETER; 2689 2689 } … … 2733 2733 2734 2734 /* 2735 * Resolve & initialize the GC bits.2736 */ 2737 if (pApicReg->pszGetInterrupt GC)2738 { 2739 int rc = PDMR3GetSymbolGCLazy(pVM, pDevIns->pDevReg->szGCMod, pApicReg->pszGetInterrupt GC, &pVM->pdm.s.Apic.pfnGetInterruptGC);2740 AssertMsgRC(rc, ("%s::%s rc=%Vrc\n", pDevIns->pDevReg->szGCMod, pApicReg->pszGetInterrupt GC, 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)); 2741 2741 if (RT_SUCCESS(rc)) 2742 2742 { 2743 rc = PDMR3GetSymbolGCLazy(pVM, pDevIns->pDevReg->szGCMod, pApicReg->pszHasPendingIrq GC, &pVM->pdm.s.Apic.pfnHasPendingIrqGC);2744 AssertMsgRC(rc, ("%s::%s rc=%Vrc\n", pDevIns->pDevReg->szGCMod, pApicReg->pszHasPendingIrq GC, 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)); 2745 2745 } 2746 2746 if (RT_SUCCESS(rc)) 2747 2747 { 2748 rc = PDMR3GetSymbolGCLazy(pVM, pDevIns->pDevReg->szGCMod, pApicReg->pszSetBase GC, &pVM->pdm.s.Apic.pfnSetBaseGC);2749 AssertMsgRC(rc, ("%s::%s rc=%Vrc\n", pDevIns->pDevReg->szGCMod, pApicReg->pszSetBase GC, 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)); 2750 2750 } 2751 2751 if (RT_SUCCESS(rc)) 2752 2752 { 2753 rc = PDMR3GetSymbolGCLazy(pVM, pDevIns->pDevReg->szGCMod, pApicReg->pszGetBase GC, &pVM->pdm.s.Apic.pfnGetBaseGC);2754 AssertMsgRC(rc, ("%s::%s rc=%Vrc\n", pDevIns->pDevReg->szGCMod, pApicReg->pszGetBase GC, 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)); 2755 2755 } 2756 2756 if (RT_SUCCESS(rc)) 2757 2757 { 2758 rc = PDMR3GetSymbolGCLazy(pVM, pDevIns->pDevReg->szGCMod, pApicReg->pszSetTPR GC, &pVM->pdm.s.Apic.pfnSetTPRGC);2759 AssertMsgRC(rc, ("%s::%s rc=%Vrc\n", pDevIns->pDevReg->szGCMod, pApicReg->pszSetTPR GC, 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)); 2760 2760 } 2761 2761 if (RT_SUCCESS(rc)) 2762 2762 { 2763 rc = PDMR3GetSymbolGCLazy(pVM, pDevIns->pDevReg->szGCMod, pApicReg->pszGetTPR GC, &pVM->pdm.s.Apic.pfnGetTPRGC);2764 AssertMsgRC(rc, ("%s::%s rc=%Vrc\n", pDevIns->pDevReg->szGCMod, pApicReg->pszGetTPR GC, 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)); 2765 2765 } 2766 2766 if (RT_SUCCESS(rc)) 2767 2767 { 2768 rc = PDMR3GetSymbolGCLazy(pVM, pDevIns->pDevReg->szGCMod, pApicReg->pszBusDeliver GC, &pVM->pdm.s.Apic.pfnBusDeliverGC);2769 AssertMsgRC(rc, ("%s::%s rc=%Vrc\n", pDevIns->pDevReg->szGCMod, pApicReg->pszBusDeliver GC, 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)); 2770 2770 } 2771 2771 if (VBOX_FAILURE(rc)) … … 2774 2774 return rc; 2775 2775 } 2776 pVM->pdm.s.Apic.pDevIns GC = PDMDEVINS_2_GCPTR(pDevIns);2776 pVM->pdm.s.Apic.pDevInsRC = PDMDEVINS_2_RCPTR(pDevIns); 2777 2777 } 2778 2778 else 2779 2779 { 2780 pVM->pdm.s.Apic.pDevIns GC = 0;2781 pVM->pdm.s.Apic.pfnGetInterrupt GC = 0;2782 pVM->pdm.s.Apic.pfnHasPendingIrq GC = 0;2783 pVM->pdm.s.Apic.pfnSetBase GC = 0;2784 pVM->pdm.s.Apic.pfnGetBase GC = 0;2785 pVM->pdm.s.Apic.pfnSetTPR GC = 0;2786 pVM->pdm.s.Apic.pfnGetTPR GC = 0;2787 pVM->pdm.s.Apic.pfnBusDeliver GC = 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; 2788 2788 } 2789 2789 … … 2849 2849 */ 2850 2850 pVM->pdm.s.Apic.pDevInsR3 = pDevIns; 2851 pVM->pdm.s.Apic.pfnGetInterruptR3 = pApicReg->pfnGetInterrupt HC;2852 pVM->pdm.s.Apic.pfnHasPendingIrqR3 = pApicReg->pfnHasPendingIrq HC;2853 pVM->pdm.s.Apic.pfnSetBaseR3 = pApicReg->pfnSetBase HC;2854 pVM->pdm.s.Apic.pfnGetBaseR3 = pApicReg->pfnGetBase HC;2855 pVM->pdm.s.Apic.pfnSetTPRR3 = pApicReg->pfnSetTPR HC;2856 pVM->pdm.s.Apic.pfnGetTPRR3 = pApicReg->pfnGetTPR HC;2857 pVM->pdm.s.Apic.pfnBusDeliverR3 = pApicReg->pfnBusDeliver HC;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; 2858 2858 Log(("PDM: Registered APIC device '%s'/%d pDevIns=%p\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, pDevIns)); 2859 2859 … … 2870 2870 PDMDEV_ASSERT_DEVINS(pDevIns); 2871 2871 VM_ASSERT_EMT(pDevIns->Internal.s.pVMHC); 2872 LogFlow(("pdmR3DevHlp_IOAPICRegister: caller='%s'/%d: pIoApicReg=%p:{.u32Version=%#x, .pfnSetIrq HC=%p, .pszSetIrqGC=%p:{%s}} ppIoApicHlpR3=%p\n",2873 pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, pIoApicReg, pIoApicReg->u32Version, pIoApicReg->pfnSetIrq HC, pIoApicReg->pszSetIrqGC,2874 pIoApicReg->pszSetIrq GC, 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)); 2875 2875 2876 2876 /* … … 2883 2883 return VERR_INVALID_PARAMETER; 2884 2884 } 2885 if (!pIoApicReg->pfnSetIrq HC)2886 { 2887 Assert(pIoApicReg->pfnSetIrq HC);2888 LogFlow(("pdmR3DevHlp_IOAPICRegister: caller='%s'/%d: returns %Vrc ( HCcallbacks)\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)); 2889 2889 return VERR_INVALID_PARAMETER; 2890 2890 } 2891 if ( pIoApicReg->pszSetIrq GC2892 && !VALID_PTR(pIoApicReg->pszSetIrq GC))2893 { 2894 Assert(VALID_PTR(pIoApicReg->pszSetIrq GC));2891 if ( pIoApicReg->pszSetIrqRC 2892 && !VALID_PTR(pIoApicReg->pszSetIrqRC)) 2893 { 2894 Assert(VALID_PTR(pIoApicReg->pszSetIrqRC)); 2895 2895 LogFlow(("pdmR3DevHlp_IOAPICRegister: caller='%s'/%d: returns %Vrc (GC callbacks)\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, VERR_INVALID_PARAMETER)); 2896 2896 return VERR_INVALID_PARAMETER; … … 2921 2921 return VERR_INVALID_PARAMETER; 2922 2922 } 2923 if ( pIoApicReg->pszSetIrq GC2924 && !pVM->pdm.s.Apic.pDevIns GC)2923 if ( pIoApicReg->pszSetIrqRC 2924 && !pVM->pdm.s.Apic.pDevInsRC) 2925 2925 { 2926 2926 AssertMsgFailed(("Configuration error! APIC doesn't do GC, I/O APIC does!\n")); … … 2942 2942 * Resolve & initialize the GC bits. 2943 2943 */ 2944 if (pIoApicReg->pszSetIrq GC)2945 { 2946 int rc = PDMR3GetSymbolGCLazy(pVM, pDevIns->pDevReg->szGCMod, pIoApicReg->pszSetIrq GC, &pVM->pdm.s.IoApic.pfnSetIrqGC);2947 AssertMsgRC(rc, ("%s::%s rc=%Vrc\n", pDevIns->pDevReg->szGCMod, pIoApicReg->pszSetIrq GC, 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)); 2948 2948 if (VBOX_FAILURE(rc)) 2949 2949 { … … 2951 2951 return rc; 2952 2952 } 2953 pVM->pdm.s.IoApic.pDevIns GC = PDMDEVINS_2_GCPTR(pDevIns);2953 pVM->pdm.s.IoApic.pDevInsRC = PDMDEVINS_2_RCPTR(pDevIns); 2954 2954 } 2955 2955 else 2956 2956 { 2957 pVM->pdm.s.IoApic.pDevIns GC = 0;2958 pVM->pdm.s.IoApic.pfnSetIrq GC = 0;2957 pVM->pdm.s.IoApic.pDevInsRC = 0; 2958 pVM->pdm.s.IoApic.pfnSetIrqRC = 0; 2959 2959 } 2960 2960 … … 2981 2981 2982 2982 /* 2983 * Initialize the HCbits.2983 * Initialize the R3 bits. 2984 2984 */ 2985 2985 pVM->pdm.s.IoApic.pDevInsR3 = pDevIns; 2986 pVM->pdm.s.IoApic.pfnSetIrqR3 = pIoApicReg->pfnSetIrq HC;2986 pVM->pdm.s.IoApic.pfnSetIrqR3 = pIoApicReg->pfnSetIrqR3; 2987 2987 Log(("PDM: Registered I/O APIC device '%s'/%d pDevIns=%p\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, pDevIns)); 2988 2988 … … 4120 4120 4121 4121 4122 /** @copydoc PDMAPICHLPR3::pfnGet GCHelpers */4123 static DECLCALLBACK(PCPDMAPICHLP GC) pdmR3ApicHlp_GetGCHelpers(PPDMDEVINS pDevIns)4122 /** @copydoc PDMAPICHLPR3::pfnGetRCHelpers */ 4123 static DECLCALLBACK(PCPDMAPICHLPRC) pdmR3ApicHlp_GetRCHelpers(PPDMDEVINS pDevIns) 4124 4124 { 4125 4125 PDMDEV_ASSERT_DEVINS(pDevIns); 4126 4126 VM_ASSERT_EMT(pDevIns->Internal.s.pVMHC); 4127 RT GCPTR32 pGCHelpers = 0;4128 int rc = PDMR3GetSymbolGC(pDevIns->Internal.s.pVMHC, NULL, "g_pdm GCApicHlp", &pGCHelpers);4127 RTRCPTR pRCHelpers = 0; 4128 int rc = PDMR3GetSymbolGC(pDevIns->Internal.s.pVMHC, NULL, "g_pdmRCApicHlp", &pRCHelpers); 4129 4129 AssertReleaseRC(rc); 4130 AssertRelease(p GCHelpers);4131 LogFlow(("pdmR3ApicHlp_Get GCHelpers: caller='%s'/%d: returns %VGv\n",4132 pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, p GCHelpers));4133 return p GCHelpers;4130 AssertRelease(pRCHelpers); 4131 LogFlow(("pdmR3ApicHlp_GetRCHelpers: caller='%s'/%d: returns %VGv\n", 4132 pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, pRCHelpers)); 4133 return pRCHelpers; 4134 4134 } 4135 4135 … … 4179 4179 4180 4180 4181 /** @copydoc PDMIOAPICHLPR3::pfnGet GCHelpers */4182 static DECLCALLBACK(PCPDMIOAPICHLP GC) pdmR3IoApicHlp_GetGCHelpers(PPDMDEVINS pDevIns)4181 /** @copydoc PDMIOAPICHLPR3::pfnGetRCHelpers */ 4182 static DECLCALLBACK(PCPDMIOAPICHLPRC) pdmR3IoApicHlp_GetRCHelpers(PPDMDEVINS pDevIns) 4183 4183 { 4184 4184 PDMDEV_ASSERT_DEVINS(pDevIns); 4185 4185 VM_ASSERT_EMT(pDevIns->Internal.s.pVMHC); 4186 RT GCPTR32 pGCHelpers = 0;4187 int rc = PDMR3GetSymbolGC(pDevIns->Internal.s.pVMHC, NULL, "g_pdm GCIoApicHlp", &pGCHelpers);4186 RTRCPTR pRCHelpers = 0; 4187 int rc = PDMR3GetSymbolGC(pDevIns->Internal.s.pVMHC, NULL, "g_pdmRCIoApicHlp", &pRCHelpers); 4188 4188 AssertReleaseRC(rc); 4189 AssertRelease(p GCHelpers);4190 LogFlow(("pdmR3IoApicHlp_Get GCHelpers: caller='%s'/%d: returns %VGv\n",4191 pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, p GCHelpers));4192 return p GCHelpers;4189 AssertRelease(pRCHelpers); 4190 LogFlow(("pdmR3IoApicHlp_GetRCHelpers: caller='%s'/%d: returns %VGv\n", 4191 pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, pRCHelpers)); 4192 return pRCHelpers; 4193 4193 } 4194 4194 -
trunk/src/VBox/VMM/PDMInternal.h
r10640 r11219 384 384 typedef struct PDMAPIC 385 385 { 386 /** Pointer to the APIC device instance - HCPtr. */386 /** Pointer to the APIC device instance - R3 Ptr. */ 387 387 PPDMDEVINSR3 pDevInsR3; 388 /** @copydoc PDMAPICREG::pfnGetInterrupt HC*/388 /** @copydoc PDMAPICREG::pfnGetInterruptR3 */ 389 389 DECLR3CALLBACKMEMBER(int, pfnGetInterruptR3,(PPDMDEVINS pDevIns)); 390 /** @copydoc PDMAPICREG::pfnHasPendingIrq HC*/390 /** @copydoc PDMAPICREG::pfnHasPendingIrqR3 */ 391 391 DECLR3CALLBACKMEMBER(bool, pfnHasPendingIrqR3,(PPDMDEVINS pDevIns)); 392 /** @copydoc PDMAPICREG::pfnSetBase HC*/392 /** @copydoc PDMAPICREG::pfnSetBaseR3 */ 393 393 DECLR3CALLBACKMEMBER(void, pfnSetBaseR3,(PPDMDEVINS pDevIns, uint64_t u64Base)); 394 /** @copydoc PDMAPICREG::pfnGetBase HC*/394 /** @copydoc PDMAPICREG::pfnGetBaseR3 */ 395 395 DECLR3CALLBACKMEMBER(uint64_t, pfnGetBaseR3,(PPDMDEVINS pDevIns)); 396 /** @copydoc PDMAPICREG::pfnSetTPR HC*/396 /** @copydoc PDMAPICREG::pfnSetTPRR3 */ 397 397 DECLR3CALLBACKMEMBER(void, pfnSetTPRR3,(PPDMDEVINS pDevIns, uint8_t u8TPR)); 398 /** @copydoc PDMAPICREG::pfnGetTPR HC*/398 /** @copydoc PDMAPICREG::pfnGetTPRR3 */ 399 399 DECLR3CALLBACKMEMBER(uint8_t, pfnGetTPRR3,(PPDMDEVINS pDevIns)); 400 /** @copydoc PDMAPICREG::pfnBusDeliver HC*/400 /** @copydoc PDMAPICREG::pfnBusDeliverR3 */ 401 401 DECLR3CALLBACKMEMBER(void, pfnBusDeliverR3,(PPDMDEVINS pDevIns, uint8_t u8Dest, uint8_t u8DestMode, uint8_t u8DeliveryMode, 402 402 uint8_t iVector, uint8_t u8Polarity, uint8_t u8TriggerMode)); … … 404 404 /** Pointer to the APIC device instance - R0. */ 405 405 R0PTRTYPE(PPDMDEVINS) pDevInsR0; 406 /** @copydoc PDMAPICREG::pfnGetInterrupt HC*/406 /** @copydoc PDMAPICREG::pfnGetInterruptR3 */ 407 407 DECLR0CALLBACKMEMBER(int, pfnGetInterruptR0,(PPDMDEVINS pDevIns)); 408 /** @copydoc PDMAPICREG::pfnHasPendingIrq HC*/408 /** @copydoc PDMAPICREG::pfnHasPendingIrqR3 */ 409 409 DECLR0CALLBACKMEMBER(bool, pfnHasPendingIrqR0,(PPDMDEVINS pDevIns)); 410 /** @copydoc PDMAPICREG::pfnSetBase HC*/410 /** @copydoc PDMAPICREG::pfnSetBaseR3 */ 411 411 DECLR0CALLBACKMEMBER(void, pfnSetBaseR0,(PPDMDEVINS pDevIns, uint64_t u64Base)); 412 /** @copydoc PDMAPICREG::pfnGetBase HC*/412 /** @copydoc PDMAPICREG::pfnGetBaseR3 */ 413 413 DECLR0CALLBACKMEMBER(uint64_t, pfnGetBaseR0,(PPDMDEVINS pDevIns)); 414 /** @copydoc PDMAPICREG::pfnSetTPR HC*/414 /** @copydoc PDMAPICREG::pfnSetTPRR3 */ 415 415 DECLR0CALLBACKMEMBER(void, pfnSetTPRR0,(PPDMDEVINS pDevIns, uint8_t u8TPR)); 416 /** @copydoc PDMAPICREG::pfnGetTPR HC*/416 /** @copydoc PDMAPICREG::pfnGetTPRR3 */ 417 417 DECLR0CALLBACKMEMBER(uint8_t, pfnGetTPRR0,(PPDMDEVINS pDevIns)); 418 /** @copydoc PDMAPICREG::pfnBusDeliver HC*/418 /** @copydoc PDMAPICREG::pfnBusDeliverR3 */ 419 419 DECLR0CALLBACKMEMBER(void, pfnBusDeliverR0,(PPDMDEVINS pDevIns, uint8_t u8Dest, uint8_t u8DestMode, uint8_t u8DeliveryMode, 420 420 uint8_t iVector, uint8_t u8Polarity, uint8_t u8TriggerMode)); 421 421 422 /** Pointer to the APIC device instance - GC Ptr. */423 PPDMDEVINS GC pDevInsGC;424 /** @copydoc PDMAPICREG::pfnGetInterrupt HC*/425 DECL GCCALLBACKMEMBER(int, pfnGetInterruptGC,(PPDMDEVINS pDevIns));426 /** @copydoc PDMAPICREG::pfnHasPendingIrq HC*/427 DECL GCCALLBACKMEMBER(bool, pfnHasPendingIrqGC,(PPDMDEVINS pDevIns));428 /** @copydoc PDMAPICREG::pfnSetBase HC*/429 DECL GCCALLBACKMEMBER(void, pfnSetBaseGC,(PPDMDEVINS pDevIns, uint64_t u64Base));430 /** @copydoc PDMAPICREG::pfnGetBase HC*/431 DECL GCCALLBACKMEMBER(uint64_t, pfnGetBaseGC,(PPDMDEVINS pDevIns));432 /** @copydoc PDMAPICREG::pfnSetTPR HC*/433 DECL GCCALLBACKMEMBER(void, pfnSetTPRGC,(PPDMDEVINS pDevIns, uint8_t u8TPR));434 /** @copydoc PDMAPICREG::pfnGetTPR HC*/435 DECL GCCALLBACKMEMBER(uint8_t, pfnGetTPRGC,(PPDMDEVINS pDevIns));436 /** @copydoc PDMAPICREG::pfnBusDeliver HC*/437 DECL GCCALLBACKMEMBER(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, 438 438 uint8_t iVector, uint8_t u8Polarity, uint8_t u8TriggerMode)); 439 439 } PDMAPIC; … … 445 445 typedef struct PDMIOAPIC 446 446 { 447 /** Pointer to the APIC device instance - HCPtr. */447 /** Pointer to the APIC device instance - R3 Ptr. */ 448 448 PPDMDEVINSR3 pDevInsR3; 449 /** @copydoc PDMIOAPICREG::pfnSetIrq HC*/449 /** @copydoc PDMIOAPICREG::pfnSetIrqR3 */ 450 450 DECLR3CALLBACKMEMBER(void, pfnSetIrqR3,(PPDMDEVINS pDevIns, int iIrq, int iLevel)); 451 451 452 452 /** Pointer to the PIC device instance - R0. */ 453 453 R0PTRTYPE(PPDMDEVINS) pDevInsR0; 454 /** @copydoc PDMIOAPICREG::pfnSetIrq HC*/454 /** @copydoc PDMIOAPICREG::pfnSetIrqR3 */ 455 455 DECLR0CALLBACKMEMBER(void, pfnSetIrqR0,(PPDMDEVINS pDevIns, int iIrq, int iLevel)); 456 456 457 457 /** Pointer to the APIC device instance - GC Ptr. */ 458 PPDMDEVINSGC pDevIns GC;459 /** @copydoc PDMIOAPICREG::pfnSetIrq HC*/460 DECLGCCALLBACKMEMBER(void, pfnSetIrq GC,(PPDMDEVINS pDevIns, int iIrq, int iLevel));458 PPDMDEVINSGC pDevInsRC; 459 /** @copydoc PDMIOAPICREG::pfnSetIrqR3 */ 460 DECLGCCALLBACKMEMBER(void, pfnSetIrqRC,(PPDMDEVINS pDevIns, int iIrq, int iLevel)); 461 461 } PDMIOAPIC; 462 462 -
trunk/src/VBox/VMM/VMMAll/PDMAll.cpp
r10661 r11219 53 53 { 54 54 VM_FF_CLEAR(pVM, VM_FF_INTERRUPT_APIC); 55 Assert(pVM->pdm.s.Apic.CTX ALLSUFF(pDevIns));56 Assert(pVM->pdm.s.Apic.CTX ALLSUFF(pfnGetInterrupt));57 int i = pVM->pdm.s.Apic.CTX ALLSUFF(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)); 58 58 AssertMsg(i <= 255 && i >= 0, ("i=%d\n", i)); 59 59 if (i >= 0) … … 110 110 } 111 111 112 if (pVM->pdm.s.IoApic.CTX ALLSUFF(pDevIns))113 { 114 Assert(pVM->pdm.s.IoApic.CTX ALLSUFF(pfnSetIrq));115 pVM->pdm.s.IoApic.CTX ALLSUFF(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); 116 116 rc = VINF_SUCCESS; 117 117 } … … 132 132 PDMDECL(int) PDMIoApicSetIrq(PVM pVM, uint8_t u8Irq, uint8_t u8Level) 133 133 { 134 if (pVM->pdm.s.IoApic.CTX ALLSUFF(pDevIns))135 { 136 Assert(pVM->pdm.s.IoApic.CTX ALLSUFF(pfnSetIrq));137 pdmLock(pVM); 138 pVM->pdm.s.IoApic.CTX ALLSUFF(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); 139 139 pdmUnlock(pVM); 140 140 return VINF_SUCCESS; … … 153 153 PDMDECL(int) PDMApicSetBase(PVM pVM, uint64_t u64Base) 154 154 { 155 if (pVM->pdm.s.Apic.CTX ALLSUFF(pDevIns))156 { 157 Assert(pVM->pdm.s.Apic.CTX ALLSUFF(pfnSetBase));158 pdmLock(pVM); 159 pVM->pdm.s.Apic.CTX ALLSUFF(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); 160 160 pdmUnlock(pVM); 161 161 return VINF_SUCCESS; … … 174 174 PDMDECL(int) PDMApicGetBase(PVM pVM, uint64_t *pu64Base) 175 175 { 176 if (pVM->pdm.s.Apic.CTX ALLSUFF(pDevIns))177 { 178 Assert(pVM->pdm.s.Apic.CTX ALLSUFF(pfnGetBase));179 pdmLock(pVM); 180 *pu64Base = pVM->pdm.s.Apic.CTX ALLSUFF(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)); 181 181 pdmUnlock(pVM); 182 182 return VINF_SUCCESS; … … 196 196 PDMDECL(int) PDMApicHasPendingIrq(PVM pVM, bool *pfPending) 197 197 { 198 if (pVM->pdm.s.Apic.CTX ALLSUFF(pDevIns))199 { 200 Assert(pVM->pdm.s.Apic.CTX ALLSUFF(pfnSetTPR));201 pdmLock(pVM); 202 *pfPending = pVM->pdm.s.Apic.CTX ALLSUFF(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)); 203 203 pdmUnlock(pVM); 204 204 return VINF_SUCCESS; … … 217 217 PDMDECL(int) PDMApicSetTPR(PVM pVM, uint8_t u8TPR) 218 218 { 219 if (pVM->pdm.s.Apic.CTX ALLSUFF(pDevIns))220 { 221 Assert(pVM->pdm.s.Apic.CTX ALLSUFF(pfnSetTPR));222 pdmLock(pVM); 223 pVM->pdm.s.Apic.CTX ALLSUFF(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); 224 224 pdmUnlock(pVM); 225 225 return VINF_SUCCESS; … … 239 239 PDMDECL(int) PDMApicGetTPR(PVM pVM, uint8_t *pu8TPR, bool *pfPending) 240 240 { 241 if (pVM->pdm.s.Apic.CTX ALLSUFF(pDevIns))242 { 243 Assert(pVM->pdm.s.Apic.CTX ALLSUFF(pfnGetTPR));244 pdmLock(pVM); 245 *pu8TPR = pVM->pdm.s.Apic.CTX ALLSUFF(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)); 246 246 if (pfPending) 247 *pfPending = pVM->pdm.s.Apic.CTX ALLSUFF(pfnHasPendingIrq)(pVM->pdm.s.Apic.CTXALLSUFF(pDevIns));247 *pfPending = pVM->pdm.s.Apic.CTX_SUFF(pfnHasPendingIrq)(pVM->pdm.s.Apic.CTX_SUFF(pDevIns)); 248 248 pdmUnlock(pVM); 249 249 return VINF_SUCCESS; -
trunk/src/VBox/VMM/VMMGC/PDMGCDevice.cpp
r11169 r11219 61 61 extern DECLEXPORT(const PDMDEVHLPGC) g_pdmGCDevHlp; 62 62 extern DECLEXPORT(const PDMPICHLPGC) g_pdmGCPicHlp; 63 extern DECLEXPORT(const PDMAPICHLP GC) g_pdmGCApicHlp;64 extern DECLEXPORT(const PDMIOAPICHLP GC) g_pdmGCIoApicHlp;63 extern DECLEXPORT(const PDMAPICHLPRC) g_pdmRCApicHlp; 64 extern DECLEXPORT(const PDMIOAPICHLPRC) g_pdmRCIoApicHlp; 65 65 extern DECLEXPORT(const PDMPCIHLPRC) g_pdmRCPciHlp; 66 66 __END_DECLS … … 96 96 97 97 98 /** @name APIC GC Helpers98 /** @name APIC RC Helpers 99 99 * @{ 100 100 */ 101 static DECLCALLBACK(void) pdm GCApicHlp_SetInterruptFF(PPDMDEVINS pDevIns);102 static DECLCALLBACK(void) pdm GCApicHlp_ClearInterruptFF(PPDMDEVINS pDevIns);103 static DECLCALLBACK(void) pdm GCApicHlp_ChangeFeature(PPDMDEVINS pDevIns, bool fEnabled);104 static DECLCALLBACK(int) pdm GCApicHlp_Lock(PPDMDEVINS pDevIns, int rc);105 static DECLCALLBACK(void) pdm GCApicHlp_Unlock(PPDMDEVINS pDevIns);101 static DECLCALLBACK(void) pdmRCApicHlp_SetInterruptFF(PPDMDEVINS pDevIns); 102 static DECLCALLBACK(void) pdmRCApicHlp_ClearInterruptFF(PPDMDEVINS pDevIns); 103 static DECLCALLBACK(void) pdmRCApicHlp_ChangeFeature(PPDMDEVINS pDevIns, bool fEnabled); 104 static DECLCALLBACK(int) pdmRCApicHlp_Lock(PPDMDEVINS pDevIns, int rc); 105 static DECLCALLBACK(void) pdmRCApicHlp_Unlock(PPDMDEVINS pDevIns); 106 106 /** @} */ 107 107 108 108 109 /** @name I/O APIC GC Helpers109 /** @name I/O APIC RC Helpers 110 110 * @{ 111 111 */ 112 static DECLCALLBACK(void) pdm GCIoApicHlp_ApicBusDeliver(PPDMDEVINS pDevIns, uint8_t u8Dest, uint8_t u8DestMode, uint8_t u8DeliveryMode,112 static DECLCALLBACK(void) pdmRCIoApicHlp_ApicBusDeliver(PPDMDEVINS pDevIns, uint8_t u8Dest, uint8_t u8DestMode, uint8_t u8DeliveryMode, 113 113 uint8_t iVector, uint8_t u8Polarity, uint8_t u8TriggerMode); 114 static DECLCALLBACK(int) pdm GCIoApicHlp_Lock(PPDMDEVINS pDevIns, int rc);115 static DECLCALLBACK(void) pdm GCIoApicHlp_Unlock(PPDMDEVINS pDevIns);114 static DECLCALLBACK(int) pdmRCIoApicHlp_Lock(PPDMDEVINS pDevIns, int rc); 115 static DECLCALLBACK(void) pdmRCIoApicHlp_Unlock(PPDMDEVINS pDevIns); 116 116 /** @} */ 117 117 … … 166 166 167 167 /** 168 * The GuestContext APIC Helper Callbacks.169 */ 170 extern DECLEXPORT(const PDMAPICHLP GC) g_pdmGCApicHlp =171 { 172 PDM_APICHLP GC_VERSION,173 pdm GCApicHlp_SetInterruptFF,174 pdm GCApicHlp_ClearInterruptFF,175 pdm GCApicHlp_ChangeFeature,176 pdm GCApicHlp_Lock,177 pdm GCApicHlp_Unlock,178 PDM_APICHLP GC_VERSION168 * The Raw-Mode Context APIC Helper Callbacks. 169 */ 170 extern 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 179 179 }; 180 180 181 181 182 182 /** 183 * The GuestContext I/O APIC Helper Callbacks.184 */ 185 extern DECLEXPORT(const PDMIOAPICHLP GC) g_pdmGCIoApicHlp =186 { 187 PDM_IOAPICHLP GC_VERSION,188 pdm GCIoApicHlp_ApicBusDeliver,189 pdm GCIoApicHlp_Lock,190 pdm GCIoApicHlp_Unlock,191 PDM_IOAPICHLP GC_VERSION183 * The Raw-Mode Context I/O APIC Helper Callbacks. 184 */ 185 extern DECLEXPORT(const PDMIOAPICHLPRC) g_pdmRCIoApicHlp = 186 { 187 PDM_IOAPICHLPRC_VERSION, 188 pdmRCIoApicHlp_ApicBusDeliver, 189 pdmRCIoApicHlp_Lock, 190 pdmRCIoApicHlp_Unlock, 191 PDM_IOAPICHLPRC_VERSION 192 192 }; 193 193 … … 391 391 392 392 /** @copydoc PDMAPICHLPGC::pfnSetInterruptFF */ 393 static DECLCALLBACK(void) pdm GCApicHlp_SetInterruptFF(PPDMDEVINS pDevIns)394 { 395 PDMDEV_ASSERT_DEVINS(pDevIns); 396 LogFlow(("pdm GCApicHlp_SetInterruptFF: caller=%p/%d: VM_FF_INTERRUPT %d -> 1\n",393 static 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", 397 397 pDevIns, pDevIns->iInstance, VM_FF_ISSET(pDevIns->Internal.s.pVMGC, VM_FF_INTERRUPT_APIC))); 398 398 VM_FF_SET(pDevIns->Internal.s.pVMGC, VM_FF_INTERRUPT_APIC); … … 401 401 402 402 /** @copydoc PDMAPICHLPGC::pfnClearInterruptFF */ 403 static DECLCALLBACK(void) pdm GCApicHlp_ClearInterruptFF(PPDMDEVINS pDevIns)404 { 405 PDMDEV_ASSERT_DEVINS(pDevIns); 406 LogFlow(("pdm GCApicHlp_ClearInterruptFF: caller=%p/%d: VM_FF_INTERRUPT %d -> 0\n",403 static 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", 407 407 pDevIns, pDevIns->iInstance, VM_FF_ISSET(pDevIns->Internal.s.pVMGC, VM_FF_INTERRUPT_APIC))); 408 408 VM_FF_CLEAR(pDevIns->Internal.s.pVMGC, VM_FF_INTERRUPT_APIC); … … 411 411 412 412 /** @copydoc PDMAPICHLPGC::pfnChangeFeature */ 413 static DECLCALLBACK(void) pdm GCApicHlp_ChangeFeature(PPDMDEVINS pDevIns, bool fEnabled)414 { 415 PDMDEV_ASSERT_DEVINS(pDevIns); 416 LogFlow(("pdm GCApicHlp_ChangeFeature: caller=%p/%d: fEnabled=%RTbool\n", pDevIns, pDevIns->iInstance, fEnabled));413 static 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)); 417 417 if (fEnabled) 418 418 CPUMSetGuestCpuIdFeature(pDevIns->Internal.s.pVMGC, CPUMCPUIDFEATURE_APIC); … … 423 423 424 424 /** @copydoc PDMAPICHLPGC::pfnLock */ 425 static DECLCALLBACK(int) pdm GCApicHlp_Lock(PPDMDEVINS pDevIns, int rc)425 static DECLCALLBACK(int) pdmRCApicHlp_Lock(PPDMDEVINS pDevIns, int rc) 426 426 { 427 427 PDMDEV_ASSERT_DEVINS(pDevIns); … … 431 431 432 432 /** @copydoc PDMAPICHLPGC::pfnUnlock */ 433 static DECLCALLBACK(void) pdm GCApicHlp_Unlock(PPDMDEVINS pDevIns)433 static DECLCALLBACK(void) pdmRCApicHlp_Unlock(PPDMDEVINS pDevIns) 434 434 { 435 435 PDMDEV_ASSERT_DEVINS(pDevIns); … … 441 441 442 442 /** @copydoc PDMIOAPICHLPGC::pfnApicBusDeliver */ 443 static DECLCALLBACK(void) pdm GCIoApicHlp_ApicBusDeliver(PPDMDEVINS pDevIns, uint8_t u8Dest, uint8_t u8DestMode, uint8_t u8DeliveryMode,443 static DECLCALLBACK(void) pdmRCIoApicHlp_ApicBusDeliver(PPDMDEVINS pDevIns, uint8_t u8Dest, uint8_t u8DestMode, uint8_t u8DeliveryMode, 444 444 uint8_t iVector, uint8_t u8Polarity, uint8_t u8TriggerMode) 445 445 { 446 446 PDMDEV_ASSERT_DEVINS(pDevIns); 447 447 PVM pVM = pDevIns->Internal.s.pVMGC; 448 LogFlow(("pdm GCIoApicHlp_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", 449 449 pDevIns, pDevIns->iInstance, u8Dest, u8DestMode, u8DeliveryMode, iVector, u8Polarity, u8TriggerMode)); 450 if (pVM->pdm.s.Apic.pfnBusDeliver GC)451 pVM->pdm.s.Apic.pfnBusDeliver GC(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); 452 452 } 453 453 454 454 455 455 /** @copydoc PDMIOAPICHLPGC::pfnLock */ 456 static DECLCALLBACK(int) pdm GCIoApicHlp_Lock(PPDMDEVINS pDevIns, int rc)456 static DECLCALLBACK(int) pdmRCIoApicHlp_Lock(PPDMDEVINS pDevIns, int rc) 457 457 { 458 458 PDMDEV_ASSERT_DEVINS(pDevIns); … … 462 462 463 463 /** @copydoc PDMIOAPICHLPGC::pfnUnlock */ 464 static DECLCALLBACK(void) pdm GCIoApicHlp_Unlock(PPDMDEVINS pDevIns)464 static DECLCALLBACK(void) pdmRCIoApicHlp_Unlock(PPDMDEVINS pDevIns) 465 465 { 466 466 PDMDEV_ASSERT_DEVINS(pDevIns); … … 516 516 static void pdmGCIsaSetIrq(PVM pVM, int iIrq, int iLevel) 517 517 { 518 if ( ( pVM->pdm.s.IoApic.pDevIns GC518 if ( ( pVM->pdm.s.IoApic.pDevInsRC 519 519 || !pVM->pdm.s.IoApic.pDevInsR3) 520 520 && ( pVM->pdm.s.Pic.pDevInsGC … … 524 524 if (pVM->pdm.s.Pic.pDevInsGC) 525 525 pVM->pdm.s.Pic.pfnSetIrqGC(pVM->pdm.s.Pic.pDevInsGC, iIrq, iLevel); 526 if (pVM->pdm.s.IoApic.pDevIns GC)527 pVM->pdm.s.IoApic.pfnSetIrq GC(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); 528 528 pdmUnlock(pVM); 529 529 } … … 556 556 static void pdmGCIoApicSetIrq(PVM pVM, int iIrq, int iLevel) 557 557 { 558 if (pVM->pdm.s.IoApic.pDevIns GC)558 if (pVM->pdm.s.IoApic.pDevInsRC) 559 559 { 560 560 pdmLock(pVM); 561 pVM->pdm.s.IoApic.pfnSetIrq GC(pVM->pdm.s.IoApic.pDevInsGC, iIrq, iLevel);561 pVM->pdm.s.IoApic.pfnSetIrqRC(pVM->pdm.s.IoApic.pDevInsRC, iIrq, iLevel); 562 562 pdmUnlock(pVM); 563 563 } -
trunk/src/VBox/VMM/testcase/tstVMStructGC.cpp
r10202 r11219 275 275 GEN_CHECK_OFF(PDM, Apic.pfnGetTPRR0); 276 276 GEN_CHECK_OFF(PDM, Apic.pfnBusDeliverR0); 277 GEN_CHECK_OFF(PDM, Apic.pDevIns GC);278 GEN_CHECK_OFF(PDM, Apic.pfnGetInterrupt GC);279 GEN_CHECK_OFF(PDM, Apic.pfnSetBase GC);280 GEN_CHECK_OFF(PDM, Apic.pfnGetBase GC);281 GEN_CHECK_OFF(PDM, Apic.pfnSetTPR GC);282 GEN_CHECK_OFF(PDM, Apic.pfnGetTPR GC);283 GEN_CHECK_OFF(PDM, Apic.pfnBusDeliver GC);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); 284 284 GEN_CHECK_OFF(PDM, IoApic); 285 285 GEN_CHECK_OFF(PDM, IoApic.pDevInsR3); … … 287 287 GEN_CHECK_OFF(PDM, IoApic.pDevInsR0); 288 288 GEN_CHECK_OFF(PDM, IoApic.pfnSetIrqR0); 289 GEN_CHECK_OFF(PDM, IoApic.pDevIns GC);290 GEN_CHECK_OFF(PDM, IoApic.pfnSetIrq GC);289 GEN_CHECK_OFF(PDM, IoApic.pDevInsRC); 290 GEN_CHECK_OFF(PDM, IoApic.pfnSetIrqRC); 291 291 GEN_CHECK_OFF(PDM, pDmac); 292 292 GEN_CHECK_OFF(PDM, pRtc);
Note:
See TracChangeset
for help on using the changeset viewer.