os/kernelhwsrv/kerneltest/e32test/mmu/d_shadow.cia
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/kernelhwsrv/kerneltest/e32test/mmu/d_shadow.cia	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,67 @@
     1.4 +// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of the License "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +// e32test\mmu\d_shadow.cia
    1.18 +// LDD for testing ROM shadowing
    1.19 +// 
    1.20 +//
    1.21 +
    1.22 +#include <kernel/kern_priv.h>
    1.23 +#include <platform.h>
    1.24 +#include <kernel/cache.h>
    1.25 +#include "d_shadow.h"
    1.26 +
    1.27 +#ifdef __MARM__
    1.28 +#include <arm.h>
    1.29 +
    1.30 +__NAKED__ TInt DoRead(TAny*)
    1.31 +	{
    1.32 +	asm("mrs r2, cpsr ");
    1.33 +	asm("orr r3, r2, #%a0" : : "i" ((TInt)KAllInterruptsMask));
    1.34 +	asm("msr cpsr, r3 ");
    1.35 +	asm("mrc p15, 0, ip, c3, c0, 0 ");
    1.36 +	asm("mvn r1, #0 ");
    1.37 +	asm("mcr p15, 0, r1, c3, c0, 0 ");
    1.38 +	CPWAIT(,r1);
    1.39 +	asm("ldr r0, [r0] ");
    1.40 +	asm("mcr p15, 0, ip, c3, c0, 0 ");
    1.41 +	CPWAIT(,r1);
    1.42 +	asm("msr cpsr, r2 ");
    1.43 +	__JUMP(,lr);
    1.44 +	}
    1.45 +
    1.46 +__NAKED__ TInt GetMmuId()
    1.47 +	{
    1.48 +	asm("mrc p15, 0, r0, c0, c0 ");
    1.49 +	__JUMP(,lr);
    1.50 +	}
    1.51 +
    1.52 +__NAKED__ TInt GetCacheType()
    1.53 +	{
    1.54 +	asm("mrc p15, 0, r0, c0, c0, 1 ");
    1.55 +	__JUMP(,lr);
    1.56 +	}
    1.57 +
    1.58 +__NAKED__ TUint GetTTBCR()
    1.59 +	{
    1.60 +	asm("mrc p15, 0, r0, c2, c0 ,2");
    1.61 +	__JUMP(,lr);
    1.62 +	}
    1.63 +
    1.64 +__NAKED__ TUint GetControlRegister()
    1.65 +	{
    1.66 +	asm("mrc p15, 0, r0, c1, c0");
    1.67 +	__JUMP(,lr);
    1.68 +	}
    1.69 +	
    1.70 +#endif