|
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_sharedchunk.h |
|
15 // |
|
16 // |
|
17 |
|
18 #ifndef __D_SHAREDCHUNK_H__ |
|
19 #define __D_SHAREDCHUNK_H__ |
|
20 |
|
21 #include <e32cmn.h> |
|
22 #ifndef __KERNEL_MODE__ |
|
23 #include <e32std.h> |
|
24 #endif |
|
25 |
|
26 _LIT(KSharedChunkLddName,"D_SHAREDCHUNK"); |
|
27 |
|
28 enum TCreateFlags |
|
29 { |
|
30 ESingle = 0x00, |
|
31 EMultiple = 0x01, |
|
32 EOwnsMemory = 0x02, |
|
33 EBlocking = 0x00, |
|
34 EBuffered = 0x04, |
|
35 ECached = 0x08, |
|
36 EBadType = 0x80, |
|
37 ECreateFlagsMask = 0xff |
|
38 }; |
|
39 |
|
40 enum TCommitType |
|
41 { |
|
42 EDiscontiguous = 0x00, |
|
43 EContiguous = 0x01, |
|
44 EPhysicalMask = 0x02, |
|
45 EDiscontiguousPhysical = EDiscontiguous|EPhysicalMask, |
|
46 EContiguousPhysical = EContiguous|EPhysicalMask, |
|
47 EBadPhysicalAddress = 0x04, |
|
48 ECommitTypeMask = 0x0f |
|
49 }; |
|
50 |
|
51 class RSharedChunkLdd : public RBusLogicalChannel |
|
52 { |
|
53 public: |
|
54 enum TControl |
|
55 { |
|
56 ECreateChunk, |
|
57 EGetChunkHandle, |
|
58 ECommitMemory, |
|
59 ECloseChunk, |
|
60 ECheckMemory, |
|
61 EReadMemory, |
|
62 EWriteMemory, |
|
63 EDfcReadWrite, |
|
64 EIsrReadWrite, |
|
65 EIsDestroyed, |
|
66 ETestOpenAddress, |
|
67 ETestOpenHandle, |
|
68 ETestAddress, |
|
69 ECloseChunkHandle, |
|
70 EChunkUserBase, |
|
71 EChunkCloseAndFree, |
|
72 }; |
|
73 |
|
74 #ifndef __KERNEL_MODE__ |
|
75 public: |
|
76 inline TInt Open() |
|
77 { return DoCreate(KSharedChunkLddName,TVersion(),KNullUnit,NULL,NULL,EOwnerProcess,ETrue); } |
|
78 inline TInt CreateChunk(TInt aSize, TAny** aKernelAddress=0) |
|
79 { return DoControl(ECreateChunk,(TAny*)aSize,aKernelAddress); } |
|
80 inline TInt GetChunkHandle(RChunk& aChunk) |
|
81 { return aChunk.SetReturnedHandle(DoControl(EGetChunkHandle)); } |
|
82 inline TInt CommitMemory(TInt aOffset, TInt aSize) |
|
83 { return DoControl(ECommitMemory,(TAny*)aOffset,(TAny*)aSize); } |
|
84 inline TInt CloseChunk() |
|
85 { return DoControl(ECloseChunk); } |
|
86 inline TInt CheckMemory(TInt aOffset) |
|
87 { return DoControl(ECheckMemory,(TAny*)aOffset); } |
|
88 inline TInt ReadMemory(TInt aOffset,TUint32& aValue) |
|
89 { return DoControl(EReadMemory,(TAny*)aOffset,&aValue); } |
|
90 inline TInt WriteMemory(TInt aOffset,TUint32 aValue) |
|
91 { return DoControl(EWriteMemory,(TAny*)aOffset,(TAny*)aValue); } |
|
92 inline TInt DfcReadWrite(TInt aOffset,TUint32& aValue) |
|
93 { return DoControl(EDfcReadWrite,(TAny*)aOffset,&aValue); } |
|
94 inline TInt IsrReadWrite(TInt aOffset,TUint32& aValue) |
|
95 { return DoControl(EIsrReadWrite,(TAny*)aOffset,&aValue); } |
|
96 inline TBool IsDestroyed() |
|
97 { return DoControl(EIsDestroyed); } |
|
98 inline TInt TestOpenAddress(TAny* aAddress) |
|
99 { return DoControl(ETestOpenAddress,aAddress); } |
|
100 inline TInt TestOpenHandle(TInt aHandle) |
|
101 { return DoControl(ETestOpenHandle,(TAny*)aHandle); } |
|
102 inline TInt TestAddress(TInt aOffset, TInt aSize) |
|
103 { return DoControl(ETestAddress,(TAny*)aOffset,(TAny*)aSize); } |
|
104 inline TInt CloseChunkHandle(RChunk aChunk) |
|
105 { return DoControl(ECloseChunkHandle,(TAny*)aChunk.Handle()); } |
|
106 inline TInt GetChunkUserBase(TAny *aAddress) |
|
107 { return DoControl(EChunkUserBase, aAddress); } |
|
108 inline TInt TestChunkCloseAndFree() |
|
109 { return DoControl(EChunkCloseAndFree); } |
|
110 #endif |
|
111 }; |
|
112 |
|
113 |
|
114 #endif |