First public contribution.
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_sharedchunk.h
18 #ifndef __D_SHAREDCHUNK_H__
19 #define __D_SHAREDCHUNK_H__
22 #ifndef __KERNEL_MODE__
26 _LIT(KSharedChunkLddName,"D_SHAREDCHUNK");
37 ECreateFlagsMask = 0xff
42 EDiscontiguous = 0x00,
45 EDiscontiguousPhysical = EDiscontiguous|EPhysicalMask,
46 EContiguousPhysical = EContiguous|EPhysicalMask,
47 EBadPhysicalAddress = 0x04,
48 ECommitTypeMask = 0x0f
51 class RSharedChunkLdd : public RBusLogicalChannel
74 #ifndef __KERNEL_MODE__
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, TBool aIsThreadLocal=ETrue)
81 { return aChunk.SetReturnedHandle(DoControl(EGetChunkHandle,(TAny*)aIsThreadLocal)); }
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); }