First public contribution.
1 // Copyright (c) 2004-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\arm\xmonitor.cia
15 // Kernel crash debugger - ARM specific portion
19 #include <kernel/monitor.h>
23 __NAKED__ TInt MapProcess(DMemModelProcess* aProcess, TBool)
25 asm("mrc p15, 0, r3, c2, c0, 0 "); // get TTBR0
26 asm("ldr r2, [r0, #%a0]" : : "i" _FOFF(DMemModelProcess, iLocalPageDir));
27 asm("and r3, r3, #%a0" : : "i" ((TInt)KTTBRExtraBitsMask)); // r3 = page table cache attributes
28 asm("mcr p15, 0, r2, c7, c10, 4 "); // drain write buffer before changing MMU registers (see ARMv6 specs)
29 asm("orr r2, r2, r3 "); // r2 = new TTBR0 value
30 UPDATE_PW_CACHING_ATTRIBUTES(,r2); // ERRATUM 1136_317041
31 asm("mcr p15, 0, r2, c2, c0, 0 "); // set TTBR0 - no TLB flush required due to ASID
33 asm("ldr r0, [r0, #%a0]" : : "i" _FOFF(DMemModelProcess, iOsAsid));
34 asm("mcr p15, 0, r0, c13, c0, 1 "); // set ASID
36 #if defined(__CPU_ARM11MP__)
37 // On other platforms, tha ASID change above has already flushed the branch prediction buffers
38 asm("mcr p15, 0, r0, c7, c5, 6 "); // flush BTAC