119
|
1 |
// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
|
0
|
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 |
//
|
|
15 |
|
|
16 |
#include <kernel/kernel.h>
|
|
17 |
#include <drivers/resourceman.h>
|
|
18 |
#include "d_prmacctst.h"
|
|
19 |
#ifdef RESOURCE_MANAGER_SIMULATED_PSL
|
|
20 |
#include "../resourceman_psl/rescontrol_psl.h"
|
|
21 |
#endif // RESOURCE_MANAGER_SIMULATED_PSL
|
|
22 |
|
|
23 |
#define TEST_KERRNONE(x) { TInt _r = (x); if (_r != KErrNone) \
|
|
24 |
Kern::Printf("Test failed: %s line %d error %d", __FILE__, __LINE__, _r); }
|
|
25 |
#define TEST(x) { if (!(x)) Kern::Printf("Test failed: %s line %d", __FILE__, __LINE__); }
|
|
26 |
|
|
27 |
_LIT(KTestDfcQueBaseName, "PrmIfDfc");
|
|
28 |
const TInt KTestDfcQuePrority = KMaxDfcPriority - 1;
|
|
29 |
|
|
30 |
//---------------------------------------------------------------------------
|
|
31 |
|
|
32 |
class DPrmIfDevice : public DLogicalDevice
|
|
33 |
{
|
|
34 |
public:
|
|
35 |
DPrmIfDevice();
|
|
36 |
virtual TInt Install();
|
|
37 |
virtual void GetCaps(TDes8& aDes) const;
|
|
38 |
virtual TInt Create(DLogicalChannelBase*& aChannel);
|
|
39 |
};
|
|
40 |
|
|
41 |
//---------------------------------------------------------------------------
|
|
42 |
|
|
43 |
class DPrmIfChannel : public DLogicalChannel
|
|
44 |
{
|
|
45 |
public:
|
|
46 |
DPrmIfChannel();
|
|
47 |
~DPrmIfChannel();
|
|
48 |
protected:
|
|
49 |
virtual void HandleMsg(TMessageBase* aMsg);
|
|
50 |
virtual TInt DoCreate(TInt aUnit, const TDesC8* anInfo, const TVersion& aVer);
|
|
51 |
private:
|
|
52 |
TInt DoControl(TInt aReqNo, TAny *a1, TAny *a2);
|
|
53 |
TInt DoRequest(TInt aReqNo, TRequestStatus* aStatus, TAny *a1, TAny *a2);
|
|
54 |
void Shutdown();
|
|
55 |
|
|
56 |
public:
|
|
57 |
static TUint KernelExtensionClientId;
|
|
58 |
private:
|
|
59 |
DThread* iUserThread;
|
|
60 |
TUint iClientId;
|
|
61 |
HBuf* iClientName;
|
|
62 |
};
|
|
63 |
|
|
64 |
TUint DPrmIfChannel::KernelExtensionClientId = 0;
|
|
65 |
|
|
66 |
void TestCallbackFunction(TUint /* aClientId */,
|
|
67 |
TUint /* aResourceId */,
|
|
68 |
TInt /* aLevel */,
|
|
69 |
TInt /* aLevelOwnerId */,
|
|
70 |
TInt /* aResult */,
|
|
71 |
TAny* aSem);
|
|
72 |
|
|
73 |
//---------------------------------------------------------------------------
|
|
74 |
|
|
75 |
DPrmIfDevice::DPrmIfDevice()
|
|
76 |
{
|
|
77 |
}
|
|
78 |
|
|
79 |
TInt DPrmIfDevice::Install()
|
|
80 |
{
|
|
81 |
return SetName(&KPrmIfLddName);
|
|
82 |
}
|
|
83 |
|
|
84 |
void DPrmIfDevice::GetCaps(TDes8& /* aDes */) const
|
|
85 |
{
|
|
86 |
// Not used but required as DLogicalDevice::GetCaps is pure virtual
|
|
87 |
}
|
|
88 |
|
|
89 |
TInt DPrmIfDevice::Create(DLogicalChannelBase*& aChannel)
|
|
90 |
{
|
|
91 |
aChannel = new DPrmIfChannel;
|
|
92 |
return aChannel ? KErrNone : KErrNoMemory;
|
|
93 |
}
|
|
94 |
|
|
95 |
//---------------------------------------------------------------------------
|
|
96 |
|
|
97 |
DPrmIfChannel::DPrmIfChannel()
|
|
98 |
{
|
|
99 |
iUserThread = &Kern::CurrentThread();
|
|
100 |
((DObject*) iUserThread)->Open();
|
|
101 |
}
|
|
102 |
|
|
103 |
DPrmIfChannel::~DPrmIfChannel()
|
|
104 |
{
|
|
105 |
if(iDfcQ)
|
|
106 |
((TDynamicDfcQue*)iDfcQ)->Destroy();
|
|
107 |
// Close our reference on the client thread
|
|
108 |
Kern::SafeClose((DObject*&)iUserThread,NULL);
|
|
109 |
}
|
|
110 |
|
|
111 |
void DPrmIfChannel::HandleMsg(TMessageBase *aMsg)
|
|
112 |
{
|
|
113 |
TThreadMessage& m = *(TThreadMessage*) aMsg;
|
|
114 |
TInt id = m.iValue;
|
|
115 |
|
|
116 |
if (id == (TInt) ECloseMsg)
|
|
117 |
{
|
|
118 |
m.Complete(KErrNone, EFalse);
|
|
119 |
return;
|
|
120 |
}
|
|
121 |
else if (id == KMaxTInt)
|
|
122 |
{
|
|
123 |
// DoCancel
|
|
124 |
m.Complete(KErrNone, ETrue);
|
|
125 |
return;
|
|
126 |
}
|
|
127 |
else if (id < 0)
|
|
128 |
{
|
|
129 |
// DoRequest
|
|
130 |
TRequestStatus* pS = (TRequestStatus*) m.Ptr0();
|
|
131 |
TInt r = DoRequest(~id, pS, m.Ptr1(), m.Ptr2());
|
|
132 |
if (r != KErrNone)
|
|
133 |
{
|
|
134 |
Kern::RequestComplete(iUserThread, pS, r);
|
|
135 |
}
|
|
136 |
m.Complete(KErrNone, ETrue);
|
|
137 |
}
|
|
138 |
else
|
|
139 |
{
|
|
140 |
// DoControl
|
|
141 |
TInt r = DoControl(id, m.Ptr0(), m.Ptr1());
|
|
142 |
if(r != KErrCompletion)
|
|
143 |
{
|
|
144 |
m.Complete(r, ETrue);
|
|
145 |
}
|
|
146 |
}
|
|
147 |
}
|
|
148 |
|
|
149 |
TInt DPrmIfChannel::DoCreate(TInt /* aUnit */, const TDesC8* /* aInfo */, const TVersion& /* aVer */)
|
|
150 |
{
|
|
151 |
TDynamicDfcQue* dfcQ;
|
|
152 |
TInt r = Kern::DynamicDfcQCreate(dfcQ, KTestDfcQuePrority, KTestDfcQueBaseName);
|
|
153 |
TEST_KERRNONE(r);
|
|
154 |
if (r != KErrNone)
|
|
155 |
{
|
|
156 |
return r;
|
|
157 |
}
|
119
|
158 |
dfcQ->SetRealtimeState(ERealtimeStateOff);
|
|
159 |
iDfcQ = dfcQ;
|
0
|
160 |
SetDfcQ(iDfcQ);
|
|
161 |
iMsgQ.Receive();
|
|
162 |
return KErrNone;
|
|
163 |
}
|
|
164 |
|
|
165 |
TInt DPrmIfChannel::DoControl(TInt aReqNo, TAny *a1, TAny *a2)
|
|
166 |
{
|
|
167 |
TInt r = KErrNotSupported;
|
|
168 |
switch (aReqNo)
|
|
169 |
{
|
|
170 |
case RPrmIf::EControlOpenClient:
|
|
171 |
{
|
|
172 |
if (iClientId)
|
|
173 |
{
|
|
174 |
return KErrAlreadyExists;
|
|
175 |
}
|
|
176 |
TBuf8<80> clientName;
|
|
177 |
r = PowerResourceManager::GetClientName((TUint) a1, (TUint) a1, clientName);
|
|
178 |
TEST_KERRNONE(r);
|
|
179 |
if (r == KErrNone)
|
|
180 |
iClientId = (TUint) a1;
|
|
181 |
break;
|
|
182 |
}
|
|
183 |
|
|
184 |
case RPrmIf::EControlGetKernelExtClientId:
|
|
185 |
{
|
|
186 |
r = Kern::ThreadRawWrite(iUserThread, a1, &KernelExtensionClientId, sizeof(TUint));
|
|
187 |
TEST_KERRNONE(r);
|
|
188 |
break;
|
|
189 |
}
|
|
190 |
|
|
191 |
case RPrmIf::EControlRegisterClient:
|
|
192 |
{
|
|
193 |
if (iClientId)
|
|
194 |
{
|
|
195 |
return KErrAlreadyExists;
|
|
196 |
}
|
|
197 |
iClientName = HBuf::New(KNameMaxLength);
|
|
198 |
r = Kern::ThreadDesRead(iUserThread, a1, *iClientName, 0);
|
|
199 |
TEST_KERRNONE(r);
|
|
200 |
if (r)
|
|
201 |
{
|
|
202 |
return r;
|
|
203 |
}
|
|
204 |
r = PowerResourceManager::RegisterClient(iClientId, *iClientName);
|
|
205 |
TEST_KERRNONE(r);
|
|
206 |
break;
|
|
207 |
}
|
|
208 |
|
|
209 |
case RPrmIf::EControlDeRegisterClient:
|
|
210 |
{
|
|
211 |
if (!iClientId)
|
|
212 |
{
|
|
213 |
return KErrNotReady;
|
|
214 |
}
|
|
215 |
r = PowerResourceManager::DeRegisterClient(iClientId);
|
|
216 |
if (r == KErrNone)
|
|
217 |
{
|
|
218 |
if (iClientId == KernelExtensionClientId)
|
|
219 |
{
|
|
220 |
// Set it to 0 so it cannot be re-opened
|
|
221 |
KernelExtensionClientId = 0;
|
|
222 |
}
|
|
223 |
delete iClientName;
|
|
224 |
iClientId = 0;
|
|
225 |
}
|
|
226 |
break;
|
|
227 |
}
|
|
228 |
|
|
229 |
case RPrmIf::EControlGetInfoOnResourcesInUseByClient:
|
|
230 |
{
|
|
231 |
if (!iClientId)
|
|
232 |
{
|
|
233 |
return KErrNotReady;
|
|
234 |
}
|
|
235 |
TUint nores;
|
|
236 |
r = PowerResourceManager::GetNumResourcesInUseByClient(iClientId, (TUint) a1, nores);
|
|
237 |
TEST_KERRNONE(r);
|
|
238 |
if (r)
|
|
239 |
{
|
|
240 |
return r;
|
|
241 |
}
|
|
242 |
if (nores > 0)
|
|
243 |
{
|
|
244 |
HBuf* resinfo;
|
|
245 |
resinfo = HBuf::New(nores * sizeof(TResInfo));
|
|
246 |
TEST(resinfo != NULL);
|
|
247 |
if (resinfo == NULL)
|
|
248 |
{
|
|
249 |
return KErrNoMemory;
|
|
250 |
}
|
|
251 |
r = PowerResourceManager::GetInfoOnResourcesInUseByClient(iClientId, (TUint) a1, nores, (TAny*) resinfo);
|
|
252 |
TEST_KERRNONE(r);
|
|
253 |
if (r)
|
|
254 |
{
|
|
255 |
delete resinfo;
|
|
256 |
return r;
|
|
257 |
}
|
|
258 |
r = Kern::ThreadDesWrite(iUserThread, a2, *resinfo, 0);
|
|
259 |
TEST_KERRNONE(r);
|
|
260 |
delete resinfo;
|
|
261 |
}
|
|
262 |
break;
|
|
263 |
}
|
|
264 |
|
|
265 |
case RPrmIf::EControlChangeResourceState:
|
|
266 |
{
|
|
267 |
if (!iClientId)
|
|
268 |
{
|
|
269 |
return KErrNotReady;
|
|
270 |
}
|
|
271 |
r = PowerResourceManager::ChangeResourceState(iClientId, (TUint) a1, (TInt) a2);
|
|
272 |
break;
|
|
273 |
}
|
|
274 |
|
|
275 |
case RPrmIf::EControlGetResourceState:
|
|
276 |
{
|
|
277 |
if (!iClientId)
|
|
278 |
{
|
|
279 |
return KErrNotReady;
|
|
280 |
}
|
|
281 |
TInt state;
|
|
282 |
TInt levelowner;
|
|
283 |
r = PowerResourceManager::GetResourceState(iClientId, (TUint) a1, EFalse, state, levelowner);
|
|
284 |
TEST_KERRNONE(r);
|
|
285 |
if (r)
|
|
286 |
{
|
|
287 |
return r;
|
|
288 |
}
|
|
289 |
r = Kern::ThreadRawWrite(iUserThread, a2, (TAny*) &state, sizeof(TInt));
|
|
290 |
TEST_KERRNONE(r);
|
|
291 |
break;
|
|
292 |
}
|
|
293 |
|
|
294 |
case RPrmIf::EControlGetResourceStateCached:
|
|
295 |
{
|
|
296 |
if (!iClientId)
|
|
297 |
{
|
|
298 |
return KErrNotReady;
|
|
299 |
}
|
|
300 |
TInt state;
|
|
301 |
TInt levelowner;
|
|
302 |
r = PowerResourceManager::GetResourceState(iClientId, (TUint) a1, ETrue, state, levelowner);
|
|
303 |
TEST_KERRNONE(r);
|
|
304 |
if (r)
|
|
305 |
{
|
|
306 |
return r;
|
|
307 |
}
|
|
308 |
r = Kern::ThreadRawWrite(iUserThread, a2, (TAny*) &state, sizeof(TInt));
|
|
309 |
TEST_KERRNONE(r);
|
|
310 |
break;
|
|
311 |
}
|
|
312 |
|
|
313 |
case RPrmIf::EControlGetLevelOwner:
|
|
314 |
{
|
|
315 |
if (!iClientId)
|
|
316 |
{
|
|
317 |
return KErrNotReady;
|
|
318 |
}
|
|
319 |
TInt state;
|
|
320 |
TInt levelowner;
|
|
321 |
r = PowerResourceManager::GetResourceState(iClientId, (TUint) a1, EFalse, state, levelowner);
|
|
322 |
TEST_KERRNONE(r);
|
|
323 |
if (r)
|
|
324 |
{
|
|
325 |
return r;
|
|
326 |
}
|
|
327 |
r = Kern::ThreadRawWrite(iUserThread, a2, (TAny*) &levelowner, sizeof(TInt));
|
|
328 |
TEST_KERRNONE(r);
|
|
329 |
break;
|
|
330 |
}
|
|
331 |
|
|
332 |
case RPrmIf::EControlGetTotalNumberOfResources:
|
|
333 |
{
|
|
334 |
if (!iClientId)
|
|
335 |
{
|
|
336 |
return KErrNotReady;
|
|
337 |
}
|
|
338 |
TUint nores;
|
|
339 |
r = PowerResourceManager::GetNumResourcesInUseByClient(iClientId, 0, nores);
|
|
340 |
TEST_KERRNONE(r);
|
|
341 |
if (r)
|
|
342 |
{
|
|
343 |
return r;
|
|
344 |
}
|
|
345 |
r = Kern::ThreadRawWrite(iUserThread, a1, (TAny*) &nores, sizeof(TUint));
|
|
346 |
TEST_KERRNONE(r);
|
|
347 |
break;
|
|
348 |
}
|
|
349 |
|
|
350 |
#ifdef PRM_ENABLE_EXTENDED_VERSION
|
|
351 |
case RPrmIf::EControlGetResourceDependencies:
|
|
352 |
{
|
|
353 |
if (!iClientId)
|
|
354 |
{
|
|
355 |
return KErrNotReady;
|
|
356 |
}
|
|
357 |
// Get the resource information from the PRM
|
|
358 |
TUint numres;
|
|
359 |
r = PowerResourceManager::GetNumDependentsForResource(iClientId, (TUint) a1, numres);
|
|
360 |
TEST_KERRNONE(r);
|
|
361 |
if (r)
|
|
362 |
{
|
|
363 |
return r;
|
|
364 |
}
|
|
365 |
|
|
366 |
// Create a descriptor with the list of dependencies
|
|
367 |
HBuf* depdes;
|
|
368 |
depdes = HBuf::New(sizeof(SResourceDependencyInfo) * numres);
|
|
369 |
TEST(depdes != NULL);
|
|
370 |
if (depdes == NULL)
|
|
371 |
{
|
|
372 |
return KErrNoMemory;
|
|
373 |
}
|
|
374 |
|
|
375 |
TUint numres2 = numres;
|
|
376 |
r = PowerResourceManager::GetDependentsIdForResource(iClientId, (TUint) a1, (TAny*) depdes, numres2);
|
|
377 |
TEST_KERRNONE(r);
|
|
378 |
TEST(numres == numres2);
|
|
379 |
|
|
380 |
// Copy the descriptor contents to the user-side descriptor
|
|
381 |
r = Kern::ThreadDesWrite(iUserThread, a2, *depdes, 0);
|
|
382 |
TEST_KERRNONE(r);
|
|
383 |
delete depdes;
|
|
384 |
break;
|
|
385 |
}
|
|
386 |
#endif // PRM_ENABLE_EXTENDED_VERSION
|
|
387 |
}
|
|
388 |
return r;
|
|
389 |
}
|
|
390 |
|
|
391 |
TInt DPrmIfChannel::DoRequest(TInt aReqNo, TRequestStatus* aStatus, TAny *a1, TAny *a2)
|
|
392 |
{
|
|
393 |
TInt r = KErrNotSupported;
|
|
394 |
switch (aReqNo)
|
|
395 |
{
|
|
396 |
case RPrmIf::ERequestChangeResourceStateAndGetState:
|
|
397 |
{
|
|
398 |
if (!iClientId)
|
|
399 |
{
|
|
400 |
return KErrNotReady;
|
|
401 |
}
|
|
402 |
TTestResourceStateBuf args;
|
|
403 |
r = Kern::ThreadDesRead(iUserThread, a1, args, 0);
|
|
404 |
TEST_KERRNONE(r);
|
|
405 |
if (r)
|
|
406 |
{
|
|
407 |
return r;
|
|
408 |
}
|
|
409 |
NFastSemaphore sem;
|
|
410 |
NKern::FSSetOwner(&sem, (NThreadBase*) NKern::CurrentThread());
|
|
411 |
TPowerResourceCb cbfn(&TestCallbackFunction, (TAny*) &sem, /*iDfcQ*/ Kern::DfcQue0(), KMaxDfcPriority - 2);
|
|
412 |
// Change the state of the resource (asynchronous call)
|
|
413 |
r = PowerResourceManager::ChangeResourceState(iClientId, args().iResourceId, args().iNewState, &cbfn);
|
|
414 |
TEST_KERRNONE(r);
|
|
415 |
if (r)
|
|
416 |
{
|
|
417 |
return r;
|
|
418 |
}
|
|
419 |
// Retrieve the intermediate state of the resource
|
|
420 |
TInt state;
|
|
421 |
TInt levelowner;
|
|
422 |
r = PowerResourceManager::GetResourceState(iClientId, args().iResourceId, EFalse, state, levelowner);
|
|
423 |
TEST_KERRNONE(r);
|
|
424 |
if (r)
|
|
425 |
{
|
|
426 |
return r;
|
|
427 |
}
|
|
428 |
r = Kern::ThreadRawWrite(iUserThread, a2, (TAny*) &state, sizeof(TInt));
|
|
429 |
TEST_KERRNONE(r);
|
|
430 |
if (r)
|
|
431 |
{
|
|
432 |
return r;
|
|
433 |
}
|
|
434 |
// Wait for the callback function
|
|
435 |
NKern::FSWait(&sem);
|
|
436 |
Kern::RequestComplete(iUserThread, aStatus, r);
|
|
437 |
break;
|
|
438 |
}
|
|
439 |
}
|
|
440 |
return r;
|
|
441 |
}
|
|
442 |
|
|
443 |
//---------------------------------------------------------------------------
|
|
444 |
|
|
445 |
//
|
|
446 |
// Callback function for Latency Tests
|
|
447 |
//
|
|
448 |
void TestCallbackFunction(TUint /* aClientId */,
|
|
449 |
TUint /* aResourceId */,
|
|
450 |
TInt /* aLevel */,
|
|
451 |
TInt /* aLevelOwnerId */,
|
|
452 |
TInt /* aResult */,
|
|
453 |
TAny* aSem)
|
|
454 |
{
|
|
455 |
if (!aSem)
|
|
456 |
{
|
|
457 |
return;
|
|
458 |
}
|
|
459 |
NKern::FSSignal((NFastSemaphore*) aSem);
|
|
460 |
}
|
|
461 |
|
|
462 |
//
|
|
463 |
// This function is called during kernel initialisation. It registers a client
|
|
464 |
// on the PRM in order to take ownership of the Single-User resources before
|
|
465 |
// anyone else does.
|
|
466 |
//
|
|
467 |
static void InitExtension(TAny*)
|
|
468 |
{
|
|
469 |
TInt r;
|
|
470 |
|
|
471 |
// Get the overall number of resources
|
|
472 |
TUint nores;
|
|
473 |
r = PowerResourceManager::GetNumResourcesInUseByClient(DPrmIfChannel::KernelExtensionClientId, 0, nores);
|
|
474 |
TEST_KERRNONE(r);
|
|
475 |
if (r)
|
|
476 |
{
|
|
477 |
return;
|
|
478 |
}
|
|
479 |
|
|
480 |
// Get hold of all of the resources by setting their state to the default level
|
|
481 |
TInt i;
|
|
482 |
for (i = 0; i < (TInt) nores; i++)
|
|
483 |
{
|
|
484 |
TPowerResourceInfoBuf01 res;
|
|
485 |
res.Zero();
|
|
486 |
r = PowerResourceManager::GetResourceInfo(DPrmIfChannel::KernelExtensionClientId, i + 1, (TAny*) &res);
|
|
487 |
TEST_KERRNONE(r);
|
|
488 |
if (r)
|
|
489 |
{
|
|
490 |
return;
|
|
491 |
}
|
|
492 |
r = PowerResourceManager::ChangeResourceState(DPrmIfChannel::KernelExtensionClientId, i + 1, res().iDefaultLevel);
|
|
493 |
TEST_KERRNONE(r);
|
|
494 |
if (r)
|
|
495 |
{
|
|
496 |
return;
|
|
497 |
}
|
|
498 |
}
|
|
499 |
TUint resinuse;
|
|
500 |
r = PowerResourceManager::GetNumResourcesInUseByClient(DPrmIfChannel::KernelExtensionClientId, DPrmIfChannel::KernelExtensionClientId, resinuse);
|
|
501 |
TEST_KERRNONE(r);
|
|
502 |
TEST(resinuse == nores);
|
|
503 |
}
|
|
504 |
|
|
505 |
static TDfc InitExtensionDfc(&InitExtension, NULL, Kern::SvMsgQue(), KMaxDfcPriority - 2); // Priority lower than the Resource Controller (KMaxDfcPriority - 1)
|
|
506 |
|
|
507 |
#ifndef RESOURCE_MANAGER_SIMULATED_PSL
|
|
508 |
_LIT8(KTestKExtClientName, "KEXTC");
|
|
509 |
DECLARE_STANDARD_EXTENSION()
|
|
510 |
{
|
|
511 |
// Register the initial PRM client (kernel will crash if this fails)
|
|
512 |
TUint clientid;
|
|
513 |
TInt r = PowerResourceManager::RegisterClient(clientid, KTestKExtClientName);
|
|
514 |
TEST_KERRNONE(r);
|
|
515 |
if (r)
|
|
516 |
{
|
|
517 |
return r;
|
|
518 |
}
|
|
519 |
DPrmIfChannel::KernelExtensionClientId = clientid;
|
|
520 |
// Queue the DFC call to take control of all the resources
|
|
521 |
InitExtensionDfc.Enque();
|
|
522 |
return KErrNone;
|
|
523 |
}
|
|
524 |
|
|
525 |
DECLARE_EXTENSION_LDD()
|
|
526 |
{
|
|
527 |
return new DPrmIfDevice;
|
|
528 |
}
|
|
529 |
#else
|
|
530 |
DECLARE_STANDARD_LDD()
|
|
531 |
{
|
|
532 |
TInt r = DSimulatedPowerResourceController::CompleteResourceControllerInitialisation();
|
|
533 |
if (r != KErrNone)
|
|
534 |
{
|
|
535 |
return NULL;
|
|
536 |
}
|
|
537 |
return new DPrmIfDevice;
|
|
538 |
}
|
|
539 |
#endif
|