Changeset 44505 in vbox for trunk/src/VBox/VMM/VMMR3
- Timestamp:
- Feb 1, 2013 10:26:12 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/SSM.cpp
r44393 r44505 147 147 #include <VBox/vmm/ssm.h> 148 148 #include <VBox/vmm/dbgf.h> 149 #include <VBox/vmm/pdmapi.h> 150 #include <VBox/vmm/pdmcritsect.h> 149 151 #include <VBox/vmm/mm.h> 150 152 #include "SSMInternal.h" … … 1253 1255 pUnit->u.Dev.pfnLoadDone = pfnLoadDone; 1254 1256 pUnit->u.Dev.pDevIns = pDevIns; 1257 pUnit->pCritSect = PDMR3DevGetCritSect(pVM, pDevIns); 1255 1258 } 1256 1259 return rc; … … 4239 4242 4240 4243 4244 4245 /** 4246 * Enters the critical session (optionally) associated with the unit. 4247 * 4248 * @param pUnit The unit. 4249 */ 4250 DECLINLINE(void) ssmR3UnitCritSectEnter(PSSMUNIT pUnit) 4251 { 4252 PPDMCRITSECT pCritSect = pUnit->pCritSect; 4253 if (pCritSect) 4254 { 4255 int rc = PDMCritSectEnter(pCritSect, VERR_IGNORED); 4256 AssertRC(rc); 4257 } 4258 } 4259 4260 4261 /** 4262 * Leaves the critical session (optionally) associated with the unit. 4263 * 4264 * @param pUnit The unit. 4265 */ 4266 DECLINLINE(void) ssmR3UnitCritSectLeave(PSSMUNIT pUnit) 4267 { 4268 PPDMCRITSECT pCritSect = pUnit->pCritSect; 4269 if (pCritSect) 4270 { 4271 int rc = PDMCritSectLeave(pCritSect); 4272 AssertRC(rc); 4273 } 4274 } 4275 4276 4241 4277 /** 4242 4278 * Do the pfnSaveDone run. … … 4262 4298 int rcOld = pSSM->rc; 4263 4299 int rc; 4300 ssmR3UnitCritSectEnter(pUnit); 4264 4301 switch (pUnit->enmType) 4265 4302 { … … 4280 4317 break; 4281 4318 } 4319 ssmR3UnitCritSectLeave(pUnit); 4282 4320 if (RT_SUCCESS(rc) && pSSM->rc != rcOld) 4283 4321 rc = pSSM->rc; … … 4609 4647 */ 4610 4648 ssmR3DataWriteBegin(pSSM); 4649 ssmR3UnitCritSectEnter(pUnit); 4611 4650 switch (pUnit->enmType) 4612 4651 { … … 4628 4667 break; 4629 4668 } 4669 ssmR3UnitCritSectLeave(pUnit); 4630 4670 pUnit->fCalled = true; 4631 4671 if (RT_FAILURE(rc) && RT_SUCCESS_NP(pSSM->rc)) … … 4697 4737 { 4698 4738 int rc; 4739 ssmR3UnitCritSectEnter(pUnit); 4699 4740 switch (pUnit->enmType) 4700 4741 { … … 4715 4756 break; 4716 4757 } 4758 ssmR3UnitCritSectLeave(pUnit); 4717 4759 pUnit->fCalled = true; 4718 4760 if (RT_FAILURE(rc) && RT_SUCCESS_NP(pSSM->rc)) … … 5038 5080 { 5039 5081 int rc; 5082 ssmR3UnitCritSectEnter(pUnit); 5040 5083 switch (pUnit->enmType) 5041 5084 { … … 5056 5099 break; 5057 5100 } 5101 ssmR3UnitCritSectLeave(pUnit); 5058 5102 pUnit->fCalled = true; 5059 5103 Assert(pSSM->rc == VINF_SUCCESS); … … 5176 5220 */ 5177 5221 ssmR3DataWriteBegin(pSSM); 5222 ssmR3UnitCritSectEnter(pUnit); 5178 5223 switch (pUnit->enmType) 5179 5224 { … … 5194 5239 break; 5195 5240 } 5241 ssmR3UnitCritSectLeave(pUnit); 5196 5242 pUnit->fCalled = true; 5197 5243 if (RT_FAILURE(rc) && RT_SUCCESS_NP(pSSM->rc)) … … 5333 5379 { 5334 5380 int rc; 5381 ssmR3UnitCritSectEnter(pUnit); 5335 5382 switch (pUnit->enmType) 5336 5383 { … … 5351 5398 break; 5352 5399 } 5400 ssmR3UnitCritSectLeave(pUnit); 5353 5401 pUnit->fCalled = true; 5354 5402 if (RT_FAILURE(rc) && RT_SUCCESS_NP(pSSM->rc)) … … 7918 7966 break; 7919 7967 } 7968 ssmR3UnitCritSectEnter(pUnit); 7920 7969 switch (pUnit->enmType) 7921 7970 { … … 7936 7985 break; 7937 7986 } 7987 ssmR3UnitCritSectLeave(pUnit); 7938 7988 pUnit->fCalled = true; 7939 7989 if (RT_FAILURE(rc) && RT_SUCCESS_NP(pSSM->rc)) … … 8181 8231 pSSM->u.Read.pCurUnit = pUnit; 8182 8232 ssmR3DataReadBeginV2(pSSM); 8233 ssmR3UnitCritSectEnter(pUnit); 8183 8234 switch (pUnit->enmType) 8184 8235 { … … 8199 8250 break; 8200 8251 } 8252 ssmR3UnitCritSectLeave(pUnit); 8201 8253 pUnit->fCalled = true; 8202 8254 if (RT_FAILURE(rc) && RT_SUCCESS_NP(pSSM->rc)) … … 8351 8403 Handle.u.Read.pCurUnit = pUnit; 8352 8404 pUnit->fCalled = true; 8405 ssmR3UnitCritSectEnter(pUnit); 8353 8406 switch (pUnit->enmType) 8354 8407 { … … 8369 8422 break; 8370 8423 } 8424 ssmR3UnitCritSectLeave(pUnit); 8371 8425 Handle.u.Read.pCurUnit = NULL; 8372 8426 if (RT_FAILURE(rc) && RT_SUCCESS_NP(Handle.rc)) … … 8422 8476 int const rcOld = Handle.rc; 8423 8477 rc = VINF_SUCCESS; 8478 ssmR3UnitCritSectEnter(pUnit); 8424 8479 switch (pUnit->enmType) 8425 8480 { … … 8440 8495 break; 8441 8496 } 8497 ssmR3UnitCritSectLeave(pUnit); 8442 8498 Handle.u.Read.pCurUnit = NULL; 8443 8499 if (RT_SUCCESS(rc) && Handle.rc != rcOld)
Note:
See TracChangeset
for help on using the changeset viewer.