- Timestamp:
- May 12, 2009 7:56:07 AM (16 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/pdmcritsect.h
r19589 r19593 72 72 VMMR3DECL(int) PDMR3CritSectDelete(PPDMCRITSECT pCritSect); 73 73 VMMDECL(int) PDMR3CritSectTerm(PVM pVM); 74 VMMR3DECL(void) PDMR3CritSectFF(PVM pVM);74 VMMR3DECL(void) PDMR3CritSectFF(PVMCPU pVCpu); 75 75 VMMR3DECL(uint32_t) PDMR3CritSectCountOwned(PVM pVM, char *pszNames, size_t cbNames); 76 76 -
trunk/include/VBox/vm.h
r19482 r19593 181 181 char padding[256]; /* multiple of 64 */ 182 182 } vmm; 183 184 /** PDM part. */ 185 union 186 { 187 #ifdef ___PDMInternal_h 188 struct PDMCPU s; 189 #endif 190 char padding[128]; /* multiple of 64 */ 191 } pdm; 183 192 184 193 /** DBGF part. … … 240 249 #define VM_FF_PDM_DMA_BIT 4 241 250 #define VM_FF_PDM_DMA RT_BIT_32(VM_FF_PDM_DMA_BIT) 242 /** PDM critical section unlocking is pending, process promptly upon return to R3. */243 #define VM_FF_PDM_CRITSECT RT_BIT_32(5)244 251 /** This action forces the VM to call DBGF so DBGF can service debugger 245 252 * requests in the emulation thread. … … 273 280 /** This action forces the VM to schedule and run pending timer (TM). (bogus for now; needed for PATM backwards compatibility) */ 274 281 #define VMCPU_FF_TIMER RT_BIT_32(2) 282 /** PDM critical section unlocking is pending, process promptly upon return to R3. */ 283 #define VMCPU_FF_PDM_CRITSECT RT_BIT_32(5) 275 284 /** This action forces the VM to service pending requests from other 276 285 * thread or requests which must be executed in another context. */ … … 325 334 326 335 /** High priority post-execution actions. */ 327 #define VM_FF_HIGH_PRIORITY_POST_MASK (VM_FF_P DM_CRITSECT | VM_FF_PGM_NO_MEMORY)336 #define VM_FF_HIGH_PRIORITY_POST_MASK (VM_FF_PGM_NO_MEMORY) 328 337 /** High priority post-execution actions. */ 329 #define VMCPU_FF_HIGH_PRIORITY_POST_MASK (VMCPU_FF_ CSAM_PENDING_ACTION)338 #define VMCPU_FF_HIGH_PRIORITY_POST_MASK (VMCPU_FF_PDM_CRITSECT|VMCPU_FF_CSAM_PENDING_ACTION) 330 339 331 340 /** Normal priority VM post-execution actions. */ … … 353 362 354 363 /** All the forced VM flags. */ 355 #define VM_FF_ALL_BUT_RAW_MASK (~(VM_FF_HIGH_PRIORITY_PRE_RAW_MASK | VM_FF_PDM_CRITSECT) | VM_FF_PGM_NO_MEMORY)364 #define VM_FF_ALL_BUT_RAW_MASK (~(VM_FF_HIGH_PRIORITY_PRE_RAW_MASK) | VM_FF_PGM_NO_MEMORY) 356 365 /** All the forced VMCPU flags. */ 357 #define VMCPU_FF_ALL_BUT_RAW_MASK (~(VMCPU_FF_HIGH_PRIORITY_PRE_RAW_MASK | VMCPU_FF_CSAM_PENDING_ACTION ))366 #define VMCPU_FF_ALL_BUT_RAW_MASK (~(VMCPU_FF_HIGH_PRIORITY_PRE_RAW_MASK | VMCPU_FF_CSAM_PENDING_ACTION | VMCPU_FF_PDM_CRITSECT)) 358 367 359 368 /** @} */ -
trunk/src/VBox/VMM/EM.cpp
r19481 r19593 3256 3256 static int emR3HighPriorityPostForcedActions(PVM pVM, PVMCPU pVCpu, int rc) 3257 3257 { 3258 if (VM _FF_ISPENDING(pVM, VM_FF_PDM_CRITSECT))3259 PDMR3CritSectFF(pV M);3258 if (VMCPU_FF_ISPENDING(pVCpu, VMCPU_FF_PDM_CRITSECT)) 3259 PDMR3CritSectFF(pVCpu); 3260 3260 3261 3261 if (VMCPU_FF_ISPENDING(pVCpu, VMCPU_FF_CSAM_PENDING_ACTION)) -
trunk/src/VBox/VMM/PDMCritSect.cpp
r19439 r19593 295 295 * Process the critical sections queued for ring-3 'leave'. 296 296 * 297 * @param pV M The VMhandle.298 */ 299 VMMR3DECL(void) PDMR3CritSectFF(PVM pVM)300 { 301 Assert(pV M->pdm.s.cQueuedCritSectLeaves > 0);302 303 const RTUINT c = pV M->pdm.s.cQueuedCritSectLeaves;297 * @param pVCpu The VMCPU handle. 298 */ 299 VMMR3DECL(void) PDMR3CritSectFF(PVMCPU pVCpu) 300 { 301 Assert(pVCpu->pdm.s.cQueuedCritSectLeaves > 0); 302 303 const RTUINT c = pVCpu->pdm.s.cQueuedCritSectLeaves; 304 304 for (RTUINT i = 0; i < c; i++) 305 305 { 306 PPDMCRITSECT pCritSect = pV M->pdm.s.apQueuedCritSectsLeaves[i];306 PPDMCRITSECT pCritSect = pVCpu->pdm.s.apQueuedCritSectsLeaves[i]; 307 307 int rc = RTCritSectLeave(&pCritSect->s.Core); 308 308 LogFlow(("PDMR3CritSectFF: %p - %Rrc\n", pCritSect, rc)); … … 310 310 } 311 311 312 pV M->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); 314 314 } 315 315 -
trunk/src/VBox/VMM/PDMInternal.h
r19475 r19593 797 797 typedef struct PDMASYNCCOMPLETIONMANAGER *PPDMASYNCCOMPLETIONMANAGER; 798 798 799 800 /** 801 * PDM VMCPU Instance data. 802 * Changes to this must checked against the padding of the cfgm union in VMCPU! 803 */ 804 typedef 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 799 814 /** 800 815 * Converts a PDM pointer into a VM pointer. … … 850 865 RCPTRTYPE(PPDMQUEUE) pDevHlpQueueRC; 851 866 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. */ 857 868 858 869 /** Linked list of timer driven PDM queues. */ … … 867 878 RCPTRTYPE(struct PDMQUEUE *) pQueueFlushRC; 868 879 #if HC_ARCH_BITS == 64 869 RTRCPTR padding0;880 RTRCPTR uPadding2; 870 881 #endif 871 882 -
trunk/src/VBox/VMM/VMM.cpp
r19582 r19593 1687 1687 PRINT_FLAG(VM_FF_,PDM_QUEUES); 1688 1688 PRINT_FLAG(VM_FF_,PDM_DMA); 1689 PRINT_FLAG(VM_FF_,PDM_CRITSECT);1690 1689 PRINT_FLAG(VM_FF_,DBGF); 1691 1690 PRINT_FLAG(VM_FF_,REQUEST); … … 1728 1727 PRINT_FLAG(VMCPU_FF_,INTERRUPT_APIC); 1729 1728 PRINT_FLAG(VMCPU_FF_,INTERRUPT_PIC); 1729 PRINT_FLAG(VMCPU_FF_,PDM_CRITSECT); 1730 1730 PRINT_FLAG(VMCPU_FF_,PGM_SYNC_CR3); 1731 1731 PRINT_FLAG(VMCPU_FF_,PGM_SYNC_CR3_NON_GLOBAL); -
trunk/src/VBox/VMM/VMMAll/PDMAllCritSect.cpp
r19590 r19593 253 253 * Queue the request. 254 254 */ 255 RTUINT i = pV M->pdm.s.cQueuedCritSectLeaves++;255 RTUINT i = pVCpu->pdm.s.cQueuedCritSectLeaves++; 256 256 LogFlow(("PDMCritSectLeave: [%d]=%p => R3\n", i, pCritSect)); 257 AssertFatal(i < RT_ELEMENTS(pV M->pdm.s.apQueuedCritSectsLeaves));258 pV M->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); 260 260 VMCPU_FF_SET(pVCpu, VMCPU_FF_TO_R3); 261 261 STAM_REL_COUNTER_INC(&pVM->pdm.s.StatQueuedCritSectLeaves); -
trunk/src/VBox/VMM/testcase/tstVMStructGC.cpp
r19462 r19593 332 332 GEN_CHECK_OFF(PDM, pDevHlpQueueR0); 333 333 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); 336 336 GEN_CHECK_OFF(PDM, pQueuesTimer); 337 337 GEN_CHECK_OFF(PDM, pQueuesForced);
Note:
See TracChangeset
for help on using the changeset viewer.