0
|
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".
|
|
7 |
//
|
|
8 |
// Initial Contributors:
|
|
9 |
// Nokia Corporation - initial contribution.
|
|
10 |
//
|
|
11 |
// Contributors:
|
|
12 |
//
|
|
13 |
// Description:
|
|
14 |
// e32test\realtime\d_latncy.h
|
|
15 |
//
|
|
16 |
//
|
|
17 |
|
|
18 |
#if !defined(__D_LATNCY_H__)
|
|
19 |
#define __D_LATNCY_H__
|
|
20 |
#include <e32cmn.h>
|
|
21 |
#ifndef __KERNEL_MODE__
|
|
22 |
#include <e32std.h>
|
|
23 |
#endif
|
|
24 |
|
|
25 |
#if defined(__IS_OMAP2420__) || defined(__WAKEUP_3430__)
|
|
26 |
#include <shared_timer.h>
|
|
27 |
#endif
|
|
28 |
|
|
29 |
#if !defined(__EPOC32__) || !defined(__CPU_X86)
|
|
30 |
#if !defined(__SMP__)
|
|
31 |
#define __CAPTURE_EXTRAS
|
|
32 |
#endif
|
|
33 |
#endif
|
|
34 |
|
|
35 |
_LIT(KLatencyLddName,"Latency");
|
|
36 |
|
|
37 |
class TCapsLatencyV01
|
|
38 |
{
|
|
39 |
public:
|
|
40 |
TVersion iVersion;
|
|
41 |
};
|
|
42 |
|
|
43 |
struct SLatencyResults
|
|
44 |
{
|
|
45 |
TUint iIntRetAddr;
|
|
46 |
TUint iIntTicks;
|
|
47 |
TUint iKernThreadTicks;
|
|
48 |
TUint iUserThreadTicks;
|
|
49 |
TUint iIntSpsr;
|
|
50 |
TUint iIntR14;
|
|
51 |
};
|
|
52 |
|
|
53 |
class RLatency : public RBusLogicalChannel
|
|
54 |
{
|
|
55 |
public:
|
|
56 |
enum TControl
|
|
57 |
{
|
|
58 |
EControlStart,
|
|
59 |
EControlTicksPerMs,
|
|
60 |
EControlGetResults,
|
|
61 |
};
|
|
62 |
public:
|
|
63 |
inline TInt Open();
|
|
64 |
inline void Start();
|
|
65 |
inline TUint TicksPerMs();
|
|
66 |
inline TInt GetResults(SLatencyResults& aResults);
|
|
67 |
};
|
|
68 |
|
|
69 |
#ifndef __KERNEL_MODE__
|
|
70 |
inline TInt RLatency::Open()
|
|
71 |
{ return DoCreate(KLatencyLddName,TVersion(1,0,1),KNullUnit,NULL,NULL); }
|
|
72 |
|
|
73 |
inline void RLatency::Start()
|
|
74 |
{ DoControl(EControlStart); }
|
|
75 |
|
|
76 |
inline TUint RLatency::TicksPerMs()
|
|
77 |
{ return (TUint)DoControl(EControlTicksPerMs); }
|
|
78 |
|
|
79 |
inline TInt RLatency::GetResults(SLatencyResults& aResults)
|
|
80 |
{ return DoControl(EControlGetResults,&aResults); }
|
|
81 |
#endif
|
|
82 |
|
|
83 |
#ifdef __KERNEL_MODE__
|
|
84 |
class DLatencyPowerHandler;
|
|
85 |
class DLatency : public DLogicalChannelBase
|
|
86 |
{
|
|
87 |
public:
|
|
88 |
DLatency();
|
|
89 |
~DLatency();
|
|
90 |
protected:
|
|
91 |
virtual TInt DoCreate(TInt aUnit, const TDesC8* anInfo, const TVersion& aVer);
|
|
92 |
virtual TInt Request(TInt aFunction, TAny* a1, TAny* a2);
|
|
93 |
public:
|
|
94 |
TInt StartTimer();
|
|
95 |
void StopTimer();
|
|
96 |
static void MsCallBack(TAny*);
|
|
97 |
static void MsDfc(TAny*);
|
|
98 |
#if defined( __MISA__) || defined(__MCOT__) || defined(__IS_OMAP2420__) || defined(__WAKEUP_3430__)
|
|
99 |
inline TUint Ticks();
|
|
100 |
#elif defined(__EPOC32__) && defined(__CPU_X86)
|
|
101 |
static TUint Ticks();
|
|
102 |
#else
|
|
103 |
inline static TUint Ticks();
|
|
104 |
#endif
|
|
105 |
|
|
106 |
#if defined(__IS_OMAP2420__) || defined(__WAKEUP_3430__)
|
|
107 |
private:
|
|
108 |
void DisableTimer();
|
|
109 |
TInt ConfigureTimer();
|
|
110 |
#endif
|
|
111 |
public:
|
|
112 |
NTimer iMsCallBack;
|
|
113 |
TDynamicDfcQue* iRtDfcQ;
|
|
114 |
TDfc iMsDfc;
|
|
115 |
SLatencyResults iResults;
|
|
116 |
#if !defined(__SMP__)
|
|
117 |
TUint* iIntStackTop;
|
|
118 |
#endif
|
|
119 |
DThread* iClient;
|
|
120 |
DLatencyPowerHandler* iPowerHandler;
|
|
121 |
TUint8 iOff;
|
|
122 |
TUint8 iStarted;
|
|
123 |
TUint8 iPad2;
|
|
124 |
TUint8 iPad3;
|
|
125 |
#if defined( __MISA__) || defined(__MCOT__)
|
|
126 |
TUint iTickIncrement;
|
|
127 |
TUint iTriggerTime;
|
|
128 |
#endif
|
|
129 |
#if defined(__IS_OMAP2420__) || defined(__WAKEUP_3430__)
|
|
130 |
TUint8 iGPTimerId;
|
|
131 |
SOmapTimerInfo iTimerInfo;
|
|
132 |
TUint iTimerLoadValue;
|
|
133 |
#endif
|
|
134 |
};
|
|
135 |
#endif
|
|
136 |
|
|
137 |
#endif
|