kerneltest/e32test/defrag/t_ramdefrag.cpp
changeset 243 c7a0ce20c48c
parent 176 af6ec97d9189
equal deleted inserted replaced
231:75252ea6123b 243:c7a0ce20c48c
   541 	gTestStarted = ETrue;
   541 	gTestStarted = ETrue;
   542 
   542 
   543 	Ldd.ResetDriver();
   543 	Ldd.ResetDriver();
   544 	
   544 	
   545 	Ldd.CallDefrag(DEFRAG_TYPE_GEN, DEFRAG_VER_SYNC);
   545 	Ldd.CallDefrag(DEFRAG_TYPE_GEN, DEFRAG_VER_SYNC);
   546 	if (VerifyMovDisAlloc() != KErrNone)
   546 	TInt r;
       
   547 	r = VerifyMovDisAlloc();
       
   548 	if (r == KErrGeneral)
       
   549 		{
       
   550 		// A rare set of circumstances may cause some of the movable pages to be in
       
   551 		// use during the defrag and thus not be moved to the correct RAM zone. Run
       
   552 		// the defrag once more to give it a chance to move these pages. We ensure
       
   553 		// that there is no pending asynchronous clean up operation before doing so.
       
   554 		UserSvr::HalFunction(EHalGroupKernel, EKernelHalSupervisorBarrier, 0, 0);
       
   555 		Ldd.CallDefrag(DEFRAG_TYPE_GEN, DEFRAG_VER_SYNC);
       
   556 		r = VerifyMovDisAlloc();
       
   557 		}
       
   558 
       
   559 	if (r != KErrNone)
   547 		{
   560 		{
   548 		CLEANUP(;);
   561 		CLEANUP(;);
   549 		TEST_FAIL;
   562 		TEST_FAIL;
   550 		}
   563 		}
   551 	
   564