First public contribution.
1 // Copyright (c) 1998-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 "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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
15 // Wins Variant Header
25 #pragma warning(disable : 4201) // nonstandard extension used : nameless struct/union
27 #pragma warning(default : 4201)
28 #include <kernel/kpower.h>
31 const TInt KDefaultDebugMask = 1<<KPANIC; //KPANIC, override this with "DebugMask 0" in EPOC.INI
33 const TInt KDefaultDebugMask = 0;
36 typedef void (*TMediaChangeCallBack)(TAny*);
43 EDefaultPeriod = 5, // milliseconds
44 EMaxLag = 100, // milliseconds
48 void Init(TUint aPeriod);
50 inline TUint Period() const
52 inline void SetIdleThread()
53 {if (!iIdleThread) iIdleThread = NKern::CurrentThread();}
54 inline void Nobble(TUint aNobbleFactor)
55 {iNobbleNanos = aNobbleFactor * iPeriod;}
56 TInt SystemTime() const;
57 void SetSystemTime(TInt aTime);
61 void EventThread(NTimerQ& aTimerQ);
62 static DWORD WINAPI Thread(LPVOID);
63 static void CALLBACK Tick(UINT, UINT, DWORD, DWORD, DWORD);
85 const char* Append(const char* aProperty, const char* aValue);
86 const char* Replace(const char* aProperty, const char* aValue);
87 TInt GetString(const char* aProperty, const char*& aValue) const;
88 TInt GetInt(const char* aProperty, TInt& aValue) const;
89 TInt GetBool(const char* aProperty, TBool& aValue, TBool aDefaultValue=EFalse) const;
93 TInt Find(const char* aProperty) const;
94 const char* Insert(TInt aIndex, const char* aProperty, const char* aValue);
101 class Wins : public Asic
106 TInt Init(TBool aRunExe);
107 inline void InstallUi(DWinsUiBase& aUi);
108 TInt EmulatorHal(TInt aFunction, TAny* a1, TAny* a2);
113 void AddressInfo(SAddressInfo& anInfo);
120 TInt SystemTimeInSecondsFrom2000(TInt& aTime);
121 TInt SetSystemTimeInSecondsFrom2000(TInt aTime);
124 TInt VariantHal(TInt aFunction, TAny* a1, TAny* a2);
126 // Machine configuration
127 TPtr8 MachineConfiguration();
128 const char* EmulatorMediaPath();
131 void DebugPrint(const TDesC8& aDes);
132 TBool ErrorDialog(TError aType, const TDesC8& aPanic, TInt aVal);
133 void EarlyLogging(const char* aMessage1,const char* aMessage2);
135 TInt InitProperties(TBool aRunExe);
137 TUint32 KernelConfigFlags();
138 TInt ParseCapabilitiesArg(SCapabilitySet& aCapabilities, const char *aText);
139 void DisabledCapabilities(SCapabilitySet& aCapabilities);
140 void CalibrateCpuSpeed();
141 TInt SetCpuSpeed(TUint aSpeed);
142 TInt AddProperty(char* aProperty, const char* aEol);
143 TInt ProcessCommandLine(TBool aRunExe, char* aCDrive);
144 TInt LoadProperties();
145 TInt ReadProperties(char* aData);
146 TInt ReadIniFile(const char* aFileName, char*& aContents);
148 TInt SetupMediaPath();
149 TInt SetupDrive(int aDrive, const char* aPath);
150 TInt MapFilename(const TDesC& aFilename, TDes& aBuffer) const;
151 TInt MapDrive(int aDrive, TDes& aBuffer) const;
152 HANDLE DebugOutput();
154 TBool ConfigSpecificProperty(const char * aProperty);
155 TInt LoadConfigSpecificProperties(const char * pFile);
156 TBool ScreenSpecificProperty(const char * aProperty);
159 friend class DWinsPowerController;
162 Properties iProperties;
168 TBool iLogToDebugger;
170 TBool iConfigPropertySet;
173 class DWinsPowerController* iPowerController;
175 static TBool MediaDoorOpen;
176 static TInt CurrentPBusDevice;
177 static TAny* MediaChangeCallbackParam;
178 static TMediaChangeCallBack MediaChangeCallBackPtr;
181 { return (Wins*) Arch::TheAsic();}
182 IMPORT_C void AssertWakeupSignal();
183 IMPORT_C void WakeupEvent();
184 IMPORT_C static TBool* MediaDoorOpenPtr();
185 IMPORT_C static TInt* CurrentPBusDevicePtr();
186 IMPORT_C static void SetMediaChangeCallBackPtr(TMediaChangeCallBack aPtr, TAny* aParam);
187 IMPORT_C static void MediaChangeCallBack();
190 GLREF_D Wins TheVariant;