equal
deleted
inserted
replaced
31 #include <e32svr.h> |
31 #include <e32svr.h> |
32 #include <e32msgqueue.h> |
32 #include <e32msgqueue.h> |
33 #include <e32math.h> |
33 #include <e32math.h> |
34 #include <hal.h> |
34 #include <hal.h> |
35 #include "testdefs.h" |
35 #include "testdefs.h" |
|
36 #include "..\mmu\mmudetect.h" |
36 |
37 |
37 |
38 |
38 #include <dptest.h> |
39 #include <dptest.h> |
39 |
40 |
40 #include "t_ramdefrag.h" |
41 #include "t_ramdefrag.h" |
126 LOCAL_D RFile gFile[KNumFilesOrig]; |
127 LOCAL_D RFile gFile[KNumFilesOrig]; |
127 |
128 |
128 LOCAL_D TInt* gCandList1; // Array of zones that have the same preference and the same |
129 LOCAL_D TInt* gCandList1; // Array of zones that have the same preference and the same |
129 LOCAL_D TInt* gCandList2; // amount of free pages |
130 LOCAL_D TInt* gCandList2; // amount of free pages |
130 const TInt KInvalidCandIndex = -1; |
131 const TInt KInvalidCandIndex = -1; |
|
132 LOCAL_D TUint gMemModel; |
131 |
133 |
132 // |
134 // |
133 // GetDrive |
135 // GetDrive |
134 // |
136 // |
135 // Gets the removable drive number |
137 // Gets the removable drive number |
487 TESTDEBUG(test.Printf(_L("Original CacheSize: minCacheSize = 0x%x, maxCacheSize = 0x%x, currentCacheSize = 0x%x\n"), |
489 TESTDEBUG(test.Printf(_L("Original CacheSize: minCacheSize = 0x%x, maxCacheSize = 0x%x, currentCacheSize = 0x%x\n"), |
488 gOriginalMinCacheSize >> gPageShift, gOriginalMaxCacheSize >> gPageShift, |
490 gOriginalMinCacheSize >> gPageShift, gOriginalMaxCacheSize >> gPageShift, |
489 currentCacheSize >> gPageShift)); |
491 currentCacheSize >> gPageShift)); |
490 } |
492 } |
491 |
493 |
|
494 // Get the memory model of the kernel that this test is running on. |
|
495 gMemModel = MemModelType(); |
492 return KErrNone; |
496 return KErrNone; |
493 } |
497 } |
494 |
498 |
495 |
499 |
496 // |
500 // |
1534 test.Printf(_L("No in use RAM zones found????\n")); |
1538 test.Printf(_L("No in use RAM zones found????\n")); |
1535 return KErrNotFound; |
1539 return KErrNotFound; |
1536 } |
1540 } |
1537 |
1541 |
1538 if (totalMorePrefInUse > requiredMovDis) |
1542 if (totalMorePrefInUse > requiredMovDis) |
1539 {// There enough allocatable pages in the RAM zones below the currently |
1543 {// There are enough allocatable pages in the RAM zones below the currently |
1540 // least preferable RAM in use. |
1544 // least preferable RAM in use. |
1541 test.Printf(_L("Memory is spread out totalMorePref 0x%x required 0x%x\n"), totalMorePrefInUse, requiredMovDis); |
1545 test.Printf(_L("Memory is spread out totalMorePref 0x%x required 0x%x\n"), totalMorePrefInUse, requiredMovDis); |
1542 if (verifySpread) |
1546 if (verifySpread) |
1543 return KErrGeneral; |
1547 return KErrGeneral; |
1544 } |
1548 } |
9437 Ldd2.FreeAllFixedPages(); |
9441 Ldd2.FreeAllFixedPages(); |
9438 TestEnd(); |
9442 TestEnd(); |
9439 |
9443 |
9440 test.Next(_L("Test5: Filling the FS Cache and allocating more than 16 contiguous fixed pages")); |
9444 test.Next(_L("Test5: Filling the FS Cache and allocating more than 16 contiguous fixed pages")); |
9441 TestStart(); |
9445 TestStart(); |
|
9446 |
|
9447 if (gMemModel >= EMemModelTypeFlexible) |
|
9448 {// The flexible memory model won't flush the whole paging cache for |
|
9449 // contiguous allocations >16 pages so skip the next test. |
|
9450 test.Printf(_L("This memory model won't flush the cache - Skipping...\n")); |
|
9451 goto SkipTest5; |
|
9452 } |
|
9453 |
9442 // TestEnd() will have reduced any cache pages to minimum so just get current |
9454 // TestEnd() will have reduced any cache pages to minimum so just get current |
9443 // count of discardable pages. |
9455 // count of discardable pages. |
9444 GetAllPageInfo(); |
9456 GetAllPageInfo(); |
9445 minDiscardPages = gTotalPageCount.iDiscardablePages; |
9457 minDiscardPages = gTotalPageCount.iDiscardablePages; |
9446 |
9458 |