os/kernelhwsrv/kerneltest/e32test/emi/d_emitest.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/kernelhwsrv/kerneltest/e32test/emi/d_emitest.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,177 @@
     1.4 +// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of the License "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +// e32test\emi\d_emitest.h
    1.18 +// 
    1.19 +//
    1.20 +
    1.21 +#ifndef __EMITEST_H__
    1.22 +#define __EMITEST_H__
    1.23 +
    1.24 +#include <e32cmn.h>
    1.25 +#include <e32ver.h>
    1.26 +#ifndef __KERNEL_MODE__
    1.27 +#include <e32std.h>
    1.28 +#endif
    1.29 +
    1.30 +
    1.31 +struct TUserTaskEventRecord
    1.32 +	{
    1.33 +	TUint8	iType;		//	Type of event, 	0 = Reschedule
    1.34 +						//	1..127 = Reserved
    1.35 +						//	> 127 = User Defined
    1.36 +	TUint8	iFlags;		//	Includes:	
    1.37 +						//Bit 0 - Events lost before this event. (All types) 
    1.38 +	 					//Bit 1 - Previous thread now waiting. (Reschedule only)
    1.39 +	TUint16	iExtra;		//This has no use in reschedule events, but may be used by other event types.
    1.40 +	TUint32	iUserState;	//The state variable at the time of the event, which will probably indicate the clock frequency at the time of the event.
    1.41 +	TUint32	iTime;		//Time that the event occurred.  Units defined by the GET_HIGH_RES_TICK macro.
    1.42 +	TAny*	iPrevious;	//	The NThread that was executing before the switch.
    1.43 +	TAny*	iNext;		//The NThread that was executing after the switch.
    1.44 +	
    1.45 +	};
    1.46 +
    1.47 +const TInt KEMI_EventLost  =1;
    1.48 +const TInt KEMI_PrevWaiting=2;
    1.49 +
    1.50 +_LIT(KEMITestName,"EMITEST");
    1.51 +
    1.52 +enum TMonitors
    1.53 +	{
    1.54 +	ENone,
    1.55 +	ENormal,
    1.56 +	EStressFirst,
    1.57 +	EStressSecond
    1.58 +	};
    1.59 +
    1.60 +class REMITest : public RBusLogicalChannel
    1.61 +	{
    1.62 +public:
    1.63 +
    1.64 +	enum TControl
    1.65 +		{
    1.66 +		ETaskEventLogging,
    1.67 +		EGetTaskEvent,
    1.68 +		EAddTaskEvent,
    1.69 +		EGetIdleThread,
    1.70 +		EGetSigmaThread,
    1.71 +		ESetVEMSData,
    1.72 +		EGetVEMSData,
    1.73 +		ESetThreadLoggable,
    1.74 +		EGetThreadLoggable,
    1.75 +		ESetThreadTag,
    1.76 +		EGetThreadTag,
    1.77 +		ESetMask,
    1.78 +		EGetMask,		
    1.79 +		ESetDFC,
    1.80 +		ESetState,
    1.81 +		EGetState,
    1.82 +		EGetNThread,
    1.83 +		EAfterIdle
    1.84 +		};
    1.85 +
    1.86 +	enum TRequest
    1.87 +		{
    1.88 +		ENumRequests,
    1.89 +		EAllRequests = (1<<ENumRequests)-1
    1.90 +		};
    1.91 +		
    1.92 + public:
    1.93 +	inline TInt Open();
    1.94 +	inline TInt TaskEventLogging(TBool, TInt, TMonitors);
    1.95 +	inline TBool GetTaskEvent(TUserTaskEventRecord&);
    1.96 +	inline TBool AddTaskEvent(TUserTaskEventRecord&);
    1.97 +	inline TAny* GetIdleThread();
    1.98 +	inline TAny* GetSigmaThread();
    1.99 +	inline void SetVEMSData(TAny* aThread, TAny* aData);
   1.100 +	inline TAny* GetVEMSData(TAny* aThread);
   1.101 +	inline void SetThreadLoggable(TAny* aThread, TBool aLoggable);
   1.102 +	inline TBool GetThreadLoggable(TAny* aThread);
   1.103 +	inline void SetThreadTag(TAny* aThread,TUint32 aTag);
   1.104 +	inline TUint32 GetThreadTag(TAny* aThread);
   1.105 +	inline void SetMask(TUint32 aMask);
   1.106 +	inline TUint32 GetMask();	
   1.107 +	inline void SetDfc();
   1.108 +	inline void SetState(TInt);
   1.109 +	inline TInt GetState();
   1.110 +	
   1.111 +	inline TAny* GetNThread(const RThread&);
   1.112 +	inline void AfterIdle(TInt);
   1.113 +	};
   1.114 +
   1.115 +#ifndef __KERNEL_MODE__
   1.116 +
   1.117 +inline TInt REMITest::Open()
   1.118 +	{ return DoCreate(KEMITestName,TVersion(1,0,1),KNullUnit,NULL,NULL); }
   1.119 +
   1.120 +inline TInt REMITest::TaskEventLogging(TBool aLogging, TInt aSize, TMonitors aMon)
   1.121 +	{
   1.122 +	 TInt param= aLogging?1:0;
   1.123 +	 param |= (aMon<<1);	
   1.124 +	 return DoControl(ETaskEventLogging,(TAny*)param,(TAny*)aSize); }  
   1.125 +
   1.126 +inline TBool REMITest::GetTaskEvent(TUserTaskEventRecord& aTask)
   1.127 +	{ return (TBool) DoControl(EGetTaskEvent,&aTask); }	
   1.128 +
   1.129 +inline TBool REMITest::AddTaskEvent(TUserTaskEventRecord& aTask)
   1.130 +	{ return (TBool) DoControl(EAddTaskEvent,&aTask); }	
   1.131 +
   1.132 +inline TAny* REMITest::GetIdleThread()
   1.133 +	{ return (TAny*) DoControl(EGetIdleThread,NULL); }	
   1.134 +
   1.135 +inline TAny* REMITest::GetSigmaThread()
   1.136 +	{ return (TAny*) DoControl(EGetSigmaThread,NULL); }	
   1.137 +
   1.138 +inline void REMITest::SetVEMSData(TAny* aThread, TAny* aData)
   1.139 +	{ DoControl(ESetVEMSData,aThread, aData); }		
   1.140 +
   1.141 +inline TAny* REMITest::GetVEMSData(TAny* aThread)
   1.142 +	{ return (TAny*) DoControl(EGetVEMSData,aThread); } 
   1.143 +
   1.144 +inline void REMITest::SetThreadLoggable(TAny* aThread, TBool aLoggable)
   1.145 +	{ DoControl(ESetThreadLoggable,aThread, (TAny*) aLoggable); }	
   1.146 +
   1.147 +inline TBool REMITest::GetThreadLoggable(TAny* aThread)
   1.148 +	{ return (TBool) DoControl(EGetThreadLoggable,aThread); }	
   1.149 +
   1.150 +inline void REMITest::SetThreadTag(TAny* aThread,TUint32 aTag)
   1.151 +	{ DoControl(ESetThreadTag,aThread, (TAny*) aTag); }	
   1.152 +
   1.153 +inline TUint32 REMITest::GetThreadTag(TAny* aThread)
   1.154 +	{ return DoControl(EGetThreadTag,aThread); }	
   1.155 +
   1.156 +inline void REMITest::SetMask(TUint32 aMask)
   1.157 +	{ DoControl(ESetMask,(TAny*) aMask); }
   1.158 +
   1.159 +inline TUint32 REMITest::GetMask()
   1.160 +	{ return DoControl(EGetMask,NULL); }		
   1.161 +
   1.162 +inline void REMITest::SetDfc()
   1.163 +	{ DoControl(ESetDFC,NULL); }	
   1.164 +
   1.165 +inline void REMITest::SetState(TInt aState)
   1.166 +	{ DoControl(ESetState,(TAny*) aState); }	
   1.167 +
   1.168 +inline TInt REMITest::GetState()
   1.169 +	{ return DoControl(EGetState,NULL); }
   1.170 +
   1.171 +inline TAny* REMITest::GetNThread(const RThread& aRThread)
   1.172 +	{return (TAny*) DoControl(EGetNThread,(TAny*)aRThread.Handle());}
   1.173 +
   1.174 +inline void REMITest::AfterIdle(TInt aDelay)
   1.175 +	{ DoControl(EAfterIdle,(TAny*)aDelay);}
   1.176 +
   1.177 +
   1.178 +#endif
   1.179 +
   1.180 +#endif