Exemple #1
0
void __fastcall RunThread(TBool aNotFirst, SThreadCreateInfo& aInfo)
	{
	SStdEpocThreadCreateInfo& cinfo = (SStdEpocThreadCreateInfo&)aInfo;

#ifdef USE_INSTRUMENTED_HEAP
	cinfo.iFlags |= ETraceHeapAllocs;
#elif defined(ENABLE_HEAP_MONITORING)
	cinfo.iFlags |= ETraceHeapAllocs|EMonitorHeapMemory;
#endif
	TInt r = UserHeap::SetupThreadHeap(aNotFirst, cinfo);

	if (r==KErrNone)
		r = UserSvr::DllSetTls(KGlobalDestructorTlsKey, KDllUid_Special, (TAny*)globalDestructorFunc);

	if (r==KErrNone)
		{
		if (aNotFirst)
			r = (*cinfo.iFunction)(cinfo.iPtr);
		else
			{
			// Init statics for implicitly linked DLLs
			User::InitProcess();

			// Init statics for EXE
			constructStatics();
			r = E32Main();
			}
		}
	User::Exit(r);
	}
Exemple #2
0
EXPORT_C TInt _E32Dll(TInt aReason)
//
// EPOC Dll entrypoint for extension
// Call extension global constructors
//
	{
	if (aReason==KModuleEntryReasonExtensionInit1)
		constructStatics();
	return KernelModuleEntry(aReason);
	}
void _E32Startup_Body(TLinAddr aRomHeader, TLinAddr aSuperPage)
//
// The main startup program
// aRomHeader is address of ROM header passed in by bootstrap
// aSuperPage is address of super page passed in by bootstrap
//
	{
	RomHeaderAddress = aRomHeader;
	SuperPageAddress = aSuperPage;

	HwInit0();

	KPrintf("RomHeaderAddress = %08x", RomHeaderAddress);
	KPrintf("SuperPageAddress = %08x", SuperPageAddress);
	KPrintf("Calling global constructors...");
	constructStatics();
	KPrintf("Calling KernelMain()...");
	KernelMain();
	}