kerneltest/e32test/mmu/d_shadow.cia
changeset 0 a41df078684a
equal deleted inserted replaced
-1:000000000000 0:a41df078684a
       
     1 // Copyright (c) 1997-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".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // e32test\mmu\d_shadow.cia
       
    15 // LDD for testing ROM shadowing
       
    16 // 
       
    17 //
       
    18 
       
    19 #include <kernel/kern_priv.h>
       
    20 #include <platform.h>
       
    21 #include <kernel/cache.h>
       
    22 #include "d_shadow.h"
       
    23 
       
    24 #ifdef __MARM__
       
    25 #include <arm.h>
       
    26 
       
    27 __NAKED__ TInt DoRead(TAny*)
       
    28 	{
       
    29 	asm("mrs r2, cpsr ");
       
    30 	asm("orr r3, r2, #%a0" : : "i" ((TInt)KAllInterruptsMask));
       
    31 	asm("msr cpsr, r3 ");
       
    32 	asm("mrc p15, 0, ip, c3, c0, 0 ");
       
    33 	asm("mvn r1, #0 ");
       
    34 	asm("mcr p15, 0, r1, c3, c0, 0 ");
       
    35 	CPWAIT(,r1);
       
    36 	asm("ldr r0, [r0] ");
       
    37 	asm("mcr p15, 0, ip, c3, c0, 0 ");
       
    38 	CPWAIT(,r1);
       
    39 	asm("msr cpsr, r2 ");
       
    40 	__JUMP(,lr);
       
    41 	}
       
    42 
       
    43 __NAKED__ TInt GetMmuId()
       
    44 	{
       
    45 	asm("mrc p15, 0, r0, c0, c0 ");
       
    46 	__JUMP(,lr);
       
    47 	}
       
    48 
       
    49 __NAKED__ TInt GetCacheType()
       
    50 	{
       
    51 	asm("mrc p15, 0, r0, c0, c0, 1 ");
       
    52 	__JUMP(,lr);
       
    53 	}
       
    54 
       
    55 __NAKED__ TUint GetTTBCR()
       
    56 	{
       
    57 	asm("mrc p15, 0, r0, c2, c0 ,2");
       
    58 	__JUMP(,lr);
       
    59 	}
       
    60 
       
    61 __NAKED__ TUint GetControlRegister()
       
    62 	{
       
    63 	asm("mrc p15, 0, r0, c1, c0");
       
    64 	__JUMP(,lr);
       
    65 	}
       
    66 	
       
    67 #endif