author | hgs |
Wed, 12 May 2010 10:34:10 +0100 | |
changeset 133 | 2a0ada0a1bf8 |
parent 90 | 947f0dc9f7a8 |
child 177 | a232af6b0b1f |
permissions | -rw-r--r-- |
0 | 1 |
// Copyright (c) 2007-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 |
// e32\include\nkernsmp\nk_priv.h |
|
15 |
// |
|
16 |
// WARNING: This file contains some APIs which are internal and are subject |
|
17 |
// to change without notice. Such APIs should therefore not be used |
|
18 |
// outside the Kernel and Hardware Services package. |
|
19 |
// |
|
20 |
||
21 |
#ifndef __NK_PRIV_H__ |
|
22 |
#define __NK_PRIV_H__ |
|
23 |
#include <cpudefs.h> |
|
24 |
#include <nkern.h> |
|
25 |
||
26 |
#define __USE_BTRACE_LOCK__ |
|
27 |
||
28 |
class Monitor; |
|
29 |
||
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
30 |
const TInt KNumPriClasses = 4; |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
31 |
extern const TUint8 KClassFromPriority[KNumPriorities]; |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
32 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
33 |
#ifndef __LOAD_BALANCE_INFO_DEFINED__ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
34 |
/** |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
35 |
@internalComponent |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
36 |
*/ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
37 |
struct SLbInfo |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
38 |
{ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
39 |
TUint64 i__Dummy; |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
40 |
}; |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
41 |
#endif |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
42 |
|
0 | 43 |
/******************************************** |
44 |
* Schedulable = thread or thread group |
|
45 |
********************************************/ |
|
46 |
||
47 |
/** |
|
48 |
@publishedPartner |
|
49 |
@prototype |
|
50 |
||
51 |
Base class for a nanokernel thread or group |
|
52 |
*/ |
|
53 |
class NThreadGroup; |
|
54 |
class NSchedulable : public TPriListLink |
|
55 |
{ |
|
56 |
public: |
|
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
57 |
/** |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
58 |
@internalComponent |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
59 |
*/ |
0 | 60 |
enum |
61 |
{ |
|
62 |
EReadyGroup=1, |
|
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
63 |
EReadyCpuMask=0x1f, |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
64 |
EReadyCpuSticky=0x40, |
0 | 65 |
EReadyOffset=0x80, |
66 |
}; |
|
67 |
||
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
68 |
/** |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
69 |
@internalComponent |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
70 |
*/ |
0 | 71 |
enum NReadyFlags |
72 |
{ |
|
73 |
ENewTimeslice=1, |
|
74 |
EPreferSameCpu=2, |
|
75 |
EUnPause=4, |
|
76 |
}; |
|
77 |
||
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
78 |
/** |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
79 |
@internalComponent |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
80 |
*/ |
0 | 81 |
enum NEventState |
82 |
{ |
|
83 |
EEventCountShift=16u, |
|
84 |
EEventCountMask=0xffff0000u, |
|
85 |
EEventCountInc=0x10000u, |
|
86 |
EEventCpuShift=0u, |
|
87 |
EEventCpuMask=0x1fu, |
|
88 |
EThreadCpuShift=8u, |
|
89 |
EThreadCpuMask=0x1f00u, |
|
90 |
EDeferredReady=0x4000u, |
|
91 |
EEventParent=0x8000u, |
|
92 |
}; |
|
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
93 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
94 |
/** |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
95 |
@internalComponent |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
96 |
*/ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
97 |
enum NLbState |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
98 |
{ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
99 |
ELbState_Inactive = 0x00u, // not currently involved in load balancing |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
100 |
ELbState_Global = 0x01u, // flag indicating this is on global load balance list |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
101 |
ELbState_Temp = 0x02u, // flag indicating this is on a temporary load balance list |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
102 |
ELbState_CpuMask = 0x1Fu, // mask of bits indicating CPU if on per-CPU list |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
103 |
ELbState_PerCpu = 0x20u, // flag indicating this is on per-CPU load balance list |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
104 |
ELbState_ExtraRef = 0x40u, // flag indicating extra reference has been taken after thread/group died |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
105 |
ELbState_Generation = 0x80u, // 1 bit generation number |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
106 |
}; |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
107 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
108 |
/** |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
109 |
@internalComponent |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
110 |
*/ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
111 |
enum NCpuStatsSelect |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
112 |
{ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
113 |
E_RunTime=0x01u, |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
114 |
E_RunTimeDelta=0x02u, |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
115 |
E_ActiveTime=0x04u, |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
116 |
E_ActiveTimeDelta=0x08u, |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
117 |
E_LastRunTime=0x10u, |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
118 |
E_LastActiveTime=0x20u, |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
119 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
120 |
E_AllStats = 0x3fu |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
121 |
}; |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
122 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
123 |
/** |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
124 |
@internalComponent |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
125 |
*/ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
126 |
struct SCpuStats |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
127 |
{ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
128 |
TUint64 iRunTime; // total run time |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
129 |
TUint64 iRunTimeDelta; // run time since we last asked |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
130 |
TUint64 iActiveTime; // total active time |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
131 |
TUint64 iActiveTimeDelta; // active time since we last asked |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
132 |
TUint64 iLastRunTime; // how long ago this last ran |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
133 |
TUint64 iLastActiveTime; // how long ago this was last active |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
134 |
}; |
0 | 135 |
public: |
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
136 |
NSchedulable(); /**< @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
137 |
void AcqSLock(); /**< @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
138 |
void RelSLock(); /**< @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
139 |
void LAcqSLock(); /**< @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
140 |
void RelSLockU(); /**< @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
141 |
void ReadyT(TUint aMode); /**< @internalComponent */ // make ready, assumes lock held |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
142 |
TInt BeginTiedEvent(); /**< @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
143 |
void EndTiedEvent(); /**< @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
144 |
TInt AddTiedEvent(NEventHandler* aEvent); /**< @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
145 |
TBool TiedEventReadyInterlock(TInt aCpu); /**< @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
146 |
void UnPauseT(); /**< @internalComponent */ // decrement pause count and make ready if necessary |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
147 |
static void DeferredReadyIDfcFn(TAny*); /**< @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
148 |
void DetachTiedEvents(); /**< @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
149 |
TBool TakeRef(); /**< @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
150 |
TBool DropRef(); /**< @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
151 |
void LbUnlink(); /**< @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
152 |
void LbTransfer(SDblQue& aDestQ); /**< @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
153 |
void RemoveFromEnumerateList(); /**< @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
154 |
void GetCpuStats(TUint aMask, SCpuStats& aOut); /**< @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
155 |
void GetCpuStatsT(TUint aMask, SCpuStats& aOut); /**< @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
156 |
void GetLbStats(TUint64 aTime); /**< @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
157 |
void LbDone(TUint aFlags); /**< @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
158 |
TUint32 SetCpuAffinityT(TUint32 aAffinity); /**< @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
159 |
TBool ShouldMigrate(TInt aCpu); /**< @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
160 |
void InitLbInfo(); /**< @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
161 |
void NominalPriorityChanged(); /**< @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
162 |
void AddToEnumerateList(); /**< @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
163 |
void SetEventCpu(); /**< @internalComponent */ |
0 | 164 |
public: |
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
165 |
static TUint32 PreprocessCpuAffinity(TUint32 aAffinity); /**< @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
166 |
inline TBool IsGroup() {return !iParent;} /**< @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
167 |
inline TBool IsLoneThread() {return iParent==this;} /**< @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
168 |
inline TBool IsGroupThread() {return iParent && iParent!=this;} /**< @internalComponent */ |
0 | 169 |
public: |
170 |
// TUint8 iReady; /**< @internalComponent */ // flag indicating thread on ready list = cpu number | EReadyOffset |
|
171 |
// TUint8 iCurrent; /**< @internalComponent */ // flag indicating thread is running |
|
172 |
// TUint8 iLastCpu; /**< @internalComponent */ // CPU on which this thread last ran |
|
173 |
TUint8 iPauseCount; /**< @internalComponent */ // count of externally requested pauses extending a voluntary wait |
|
174 |
TUint8 iSuspended; /**< @internalComponent */ // flag indicating active external suspend (Not used for groups) |
|
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
175 |
TUint8 iACount; /**< @internalComponent */ // access count |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
176 |
TUint8 iPreferredCpu; /**< @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
177 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
178 |
TInt iActiveState; /**< @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
179 |
TUint8 i_NSchedulable_Spare2; /**< @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
180 |
TUint8 iForcedCpu; /**< @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
181 |
TUint8 iTransientCpu; /**< @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
182 |
TUint8 iLbState; /**< @internalComponent */ |
0 | 183 |
|
184 |
TUint8 iCpuChange; /**< @internalComponent */ // flag showing CPU migration outstanding |
|
185 |
TUint8 iStopping; /**< @internalComponent */ // thread is exiting, thread group is being destroyed |
|
186 |
TUint16 iFreezeCpu; /**< @internalComponent */ // flag set if CPU frozen - count for groups |
|
187 |
NSchedulable* iParent; /**< @internalComponent */ // Pointer to group containing thread, =this for normal thread, =0 for group |
|
188 |
||
189 |
TUint32 iCpuAffinity; /**< @internalComponent */ |
|
190 |
volatile TUint32 iEventState; /**< @internalComponent */ // bits 16-31=count, 0-4=event CPU, 5-9=thread CPU, 10=defer, 11=parent |
|
191 |
||
192 |
TSpinLock iSSpinLock; /**< @internalComponent */ |
|
193 |
||
194 |
SDblQue iEvents; /**< @internalComponent */ // doubly-linked list of tied events |
|
195 |
||
196 |
TUint32 i_IDfcMem[sizeof(TDfc)/sizeof(TUint32)]; /**< @internalComponent */ // IDFC used to make thread ready after last tied event completes |
|
197 |
// TDfc iDeferredReadyIDfc; /**< @internalComponent */ // IDFC used to make thread ready after last tied event completes |
|
198 |
||
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
199 |
union { |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
200 |
TUint64HL iRunCount; /**< @internalComponent */ // number of times this thread has run |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
201 |
TUint64HL iLastStartTime; /**< @internalComponent */ // last start time for groups |
0 | 202 |
}; |
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
203 |
TUint64HL iLastRunTime; /**< @internalComponent */ // time when this thread last ran |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
204 |
TUint64HL iTotalCpuTime; /**< @internalComponent */ // total CPU time used by this thread |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
205 |
TUint64HL iLastActivationTime; /**< @internalComponent */ // time when this thread last became active |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
206 |
TUint64HL iTotalActiveTime; /**< @internalComponent */ // total time this thread has been active |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
207 |
TUint64HL iSavedCpuTime; /**< @internalComponent */ // Total CPU time used at last check |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
208 |
TUint64HL iSavedActiveTime; /**< @internalComponent */ // Total active time at last check |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
209 |
SDblQueLink iLbLink; /**< @internalComponent */ // Link into queue of tasks requiring load balancing |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
210 |
SIterDQLink iEnumerateLink; /**< @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
211 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
212 |
enum {EMaxLbInfoSize = 48}; /**< @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
213 |
union { |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
214 |
TUint64 i__Dummy[EMaxLbInfoSize/sizeof(TUint64)]; /**< @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
215 |
SLbInfo iLbInfo; /**< @internalComponent */ |
0 | 216 |
}; |
217 |
}; |
|
218 |
||
219 |
__ASSERT_COMPILE(!(_FOFF(NSchedulable,iSSpinLock)&7)); |
|
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
220 |
__ASSERT_COMPILE(!(_FOFF(NSchedulable,iRunCount)&7)); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
221 |
__ASSERT_COMPILE(!(_FOFF(NSchedulable,iTotalCpuTime)&7)); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
222 |
__ASSERT_COMPILE(!(_FOFF(NSchedulable,iLbInfo)&7)); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
223 |
__ASSERT_COMPILE(sizeof(SLbInfo) <= NSchedulable::EMaxLbInfoSize); |
0 | 224 |
__ASSERT_COMPILE(!(sizeof(NSchedulable)&7)); |
225 |
||
226 |
||
227 |
/** |
|
228 |
@internalComponent |
|
229 |
*/ |
|
230 |
inline TBool TDfc::IsValid() |
|
231 |
{ |
|
232 |
if (iHType < KNumDfcPriorities) |
|
233 |
return TRUE; |
|
234 |
if (iHType != EEventHandlerIDFC) |
|
235 |
return FALSE; |
|
236 |
return !iTied || !iTied->iStopping; |
|
237 |
} |
|
238 |
||
239 |
/******************************************** |
|
240 |
* Thread |
|
241 |
********************************************/ |
|
242 |
||
243 |
/** |
|
244 |
@internalComponent |
|
245 |
*/ |
|
246 |
class NThreadWaitState |
|
247 |
{ |
|
248 |
private: |
|
249 |
enum TWtStFlags |
|
250 |
{ |
|
251 |
EWtStWaitPending =0x01u, // thread is about to wait |
|
252 |
EWtStWaitActive =0x02u, // thread is actually blocked |
|
253 |
EWtStTimeout =0x04u, // timeout is active on this wait |
|
254 |
EWtStObstructed =0x08u, // wait is due to obstruction (e.g. mutex) rather than lack of work to do |
|
255 |
EWtStDead =0x80u, // thread is dead |
|
256 |
}; |
|
257 |
private: |
|
258 |
NThreadWaitState(); |
|
259 |
void SetUpWait(TUint aType, TUint aFlags, TAny* aWaitObj); |
|
260 |
void SetUpWait(TUint aType, TUint aFlags, TAny* aWaitObj, TUint32 aTimeout); |
|
261 |
void SetDead(TDfc* aKillDfc); |
|
262 |
void CancelWait(); |
|
263 |
TInt DoWait(); |
|
264 |
static void TimerExpired(TAny*); |
|
265 |
TInt UnBlockT(TUint aType, TAny* aWaitObj, TInt aReturnValue); |
|
266 |
TUint32 ReleaseT(TAny*& aWaitObj, TInt aReturnValue); |
|
267 |
void CancelTimerT(); |
|
268 |
private: |
|
269 |
inline NThreadBase* Thread(); |
|
270 |
inline TBool WaitPending() |
|
271 |
{ return iWtC.iWtStFlags & (EWtStWaitPending|EWtStDead); } |
|
272 |
inline TBool ThreadIsBlocked() |
|
273 |
{ return iWtC.iWtStFlags & (EWtStWaitActive|EWtStDead); } |
|
274 |
inline TBool ThreadIsDead() |
|
275 |
{ return iWtC.iWtStFlags & EWtStDead; } |
|
276 |
private: |
|
277 |
struct S |
|
278 |
{ |
|
279 |
volatile TUint8 iWtStFlags; |
|
280 |
volatile TUint8 iWtObjType; |
|
281 |
volatile TUint8 iWtStSpare1; |
|
282 |
volatile TUint8 iWtStSpare2; |
|
283 |
union |
|
284 |
{ |
|
285 |
TAny* volatile iWtObj; |
|
286 |
volatile TInt iRetVal; |
|
287 |
TDfc* volatile iKillDfc; |
|
288 |
}; |
|
289 |
}; |
|
290 |
union |
|
291 |
{ |
|
292 |
S iWtC; |
|
293 |
volatile TUint32 iWtSt32[2]; |
|
294 |
volatile TUint64 iWtSt64; |
|
295 |
}; |
|
296 |
NTimer iTimer; |
|
297 |
private: |
|
298 |
friend class NSchedulable; |
|
299 |
friend class NThreadBase; |
|
300 |
friend class NThread; |
|
301 |
friend class TScheduler; |
|
302 |
friend class TSubScheduler; |
|
303 |
friend class TDfc; |
|
304 |
friend class TDfcQue; |
|
305 |
friend class NFastSemaphore; |
|
306 |
friend class NFastMutex; |
|
307 |
friend class NTimer; |
|
308 |
friend class NTimerQ; |
|
309 |
friend class NKern; |
|
310 |
friend class Monitor; |
|
311 |
friend class NKTest; |
|
312 |
}; |
|
313 |
||
314 |
/** |
|
315 |
@publishedPartner |
|
316 |
@prototype |
|
317 |
||
318 |
Base class for a nanokernel thread. |
|
319 |
*/ |
|
320 |
class TSubScheduler; |
|
321 |
class NThreadBase : public NSchedulable |
|
322 |
{ |
|
323 |
public: |
|
324 |
/** |
|
325 |
Defines the possible types of wait object |
|
326 |
*/ |
|
327 |
enum NThreadWaitType |
|
328 |
{ |
|
329 |
EWaitNone, |
|
330 |
EWaitFastSemaphore, |
|
331 |
EWaitFastMutex, |
|
332 |
EWaitSleep, |
|
333 |
EWaitBlocked, |
|
334 |
EWaitDfc, |
|
335 |
||
336 |
ENumWaitTypes |
|
337 |
}; |
|
338 |
||
339 |
||
340 |
/** |
|
341 |
@internalComponent |
|
342 |
*/ |
|
343 |
enum NThreadCSFunction |
|
344 |
{ |
|
345 |
ECSExitPending=-1, |
|
346 |
ECSExitInProgress=-2, |
|
347 |
ECSDivertPending=-3, |
|
348 |
}; |
|
349 |
||
350 |
/** |
|
351 |
@internalComponent |
|
352 |
*/ |
|
353 |
enum NThreadTimeoutOp |
|
354 |
{ |
|
355 |
ETimeoutPreamble=0, |
|
356 |
ETimeoutPostamble=1, |
|
357 |
ETimeoutSpurious=2, |
|
358 |
}; |
|
359 |
public: |
|
360 |
NThreadBase(); |
|
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
361 |
TInt Create(SNThreadCreateInfo& anInfo, TBool aInitial); /**< @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
362 |
void UnReadyT(); /**< @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
363 |
TBool SuspendOrKill(TInt aCount); /**< @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
364 |
TBool DoSuspendOrKillT(TInt aCount, TSubScheduler* aS); /**< @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
365 |
TBool CancelTimerT(); /**< @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
366 |
void DoReleaseT(TInt aReturnCode, TUint aMode); /**< @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
367 |
TBool CheckFastMutexDefer(); /**< @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
368 |
void DoCsFunctionT(); /**< @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
369 |
TBool Resume(TBool aForce); /**< @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
370 |
IMPORT_C TBool Suspend(TInt aCount); /**< @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
371 |
IMPORT_C TBool Resume(); /**< @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
372 |
IMPORT_C TBool ForceResume(); /**< @internalComponent */ |
0 | 373 |
IMPORT_C void Release(TInt aReturnCode, TUint aMode); /**< @internalComponent */ |
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
374 |
IMPORT_C void RequestSignal(); /**< @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
375 |
IMPORT_C void SetPriority(TInt aPriority); /**< @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
376 |
void SetNominalPriority(TInt aPriority); /**< @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
377 |
void SetMutexPriority(NFastMutex* aMutex); /**< @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
378 |
void LoseInheritedPriorityT(); /**< @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
379 |
void ChangeReadyThreadPriority(); /**< @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
380 |
TBool TiedEventLeaveInterlock(); /**< @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
381 |
TBool TiedEventJoinInterlock(); /**< @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
382 |
IMPORT_C void Kill(); /**< @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
383 |
void Exit(); /**< @internalComponent */ |
0 | 384 |
// hooks for platform-specific code |
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
385 |
void OnKill(); /**< @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
386 |
void OnExit(); /**< @internalComponent */ |
0 | 387 |
public: |
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
388 |
static void TimerExpired(TAny* aPtr); /**< @internalComponent */ |
0 | 389 |
|
390 |
/** @internalComponent */ |
|
391 |
inline void UnknownState(TInt aOp, TInt aParam) |
|
392 |
{ (*iHandlers->iStateHandler)((NThread*)this,aOp,aParam); } |
|
393 |
||
394 |
/** @internalComponent */ |
|
395 |
inline TUint8 Attributes() |
|
396 |
{ return i_ThrdAttr; } |
|
397 |
||
398 |
/** @internalComponent */ |
|
399 |
inline TUint8 SetAttributes(TUint8 aNewAtt) |
|
400 |
{ return __e32_atomic_swp_ord8(&i_ThrdAttr, aNewAtt); } |
|
401 |
||
402 |
/** @internalComponent */ |
|
403 |
inline TUint8 ModifyAttributes(TUint8 aClearMask, TUint8 aSetMask) |
|
404 |
{ return __e32_atomic_axo_ord8(&i_ThrdAttr, (TUint8)~(aClearMask|aSetMask), aSetMask); } |
|
405 |
||
406 |
/** @internalComponent */ |
|
407 |
inline void SetAddressSpace(TAny* a) |
|
408 |
{ iAddressSpace=a; } |
|
409 |
||
410 |
/** @internalComponent */ |
|
411 |
inline void SetExtraContext(TAny* a, TInt aSize) |
|
412 |
{ iExtraContext = a; iExtraContextSize = aSize; } |
|
413 |
||
414 |
/** @internalTechnology */ |
|
415 |
inline TBool IsDead() |
|
416 |
{ return iWaitState.ThreadIsDead(); } |
|
417 |
public: |
|
418 |
TPriListLink iWaitLink; /**< @internalComponent */ // used to link thread into a wait queue |
|
419 |
// TUint8 iBasePri; /**< @internalComponent */ // priority with no fast mutex held |
|
420 |
// TUint8 iMutexPri; /**< @internalComponent */ // priority from held fast mutex |
|
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
421 |
// TUint8 iNominalPri; /**< @internalComponent */ // nominal priority of thread (excluding effect of higher level inheritance) |
0 | 422 |
TUint8 iLinkedObjType; |
423 |
TUint8 i_ThrdAttr; /**< @internalComponent */ |
|
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
424 |
TUint8 iInitial; /**< @internalComponent */ // TRUE if this is an initial thread |
0 | 425 |
TUint8 iFastMutexDefer; /**< @internalComponent */ |
426 |
||
427 |
NFastSemaphore iRequestSemaphore; /**< @internalComponent */ |
|
428 |
||
429 |
TInt iTime; /**< @internalComponent */ // time remaining, 0 if expired |
|
430 |
TInt iTimeslice; /**< @internalComponent */ // timeslice for this thread, -ve = no timeslicing |
|
431 |
||
432 |
TLinAddr iSavedSP; /**< @internalComponent */ |
|
433 |
TAny* iAddressSpace; /**< @internalComponent */ |
|
434 |
||
435 |
NFastMutex* volatile iHeldFastMutex; /**< @internalComponent */ // fast mutex held by this thread |
|
436 |
TUserModeCallback* volatile iUserModeCallbacks; /**< @internalComponent */ // Head of singly-linked list of callbacks |
|
437 |
TAny* volatile iLinkedObj; /**< @internalComponent */ // object to which this thread is linked |
|
438 |
NThreadGroup* iNewParent; /**< @internalComponent */ // group to join |
|
439 |
||
440 |
const SFastExecTable* iFastExecTable; /**< @internalComponent */ |
|
441 |
const SSlowExecEntry* iSlowExecTable; /**< @internalComponent */ // points to first entry iEntries[0] |
|
442 |
||
443 |
volatile TInt iCsCount; /**< @internalComponent */ // critical section count |
|
444 |
volatile TInt iCsFunction; /**< @internalComponent */ // what to do on leaving CS: +n=suspend n times, 0=nothing, -1=exit |
|
445 |
||
446 |
NThreadWaitState iWaitState; /**< @internalComponent */ |
|
447 |
||
448 |
const SNThreadHandlers* iHandlers; /**< @internalComponent */ // additional thread event handlers |
|
449 |
TInt iSuspendCount; /**< @internalComponent */ // -how many times we have been suspended |
|
450 |
||
451 |
TLinAddr iStackBase; /**< @internalComponent */ |
|
452 |
TInt iStackSize; /**< @internalComponent */ |
|
453 |
||
454 |
TAny* iExtraContext; /**< @internalComponent */ // parent FPSCR value (iExtraContextSize == -1), coprocessor context (iExtraContextSize > 0) or NULL |
|
455 |
TInt iExtraContextSize; /**< @internalComponent */ // +ve=dynamically allocated, 0=none, -1=iExtraContext stores parent FPSCR value |
|
456 |
||
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
457 |
TUint8 iCoreCycling; /**< @internalComponent */ // this thread is currently cycling through all active cores |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
458 |
TUint8 iRebalanceAttr; /**< @internalComponent */ // behaviour of load balancing wrt this thread |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
459 |
TUint8 iNThreadBaseSpare4c; /**< @internalComponent */ // spare to allow growth while preserving BC |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
460 |
TUint8 iNThreadBaseSpare4d; /**< @internalComponent */ // spare to allow growth while preserving BC |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
461 |
TUint32 iNThreadBaseSpare5; /**< @internalComponent */ // spare to allow growth while preserving BC |
0 | 462 |
TUint32 iNThreadBaseSpare6; /**< @internalComponent */ // spare to allow growth while preserving BC |
463 |
TUint32 iNThreadBaseSpare7; /**< @internalComponent */ // spare to allow growth while preserving BC |
|
464 |
TUint32 iNThreadBaseSpare8; /**< @internalComponent */ // spare to allow growth while preserving BC |
|
465 |
TUint32 iNThreadBaseSpare9; /**< @internalComponent */ // spare to allow growth while preserving BC |
|
466 |
}; |
|
467 |
||
468 |
__ASSERT_COMPILE(!(_FOFF(NThreadBase,iWaitLink)&7)); |
|
469 |
__ASSERT_COMPILE(!(sizeof(NThreadBase)&7)); |
|
470 |
||
471 |
#ifdef __INCLUDE_NTHREADBASE_DEFINES__ |
|
472 |
#define iReady iSpare1 /**< @internalComponent */ |
|
473 |
#define iCurrent iSpare2 /**< @internalComponent */ |
|
474 |
#define iLastCpu iSpare3 /**< @internalComponent */ |
|
475 |
||
476 |
#define iBasePri iWaitLink.iSpare1 /**< @internalComponent */ |
|
477 |
#define iMutexPri iWaitLink.iSpare2 /**< @internalComponent */ |
|
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
478 |
#define iNominalPri iWaitLink.iSpare3 /**< @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
479 |
#define i_NThread_Initial iInitial /**< @internalComponent */ |
0 | 480 |
|
481 |
#endif |
|
482 |
||
483 |
/** @internalComponent */ |
|
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
484 |
#define i_NThread_BasePri iWaitLink.iSpare1 |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
485 |
#define i_NThread_NominalPri iWaitLink.iSpare3 |
0 | 486 |
|
487 |
/** @internalComponent */ |
|
488 |
#define NTHREADBASE_CPU_AFFINITY_MASK 0x80000000 |
|
489 |
||
490 |
/** @internalComponent */ |
|
491 |
inline NThreadBase* NThreadWaitState::Thread() |
|
492 |
{ return _LOFF(this, NThreadBase, iWaitState); } |
|
493 |
||
494 |
/******************************************** |
|
495 |
* Thread group |
|
496 |
********************************************/ |
|
497 |
||
498 |
/** |
|
499 |
@publishedPartner |
|
500 |
@prototype |
|
501 |
||
502 |
Base class for a nanokernel thread or group |
|
503 |
*/ |
|
504 |
class NThreadGroup : public NSchedulable |
|
505 |
{ |
|
506 |
public: |
|
507 |
NThreadGroup(); |
|
508 |
public: |
|
509 |
TInt iThreadCount; /**< @internalComponent */ |
|
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
510 |
TDfc* iDestructionDfc; /**< @internalComponent */ |
0 | 511 |
TPriList<NThreadBase, KNumPriorities> iNThreadList; /**< @internalComponent */ |
512 |
}; |
|
513 |
||
514 |
/******************************************** |
|
515 |
* Scheduler |
|
516 |
********************************************/ |
|
517 |
||
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
518 |
#include <nk_plat.h> |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
519 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
520 |
/** |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
521 |
@internalComponent |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
522 |
*/ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
523 |
enum |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
524 |
{ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
525 |
EQueueEvent_Kick=1, |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
526 |
EQueueEvent_WakeUp=2, |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
527 |
}; |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
528 |
|
0 | 529 |
/** |
530 |
@internalComponent |
|
531 |
*/ |
|
532 |
class TScheduler; |
|
533 |
class NThread; |
|
534 |
class NIrqHandler; |
|
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
535 |
struct SIdlePullThread; |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
536 |
class TSubScheduler |
0 | 537 |
{ |
538 |
public: |
|
539 |
TSubScheduler(); |
|
540 |
void QueueDfcs(); |
|
541 |
void RotateReadyList(TInt aPriority); |
|
542 |
NThread* SelectNextThread(); |
|
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
543 |
TInt QueueEvent(NEventHandler* aEvent); |
0 | 544 |
void QueueEventAndKick(NEventHandler* aEvent); |
545 |
void SaveTimesliceTimer(NThreadBase* aThread); |
|
546 |
void UpdateThreadTimes(NThreadBase* aOld, NThreadBase* aNew); |
|
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
547 |
void SSAddEntry(NSchedulable* aEntry); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
548 |
void SSAddEntryHead(NSchedulable* aEntry); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
549 |
void SSRemoveEntry(NSchedulable* aEntry); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
550 |
void SSChgEntryP(NSchedulable* aEntry, TInt aNewPriority); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
551 |
void IdlePullSearch(SIdlePullThread& a, TSubScheduler* aDest); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
552 |
void GetLbThreads(SDblQue& aQ); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
553 |
TBool Detached(); // platform specific |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
554 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
555 |
inline TInt HighestPriority() |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
556 |
{ return iSSList.HighestPriority(); } |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
557 |
inline NSchedulable* EntryAtPriority(TInt aPri) |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
558 |
{ return (NSchedulable*)iSSList.iQueue[aPri]; } |
0 | 559 |
private: |
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
560 |
TPriList<NSchedulable, KNumPriorities> iSSList; |
0 | 561 |
public: |
562 |
TSpinLock iExIDfcLock; // lock to protect exogenous IDFC queue |
|
563 |
||
564 |
SDblQue iExIDfcs; // list of pending exogenous IDFCs (i.e. ones punted over from another CPU) |
|
565 |
||
566 |
SDblQue iDfcs; // normal IDFC/DFC pending queue (only accessed by this CPU) |
|
567 |
||
568 |
TDfc* volatile iCurrentIDFC; // pointer to IDFC currently running on this CPU |
|
569 |
NThread* iCurrentThread; // the thread currently running on this CPU |
|
570 |
||
571 |
TUint32 iCpuNum; |
|
572 |
TUint32 iCpuMask; |
|
573 |
||
574 |
TSpinLock iReadyListLock; |
|
575 |
||
576 |
volatile TUint8 iRescheduleNeededFlag; // TRUE if a thread reschedule is pending |
|
577 |
TUint8 iSubSchedulerSBZ1; // always zero |
|
578 |
volatile TUint8 iDfcPendingFlag; // TRUE if a normal IDFC is pending |
|
579 |
volatile TUint8 iExIDfcPendingFlag; // TRUE if an exogenous IDFC is pending |
|
580 |
TInt iKernLockCount; // how many times the current CPU has locked the kernel |
|
581 |
||
582 |
TUint8 iInIDFC; // TRUE if IDFCs are currently being run on this CPU |
|
583 |
volatile TUint8 iEventHandlersPending; // TRUE if an event handler is pending on this CPU |
|
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
584 |
TUint8 iCCSyncPending; |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
585 |
TUint8 iLbCounter; |
0 | 586 |
TAny* iAddressSpace; |
587 |
||
588 |
TUint32 iReschedIPIs; |
|
589 |
TScheduler* iScheduler; |
|
590 |
||
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
591 |
TInt iDeferShutdown; // counts reasons why this CPU can't shut down |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
592 |
TInt iRdyThreadCount; // number of ready threads excluding idle thread |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
593 |
TUint16 iPriClassThreadCount[KNumPriClasses]; |
0 | 594 |
|
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
595 |
TUint64HL iLastTimestamp; // timestamp at which last reschedule occurred |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
596 |
TUint64HL iReschedCount; |
0 | 597 |
|
598 |
TGenericIPI* iNextIPI; // next generic IPI to run on this CPU |
|
599 |
NThread* iInitialThread; // Initial (idle) thread on this CPU |
|
600 |
||
601 |
TSpinLock iEventHandlerLock; // lock to protect event handler queue |
|
602 |
||
603 |
SDblQue iEventHandlers; // queue of pending event handlers on this CPU |
|
604 |
||
605 |
TUint64 iSpinLockOrderCheck; // bitmask showing which spinlock orders currently held |
|
606 |
||
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
607 |
TSubSchedulerX iSSX; // platform specific extras |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
608 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
609 |
volatile TAny* iUncached; // points to platform specific uncached data structure |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
610 |
TUint iMadeReadyCounter; // Number of times this core made a thread ready. |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
611 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
612 |
TUint iMadeUnReadyCounter; // Number of times this core made a thread unready. |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
613 |
TUint iTimeSliceExpireCounter; // Number of times this core hass reschedualed due to time slice exireation. |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
614 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
615 |
TUint32 iSubSchedulerPadding[70]; |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
616 |
SDblQue iLbQ; // threads to be considered by subsequent periodic load balance |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
617 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
618 |
TAny* iSubSchedScratch[16]; // For use by code outside NKern |
0 | 619 |
}; |
620 |
||
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
621 |
const TInt KSubSchedulerShift = 10; // log2(sizeof(TSubScheduler)) |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
622 |
|
0 | 623 |
__ASSERT_COMPILE(!(_FOFF(TSubScheduler,iExIDfcLock)&7)); |
624 |
__ASSERT_COMPILE(!(_FOFF(TSubScheduler,iEventHandlerLock)&7)); |
|
625 |
__ASSERT_COMPILE(!(_FOFF(TSubScheduler,iReadyListLock)&7)); |
|
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
626 |
__ASSERT_COMPILE(!(_FOFF(TSubScheduler,iLastTimestamp)&7)); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
627 |
__ASSERT_COMPILE(!(_FOFF(TSubScheduler,iReschedCount)&7)); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
628 |
__ASSERT_COMPILE(sizeof(TSubSchedulerX)==256); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
629 |
__ASSERT_COMPILE(sizeof(TSubScheduler)==(1<<KSubSchedulerShift)); // make it a nice power of 2 size for easy indexing |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
630 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
631 |
struct SCoreControlAction; |
0 | 632 |
|
633 |
/** |
|
634 |
@internalComponent |
|
635 |
*/ |
|
636 |
class TScheduler |
|
637 |
{ |
|
638 |
public: |
|
639 |
TScheduler(); |
|
640 |
static void Reschedule(); |
|
641 |
IMPORT_C static TScheduler* Ptr(); |
|
642 |
inline void SetProcessHandler(TLinAddr aHandler) {iProcessHandler=aHandler;} |
|
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
643 |
void PeriodicBalance(); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
644 |
TBool ReBalance(SDblQue& aQ, TBool aCC); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
645 |
void CCReactivate(TUint32 aMore); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
646 |
void CCIpiReactivate(); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
647 |
void CCRequest(); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
648 |
void GetLbThreads(SDblQue& aQ); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
649 |
void CCUnDefer(); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
650 |
void ChangeThreadAcceptCpus(TUint32 aNewMask); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
651 |
TUint32 ReschedInactiveCpus(TUint32 aMask); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
652 |
void InitCCAction(SCoreControlAction& aA); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
653 |
TUint32 ModifyCCState(TUint32 aAnd, TUint32 aXor); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
654 |
TUint32 CpuShuttingDown(TSubScheduler& aSS); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
655 |
void AllCpusIdle(); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
656 |
void FirstBackFromIdle(); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
657 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
658 |
void InitLB(); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
659 |
void StartRebalanceTimer(TBool aRestart); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
660 |
void StopRebalanceTimer(TBool aTemp); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
661 |
static void BalanceTimerExpired(TAny*); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
662 |
static void StartPeriodicBalancing(); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
663 |
static void CCSyncDone(TAny*); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
664 |
static void CCReactivateDfcFn(TAny*); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
665 |
static void CCRequestDfcFn(TAny*); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
666 |
static void CCIpiReactivateFn(TAny*); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
667 |
static TDfcQue* RebalanceDfcQ(); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
668 |
static NThread* LBThread(); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
669 |
static TBool CoreControlSupported(); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
670 |
static void CCInitiatePowerUp(TUint32 aCores); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
671 |
static void CCIndirectPowerDown(TAny*); |
0 | 672 |
public: |
673 |
TLinAddr iMonitorExceptionHandler; |
|
674 |
TLinAddr iProcessHandler; |
|
675 |
||
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
676 |
volatile TUint32 iThreadAcceptCpus; // bit n set if CPU n is accepting unlocked threads |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
677 |
volatile TUint32 iIpiAcceptCpus; // bit n set if CPU n is accepting generic IPIs |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
678 |
volatile TUint32 iCpusComingUp; // bit n set if CPU n is in the process of powering up |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
679 |
volatile TUint32 iCpusGoingDown; // bit n set if CPU n is in the process of powering down and is no longer accepting IPIs |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
680 |
volatile TInt iCCDeferCount; // >0 means CPUs on the way down will stop just before the 'point of no return' |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
681 |
volatile TUint32 iCCSyncCpus; // bit n set if CPU n has not yet observed a change to iThreadAcceptCpus |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
682 |
volatile TUint32 iCCReactivateCpus; |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
683 |
volatile TUint32 iCCState; |
0 | 684 |
|
685 |
TInt iNumCpus; // number of CPUs under the kernel's control |
|
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
686 |
TLinAddr iRescheduleHook; |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
687 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
688 |
SDblQue iGenIPIList; // list of active generic IPIs |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
689 |
TSpinLock iGenIPILock; // spin lock protects iGenIPIList, also iIpiAcceptCpus, iCpusComingUp, iCpusGoingDown, iCCDeferCount |
0 | 690 |
|
691 |
TSubScheduler* iSub[KMaxCpus]; // one subscheduler per CPU |
|
692 |
||
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
693 |
TAny* iSchedScratch[16]; // for use by code outside NKern |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
694 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
695 |
TSchedulerX iSX; // platform specific extras |
0 | 696 |
|
697 |
NFastMutex iLock; // the 'system lock' fast mutex |
|
698 |
||
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
699 |
TSpinLock iIdleBalanceLock; |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
700 |
|
0 | 701 |
TSpinLock iIdleSpinLock; // lock to protect list of DFCs to be run on idle |
702 |
||
703 |
SDblQue iIdleDfcs; // list of DFCs to run when all CPUs go idle |
|
704 |
||
705 |
TUint32 iCpusNotIdle; // bitmask - Bit n set => CPU n is not idle |
|
706 |
TUint8 iIdleGeneration; // Toggles between 0 and 1 each time iIdleDfcs list is spilled to a CPU IDFC queue |
|
707 |
TUint8 iIdleSpillCpu; // Which CPU last spilled the iIdleDfcs list to its IDFC queue |
|
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
708 |
TUint8 iLbCounter; |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
709 |
volatile TUint8 iNeedBal; |
0 | 710 |
|
711 |
TUint32 iIdleGenerationCount; // Incremented each time iIdleDfcs list is spilled to a CPU IDFC queue |
|
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
712 |
TDfcQue* iRebalanceDfcQ; |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
713 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
714 |
TSpinLock iEnumerateLock; // lock to protect iAllThreads, iAllGroups |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
715 |
SIterDQ iAllThreads; // list of all nanokernel threads in order of creation |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
716 |
SIterDQ iAllGroups; // list of all thread groups in order of creation |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
717 |
TSpinLock iBalanceListLock; // lock to protect iBalanceList |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
718 |
TUint64 iLastBalanceTime; // time at which last rebalance occurred |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
719 |
SDblQue iBalanceList; // list of threads/groups for load balancing |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
720 |
NTimer iBalanceTimer; // triggers periodic rebalancing |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
721 |
TDfc iCCSyncIDFC; // runs when a change to iThreadAcceptCpus has been observed by all CPUs |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
722 |
TDfc iCCReactivateDfc; // runs when a reschedule IPI is targeted to an inactive CPU |
0 | 723 |
|
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
724 |
TUint32 iCCRequestLevel; // Number of active cores last requested |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
725 |
volatile TUint32 iCCIpiReactivate; // Cores to be woken up because of IPIs |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
726 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
727 |
TDfc iCCRequestDfc; // runs when a request is made to change the number of active cores |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
728 |
TDfc iCCPowerDownDfc; // runs when indirect power down of core(s) is required |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
729 |
TDfc iCCIpiReactIDFC; // runs when an IPI needs to wake up a core |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
730 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
731 |
TSubScheduler* iPoweringOff; // CPU last to power off |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
732 |
TUint32 iDetachCount; // detach count before power off |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
733 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
734 |
TUint32 i_Scheduler_Padding[54]; |
0 | 735 |
}; |
736 |
||
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
737 |
__ASSERT_COMPILE(!(_FOFF(TScheduler,iGenIPILock)&7)); |
0 | 738 |
__ASSERT_COMPILE(!(_FOFF(TScheduler,iIdleSpinLock)&7)); |
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
739 |
__ASSERT_COMPILE(!(_FOFF(TScheduler,iIdleBalanceLock)&7)); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
740 |
__ASSERT_COMPILE(!(_FOFF(TScheduler,iEnumerateLock)&7)); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
741 |
__ASSERT_COMPILE(!(_FOFF(TScheduler,iBalanceListLock)&7)); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
742 |
__ASSERT_COMPILE(sizeof(TSchedulerX)==16*4); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
743 |
__ASSERT_COMPILE(sizeof(TScheduler)==1024); |
0 | 744 |
|
745 |
extern TScheduler TheScheduler; |
|
746 |
extern TSubScheduler TheSubSchedulers[KMaxCpus]; |
|
747 |
||
748 |
#ifdef __USE_BTRACE_LOCK__ |
|
749 |
extern TSpinLock BTraceLock; |
|
750 |
||
751 |
#define __ACQUIRE_BTRACE_LOCK() TInt _btrace_irq = BTraceLock.LockIrqSave() |
|
752 |
#define __RELEASE_BTRACE_LOCK() BTraceLock.UnlockIrqRestore(_btrace_irq) |
|
753 |
||
754 |
#else |
|
755 |
||
756 |
#define __ACQUIRE_BTRACE_LOCK() |
|
757 |
#define __RELEASE_BTRACE_LOCK() |
|
758 |
||
759 |
#endif |
|
760 |
||
761 |
/** |
|
762 |
@internalComponent |
|
763 |
*/ |
|
764 |
extern "C" TSubScheduler& SubScheduler(); |
|
765 |
||
766 |
/** |
|
767 |
@internalComponent |
|
768 |
*/ |
|
769 |
extern "C" void send_resched_ipi(TInt aCpu); |
|
770 |
||
771 |
/** |
|
772 |
@internalComponent |
|
773 |
*/ |
|
774 |
extern "C" void send_resched_ipi_and_wait(TInt aCpu); |
|
775 |
||
776 |
/** |
|
777 |
Call with kernel locked |
|
778 |
||
779 |
@internalComponent |
|
780 |
*/ |
|
781 |
inline void RescheduleNeeded() |
|
782 |
{ SubScheduler().iRescheduleNeededFlag = 1; } |
|
783 |
||
784 |
||
785 |
/** |
|
786 |
@internalComponent |
|
787 |
*/ |
|
788 |
#define NCurrentThread() NKern::CurrentThread() |
|
789 |
||
790 |
/** Optimised current thread function which can only be called from places where |
|
791 |
CPU migration is not possible - i.e. with interrupts disabled or preemption |
|
792 |
disabled. |
|
793 |
||
794 |
@internalComponent |
|
795 |
*/ |
|
796 |
extern "C" NThread* NCurrentThreadL(); |
|
797 |
||
798 |
/** @internalComponent */ |
|
799 |
inline TBool CheckCpuAgainstAffinity(TInt aCpu, TUint32 aAffinity) |
|
800 |
{ |
|
801 |
if (aAffinity & NTHREADBASE_CPU_AFFINITY_MASK) |
|
802 |
return aAffinity & (1<<aCpu); |
|
803 |
return aAffinity==(TUint32)aCpu; |
|
804 |
} |
|
805 |
||
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
806 |
/** @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
807 |
inline TBool CheckCpuAgainstAffinity(TInt aCpu, TUint32 aAffinity, TUint32 aActive) |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
808 |
{ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
809 |
if (aAffinity & NTHREADBASE_CPU_AFFINITY_MASK) |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
810 |
return aActive & aAffinity & (1<<aCpu); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
811 |
return (aAffinity==(TUint32)aCpu) && (aActive & (1<<aCpu)); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
812 |
} |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
813 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
814 |
/** @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
815 |
inline TUint32 AffinityToMask(TUint32 aAffinity) |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
816 |
{ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
817 |
return (aAffinity & NTHREADBASE_CPU_AFFINITY_MASK) ? (aAffinity & ~NTHREADBASE_CPU_AFFINITY_MASK) : (1u<<aAffinity); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
818 |
} |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
819 |
|
0 | 820 |
/** |
821 |
@internalComponent |
|
822 |
*/ |
|
823 |
#define __NK_ASSERT_UNLOCKED __NK_ASSERT_DEBUG(!NKern::KernelLocked()) |
|
824 |
||
825 |
/** |
|
826 |
@internalComponent |
|
827 |
*/ |
|
828 |
#define __NK_ASSERT_LOCKED __NK_ASSERT_DEBUG(NKern::KernelLocked()) |
|
829 |
||
830 |
#ifdef _DEBUG |
|
831 |
/** |
|
832 |
@publishedPartner |
|
833 |
@released |
|
834 |
*/ |
|
835 |
#define __ASSERT_NO_FAST_MUTEX __NK_ASSERT_DEBUG(!NKern::HeldFastMutex()); |
|
836 |
||
837 |
/** |
|
838 |
@publishedPartner |
|
839 |
@released |
|
840 |
*/ |
|
841 |
#define __ASSERT_FAST_MUTEX(m) __NK_ASSERT_DEBUG((m)->HeldByCurrentThread()); |
|
842 |
||
843 |
/** |
|
844 |
@publishedPartner |
|
845 |
@released |
|
846 |
*/ |
|
847 |
#define __ASSERT_SYSTEM_LOCK __NK_ASSERT_DEBUG(TScheduler::Ptr()->iLock.HeldByCurrentThread()); |
|
848 |
||
849 |
#define __ASSERT_NOT_ISR __NK_ASSERT_DEBUG(NKern::CurrentContext()!=NKern::EInterrupt) |
|
850 |
||
851 |
#else |
|
852 |
#define __ASSERT_NO_FAST_MUTEX |
|
853 |
#define __ASSERT_FAST_MUTEX(m) |
|
854 |
#define __ASSERT_SYSTEM_LOCK |
|
855 |
#define __ASSERT_NOT_ISR |
|
856 |
#endif |
|
857 |
||
858 |
/******************************************** |
|
859 |
* System timer queue |
|
860 |
********************************************/ |
|
861 |
||
862 |
/** |
|
863 |
@publishedPartner |
|
864 |
@prototype |
|
865 |
*/ |
|
866 |
class NTimerQ |
|
867 |
{ |
|
868 |
friend class NTimer; |
|
869 |
public: |
|
870 |
typedef void (*TDebugFn)(TAny* aPtr, TInt aPos); /**< @internalComponent */ |
|
871 |
enum { ETimerQMask=31, ENumTimerQueues=32 }; /**< @internalComponent */ // these are not easily modifiable |
|
872 |
||
873 |
/** @internalComponent */ |
|
874 |
struct STimerQ |
|
875 |
{ |
|
876 |
SDblQue iIntQ; |
|
877 |
SDblQue iDfcQ; |
|
878 |
}; |
|
879 |
public: |
|
880 |
NTimerQ(); |
|
881 |
static void Init1(TInt aTickPeriod); |
|
882 |
static void Init3(TDfcQue* aDfcQ); |
|
883 |
IMPORT_C static TAny* TimerAddress(); |
|
884 |
IMPORT_C void Tick(); |
|
885 |
IMPORT_C static TInt IdleTime(); |
|
886 |
IMPORT_C static void Advance(TInt aTicks); |
|
887 |
private: |
|
888 |
static void DfcFn(TAny* aPtr); |
|
889 |
void Dfc(); |
|
890 |
void Add(NTimer* aTimer); |
|
891 |
void AddFinal(NTimer* aTimer); |
|
892 |
public: |
|
893 |
STimerQ iTickQ[ENumTimerQueues]; /**< @internalComponent */ // NOTE: the order of member data is important |
|
894 |
TUint32 iPresent; /**< @internalComponent */ // The assembler code relies on it |
|
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
895 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
896 |
/** |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
897 |
This member is intended for use by ASSP/variant interrupt code as a convenient |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
898 |
location to store the value of a free running counter at the point where the |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
899 |
system tick is started. |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
900 |
@publishedPartner |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
901 |
@prototype |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
902 |
*/ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
903 |
TUint32 iFRCOffset; |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
904 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
905 |
union { |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
906 |
TUint32 iMsCount; /**< @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
907 |
TUint64 iMsCount64; /**< @internalComponent */ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
908 |
}; |
0 | 909 |
SDblQue iHoldingQ; /**< @internalComponent */ |
910 |
SDblQue iOrderedQ; /**< @internalComponent */ |
|
911 |
SDblQue iCompletedQ; /**< @internalComponent */ |
|
912 |
TDfc iDfc; /**< @internalComponent */ |
|
913 |
TUint8 iTransferringCancelled; /**< @internalComponent */ |
|
914 |
TUint8 iCriticalCancelled; /**< @internalComponent */ |
|
915 |
TUint8 iPad1; /**< @internalComponent */ |
|
916 |
TUint8 iPad2; /**< @internalComponent */ |
|
917 |
TDebugFn iDebugFn; /**< @internalComponent */ |
|
918 |
TAny* iDebugPtr; /**< @internalComponent */ |
|
919 |
TInt iTickPeriod; /**< @internalComponent */ // in microseconds |
|
920 |
||
921 |
/** |
|
922 |
This member is intended for use by ASSP/variant interrupt code as a convenient |
|
923 |
location to store rounding error information where hardware interrupts are not |
|
924 |
exactly one millisecond. The Symbian kernel does not make any use of this member. |
|
925 |
@publishedPartner |
|
926 |
@prototype |
|
927 |
*/ |
|
928 |
TInt iRounding; |
|
929 |
TInt iDfcCompleteCount; /**< @internalComponent */ |
|
930 |
TSpinLock iTimerSpinLock; /**< @internalComponent */ |
|
931 |
}; |
|
932 |
||
933 |
__ASSERT_COMPILE(!(_FOFF(NTimerQ,iTimerSpinLock)&7)); |
|
934 |
||
935 |
||
936 |
GLREF_D NTimerQ TheTimerQ; |
|
937 |
||
938 |
/** |
|
939 |
@internalComponent |
|
940 |
*/ |
|
941 |
inline TUint32 NTickCount() |
|
942 |
{return TheTimerQ.iMsCount;} |
|
943 |
||
944 |
/** |
|
945 |
@internalComponent |
|
946 |
*/ |
|
947 |
inline TInt NTickPeriod() |
|
948 |
{return TheTimerQ.iTickPeriod;} |
|
949 |
||
950 |
||
951 |
extern "C" { |
|
952 |
/** |
|
953 |
@internalComponent |
|
954 |
*/ |
|
955 |
extern void NKCrashHandler(TInt aPhase, const TAny* a0, TInt a1); |
|
956 |
||
957 |
/** |
|
958 |
@internalComponent |
|
959 |
*/ |
|
960 |
extern TUint32 CrashState; |
|
961 |
} |
|
962 |
||
963 |
||
964 |
/** |
|
965 |
@internalComponent |
|
966 |
*/ |
|
967 |
class TCancelIPI : public TGenericIPI |
|
968 |
{ |
|
969 |
public: |
|
970 |
void Send(TDfc* aDfc, TInt aCpu); |
|
971 |
static void Isr(TGenericIPI*); |
|
972 |
public: |
|
973 |
TDfc* volatile iDfc; |
|
974 |
}; |
|
975 |
||
976 |
||
977 |
/** |
|
978 |
@internalComponent |
|
979 |
*/ |
|
980 |
TBool InterruptsStatus(TBool aRequest); |
|
981 |
||
982 |
||
983 |
//declarations for the checking of kernel preconditions |
|
36
538db54a451d
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
984 |
|
538db54a451d
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
985 |
/** |
538db54a451d
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
986 |
@internalComponent |
538db54a451d
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
987 |
|
538db54a451d
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
988 |
PRECOND_FUNCTION_CALLER is needed for __ASSERT_WITH_MESSAGE_ALWAYS(), |
538db54a451d
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
989 |
so is outside the #ifdef _DEBUG. |
538db54a451d
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
990 |
*/ |
538db54a451d
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
991 |
#ifndef PRECOND_FUNCTION_CALLER |
538db54a451d
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
992 |
#define PRECOND_FUNCTION_CALLER 0 |
538db54a451d
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
993 |
#endif |
538db54a451d
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
994 |
|
0 | 995 |
#ifdef _DEBUG |
996 |
||
997 |
/** |
|
998 |
@internalComponent |
|
999 |
*/ |
|
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
1000 |
#define MASK_NO_FAST_MUTEX 0x1 |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
1001 |
#define MASK_CRITICAL 0x2 |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
1002 |
#define MASK_NO_CRITICAL 0x4 |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
1003 |
#define MASK_KERNEL_LOCKED 0x8 |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
1004 |
#define MASK_KERNEL_UNLOCKED 0x10 |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
1005 |
#define MASK_KERNEL_LOCKED_ONCE 0x20 |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
1006 |
#define MASK_INTERRUPTS_ENABLED 0x40 |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
1007 |
#define MASK_INTERRUPTS_DISABLED 0x80 |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
1008 |
#define MASK_SYSTEM_LOCKED 0x100 |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
1009 |
#define MASK_NOT_ISR 0x400 |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
1010 |
#define MASK_NOT_IDFC 0x800 |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
1011 |
#define MASK_NOT_THREAD 0x1000 |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
1012 |
#define MASK_NO_CRITICAL_IF_USER 0x2000 |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
1013 |
#define MASK_ALWAYS_FAIL 0x4000 |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
1014 |
#define MASK_NO_RESCHED 0x8000 |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
1015 |
#define MASK_NO_KILL_OR_SUSPEND 0x10000 |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
1016 |
#define MASK_THREAD_STANDARD ( MASK_NO_FAST_MUTEX | MASK_KERNEL_UNLOCKED | MASK_INTERRUPTS_ENABLED | MASK_NOT_ISR | MASK_NOT_IDFC ) |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
1017 |
#define MASK_THREAD_CRITICAL ( MASK_THREAD_STANDARD | MASK_CRITICAL ) |
0 | 1018 |
|
1019 |
#if defined(__STANDALONE_NANOKERNEL__) || (!defined (__KERNEL_APIS_CONTEXT_CHECKS_WARNING__)&&!defined (__KERNEL_APIS_CONTEXT_CHECKS_FAULT__)) |
|
1020 |
#define CHECK_PRECONDITIONS(mask,function) |
|
1021 |
#define __ASSERT_WITH_MESSAGE_DEBUG(cond,message,function) |
|
1022 |
||
1023 |
#else |
|
1024 |
/** |
|
1025 |
@internalComponent |
|
1026 |
*/ |
|
1027 |
extern "C" TInt CheckPreconditions(TUint32 aConditionMask, const char* aFunction, TLinAddr aAddr); |
|
1028 |
/** |
|
1029 |
@internalComponent |
|
1030 |
*/ |
|
36
538db54a451d
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1031 |
#define CHECK_PRECONDITIONS(mask,function) CheckPreconditions(mask,function,PRECOND_FUNCTION_CALLER) |
0 | 1032 |
|
1033 |
#ifdef __KERNEL_APIS_CONTEXT_CHECKS_FAULT__ |
|
1034 |
||
1035 |
/** |
|
1036 |
@internalComponent |
|
1037 |
*/ |
|
1038 |
#define __ASSERT_WITH_MESSAGE_DEBUG(cond,message,function) \ |
|
1039 |
__ASSERT_DEBUG( (cond), ( \ |
|
36
538db54a451d
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1040 |
DEBUGPRINT("Assertion failed: %s\nFunction: %s; called from: %08x\n",message,function,PRECOND_FUNCTION_CALLER),\ |
0 | 1041 |
NKFault(function, 0))) |
1042 |
||
1043 |
#else//!__KERNEL_APIS_CONTEXT_CHECKS_FAULT__ |
|
1044 |
/** |
|
1045 |
@internalComponent |
|
1046 |
*/ |
|
1047 |
#define __ASSERT_WITH_MESSAGE_DEBUG(cond,message,function) \ |
|
1048 |
__ASSERT_DEBUG( (cond), \ |
|
36
538db54a451d
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1049 |
DEBUGPRINT("Assertion failed: %s\nFunction: %s; called from: %08x\n",message,function,PRECOND_FUNCTION_CALLER)) |
0 | 1050 |
|
1051 |
||
1052 |
#endif//__KERNEL_APIS_CONTEXT_CHECKS_FAULT__ |
|
1053 |
#endif//(!defined (__KERNEL_APIS_CONTEXT_CHECKS_WARNING__)&&!defined (__KERNEL_APIS_CONTEXT_CHECKS_FAULT__)) |
|
1054 |
||
1055 |
#else//if !DEBUG |
|
1056 |
||
1057 |
#define CHECK_PRECONDITIONS(mask,function) |
|
1058 |
#define __ASSERT_WITH_MESSAGE_DEBUG(cond,message,function ) |
|
1059 |
||
1060 |
#endif//_DEBUG |
|
1061 |
||
1062 |
#if (!defined (__KERNEL_APIS_CONTEXT_CHECKS_WARNING__)&&!defined (__KERNEL_APIS_CONTEXT_CHECKS_FAULT__)) |
|
1063 |
#define __ASSERT_WITH_MESSAGE_ALWAYS(cond,message,function ) |
|
1064 |
#else |
|
1065 |
#ifdef __KERNEL_APIS_CONTEXT_CHECKS_FAULT__ |
|
1066 |
/** |
|
1067 |
@internalComponent |
|
1068 |
*/ |
|
1069 |
#define __ASSERT_WITH_MESSAGE_ALWAYS(cond,message,function) \ |
|
1070 |
__ASSERT_ALWAYS( (cond), ( \ |
|
36
538db54a451d
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1071 |
DEBUGPRINT("Assertion failed: %s\nFunction: %s; called from: %08x\n",message,function,PRECOND_FUNCTION_CALLER),\ |
0 | 1072 |
NKFault(function, 0))) |
1073 |
#else |
|
1074 |
/** |
|
1075 |
@internalComponent |
|
1076 |
*/ |
|
1077 |
#define __ASSERT_WITH_MESSAGE_ALWAYS(cond,message,function) \ |
|
1078 |
__ASSERT_ALWAYS( (cond), \ |
|
36
538db54a451d
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1079 |
DEBUGPRINT("Assertion failed: %s\nFunction: %s; called from: %08x\n",message,function,PRECOND_FUNCTION_CALLER)) |
0 | 1080 |
#endif//__KERNEL_APIS_CONTEXT_CHECKS_FAULT__ |
1081 |
#endif//(!defined (__KERNEL_APIS_CONTEXT_CHECKS_WARNING__)&&!defined (__KERNEL_APIS_CONTEXT_CHECKS_FAULT__)) |
|
1082 |
||
1083 |
#endif |