sl@0: // Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // e32test\mmu\t_mmubm.cpp sl@0: // Overview: sl@0: // Time MMU allocation & deallocation sl@0: // API Information: sl@0: // RChunk sl@0: // Details: sl@0: // - Allocate and release a 1 MB chunk 100 times and time how long it takes. sl@0: // - Allocate and release a 2 MB chunk 100 times and time how long it takes. sl@0: // - Allocate and release a 7 MB chunk 100 times and time how long it takes. sl@0: // - Allocate a 7 MB chunk once and time how long it takes. sl@0: // - Deallocate a 7 MB chunk once and time how long it takes. sl@0: // Platforms/Drives/Compatibility: sl@0: // All. sl@0: // Assumptions/Requirement/Pre-requisites: sl@0: // Failures and causes: sl@0: // Base Port information: sl@0: // sl@0: // sl@0: sl@0: #define __E32TEST_EXTENSION__ sl@0: sl@0: #include sl@0: #include "mmudetect.h" sl@0: #include "d_gobble.h" sl@0: #include "d_memorytest.h" sl@0: #include "freeram.h" sl@0: sl@0: RTest test(_L("T_MMUBM")); sl@0: sl@0: typedef TInt (*TestFunction)(TUint32 aIters, TUint32 aSize); sl@0: sl@0: RMemoryTestLdd MemoryTest; sl@0: RChunk TheChunk; sl@0: sl@0: LOCAL_C TInt AllocPhysical(TUint32 aIters, TUint32 aSize) sl@0: { sl@0: return MemoryTest.AllocPhysTest(aIters, aSize * 0x00100000); sl@0: } sl@0: sl@0: LOCAL_C TInt AllocPhysical1(TUint32 aIters, TUint32 aSize) sl@0: { sl@0: return MemoryTest.AllocPhysTest1(aIters, aSize * 0x00100000); sl@0: } sl@0: sl@0: LOCAL_C TInt AdjustChunk(TUint32 aIters, TUint32 aSize) sl@0: { sl@0: TUint32 i; sl@0: for (i=0; i