sl@0: // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // e32test\mmu\d_sharedio.h sl@0: // sl@0: // sl@0: sl@0: #ifndef __D_SLDD_H__ sl@0: #define __D_SLDD_H__ sl@0: #include sl@0: #ifndef __KERNEL_MODE__ sl@0: #include sl@0: #endif sl@0: sl@0: const TInt KSizeGlobalBuffer=0x2000; sl@0: const TInt KMagic1=12345; sl@0: const TInt KMagic2=54321; sl@0: sl@0: class RTestLdd : public RBusLogicalChannel sl@0: { sl@0: public: sl@0: enum TControl sl@0: { sl@0: ECreateBuffer, sl@0: EMapInGlobalBuffer, sl@0: EMapOutGlobalBuffer, sl@0: EDestroyGlobalBuffer, sl@0: ECreateBufferPhysAddr, sl@0: EDestroyBufferPhysAddr, sl@0: EMapInBuffer, sl@0: EMapOutBuffer, sl@0: EDestroyBuffer, sl@0: ECheckBuffer, sl@0: EFillBuffer, sl@0: EThreadRW sl@0: }; sl@0: public: sl@0: inline TInt Open(); sl@0: inline TInt CreateBuffer(TInt aLength); sl@0: inline TInt MapInGlobalBuffer(TUint aProcessId,TAny*& aAddress,TUint32& aLength); sl@0: inline TInt MapOutGlobalBuffer(); sl@0: inline TInt DestroyGlobalBuffer(); sl@0: inline TInt CreateBufferPhysAddr(TInt aLength); sl@0: inline TInt DestroyBufferPhysAddr(); sl@0: inline TInt MapInBuffer(TAny** aAddress,TUint32* aLength); sl@0: inline TInt MapOutBuffer(); sl@0: inline TInt DestroyBuffer(); sl@0: inline TInt CheckBuffer(TUint32 key); sl@0: inline TInt FillBuffer(TUint32 key); sl@0: inline TInt ThreadRW(TDes8& aDes,TInt aThreadId=-1); sl@0: }; sl@0: sl@0: _LIT(KSharedIoTestLddName,"D_SHAREDIO"); sl@0: sl@0: #ifndef __KERNEL_MODE__ sl@0: inline TInt RTestLdd::Open() sl@0: { return DoCreate(KSharedIoTestLddName,TVersion(),KNullUnit,NULL,NULL); } sl@0: inline TInt RTestLdd::CreateBuffer(TInt aLength) sl@0: { return DoControl(ECreateBuffer,(TAny*)aLength); } sl@0: inline TInt RTestLdd::MapInGlobalBuffer(TUint aProcessId,TAny*& aAddress,TUint32& aLength) sl@0: { sl@0: TUint a = aProcessId; sl@0: TInt r=DoControl(EMapInGlobalBuffer,&a,&aLength); sl@0: aAddress = (TAny*)a; sl@0: return r; sl@0: } sl@0: inline TInt RTestLdd::MapOutGlobalBuffer() sl@0: { return DoControl(EMapOutGlobalBuffer); } sl@0: inline TInt RTestLdd::DestroyGlobalBuffer() sl@0: { return DoControl(EDestroyGlobalBuffer); } sl@0: inline TInt RTestLdd::CreateBufferPhysAddr(TInt aLength) sl@0: { return DoControl(ECreateBufferPhysAddr,(TAny*)aLength); } sl@0: inline TInt RTestLdd::DestroyBufferPhysAddr() sl@0: { return DoControl(EDestroyBufferPhysAddr); } sl@0: inline TInt RTestLdd::MapInBuffer(TAny** aAddress,TUint32* aLength) sl@0: { return DoControl(EMapInBuffer,aAddress,aLength); } sl@0: inline TInt RTestLdd::MapOutBuffer() sl@0: { return DoControl(EMapOutBuffer); } sl@0: inline TInt RTestLdd::DestroyBuffer() sl@0: { return DoControl(EDestroyBuffer); } sl@0: inline TInt RTestLdd::CheckBuffer(TUint32 key) sl@0: { return DoControl(ECheckBuffer,(TAny*)key); } sl@0: inline TInt RTestLdd::FillBuffer(TUint32 key) sl@0: { return DoControl(EFillBuffer,(TAny*)key); } sl@0: inline TInt RTestLdd::ThreadRW(TDes8& aDes,TInt aThreadId) sl@0: { return DoControl(EThreadRW,(TAny*)&aDes,(TAny*)aThreadId); } sl@0: #endif sl@0: sl@0: #endif sl@0: