First public contribution.
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\direct\arm\xinit.cpp
20 #include <kernel/cache.h>
24 __KTRACE_OPT(KBOOT,Kern::Printf("MM::Init1()"));
26 MM::RamBlockSize=0x1000;
29 PP::MaxUserThreadStack=0x14000; // 80K - STDLIB asks for 64K for PosixServer!!!!
30 PP::UserThreadStackGuard=0x2000; // 8K
31 PP::MaxStackSpacePerProcess=0x200000; // 2Mb
32 K::SupervisorThreadStackSize=0x1000; // 4K
33 PP::SupervisorThreadStackGuard=0x1000; // 4K
35 K::MachineConfig=(TMachineConfig*)(((TUint8*)SuperPageAddress)+0x800); // HACK!!
36 K::MaxMemCopyInOneGo = KDefaultMaxMemCopyInOneGo;
37 PP::RamDriveStartAddress = TheSuperPage().iKernelLimit;
38 PP::RamDriveMaxSize = TheRomHeader().iUserDataAddress - PP::RamDriveStartAddress;
40 __KTRACE_OPT(KBOOT,Kern::Printf("RamDriveBase %08x RamDriveMaxSize %08x",PP::RamDriveStartAddress,PP::RamDriveMaxSize));
42 #ifdef __CPU_ARM_USE_DOMAINS
43 Arm::DefaultDomainAccess=Arm::Dacr();
46 K::MemModelAttributes=EMemModelTypeDirect|EMemModelAttrNonExProt|EMemModelAttrKernProt|
47 EMemModelAttrWriteProt|EMemModelAttrSvKernProt;
49 __KTRACE_OPT(KBOOT,Kern::Printf("K::MaxMemCopyInOneGo=0x%x",K::MaxMemCopyInOneGo));
52 #ifdef __CPU_HAS_CACHE
53 // Set up virtual addresses used for cache flushing if this is
54 // done by data read or line allocate
55 void M::SetupCacheFlushPtr(TInt aCache, SCacheInfo& aInfo)
57 #if defined(__CPU_CACHE_FLUSH_BY_DATA_READ) || defined(__CPU_CACHE_FLUSH_BY_LINE_ALLOC)
58 #ifdef __CPU_HAS_ALT_D_CACHE
59 if (aCache==KCacheNumAltD)
61 aInfo.iFlushPtr=TheSuperPage().iAltDCacheFlushArea;
62 aInfo.iFlushMask=TheSuperPage().iAltDCacheFlushWrap;
65 if (aCache==KCacheNumD)
67 aInfo.iFlushPtr=TheSuperPage().iDCacheFlushArea;
68 aInfo.iFlushMask=TheSuperPage().iDCacheFlushWrap;
75 void M::GetAPBootInfo(TInt aCpu, volatile SAPBootInfo* aInfo)
77 volatile SArmAPBootInfo& info = *(volatile SArmAPBootInfo*)aInfo;
78 TSubScheduler& ss = SubScheduler();
79 TUint32 delta = aCpu*0x2000;
80 info.iInitR13Fiq = TLinAddr(ss.i_FiqStackTop) + delta;
81 info.iInitR13Irq = TLinAddr(ss.i_IrqStackTop) + delta;
82 info.iInitR13Abt = TLinAddr(ss.i_AbtStackTop) + delta;
83 info.iInitR13Und = TLinAddr(ss.i_UndStackTop) + delta;
88 __KTRACE_OPT(KBOOT,Kern::Printf("M::Init2AP()"));