Changeset 10492 in vbox for trunk/src/VBox
- Timestamp:
- Jul 11, 2008 8:14:13 AM (16 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/PC/DevAPIC.cpp
r10477 r10492 267 267 PDMBOTHCBDECL(int) apicMMIOWrite(PPDMDEVINS pDevIns, void *pvUser, RTGCPHYS GCPhysAddr, void *pv, unsigned cb); 268 268 PDMBOTHCBDECL(int) apicGetInterrupt(PPDMDEVINS pDevIns); 269 PDMBOTHCBDECL(bool) apicHasPendingIrq(PPDMDEVINS pDevIns); 269 270 PDMBOTHCBDECL(void) apicSetBase(PPDMDEVINS pDevIns, uint64_t val); 270 271 PDMBOTHCBDECL(uint64_t) apicGetBase(PPDMDEVINS pDevIns); … … 761 762 return intno; 762 763 } 764 765 /* Check if the APIC has a pending interrupt/if a TPR change would active one. */ 766 PDMBOTHCBDECL(bool) apicHasPendingIrq(PPDMDEVINS pDevIns) 767 { 768 APICState *s = PDMINS2DATA(pDevIns, APICState *); 769 return false; 770 } 771 763 772 764 773 static uint32_t apic_get_current_count(APICState *s) … … 1680 1689 * Register the APIC. 1681 1690 */ 1682 ApicReg.u32Version = PDM_APICREG_VERSION; 1683 ApicReg.pfnGetInterruptHC = apicGetInterrupt; 1684 ApicReg.pfnSetBaseHC = apicSetBase; 1685 ApicReg.pfnGetBaseHC = apicGetBase; 1686 ApicReg.pfnSetTPRHC = apicSetTPR; 1687 ApicReg.pfnGetTPRHC = apicGetTPR; 1688 ApicReg.pfnBusDeliverHC = apicBusDeliverCallback; 1691 ApicReg.u32Version = PDM_APICREG_VERSION; 1692 ApicReg.pfnGetInterruptHC = apicGetInterrupt; 1693 ApicReg.pfnHasPendingIrqHC = apicHasPendingIrq; 1694 ApicReg.pfnSetBaseHC = apicSetBase; 1695 ApicReg.pfnGetBaseHC = apicGetBase; 1696 ApicReg.pfnSetTPRHC = apicSetTPR; 1697 ApicReg.pfnGetTPRHC = apicGetTPR; 1698 ApicReg.pfnBusDeliverHC = apicBusDeliverCallback; 1689 1699 if (fGCEnabled) { 1690 1700 ApicReg.pszGetInterruptGC = "apicGetInterrupt"; 1701 ApicReg.pszHasPendingIrqGC = "apicHasPendingIrq"; 1691 1702 ApicReg.pszSetBaseGC = "apicSetBase"; 1692 1703 ApicReg.pszGetBaseGC = "apicGetBase"; … … 1696 1707 } else { 1697 1708 ApicReg.pszGetInterruptGC = NULL; 1709 ApicReg.pszHasPendingIrqGC = NULL; 1698 1710 ApicReg.pszSetBaseGC = NULL; 1699 1711 ApicReg.pszGetBaseGC = NULL; … … 1704 1716 if (fR0Enabled) { 1705 1717 ApicReg.pszGetInterruptR0 = "apicGetInterrupt"; 1718 ApicReg.pszHasPendingIrqR0 = "apicHasPendingIrq"; 1706 1719 ApicReg.pszSetBaseR0 = "apicSetBase"; 1707 1720 ApicReg.pszGetBaseR0 = "apicGetBase"; … … 1711 1724 } else { 1712 1725 ApicReg.pszGetInterruptR0 = NULL; 1726 ApicReg.pszHasPendingIrqR0 = NULL; 1713 1727 ApicReg.pszSetBaseR0 = NULL; 1714 1728 ApicReg.pszGetBaseR0 = NULL; -
trunk/src/VBox/VMM/PDMDevice.cpp
r10202 r10492 2645 2645 } 2646 2646 if ( !pApicReg->pfnGetInterruptHC 2647 || !pApicReg->pfnHasPendingIrqHC 2647 2648 || !pApicReg->pfnSetBaseHC 2648 2649 || !pApicReg->pfnGetBaseHC … … 2652 2653 { 2653 2654 Assert(pApicReg->pfnGetInterruptHC); 2655 Assert(pApicReg->pfnHasPendingIrqHC); 2654 2656 Assert(pApicReg->pfnSetBaseHC); 2655 2657 Assert(pApicReg->pfnGetBaseHC); … … 2661 2663 } 2662 2664 if ( ( pApicReg->pszGetInterruptGC 2665 || pApicReg->pszHasPendingIrqGC 2663 2666 || pApicReg->pszSetBaseGC 2664 2667 || pApicReg->pszGetBaseGC … … 2667 2670 || pApicReg->pszBusDeliverGC) 2668 2671 && ( !VALID_PTR(pApicReg->pszGetInterruptGC) 2672 || !VALID_PTR(pApicReg->pszHasPendingIrqGC) 2669 2673 || !VALID_PTR(pApicReg->pszSetBaseGC) 2670 2674 || !VALID_PTR(pApicReg->pszGetBaseGC) … … 2675 2679 { 2676 2680 Assert(VALID_PTR(pApicReg->pszGetInterruptGC)); 2681 Assert(VALID_PTR(pApicReg->pszHasPendingIrqGC)); 2677 2682 Assert(VALID_PTR(pApicReg->pszSetBaseGC)); 2678 2683 Assert(VALID_PTR(pApicReg->pszGetBaseGC)); … … 2684 2689 } 2685 2690 if ( ( pApicReg->pszGetInterruptR0 2691 || pApicReg->pszHasPendingIrqR0 2686 2692 || pApicReg->pszSetBaseR0 2687 2693 || pApicReg->pszGetBaseR0 … … 2690 2696 || pApicReg->pszBusDeliverR0) 2691 2697 && ( !VALID_PTR(pApicReg->pszGetInterruptR0) 2698 || !VALID_PTR(pApicReg->pszHasPendingIrqR0) 2692 2699 || !VALID_PTR(pApicReg->pszSetBaseR0) 2693 2700 || !VALID_PTR(pApicReg->pszGetBaseR0) … … 2698 2705 { 2699 2706 Assert(VALID_PTR(pApicReg->pszGetInterruptR0)); 2707 Assert(VALID_PTR(pApicReg->pszHasPendingIrqR0)); 2700 2708 Assert(VALID_PTR(pApicReg->pszSetBaseR0)); 2701 2709 Assert(VALID_PTR(pApicReg->pszGetBaseR0)); … … 2733 2741 if (RT_SUCCESS(rc)) 2734 2742 { 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)); 2745 } 2746 if (RT_SUCCESS(rc)) 2747 { 2735 2748 rc = PDMR3GetSymbolGCLazy(pVM, pDevIns->pDevReg->szGCMod, pApicReg->pszSetBaseGC, &pVM->pdm.s.Apic.pfnSetBaseGC); 2736 2749 AssertMsgRC(rc, ("%s::%s rc=%Vrc\n", pDevIns->pDevReg->szGCMod, pApicReg->pszSetBaseGC, rc)); … … 2767 2780 pVM->pdm.s.Apic.pDevInsGC = 0; 2768 2781 pVM->pdm.s.Apic.pfnGetInterruptGC = 0; 2782 pVM->pdm.s.Apic.pfnHasPendingIrqGC = 0; 2769 2783 pVM->pdm.s.Apic.pfnSetBaseGC = 0; 2770 2784 pVM->pdm.s.Apic.pfnGetBaseGC = 0; … … 2783 2797 if (RT_SUCCESS(rc)) 2784 2798 { 2799 rc = PDMR3GetSymbolR0Lazy(pVM, pDevIns->pDevReg->szR0Mod, pApicReg->pszHasPendingIrqR0, &pVM->pdm.s.Apic.pfnHasPendingIrqR0); 2800 AssertMsgRC(rc, ("%s::%s rc=%Vrc\n", pDevIns->pDevReg->szR0Mod, pApicReg->pszHasPendingIrqR0, rc)); 2801 } 2802 if (RT_SUCCESS(rc)) 2803 { 2785 2804 rc = PDMR3GetSymbolR0Lazy(pVM, pDevIns->pDevReg->szR0Mod, pApicReg->pszSetBaseR0, &pVM->pdm.s.Apic.pfnSetBaseR0); 2786 2805 AssertMsgRC(rc, ("%s::%s rc=%Vrc\n", pDevIns->pDevReg->szR0Mod, pApicReg->pszSetBaseR0, rc)); … … 2817 2836 { 2818 2837 pVM->pdm.s.Apic.pfnGetInterruptR0 = 0; 2838 pVM->pdm.s.Apic.pfnHasPendingIrqR0 = 0; 2819 2839 pVM->pdm.s.Apic.pfnSetBaseR0 = 0; 2820 2840 pVM->pdm.s.Apic.pfnGetBaseR0 = 0; … … 2830 2850 pVM->pdm.s.Apic.pDevInsR3 = pDevIns; 2831 2851 pVM->pdm.s.Apic.pfnGetInterruptR3 = pApicReg->pfnGetInterruptHC; 2852 pVM->pdm.s.Apic.pfnHasPendingIrqR3 = pApicReg->pfnHasPendingIrqHC; 2832 2853 pVM->pdm.s.Apic.pfnSetBaseR3 = pApicReg->pfnSetBaseHC; 2833 2854 pVM->pdm.s.Apic.pfnGetBaseR3 = pApicReg->pfnGetBaseHC; -
trunk/src/VBox/VMM/PDMInternal.h
r10202 r10492 388 388 /** @copydoc PDMAPICREG::pfnGetInterruptHC */ 389 389 DECLR3CALLBACKMEMBER(int, pfnGetInterruptR3,(PPDMDEVINS pDevIns)); 390 /** @copydoc PDMAPICREG::pfnHasPendingIrqHC */ 391 DECLR3CALLBACKMEMBER(bool, pfnHasPendingIrqR3,(PPDMDEVINS pDevIns)); 390 392 /** @copydoc PDMAPICREG::pfnSetBaseHC */ 391 393 DECLR3CALLBACKMEMBER(void, pfnSetBaseR3,(PPDMDEVINS pDevIns, uint64_t u64Base)); … … 404 406 /** @copydoc PDMAPICREG::pfnGetInterruptHC */ 405 407 DECLR0CALLBACKMEMBER(int, pfnGetInterruptR0,(PPDMDEVINS pDevIns)); 408 /** @copydoc PDMAPICREG::pfnHasPendingIrqHC */ 409 DECLR0CALLBACKMEMBER(bool, pfnHasPendingIrqR0,(PPDMDEVINS pDevIns)); 406 410 /** @copydoc PDMAPICREG::pfnSetBaseHC */ 407 411 DECLR0CALLBACKMEMBER(void, pfnSetBaseR0,(PPDMDEVINS pDevIns, uint64_t u64Base)); … … 420 424 /** @copydoc PDMAPICREG::pfnGetInterruptHC */ 421 425 DECLGCCALLBACKMEMBER(int, pfnGetInterruptGC,(PPDMDEVINS pDevIns)); 426 /** @copydoc PDMAPICREG::pfnHasPendingIrqHC */ 427 DECLGCCALLBACKMEMBER(bool, pfnHasPendingIrqGC,(PPDMDEVINS pDevIns)); 422 428 /** @copydoc PDMAPICREG::pfnSetBaseHC */ 423 429 DECLGCCALLBACKMEMBER(void, pfnSetBaseGC,(PPDMDEVINS pDevIns, uint64_t u64Base)); -
trunk/src/VBox/VMM/VMMAll/PDMAll.cpp
r10202 r10492 188 188 189 189 /** 190 * Check if the APIC has a pending interrupt/if a TPR change would active one 191 * 192 * @returns Pending interrupt yes/no 193 * @param pDevIns Device instance of the APIC. 194 * @param pfPending Pending state (out) 195 */ 196 PDMDECL(int) PDMApicHasPendingIrq(PVM pVM, bool *pfPending) 197 { 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)); 203 pdmUnlock(pVM); 204 return VINF_SUCCESS; 205 } 206 return VERR_PDM_NO_APIC_INSTANCE; 207 } 208 209 /** 190 210 * Set the TPR (task priority register?). 191 211 *
Note:
See TracChangeset
for help on using the changeset viewer.