Changeset 60601 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Apr 20, 2016 2:03:01 PM (9 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/APICAll.cpp
r60593 r60601 105 105 106 106 /** 107 * Atomically tests andsets the PIB notification bit.108 * 109 * @returns true if the bit was already set, falseotherwise.110 * @param p vPib Opaque pointer to the PIB.111 */ 112 DECLINLINE( bool) apicSetNotificationBitInPib(volatile void *pvPib)113 { 114 return ASMAtomic BitTestAndSet(pvPib, XAPIC_PIB_NOTIFICATION_BIT);107 * Atomically sets the PIB notification bit. 108 * 109 * @returns non-zero if the bit was already set, 0 otherwise. 110 * @param pApicPib Pointer to the PIB. 111 */ 112 DECLINLINE(uint32_t) apicSetNotificationBitInPib(PAPICPIB pApicPib) 113 { 114 return ASMAtomicXchgU32(&pApicPib->fOutstandingNotification, RT_BIT_32(31)); 115 115 } 116 116 … … 119 119 * Atomically tests and clears the PIB notification bit. 120 120 * 121 * @returns true if the bit was already set, false otherwise. 122 */ 123 DECLINLINE(bool) apicClearNotificationBitInPib(volatile void *pvPib) 124 { 125 return ASMAtomicBitTestAndClear(pvPib, XAPIC_PIB_NOTIFICATION_BIT); 121 * @returns non-zero if the bit was already set, 0 otherwise. 122 * @param pApicPib Pointer to the PIB. 123 */ 124 DECLINLINE(uint32_t) apicClearNotificationBitInPib(PAPICPIB pApicPib) 125 { 126 return ASMAtomicXchgU32(&pApicPib->fOutstandingNotification, UINT32_C(0)); 126 127 } 127 128 … … 2442 2443 else 2443 2444 { 2444 Assert(CTX_SUFF(pApicCpu->pvApicPib)); 2445 apicSetVectorInPib(CTX_SUFF(pApicCpu->pvApicPib), uVector); 2446 bool const fAlreadySet = apicSetNotificationBitInPib(CTX_SUFF(pApicCpu->pvApicPib)); 2445 apicSetVectorInPib(pApicCpu->CTX_SUFF(pvApicPib), uVector); 2446 uint32_t const fAlreadySet = apicSetNotificationBitInPib((PAPICPIB)pApicCpu->CTX_SUFF(pvApicPib)); 2447 2447 if (!fAlreadySet) 2448 2448 APICSetInterruptFF(pVCpu, PDMAPICIRQ_HARDWARE); … … 2455 2455 * delivered asynchronously. 2456 2456 */ 2457 apicSetVectorInPib(&pApicCpu->ApicPibLevel .aVectorBitmap[0], uVector);2458 bool const fAlreadySet = apicSetNotificationBitInPib(&pApicCpu->ApicPibLevel.aVectorBitmap[0]);2457 apicSetVectorInPib(&pApicCpu->ApicPibLevel, uVector); 2458 uint32_t const fAlreadySet = apicSetNotificationBitInPib((PAPICPIB)&pApicCpu->ApicPibLevel); 2459 2459 if (!fAlreadySet) 2460 2460 APICSetInterruptFF(pVCpu, PDMAPICIRQ_HARDWARE); … … 2636 2636 for (;;) 2637 2637 { 2638 bool const fAlreadySet = apicClearNotificationBitInPib(CTX_SUFF(pApicCpu->pvApicPib));2638 uint32_t const fAlreadySet = apicClearNotificationBitInPib((PAPICPIB)pApicCpu->CTX_SUFF(pvApicPib)); 2639 2639 if (!fAlreadySet) 2640 2640 break; … … 2663 2663 for (;;) 2664 2664 { 2665 bool const fAlreadySet = apicClearNotificationBitInPib(&pApicCpu->ApicPibLevel);2665 uint32_t const fAlreadySet = apicClearNotificationBitInPib((PAPICPIB)&pApicCpu->ApicPibLevel); 2666 2666 if (!fAlreadySet) 2667 2667 break; -
trunk/src/VBox/VMM/VMMR3/APIC.cpp
r60593 r60601 148 148 }; 149 149 150 /** Saved state field descriptors for APICPIB. */ 151 static const SSMFIELD g_aApicPibFields[] = 152 { 153 SSMFIELD_ENTRY(APICPIB, aVectorBitmap[0]), 154 SSMFIELD_ENTRY(APICPIB, aVectorBitmap[1]), 155 SSMFIELD_ENTRY(APICPIB, aVectorBitmap[2]), 156 SSMFIELD_ENTRY(APICPIB, aVectorBitmap[3]), 157 SSMFIELD_ENTRY(APICPIB, fOutstandingNotification), 158 SSMFIELD_ENTRY_TERM() 159 }; 150 160 151 161 /** … … 655 665 PCAPICCPU pApicCpu = VMCPU_TO_APICCPU(pVCpu); 656 666 667 /* Save the auxiliary data. */ 657 668 SSMR3PutU64(pSSM, pApicCpu->uApicBaseMsr); 658 659 /** @todo */ 669 SSMR3PutU32(pSSM, pApicCpu->uEsrInternal); 670 671 /* Save the APIC page. */ 672 if (XAPIC_IN_X2APIC_MODE(pVCpu)) 673 SSMR3PutStruct(pSSM, (const void *)pApicCpu->pvApicPageR3, g_aX2ApicPageFields); 674 else 675 SSMR3PutStruct(pSSM, (const void *)pApicCpu->pvApicPageR3, g_aXApicPageFields); 676 677 /* Save the PIBs: We could in theory push them to vIRR and avoid saving them, 678 but in case of posted-interrupts we can't do that at this point, so save in all cases. */ 679 SSMR3PutStruct(pSSM, (const void *)pApicCpu->pvApicPibR3, g_aApicPibFields); 680 SSMR3PutStruct(pSSM, (const void *)&pApicCpu->ApicPibLevel, g_aApicPibFields); 681 682 /* Save the timer. */ 683 TMR3TimerSave(pApicCpu->pTimerR3, pSSM); 684 SSMR3PutU64(pSSM, pApicCpu->u64TimerInitial); 685 686 /** @todo anything else? */ 660 687 } 661 688
Note:
See TracChangeset
for help on using the changeset viewer.