Update contrib.
1 // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Thread for executing benchmark test threads
23 #include <e32std_private.h>
27 GLREF_D TUint32 Count;
28 GLREF_D TTestInfo TestInfo; ///< Data passed to exector thread
30 GLREF_D TBusLocalDrive drive;
31 GLREF_D TLocalDriveCapsV2Buf driveInfo;
32 GLREF_D HBufC8* writeBuffer;
33 GLREF_D HBufC8* readBuffer;
35 GLREF_D TBool StopTest;
37 GLREF_D TInt mainThreadHandle;
39 _LIT( KPanicCat, "bf_raw" );
41 GLDEF_C TInt BmWrite(TAny*)
43 * Performs writes continuously
46 TPtrC8 wd( writeBuffer->Des().Ptr(), TestInfo.iLength );
49 TInt r = drive.Write( TestInfo.iOffset, wd );
52 User::Panic( KPanicCat, r );
60 GLDEF_C TInt BmWriteThread(TAny*)
62 * Performs writes continuously, telling device driver that a thread
66 TAny* p = writeBuffer;
69 TInt r = drive.Write( TestInfo.iOffset, TestInfo.iLength, p, mainThreadHandle, 0 );
72 User::Panic( KPanicCat, r );
80 GLDEF_C TInt BmRead(TAny*)
82 * Performs reads continously
85 TPtr8 rd = readBuffer->Des();
88 TInt r = drive.Read( TestInfo.iOffset, TestInfo.iLength, rd );
91 User::Panic( KPanicCat, r );
98 GLDEF_C TInt BmReadThread(TAny*)
100 * Performs reads continously, telling device driver that a thread
104 TPtr8 des = readBuffer->Des();
108 TInt r = drive.Read( TestInfo.iOffset, TestInfo.iLength, p, mainThreadHandle, 0 );
111 User::Panic( KPanicCat, r );