VirtualBox

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


Ignore:
Timestamp:
May 12, 2009 7:56:07 AM (16 years ago)
Author:
vboxsync
Message:

Split up PDM.

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

Legend:

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

    r19481 r19593  
    32563256static int emR3HighPriorityPostForcedActions(PVM pVM, PVMCPU pVCpu, int rc)
    32573257{
    3258     if (VM_FF_ISPENDING(pVM, VM_FF_PDM_CRITSECT))
    3259         PDMR3CritSectFF(pVM);
     3258    if (VMCPU_FF_ISPENDING(pVCpu, VMCPU_FF_PDM_CRITSECT))
     3259        PDMR3CritSectFF(pVCpu);
    32603260
    32613261    if (VMCPU_FF_ISPENDING(pVCpu, VMCPU_FF_CSAM_PENDING_ACTION))
  • trunk/src/VBox/VMM/PDMCritSect.cpp

    r19439 r19593  
    295295 * Process the critical sections queued for ring-3 'leave'.
    296296 *
    297  * @param   pVM         The VM handle.
    298  */
    299 VMMR3DECL(void) PDMR3CritSectFF(PVM pVM)
    300 {
    301     Assert(pVM->pdm.s.cQueuedCritSectLeaves > 0);
    302 
    303     const RTUINT c = pVM->pdm.s.cQueuedCritSectLeaves;
     297 * @param   pVCpu         The VMCPU handle.
     298 */
     299VMMR3DECL(void) PDMR3CritSectFF(PVMCPU pVCpu)
     300{
     301    Assert(pVCpu->pdm.s.cQueuedCritSectLeaves > 0);
     302
     303    const RTUINT c = pVCpu->pdm.s.cQueuedCritSectLeaves;
    304304    for (RTUINT i = 0; i < c; i++)
    305305    {
    306         PPDMCRITSECT pCritSect = pVM->pdm.s.apQueuedCritSectsLeaves[i];
     306        PPDMCRITSECT pCritSect = pVCpu->pdm.s.apQueuedCritSectsLeaves[i];
    307307        int rc = RTCritSectLeave(&pCritSect->s.Core);
    308308        LogFlow(("PDMR3CritSectFF: %p - %Rrc\n", pCritSect, rc));
     
    310310    }
    311311
    312     pVM->pdm.s.cQueuedCritSectLeaves = 0;
    313     VM_FF_CLEAR(pVM, VM_FF_PDM_CRITSECT);
     312    pVCpu->pdm.s.cQueuedCritSectLeaves = 0;
     313    VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_PDM_CRITSECT);
    314314}
    315315
  • trunk/src/VBox/VMM/PDMInternal.h

    r19475 r19593  
    797797typedef struct PDMASYNCCOMPLETIONMANAGER *PPDMASYNCCOMPLETIONMANAGER;
    798798
     799
     800/**
     801 * PDM VMCPU Instance data.
     802 * Changes to this must checked against the padding of the cfgm union in VMCPU!
     803 */
     804typedef struct PDMCPU
     805{
     806    /** The number of entries in the apQueuedCritSectsLeaves table that's currnetly in use. */
     807    RTUINT                          cQueuedCritSectLeaves;
     808    RTUINT                          uPadding0; /**< Alignment padding.*/
     809    /** Critical sections queued in RC/R0 because of contention preventing leave to complete. (R3 Ptrs)
     810     * We will return to Ring-3 ASAP, so this queue doesn't have to be very long. */
     811    R3PTRTYPE(PPDMCRITSECT)         apQueuedCritSectsLeaves[8];
     812} PDMCPU;
     813
    799814/**
    800815 * Converts a PDM pointer into a VM pointer.
     
    850865    RCPTRTYPE(PPDMQUEUE)            pDevHlpQueueRC;
    851866
    852     /** The number of entries in the apQueuedCritSectsLeaves table that's currnetly in use. */
    853     RTUINT                          cQueuedCritSectLeaves;
    854     /** Critical sections queued in RC/R0 because of contention preventing leave to complete. (R3 Ptrs)
    855      * We will return to Ring-3 ASAP, so this queue doesn't have to be very long. */
    856     R3PTRTYPE(PPDMCRITSECT)         apQueuedCritSectsLeaves[8];
     867    RTUINT                          uPadding1; /**< Alignment padding. */
    857868
    858869    /** Linked list of timer driven PDM queues. */
     
    867878    RCPTRTYPE(struct PDMQUEUE *)    pQueueFlushRC;
    868879#if HC_ARCH_BITS == 64
    869     RTRCPTR                         padding0;
     880    RTRCPTR                         uPadding2;
    870881#endif
    871882
  • trunk/src/VBox/VMM/VMM.cpp

    r19582 r19593  
    16871687    PRINT_FLAG(VM_FF_,PDM_QUEUES);
    16881688    PRINT_FLAG(VM_FF_,PDM_DMA);
    1689     PRINT_FLAG(VM_FF_,PDM_CRITSECT);
    16901689    PRINT_FLAG(VM_FF_,DBGF);
    16911690    PRINT_FLAG(VM_FF_,REQUEST);
     
    17281727        PRINT_FLAG(VMCPU_FF_,INTERRUPT_APIC);
    17291728        PRINT_FLAG(VMCPU_FF_,INTERRUPT_PIC);
     1729        PRINT_FLAG(VMCPU_FF_,PDM_CRITSECT);
    17301730        PRINT_FLAG(VMCPU_FF_,PGM_SYNC_CR3);
    17311731        PRINT_FLAG(VMCPU_FF_,PGM_SYNC_CR3_NON_GLOBAL);
  • trunk/src/VBox/VMM/VMMAll/PDMAllCritSect.cpp

    r19590 r19593  
    253253     * Queue the request.
    254254     */
    255     RTUINT i = pVM->pdm.s.cQueuedCritSectLeaves++;
     255    RTUINT i = pVCpu->pdm.s.cQueuedCritSectLeaves++;
    256256    LogFlow(("PDMCritSectLeave: [%d]=%p => R3\n", i, pCritSect));
    257     AssertFatal(i < RT_ELEMENTS(pVM->pdm.s.apQueuedCritSectsLeaves));
    258     pVM->pdm.s.apQueuedCritSectsLeaves[i] = MMHyperCCToR3(pVM, pCritSect);
    259     VM_FF_SET(pVM, VM_FF_PDM_CRITSECT);
     257    AssertFatal(i < RT_ELEMENTS(pVCpu->pdm.s.apQueuedCritSectsLeaves));
     258    pVCpu->pdm.s.apQueuedCritSectsLeaves[i] = MMHyperCCToR3(pVM, pCritSect);
     259    VMCPU_FF_SET(pVCpu, VMCPU_FF_PDM_CRITSECT);
    260260    VMCPU_FF_SET(pVCpu, VMCPU_FF_TO_R3);
    261261    STAM_REL_COUNTER_INC(&pVM->pdm.s.StatQueuedCritSectLeaves);
  • trunk/src/VBox/VMM/testcase/tstVMStructGC.cpp

    r19462 r19593  
    332332    GEN_CHECK_OFF(PDM, pDevHlpQueueR0);
    333333    GEN_CHECK_OFF(PDM, pDevHlpQueueRC);
    334     GEN_CHECK_OFF(PDM, cQueuedCritSectLeaves);
    335     GEN_CHECK_OFF(PDM, apQueuedCritSectsLeaves);
     334    GEN_CHECK_OFF(PDMCPU, cQueuedCritSectLeaves);
     335    GEN_CHECK_OFF(PDMCPU, apQueuedCritSectsLeaves);
    336336    GEN_CHECK_OFF(PDM, pQueuesTimer);
    337337    GEN_CHECK_OFF(PDM, pQueuesForced);
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