author | hgs |
Fri, 23 Apr 2010 22:08:41 +0100 | |
changeset 121 | 661475905584 |
parent 90 | 947f0dc9f7a8 |
permissions | -rw-r--r-- |
0 | 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". |
|
7 |
// |
|
8 |
// Initial Contributors: |
|
9 |
// Nokia Corporation - initial contribution. |
|
10 |
// |
|
11 |
// Contributors: |
|
12 |
// |
|
13 |
// Description: |
|
14 |
// e32test\mmu\d_memorytest.h |
|
15 |
// |
|
16 |
// |
|
17 |
||
18 |
#ifndef __D_MEMORYTEST_H__ |
|
19 |
#define __D_MEMORYTEST_H__ |
|
20 |
||
21 |
#include <e32cmn.h> |
|
22 |
#ifndef __KERNEL_MODE__ |
|
23 |
#include <e32std.h> |
|
24 |
#endif |
|
25 |
||
26 |
_LIT(KMemoryTestLddName,"d_memorytest"); |
|
27 |
||
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
39
diff
changeset
|
28 |
const TInt KUCPageCount = 16;//Page count of user chunk used in physical pinning tests. |
0 | 29 |
|
30 |
class RMemoryTestLdd : public RBusLogicalChannel |
|
31 |
{ |
|
32 |
public: |
|
33 |
enum TControl |
|
34 |
{ |
|
35 |
EReadWriteMemory, |
|
36 |
EReadMemory, |
|
37 |
EWriteMemory, |
|
38 |
ETestAllocZerosMemory, |
|
39 |
ETestReAllocZerosMemory, |
|
40 |
ETestAllocPhysTest, |
|
41 |
ETestAllocPhysTest1, |
|
42 |
ECreateVirtualPinObject, |
|
43 |
EPinVirtualMemory, |
|
44 |
EUnpinVirtualMemory, |
|
45 |
EDestroyVirtualPinObject, |
|
46 |
ECreatePhysicalPinObject, |
|
47 |
EPinPhysicalMemory, |
|
48 |
EPinPhysicalMemoryRO, |
|
49 |
ECheckPageList, |
|
50 |
ESyncPinnedPhysicalMemory, |
|
51 |
EMovePinnedPhysicalMemory, |
|
52 |
EInvalidatePinnedPhysicalMemory, |
|
53 |
EUnpinPhysicalMemory, |
|
54 |
EDestroyPhysicalPinObject, |
|
55 |
EPinKernelPhysicalMemory, |
|
56 |
ESetPanicTrace, |
|
39
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
57 |
EIsMemoryPresent, |
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
58 |
ECreateKernelMapObject, |
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
59 |
EDestroyKernelMapObject, |
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
60 |
EKernelMapMemory, |
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
61 |
EKernelMapMemoryRO, |
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
62 |
EKernelMapMemoryInvalid, |
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
63 |
EKernelMapCheckPageList, |
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
64 |
EKernelMapSyncMemory, |
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
65 |
EKernelMapInvalidateMemory, |
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
66 |
EKernelMapMoveMemory, |
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
67 |
EKernelMapReadModifyMemory, |
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
68 |
EKernelUnmapMemory, |
0 | 69 |
}; |
70 |
||
71 |
#ifndef __KERNEL_MODE__ |
|
72 |
public: |
|
73 |
inline TInt Open() |
|
74 |
{ |
|
75 |
TInt r=User::LoadLogicalDevice(KMemoryTestLddName); |
|
76 |
if(r==KErrNone || r==KErrAlreadyExists) |
|
77 |
r=DoCreate(KMemoryTestLddName,TVersion(),KNullUnit,NULL,NULL,EOwnerProcess,ETrue); |
|
78 |
return r; |
|
79 |
}; |
|
80 |
inline TInt ReadWriteMemory(TAny* aPtr) |
|
81 |
{ return DoControl(EReadWriteMemory,aPtr); } |
|
82 |
inline TInt ReadMemory(TAny* aPtr,TUint32& aValue) |
|
83 |
{ return DoControl(EReadMemory,aPtr,&aValue); } |
|
84 |
inline TInt WriteMemory(TAny* aPtr,TUint32 aValue) |
|
85 |
{ return DoControl(EWriteMemory,aPtr,(TAny*)aValue); } |
|
86 |
inline TInt TestAllocZerosMemory() |
|
87 |
{ return DoControl(ETestAllocZerosMemory,NULL,NULL); } |
|
88 |
inline TInt TestReAllocZerosMemory() |
|
89 |
{ return DoControl(ETestReAllocZerosMemory,NULL,NULL); } |
|
90 |
inline TInt AllocPhysTest(TUint32 aIters, TUint32 aSize) |
|
91 |
{ return DoControl(ETestAllocPhysTest,(TAny*)aIters, (TAny*)aSize); } |
|
92 |
inline TInt AllocPhysTest1(TUint32 aIters, TUint32 aSize) |
|
93 |
{ return DoControl(ETestAllocPhysTest1,(TAny*)aIters, (TAny*)aSize); } |
|
94 |
inline TInt CreateVirtualPinObject() |
|
95 |
{ return DoControl(ECreateVirtualPinObject); } |
|
96 |
inline TInt PinVirtualMemory(TLinAddr aStart,TUint aSize) |
|
97 |
{ return DoControl(EPinVirtualMemory,(TAny*)aStart,(TAny*)aSize); } |
|
98 |
inline TInt UnpinVirtualMemory() |
|
99 |
{ return DoControl(EUnpinVirtualMemory); } |
|
100 |
inline TInt DestroyVirtualPinObject() |
|
101 |
{ return DoControl(EDestroyVirtualPinObject); } |
|
102 |
inline TInt CreatePhysicalPinObject() |
|
103 |
{ return DoControl(ECreatePhysicalPinObject); } |
|
104 |
inline TInt PinPhysicalMemory(TLinAddr aStart,TUint aSize) |
|
105 |
{ return DoControl(EPinPhysicalMemory,(TAny*)aStart,(TAny*)aSize); } |
|
106 |
inline TInt PinPhysicalMemoryRO(TLinAddr aStart,TUint aSize) |
|
107 |
{ return DoControl(EPinPhysicalMemoryRO,(TAny*)aStart,(TAny*)aSize); } |
|
108 |
inline TInt CheckPageList(TUint8* aStart) |
|
109 |
{ return DoControl(ECheckPageList,(TAny*)aStart); } |
|
110 |
inline TInt SyncPinnedPhysicalMemory(TUint aOffset,TUint aSize) |
|
111 |
{ return DoControl(ESyncPinnedPhysicalMemory,(TAny*)aOffset,(TAny*)aSize); } |
|
112 |
inline TInt MovePinnedPhysicalMemory(TInt aPageNumber) |
|
113 |
{ return DoControl(EMovePinnedPhysicalMemory,(TAny*)aPageNumber); } |
|
114 |
inline TInt InvalidatePinnedPhysicalMemory(TUint aOffset,TUint aSize) |
|
115 |
{ return DoControl(EInvalidatePinnedPhysicalMemory,(TAny*)aOffset,(TAny*)aSize); } |
|
116 |
inline TInt UnpinPhysicalMemory() |
|
117 |
{ return DoControl(EUnpinPhysicalMemory); } |
|
118 |
inline TInt DestroyPhysicalPinObject() |
|
119 |
{ return DoControl(EDestroyPhysicalPinObject); } |
|
120 |
inline TInt PinKernelPhysicalMemory() |
|
121 |
{ return DoControl(EPinKernelPhysicalMemory); } |
|
122 |
inline TBool SetPanicTrace(TBool aEnable) |
|
123 |
{ return DoControl(ESetPanicTrace,(TAny*)aEnable); } |
|
124 |
inline TInt IsMemoryPresent(const TAny* aPtr) |
|
125 |
{ return DoControl(EIsMemoryPresent,(TAny*)aPtr); } |
|
39
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
126 |
inline TInt CreateKernelMapObject(TUint aReserveBytes) |
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
127 |
{ return DoControl(ECreateKernelMapObject, (TAny*)aReserveBytes); } |
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
128 |
inline TInt DestroyKernelMapObject() |
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
129 |
{ return DoControl(EDestroyKernelMapObject); } |
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
130 |
inline TInt KernelMapMemory(TLinAddr aStart, TUint aSize) |
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
131 |
{ return DoControl(EKernelMapMemory,(TAny*)aStart, (TAny*)aSize); } |
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
132 |
inline TInt KernelMapMemoryRO(TLinAddr aStart, TUint aSize) |
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
133 |
{ return DoControl(EKernelMapMemoryRO,(TAny*)aStart, (TAny*)aSize); } |
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
134 |
inline TInt KernelMapMemoryInvalid(TLinAddr aStart, TUint aSize) |
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
135 |
{ return DoControl(EKernelMapMemoryInvalid,(TAny*)aStart, (TAny*)aSize); } |
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
136 |
inline TInt KernelMapCheckPageList(TUint8* aStart) |
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
137 |
{ return DoControl(EKernelMapCheckPageList, (TAny*)aStart); } |
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
138 |
inline TInt KernelMapSyncMemory() |
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
139 |
{ return DoControl(EKernelMapSyncMemory); } |
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
140 |
inline TInt KernelMapInvalidateMemory() |
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
141 |
{ return DoControl(EKernelMapInvalidateMemory); } |
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
142 |
inline TInt KernelMapMoveMemory(TUint aIndex) |
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
143 |
{ return DoControl(EKernelMapMoveMemory, (TAny*)aIndex); } |
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
144 |
inline TInt KernelMapReadAndModifyMemory() |
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
145 |
{ return DoControl(EKernelMapReadModifyMemory); } |
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
146 |
inline TInt KernelUnmapMemory() |
5d2844f35677
Revision: 201004
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
147 |
{ return DoControl(EKernelUnmapMemory); } |
0 | 148 |
#endif |
149 |
}; |
|
150 |
||
151 |
||
152 |
#endif |