sl@0
|
1 |
// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of the License "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
// e32test\mmu\d_shadow.cia
|
sl@0
|
15 |
// LDD for testing ROM shadowing
|
sl@0
|
16 |
//
|
sl@0
|
17 |
//
|
sl@0
|
18 |
|
sl@0
|
19 |
#include <kernel/kern_priv.h>
|
sl@0
|
20 |
#include <platform.h>
|
sl@0
|
21 |
#include <kernel/cache.h>
|
sl@0
|
22 |
#include "d_shadow.h"
|
sl@0
|
23 |
|
sl@0
|
24 |
#ifdef __MARM__
|
sl@0
|
25 |
#include <arm.h>
|
sl@0
|
26 |
|
sl@0
|
27 |
__NAKED__ TInt DoRead(TAny*)
|
sl@0
|
28 |
{
|
sl@0
|
29 |
asm("mrs r2, cpsr ");
|
sl@0
|
30 |
asm("orr r3, r2, #%a0" : : "i" ((TInt)KAllInterruptsMask));
|
sl@0
|
31 |
asm("msr cpsr, r3 ");
|
sl@0
|
32 |
asm("mrc p15, 0, ip, c3, c0, 0 ");
|
sl@0
|
33 |
asm("mvn r1, #0 ");
|
sl@0
|
34 |
asm("mcr p15, 0, r1, c3, c0, 0 ");
|
sl@0
|
35 |
CPWAIT(,r1);
|
sl@0
|
36 |
asm("ldr r0, [r0] ");
|
sl@0
|
37 |
asm("mcr p15, 0, ip, c3, c0, 0 ");
|
sl@0
|
38 |
CPWAIT(,r1);
|
sl@0
|
39 |
asm("msr cpsr, r2 ");
|
sl@0
|
40 |
__JUMP(,lr);
|
sl@0
|
41 |
}
|
sl@0
|
42 |
|
sl@0
|
43 |
__NAKED__ TInt GetMmuId()
|
sl@0
|
44 |
{
|
sl@0
|
45 |
asm("mrc p15, 0, r0, c0, c0 ");
|
sl@0
|
46 |
__JUMP(,lr);
|
sl@0
|
47 |
}
|
sl@0
|
48 |
|
sl@0
|
49 |
__NAKED__ TInt GetCacheType()
|
sl@0
|
50 |
{
|
sl@0
|
51 |
asm("mrc p15, 0, r0, c0, c0, 1 ");
|
sl@0
|
52 |
__JUMP(,lr);
|
sl@0
|
53 |
}
|
sl@0
|
54 |
|
sl@0
|
55 |
__NAKED__ TUint GetTTBCR()
|
sl@0
|
56 |
{
|
sl@0
|
57 |
asm("mrc p15, 0, r0, c2, c0 ,2");
|
sl@0
|
58 |
__JUMP(,lr);
|
sl@0
|
59 |
}
|
sl@0
|
60 |
|
sl@0
|
61 |
__NAKED__ TUint GetControlRegister()
|
sl@0
|
62 |
{
|
sl@0
|
63 |
asm("mrc p15, 0, r0, c1, c0");
|
sl@0
|
64 |
__JUMP(,lr);
|
sl@0
|
65 |
}
|
sl@0
|
66 |
|
sl@0
|
67 |
#endif
|