kerneltest/e32test/mmu/d_shadow.cia
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Thu, 15 Jul 2010 20:11:42 +0300
branchRCL_3
changeset 41 0ffb4e86fcc9
parent 0 a41df078684a
permissions -rw-r--r--
Revision: 201027 Kit: 2010127

// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
// All rights reserved.
// This component and the accompanying materials are made available
// under the terms of the License "Eclipse Public License v1.0"
// which accompanies this distribution, and is available
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
//
// Initial Contributors:
// Nokia Corporation - initial contribution.
//
// Contributors:
//
// Description:
// e32test\mmu\d_shadow.cia
// LDD for testing ROM shadowing
// 
//

#include <kernel/kern_priv.h>
#include <platform.h>
#include <kernel/cache.h>
#include "d_shadow.h"

#ifdef __MARM__
#include <arm.h>

__NAKED__ TInt DoRead(TAny*)
	{
	asm("mrs r2, cpsr ");
	asm("orr r3, r2, #%a0" : : "i" ((TInt)KAllInterruptsMask));
	asm("msr cpsr, r3 ");
	asm("mrc p15, 0, ip, c3, c0, 0 ");
	asm("mvn r1, #0 ");
	asm("mcr p15, 0, r1, c3, c0, 0 ");
	CPWAIT(,r1);
	asm("ldr r0, [r0] ");
	asm("mcr p15, 0, ip, c3, c0, 0 ");
	CPWAIT(,r1);
	asm("msr cpsr, r2 ");
	__JUMP(,lr);
	}

__NAKED__ TInt GetMmuId()
	{
	asm("mrc p15, 0, r0, c0, c0 ");
	__JUMP(,lr);
	}

__NAKED__ TInt GetCacheType()
	{
	asm("mrc p15, 0, r0, c0, c0, 1 ");
	__JUMP(,lr);
	}

__NAKED__ TUint GetTTBCR()
	{
	asm("mrc p15, 0, r0, c2, c0 ,2");
	__JUMP(,lr);
	}

__NAKED__ TUint GetControlRegister()
	{
	asm("mrc p15, 0, r0, c1, c0");
	__JUMP(,lr);
	}
	
#endif