Update contrib.
1 // Copyright (c) 2005-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 // e32test\emi\d_emitest.h
23 #ifndef __KERNEL_MODE__
28 struct TUserTaskEventRecord
30 TUint8 iType; // Type of event, 0 = Reschedule
32 // > 127 = User Defined
33 TUint8 iFlags; // Includes:
34 //Bit 0 - Events lost before this event. (All types)
35 //Bit 1 - Previous thread now waiting. (Reschedule only)
36 TUint16 iExtra; //This has no use in reschedule events, but may be used by other event types.
37 TUint32 iUserState; //The state variable at the time of the event, which will probably indicate the clock frequency at the time of the event.
38 TUint32 iTime; //Time that the event occurred. Units defined by the GET_HIGH_RES_TICK macro.
39 TAny* iPrevious; // The NThread that was executing before the switch.
40 TAny* iNext; //The NThread that was executing after the switch.
44 const TInt KEMI_EventLost =1;
45 const TInt KEMI_PrevWaiting=2;
47 _LIT(KEMITestName,"EMITEST");
57 class REMITest : public RBusLogicalChannel
86 EAllRequests = (1<<ENumRequests)-1
91 inline TInt TaskEventLogging(TBool, TInt, TMonitors);
92 inline TBool GetTaskEvent(TUserTaskEventRecord&);
93 inline TBool AddTaskEvent(TUserTaskEventRecord&);
94 inline TAny* GetIdleThread();
95 inline TAny* GetSigmaThread();
96 inline void SetVEMSData(TAny* aThread, TAny* aData);
97 inline TAny* GetVEMSData(TAny* aThread);
98 inline void SetThreadLoggable(TAny* aThread, TBool aLoggable);
99 inline TBool GetThreadLoggable(TAny* aThread);
100 inline void SetThreadTag(TAny* aThread,TUint32 aTag);
101 inline TUint32 GetThreadTag(TAny* aThread);
102 inline void SetMask(TUint32 aMask);
103 inline TUint32 GetMask();
104 inline void SetDfc();
105 inline void SetState(TInt);
106 inline TInt GetState();
108 inline TAny* GetNThread(const RThread&);
109 inline void AfterIdle(TInt);
112 #ifndef __KERNEL_MODE__
114 inline TInt REMITest::Open()
115 { return DoCreate(KEMITestName,TVersion(1,0,1),KNullUnit,NULL,NULL); }
117 inline TInt REMITest::TaskEventLogging(TBool aLogging, TInt aSize, TMonitors aMon)
119 TInt param= aLogging?1:0;
121 return DoControl(ETaskEventLogging,(TAny*)param,(TAny*)aSize); }
123 inline TBool REMITest::GetTaskEvent(TUserTaskEventRecord& aTask)
124 { return (TBool) DoControl(EGetTaskEvent,&aTask); }
126 inline TBool REMITest::AddTaskEvent(TUserTaskEventRecord& aTask)
127 { return (TBool) DoControl(EAddTaskEvent,&aTask); }
129 inline TAny* REMITest::GetIdleThread()
130 { return (TAny*) DoControl(EGetIdleThread,NULL); }
132 inline TAny* REMITest::GetSigmaThread()
133 { return (TAny*) DoControl(EGetSigmaThread,NULL); }
135 inline void REMITest::SetVEMSData(TAny* aThread, TAny* aData)
136 { DoControl(ESetVEMSData,aThread, aData); }
138 inline TAny* REMITest::GetVEMSData(TAny* aThread)
139 { return (TAny*) DoControl(EGetVEMSData,aThread); }
141 inline void REMITest::SetThreadLoggable(TAny* aThread, TBool aLoggable)
142 { DoControl(ESetThreadLoggable,aThread, (TAny*) aLoggable); }
144 inline TBool REMITest::GetThreadLoggable(TAny* aThread)
145 { return (TBool) DoControl(EGetThreadLoggable,aThread); }
147 inline void REMITest::SetThreadTag(TAny* aThread,TUint32 aTag)
148 { DoControl(ESetThreadTag,aThread, (TAny*) aTag); }
150 inline TUint32 REMITest::GetThreadTag(TAny* aThread)
151 { return DoControl(EGetThreadTag,aThread); }
153 inline void REMITest::SetMask(TUint32 aMask)
154 { DoControl(ESetMask,(TAny*) aMask); }
156 inline TUint32 REMITest::GetMask()
157 { return DoControl(EGetMask,NULL); }
159 inline void REMITest::SetDfc()
160 { DoControl(ESetDFC,NULL); }
162 inline void REMITest::SetState(TInt aState)
163 { DoControl(ESetState,(TAny*) aState); }
165 inline TInt REMITest::GetState()
166 { return DoControl(EGetState,NULL); }
168 inline TAny* REMITest::GetNThread(const RThread& aRThread)
169 {return (TAny*) DoControl(EGetNThread,(TAny*)aRThread.Handle());}
171 inline void REMITest::AfterIdle(TInt aDelay)
172 { DoControl(EAfterIdle,(TAny*)aDelay);}