author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 14 Sep 2010 23:56:21 +0300 | |
branch | RCL_3 |
changeset 45 | 9e2d4f7f5028 |
parent 19 | 4a8fed1c0ef6 |
permissions | -rw-r--r-- |
0 | 1 |
// Copyright (c) 1995-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\kernel\sglobals.cpp |
|
15 |
// |
|
16 |
// |
|
17 |
||
18 |
#include <kernel/kern_priv.h> |
|
19 |
#include <kernel/sshbuf.h> |
|
20 |
||
21 |
extern "C" { |
|
22 |
TLinAddr SuperPageAddress; |
|
23 |
} |
|
24 |
||
19
4a8fed1c0ef6
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
25 |
extern void DrainEntropyBuffers(TAny*); |
4a8fed1c0ef6
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
26 |
|
0 | 27 |
TMachineConfig* K::MachineConfig; |
28 |
RAllocator* K::Allocator; |
|
29 |
K::SHeapInfo K::HeapInfo; |
|
30 |
K::SMsgInfo K::MsgInfo; |
|
31 |
DThread* K::TheKernelThread; |
|
32 |
DProcess* K::TheKernelProcess; |
|
33 |
DThread* K::TheNullThread; |
|
34 |
DThread* K::SvThread; |
|
35 |
TDfcQue* K::SvMsgQ; |
|
36 |
TMessageQue K::SvBarrierQ(&K::DoSvBarrier, &K::SvBarrierQ, NULL, 0); |
|
37 |
NFastMutex K::EventQueueMutex; |
|
38 |
TRawEvent *K::EventHeadPtr; |
|
39 |
TRawEvent *K::EventTailPtr; |
|
40 |
TRawEvent *K::EventBufferStart; |
|
41 |
TRawEvent *K::EventBufferEnd; |
|
42 |
TClientDataRequest<TRawEvent>* K::EventRequest; |
|
43 |
DThread *K::EventThread; |
|
44 |
TDfcQue* K::DfcQ0; |
|
45 |
TDfcQue* K::DfcQ1; |
|
46 |
TDfcQue* K::TimerDfcQ; |
|
47 |
TInt K::DfcQId=0; |
|
48 |
volatile TUint K::DynamicDfcQId=0xdfc00001; |
|
49 |
SHalEntry2* K::HalEntryArray; |
|
50 |
DPowerModel* K::PowerModel=NULL; |
|
51 |
TBool K::PowerGood=ETrue; |
|
52 |
TInt K::MaxMemCopyInOneGo; |
|
53 |
TTickQ* K::TickQ; |
|
54 |
TSecondQ* K::SecondQ; |
|
55 |
TInactivityQ* K::InactivityQ; |
|
56 |
TInt K::HomeTimeOffsetSeconds; |
|
57 |
TInt K::NonSecureOffsetSeconds; |
|
58 |
TInt K::SecureClockStatus; |
|
59 |
TInt64 K::Year2000InSeconds; |
|
60 |
DMutex* K::MachineConfigMutex; |
|
61 |
DObjectCon* K::Containers[ENumObjectTypes]; |
|
62 |
DMutex* DCodeSeg::CodeSegLock; |
|
63 |
TInt DCodeSeg::DeleteLock; |
|
64 |
TInt DCodeSeg::KernelCleanupLock; |
|
65 |
SDblQue DCodeSeg::GlobalList; |
|
66 |
SDblQue DCodeSeg::GarbageList; |
|
67 |
SDblQue DCodeSeg::KernelGarbageList; |
|
68 |
SDblQue DCodeSeg::DeferredKernelGarbageList; |
|
69 |
TDfc DCodeSeg::KernelCleanupDfc(DCodeSeg::DoKernelCleanup, NULL, 1); |
|
70 |
RPointerArray<DCodeSeg> DCodeSeg::CodeSegsByName(8, 2*256); |
|
71 |
DCodeSeg::RCodeSegsByAddress DCodeSeg::CodeSegsByAddress(8, 2*256); |
|
72 |
TClientRequest* DCodeSeg::DestructNotifyRequest=NULL; |
|
73 |
DThread* DCodeSeg::DestructNotifyThread=NULL; |
|
74 |
TCodeSegLoaderCookieList* DCodeSeg::DestructNotifyList=NULL; |
|
75 |
TDfc TClientRequest::DeadClientCleanupDfc(TClientRequest::DoDeadClientCleanup, NULL, 2); |
|
76 |
||
77 |
TInt K::MaxFreeRam; |
|
78 |
// |
|
79 |
TInt K::NextId=0; |
|
80 |
// |
|
81 |
NFastMutex TMessageQue::MsgLock; |
|
82 |
NFastMutex DObject::Lock; |
|
83 |
TUint64 DObject::NextObjectId = 1u<<18; |
|
84 |
DMutex* RObjectIx::HandleMutex; |
|
85 |
NFastMutex TLogon::LogonLock; |
|
86 |
// |
|
87 |
TAny* volatile K::AsyncFreeHead=NULL; |
|
88 |
DBase* volatile K::AsyncDeleteHead=NULL; |
|
89 |
TDfc K::AsyncFreeDfc(K::DoAsyncFree, NULL, 2); |
|
90 |
TInt K::MemoryLowThreshold=0; |
|
91 |
TInt K::MemoryGoodThreshold=KMaxTInt; |
|
92 |
TUint K::AsyncChanges=0; |
|
93 |
TDfc K::AsyncChangeNotifierDfc(K::DoAsyncNotify, NULL, 2); |
|
94 |
||
95 |
// |
|
96 |
TBool K::Initialising=ETrue; |
|
97 |
TBool K::ColdStart; |
|
98 |
TInt K::ExtensionCount = 0; |
|
99 |
RArray<SExtInit1EntryPoint>* K::ExtensionArray=0; |
|
100 |
DProcess* K::TheFileServerProcess; |
|
101 |
DProcess* K::TheWindowServerProcess; |
|
102 |
TInt K::PINestLevel=0; |
|
103 |
SDblQue DKernelEventHandler::HandlersQ; |
|
104 |
TInt K::SupervisorThreadStackSize; |
|
105 |
TUint32 K::MemModelAttributes; |
|
106 |
||
107 |
DMutex* TInternalRamDrive::Mutex=NULL; |
|
108 |
||
109 |
TKernelHookFn K::KernelHooks[ENumKernelHooks] = |
|
110 |
{ |
|
111 |
NULL, // EHookTrace |
|
112 |
(TKernelHookFn)K::DoNanoWait, // EHookNanoWait |
|
113 |
(TKernelHookFn)P::DefaultInitialTime // EHookInitialTime |
|
114 |
}; |
|
115 |
||
116 |
TUint K::TextTraceMode=0; |
|
117 |
||
118 |
TMiscNotifierMgr K::TheMiscNotifierMgr; |
|
119 |
TAny* K::VariantData[31]; |
|
120 |
||
19
4a8fed1c0ef6
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
121 |
// Array of per CPU entropy buffer status values, each has the number of words used in the bottom 14 bits, |
4a8fed1c0ef6
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
122 |
// which may not exceed 2^13 words (32KB or 256Kbit). |
4a8fed1c0ef6
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
123 |
// The top 18 bits is the number of bits of entropy with maximum value 2^18 or 256Kbit which matches the buffer size. |
4a8fed1c0ef6
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
124 |
TUint32 K::EntropyBufferStatus[KMaxCpus]; |
4a8fed1c0ef6
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
125 |
|
4a8fed1c0ef6
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
126 |
// Array of per CPU pointers to entropy buffers. |
4a8fed1c0ef6
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
127 |
TUint32* K::EntropyBuffer[KMaxCpus]; |
4a8fed1c0ef6
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
128 |
|
4a8fed1c0ef6
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
129 |
// Temporary buffer to drain per cpu buffers to |
4a8fed1c0ef6
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
130 |
TUint32 K::TempEntropyBuffer[KEntropyBufferSizeWords]; |
4a8fed1c0ef6
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
131 |
|
4a8fed1c0ef6
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
132 |
// DFC to drain entropy buffers |
4a8fed1c0ef6
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
133 |
TDfc K::EntropyBufferDfc(DrainEntropyBuffers, NULL, 1); |
4a8fed1c0ef6
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
134 |
|
0 | 135 |
TDfcQue DShPool::iSharedDfcQue; // DFCQ thread for shareable data buffers growing/shrinking/notifications |