Update contrib.
1 // Copyright (c) 1999-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\realtime\d_latncy.h
18 #if !defined(__D_LATNCY_H__)
19 #define __D_LATNCY_H__
21 #ifndef __KERNEL_MODE__
25 #if defined(__IS_OMAP2420__) || defined(__WAKEUP_3430__)
26 #include <shared_timer.h>
29 #if !defined(__EPOC32__) || !defined(__CPU_X86)
31 #define __CAPTURE_EXTRAS
35 _LIT(KLatencyLddName,"Latency");
43 struct SLatencyResults
47 TUint iKernThreadTicks;
48 TUint iUserThreadTicks;
53 class RLatency : public RBusLogicalChannel
65 inline TUint TicksPerMs();
66 inline TInt GetResults(SLatencyResults& aResults);
69 #ifndef __KERNEL_MODE__
70 inline TInt RLatency::Open()
71 { return DoCreate(KLatencyLddName,TVersion(1,0,1),KNullUnit,NULL,NULL); }
73 inline void RLatency::Start()
74 { DoControl(EControlStart); }
76 inline TUint RLatency::TicksPerMs()
77 { return (TUint)DoControl(EControlTicksPerMs); }
79 inline TInt RLatency::GetResults(SLatencyResults& aResults)
80 { return DoControl(EControlGetResults,&aResults); }
83 #ifdef __KERNEL_MODE__
84 class DLatencyPowerHandler;
85 class DLatency : public DLogicalChannelBase
91 virtual TInt DoCreate(TInt aUnit, const TDesC8* anInfo, const TVersion& aVer);
92 virtual TInt Request(TInt aFunction, TAny* a1, TAny* a2);
96 static void MsCallBack(TAny*);
97 static void MsDfc(TAny*);
98 #if defined( __MISA__) || defined(__MCOT__) || defined(__IS_OMAP2420__) || defined(__WAKEUP_3430__)
100 #elif defined(__EPOC32__) && defined(__CPU_X86)
101 static TUint Ticks();
103 inline static TUint Ticks();
106 #if defined(__IS_OMAP2420__) || defined(__WAKEUP_3430__)
109 TInt ConfigureTimer();
113 TDynamicDfcQue* iRtDfcQ;
115 SLatencyResults iResults;
116 #if !defined(__SMP__)
120 DLatencyPowerHandler* iPowerHandler;
125 #if defined( __MISA__) || defined(__MCOT__)
126 TUint iTickIncrement;
129 #if defined(__IS_OMAP2420__) || defined(__WAKEUP_3430__)
131 SOmapTimerInfo iTimerInfo;
132 TUint iTimerLoadValue;