kerneltest/e32test/mmu/d_asid.h
changeset 0 a41df078684a
equal deleted inserted replaced
-1:000000000000 0:a41df078684a
       
     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_ASID_H__
       
    19 #define __D_ASID_H__
       
    20 
       
    21 #include <e32cmn.h>
       
    22 #ifndef __KERNEL_MODE__
       
    23 #include <e32std.h>
       
    24 #endif
       
    25 
       
    26 _LIT(KMemoryTestLddName,"d_asid");
       
    27 
       
    28 struct SDesHeader 
       
    29 	{
       
    30 	TAny* iDes;			// Pointer to the descriptor to read the header of.
       
    31 	TInt iLength;		// Length of the descriptor.
       
    32 	TInt iMaxLength;	// Maximum length of the descriptor.
       
    33 	};
       
    34 	
       
    35 
       
    36 class RAsidLdd : public RBusLogicalChannel
       
    37 	{
       
    38 public:
       
    39 	enum TControl
       
    40 		{
       
    41 		EGetCurrentThread,
       
    42 		EOpenThread,
       
    43 		ECloseThread,
       
    44 		EReadDesHeader,
       
    45 		};
       
    46 
       
    47 #ifndef __KERNEL_MODE__
       
    48 public:
       
    49 	inline TInt Open()
       
    50 		{
       
    51 		TInt r=User::LoadLogicalDevice(KMemoryTestLddName);
       
    52 		if(r==KErrNone || r==KErrAlreadyExists)
       
    53 			r=DoCreate(KMemoryTestLddName,TVersion(),KNullUnit,NULL,NULL,EOwnerProcess,ETrue);
       
    54 		return r;
       
    55 		};
       
    56 	inline TInt GetCurrentThread(TAny*& aPtr)
       
    57 		{ return DoControl(EGetCurrentThread, &aPtr); }
       
    58 	inline TInt OpenThread(TAny* aPtr)
       
    59 		{ return DoControl(EOpenThread, aPtr); }
       
    60 	inline TInt CloseThread()
       
    61 		{ return DoControl(ECloseThread); }
       
    62 	inline TInt ReadDesHeader(TAny* aThread, SDesHeader& aHdr)
       
    63 		{ return DoControl(EReadDesHeader, aThread, &aHdr); }
       
    64 #endif
       
    65 	};
       
    66 
       
    67 
       
    68 #endif