author | Slion |
Wed, 06 Jan 2010 20:35:57 +0100 | |
branch | anywhere |
changeset 24 | 18d195b75193 |
parent 0 | a41df078684a |
child 51 | 256ad52425f0 |
permissions | -rw-r--r-- |
0 | 1 |
// Copyright (c) 1996-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\win32\cinit.cpp |
|
15 |
// |
|
16 |
// |
|
17 |
||
18 |
#include "memmodel.h" |
|
19 |
#include <e32uid.h> |
|
20 |
#include <property.h> |
|
21 |
#include <emulator.h> |
|
22 |
||
23 |
extern const char* JustInTime; |
|
24 |
TBool DisableWSDWarning; |
|
25 |
||
26 |
GLREF_D TBool EmulRunExe; |
|
27 |
||
28 |
extern "C" void NKIdle(TInt aStage) |
|
29 |
{ |
|
30 |
SCpuIdleHandler* cih = NKern::CpuIdleHandler(); |
|
31 |
if (cih && cih->iHandler) |
|
32 |
(*cih->iHandler)(cih->iPtr, aStage); |
|
33 |
else if (K::PowerModel) |
|
34 |
K::PowerModel->CpuIdle(); |
|
35 |
else |
|
36 |
Emul::TheAsic->Idle(); |
|
37 |
} |
|
38 |
||
39 |
TInt A::CreateVariant(const TAny* aHandle, TInt /*aMode*/) |
|
40 |
// |
|
41 |
// Hack! aHandle is not a rom image file, but a win32 HMODULE for the variant DLL |
|
42 |
// |
|
43 |
{ |
|
44 |
HMODULE h=(HMODULE)aHandle; |
|
45 |
TVariantInitialise f=(TVariantInitialise)Emulator::GetProcAddress(h, (LPCSTR)1); |
|
46 |
__KTRACE_OPT(KBOOT,Kern::Printf("Calling Initialise %08x",f)); |
|
24
18d195b75193
Created separate CMakeLists.txt for euser and ekern to easily build them with different compiler definitions. Ekern now building as a DLL.
Slion
parents:
0
diff
changeset
|
47 |
//SL: Fixed our linkage error |
18d195b75193
Created separate CMakeLists.txt for euser and ekern to easily build them with different compiler definitions. Ekern now building as a DLL.
Slion
parents:
0
diff
changeset
|
48 |
//Emul::TheAsic=(*f)(EmulRunExe); |
18d195b75193
Created separate CMakeLists.txt for euser and ekern to easily build them with different compiler definitions. Ekern now building as a DLL.
Slion
parents:
0
diff
changeset
|
49 |
Emul::TheAsic=(*f)(EFalse); |
0 | 50 |
__KTRACE_OPT(KBOOT,Kern::Printf("Initialise returned %08x",Emul::TheAsic)); |
51 |
if (!Emul::TheAsic) |
|
52 |
return KErrGeneral; |
|
53 |
return KErrNone; |
|
54 |
} |
|
55 |
||
56 |
void A::Init1() |
|
57 |
{ |
|
58 |
__KTRACE_OPT(KBOOT,Kern::Printf("A::Init1()")); |
|
59 |
||
60 |
// first phase ASIC/Variant initialisation |
|
61 |
Emul::TheAsic->Init1(); |
|
62 |
||
63 |
TheSuperPage().iStartupReason=EStartupColdReset; |
|
64 |
K::ColdStart=ETrue; |
|
65 |
||
66 |
NTimerQ::Init1(Emul::TheAsic->MsTickPeriod()); |
|
67 |
} |
|
68 |
||
69 |
void A::Init2() |
|
70 |
{ |
|
71 |
__KTRACE_OPT(KBOOT,Kern::Printf("A::Init2()")); |
|
72 |
} |
|
73 |
||
74 |
void A::Init3() |
|
75 |
{ |
|
76 |
__KTRACE_OPT(KBOOT,Kern::Printf("A::Init3()")); |
|
77 |
||
78 |
Emul::TheAsic->Init3(); |
|
79 |
JustInTime = Property::GetString("JustInTime","query"); |
|
80 |
DisableWSDWarning = Property::GetBool("DisableWSDWarning",EFalse); |
|
81 |
#ifdef _DEBUG |
|
82 |
// install a handler for thread panics to invoke the IDE debugger if |
|
83 |
// JustInTime is not set to 'none' |
|
84 |
if (_stricmp(JustInTime,"none") != 0) |
|
85 |
{ |
|
86 |
Emul::TheJitHandler = new DJitCrashHandler; |
|
87 |
if (!Emul::TheJitHandler || Emul::TheJitHandler->Add() != KErrNone) |
|
88 |
K::Fault(K::EJitCrashHandlerCreation); |
|
89 |
} |
|
90 |
||
91 |
#endif |
|
92 |
} |
|
93 |
||
94 |