kerneltest/e32test/defrag/d_ramdefrag.cpp
branchRCL_3
changeset 257 3e88ff8f41d5
parent 256 c1f20ce4abcf
equal deleted inserted replaced
256:c1f20ce4abcf 257:3e88ff8f41d5
    70 	TInt ZoneAllocToMany(TInt aZoneIndex, TInt aNumPages);
    70 	TInt ZoneAllocToMany(TInt aZoneIndex, TInt aNumPages);
    71 	TInt ZoneAllocToManyArray(TInt aZoneIndex, TInt aNumPages);
    71 	TInt ZoneAllocToManyArray(TInt aZoneIndex, TInt aNumPages);
    72 	TInt ZoneAllocToMany2(TInt aZoneIndex, TInt aNumPages);
    72 	TInt ZoneAllocToMany2(TInt aZoneIndex, TInt aNumPages);
    73 	TInt AllocContiguous(TUint aNumBytes);
    73 	TInt AllocContiguous(TUint aNumBytes);
    74 	TInt FreeZone(TInt aNumPages);
    74 	TInt FreeZone(TInt aNumPages);
    75 	TInt FreeZoneId(TUint aZoneId);
       
    76 	TInt FreeFromAllZones();
    75 	TInt FreeFromAllZones();
    77 	TInt FreeFromAddr(TInt aNumPages, TUint32 aAddr);
    76 	TInt FreeFromAddr(TInt aNumPages, TUint32 aAddr);
    78 	TInt PageCount(TUint aId, STestUserSidePageCount* aPageData);
    77 	TInt PageCount(TUint aId, STestUserSidePageCount* aPageData);
    79 	TInt CancelDefrag();
    78 	TInt CancelDefrag();
    80 	TInt CheckCancel(STestParameters* aParams);
    79 	TInt CheckCancel(STestParameters* aParams);
   386 			retVal = DRamDefragFuncTestChannel::AllocContiguous((TUint)a1);	
   385 			retVal = DRamDefragFuncTestChannel::AllocContiguous((TUint)a1);	
   387 			break;
   386 			break;
   388 
   387 
   389 		case RRamDefragFuncTestLdd::EFreeZone:
   388 		case RRamDefragFuncTestLdd::EFreeZone:
   390 			retVal = DRamDefragFuncTestChannel::FreeZone((TInt)a1);
   389 			retVal = DRamDefragFuncTestChannel::FreeZone((TInt)a1);
   391 			break;
       
   392 
       
   393 		case RRamDefragFuncTestLdd::EFreeZoneId:
       
   394 			retVal = DRamDefragFuncTestChannel::FreeZoneId((TUint)a1);
       
   395 			break;
   390 			break;
   396 
   391 
   397 		case RRamDefragFuncTestLdd::EFreeFromAllZones:
   392 		case RRamDefragFuncTestLdd::EFreeFromAllZones:
   398 			retVal = DRamDefragFuncTestChannel::FreeFromAllZones();	
   393 			retVal = DRamDefragFuncTestChannel::FreeFromAllZones();	
   399 			break;
   394 			break;
  1515 	NKern::ThreadLeaveCS();
  1510 	NKern::ThreadLeaveCS();
  1516 	return returnValue;
  1511 	return returnValue;
  1517 	}
  1512 	}
  1518 
  1513 
  1519 //
  1514 //
  1520 // FreeZoneId
       
  1521 //
       
  1522 // Call Epoc::FreeRamZone()
       
  1523 //
       
  1524 TInt DRamDefragFuncTestChannel::FreeZoneId(TUint aZoneId)
       
  1525 	{
       
  1526 	NKern::ThreadEnterCS();
       
  1527 	
       
  1528 	TInt r = Epoc::FreeRamZone(aZoneId);
       
  1529 	if (r == KErrNone)
       
  1530 		{
       
  1531 		if (iContigAddr == KPhysAddrInvalid)
       
  1532 			{
       
  1533 			Kern::Printf("Error some how freed a RAM zone that wasn't previously claimed");
       
  1534 			NKern::ThreadLeaveCS();
       
  1535 			return KErrGeneral;
       
  1536 			}
       
  1537 		iContigAddr = KPhysAddrInvalid;
       
  1538 		}
       
  1539 	NKern::ThreadLeaveCS();
       
  1540 	return r;
       
  1541 	}
       
  1542 
       
  1543 //
       
  1544 // FreeFromAllZones
  1515 // FreeFromAllZones
  1545 //
  1516 //
  1546 // Call the overloaded Epoc::FreePhysicalRam function
  1517 // Call the overloaded Epoc::FreePhysicalRam function
  1547 //
  1518 //
  1548 TInt DRamDefragFuncTestChannel::FreeFromAllZones()
  1519 TInt DRamDefragFuncTestChannel::FreeFromAllZones()