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