Update contrib.
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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // e32test\mmu\d_memorytest.h
18 #ifndef __D_MEMORYTEST_H__
19 #define __D_MEMORYTEST_H__
22 #ifndef __KERNEL_MODE__
26 _LIT(KMemoryTestLddName,"d_memorytest");
28 const TInt KUCPageCount = 4;//Page count of user chunk used in physical pinning tests.
30 class RMemoryTestLdd : public RBusLogicalChannel
38 ETestAllocZerosMemory,
39 ETestReAllocZerosMemory,
42 ECreateVirtualPinObject,
45 EDestroyVirtualPinObject,
46 ECreatePhysicalPinObject,
50 ESyncPinnedPhysicalMemory,
51 EMovePinnedPhysicalMemory,
52 EInvalidatePinnedPhysicalMemory,
54 EDestroyPhysicalPinObject,
55 EPinKernelPhysicalMemory,
58 ECreateKernelMapObject,
59 EDestroyKernelMapObject,
62 EKernelMapMemoryInvalid,
63 EKernelMapCheckPageList,
65 EKernelMapInvalidateMemory,
67 EKernelMapReadModifyMemory,
71 #ifndef __KERNEL_MODE__
75 TInt r=User::LoadLogicalDevice(KMemoryTestLddName);
76 if(r==KErrNone || r==KErrAlreadyExists)
77 r=DoCreate(KMemoryTestLddName,TVersion(),KNullUnit,NULL,NULL,EOwnerProcess,ETrue);
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); }
126 inline TInt CreateKernelMapObject(TUint aReserveBytes)
127 { return DoControl(ECreateKernelMapObject, (TAny*)aReserveBytes); }
128 inline TInt DestroyKernelMapObject()
129 { return DoControl(EDestroyKernelMapObject); }
130 inline TInt KernelMapMemory(TLinAddr aStart, TUint aSize)
131 { return DoControl(EKernelMapMemory,(TAny*)aStart, (TAny*)aSize); }
132 inline TInt KernelMapMemoryRO(TLinAddr aStart, TUint aSize)
133 { return DoControl(EKernelMapMemoryRO,(TAny*)aStart, (TAny*)aSize); }
134 inline TInt KernelMapMemoryInvalid(TLinAddr aStart, TUint aSize)
135 { return DoControl(EKernelMapMemoryInvalid,(TAny*)aStart, (TAny*)aSize); }
136 inline TInt KernelMapCheckPageList(TUint8* aStart)
137 { return DoControl(EKernelMapCheckPageList, (TAny*)aStart); }
138 inline TInt KernelMapSyncMemory()
139 { return DoControl(EKernelMapSyncMemory); }
140 inline TInt KernelMapInvalidateMemory()
141 { return DoControl(EKernelMapInvalidateMemory); }
142 inline TInt KernelMapMoveMemory(TUint aIndex)
143 { return DoControl(EKernelMapMoveMemory, (TAny*)aIndex); }
144 inline TInt KernelMapReadAndModifyMemory()
145 { return DoControl(EKernelMapReadModifyMemory); }
146 inline TInt KernelUnmapMemory()
147 { return DoControl(EKernelUnmapMemory); }