Update contrib.
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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // e32\memmodel\epoc\moving\minit.cpp
19 #include "cache_maintenance.h"
21 _LIT(KLitSvStack,"SvStack");
23 const TInt KMaxSupervisorStackSpace=0x200000;
27 TheCurrentAddressSpace=NULL;
28 TheCurrentVMProcess=NULL;
29 TheCurrentDataSectionProcess=NULL;
30 TheCompleteDataSectionProcess=NULL;
32 // Memory model dependent CPU stuff
36 CacheMaintenance::Init1();
38 // First phase MMU initialisation
45 // Second phase MMU initialisation
52 // Third phase MMU initialisation
57 TInt M::InitSvHeapChunk(DChunk* aChunk, TInt aSize)
60 DMemModelChunk* pC=(DMemModelChunk*)aChunk;
61 TLinAddr base = TheRomHeader().iKernDataAddress;
62 K::HeapInfo.iChunk = aChunk;
63 K::HeapInfo.iBase = (TUint8*)base;
64 K::HeapInfo.iMaxSize = pC->MaxSize();
65 pC->SetFixedAddress(base, aSize);
66 __KTRACE_OPT(KBOOT,Kern::Printf("Created SvHeap chunk, addr %08X, init size %08X max size %08X",pC->Base(),aSize,pC->MaxSize()));
67 TLinAddr dataSectionBase=0;
68 r=((DMemModelProcess*)K::TheKernelProcess)->AddChunk(pC,dataSectionBase,EFalse);
69 __KTRACE_OPT(KBOOT,Kern::Printf("Added kernel heap chunk to current process, %d",r));
73 TInt M::InitSvStackChunk()
75 // create a chunk to hold supervisor-mode stacks
76 DMemModelChunk* pC=NULL;
77 DMemModelProcess* pP=(DMemModelProcess*)K::TheKernelProcess;
78 TInt maxsize=Mmu::RoundToChunkSize(KMaxSupervisorStackSpace);
79 TLinAddr dataSectionBase=0;
80 SChunkCreateInfo cinfo;
82 cinfo.iAtt=TChunkCreate::EDisconnected;
83 cinfo.iForceFixed=EFalse;
85 cinfo.iType=EKernelStack;
86 cinfo.iMaxSize=maxsize;
87 cinfo.iPreallocated=0;
88 cinfo.iName.Set(KLitSvStack);
89 cinfo.iOwner=K::TheKernelProcess;
90 TInt r=pP->NewChunk((DChunk*&)pC,cinfo,dataSectionBase);
91 __KTRACE_OPT(KBOOT,Kern::Printf("Created SvStack, %d",r));
97 __KTRACE_OPT(KBOOT,Kern::Printf("Created SvStack chunk, addr %08X, max size %08X",pC->Base(),maxsize));
99 r=pP->AddChunk(pC,dataSectionBase,EFalse);
100 __KTRACE_OPT(KBOOT,Kern::Printf("Added SvStack chunk to current process, %d",r));
102 // create user code chunk
104 r = MM::CreateCodeChunk(EFalse);
106 // create kernel code chunk
108 r = MM::CreateCodeChunk(ETrue);