Update contrib.
1 // Copyright (c) 1994-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\multiple\x86\xmonitor.cpp
15 // Kernel crash debugger - ARM specific portion
19 #include <kernel/monitor.h>
22 void SetPageDir(DMemModelProcess* aProcess);
24 void Monitor::CpuInit()
28 void Monitor::DumpCpuProcessData(DProcess* aProcess)
32 void Monitor::DumpCpuChunkData(DChunk* aChunk)
38 const TUint32 KPdePteAccessed=0x20;
39 const TUint32 KPdePteDirty=0x40;
41 // Mask to ignore accessed and dirty bits
42 const TUint32 KPdeEqualMask=~(KPdePteAccessed|KPdePteDirty);
44 TBool PdesEqual(const TPde* aLeft, const TPde* aRight, TLinAddr aBase, TLinAddr aEnd)
46 for (TUint addr = aBase ; addr != aEnd ; addr += (1 << KChunkShift))
48 TUint i = addr >> KChunkShift;
49 if ((aLeft[i] & KPdeEqualMask) != (aRight[i] & KPdeEqualMask))
55 TInt MapProcess(DMemModelProcess* aProcess, TBool aForce)
57 // Check top half of page dir is same as for the kernel
58 TUint a = (TUint)aProcess;
59 DMonObject* o = (DMonObject*)aProcess;
60 if (a<KPrimaryIOBase || a>=KKernelSectionEnd || (a&3))
62 if (o->Type()!=EProcess)
65 const TPde* kpd=(const TPde*)KPageDirectoryBase;
66 const TPde* ppd=(const TPde*)(KPageDirectoryBase+(aProcess->iOsAsid<<KPageTableShift));
67 if (!PdesEqual(kpd, ppd, KRomLinearBase, KUserGlobalDataEnd) || // ROM + user global
68 !PdesEqual(kpd, ppd, KRamDriveEndAddress, 0x00000000)) // kernel mappings
72 wordmove((TAny*)(ppd+(KRomLinearBase>>KChunkShift)), (TAny*)(kpd+(KRomLinearBase>>KChunkShift)), ((KUserGlobalDataEnd-KRomLinearBase)>>KChunkShift)*sizeof(TPde));
73 wordmove((TAny*)(ppd+(KRamDriveEndAddress>>KChunkShift)), (TAny*)(kpd+(KRamDriveEndAddress>>KChunkShift)), ((0-KRamDriveEndAddress)>>KChunkShift)*sizeof(TPde));