kerneltest/e32test/debug/d_schedhook.h
changeset 0 a41df078684a
equal deleted inserted replaced
-1:000000000000 0:a41df078684a
       
     1 // Copyright (c) 2002-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\debug\d_schedhook.h
       
    15 // 
       
    16 //
       
    17 
       
    18 #ifndef __D_SCHEDHOOK_H__
       
    19 #define __D_SCHEDHOOK_H__
       
    20 
       
    21 #include <e32cmn.h>
       
    22 #ifndef __KERNEL_MODE__
       
    23 #include <e32std.h>
       
    24 #endif
       
    25 #include <kernel/arm/arm_types.h>
       
    26 
       
    27 class TCapsTestV01
       
    28 	{
       
    29 public:
       
    30 	TVersion	iVersion;
       
    31 	};
       
    32 
       
    33 class RSchedhookTest : public RBusLogicalChannel
       
    34 	{
       
    35 public:
       
    36 	enum TControl
       
    37 		{
       
    38 		EInstall,
       
    39 		EUninstall,
       
    40 		EInsertHooks,
       
    41 		ERemoveHooks,
       
    42 		EEnableCallback,
       
    43 		EDisableCallback,
       
    44 		ESetTestThread,
       
    45 		EGetTestCount,
       
    46 		EGetThreadContext,
       
    47 		};
       
    48 	enum TRequest
       
    49 		{
       
    50 		};
       
    51 public:
       
    52 #ifndef __KERNEL_MODE__
       
    53 	inline TInt Open();
       
    54 	inline TInt Install();
       
    55 	inline TInt Uninstall();
       
    56 	inline TInt InsertHooks();
       
    57 	inline TInt RemoveHooks();
       
    58 	inline TInt EnableCallback();
       
    59 	inline TInt DisableCallback();
       
    60 	inline TInt SetTestThread(TThreadId aThreadId);
       
    61 	inline TInt GetTestCount();
       
    62 	inline TInt GetThreadContext(TThreadId aThreadId,TDes8& aContext);
       
    63 #endif
       
    64 	};
       
    65 
       
    66 #ifndef __KERNEL_MODE__
       
    67 inline TInt RSchedhookTest::Open()
       
    68 	{ return DoCreate(_L("D_SCHEDHOOK"),TVersion(0,1,1),KNullUnit,NULL,NULL); }
       
    69 inline TInt RSchedhookTest::Install()
       
    70 	{ return DoControl(EInstall); }
       
    71 inline TInt RSchedhookTest::Uninstall()
       
    72 	{ return DoControl(EUninstall); }
       
    73 inline TInt RSchedhookTest::InsertHooks()
       
    74 	{ return DoControl(EInsertHooks); }
       
    75 inline TInt RSchedhookTest::RemoveHooks()
       
    76 	{ return DoControl(ERemoveHooks); }
       
    77 inline TInt RSchedhookTest::EnableCallback()
       
    78 	{ return DoControl(EEnableCallback); }
       
    79 inline TInt RSchedhookTest::DisableCallback()
       
    80 	{ return DoControl(EDisableCallback); }
       
    81 inline TInt RSchedhookTest::SetTestThread(TThreadId aThreadId)
       
    82 	{ return DoControl(ESetTestThread,(TAny*)(TUint)aThreadId); }
       
    83 inline TInt RSchedhookTest::GetTestCount()
       
    84 	{ return DoControl(EGetTestCount); }
       
    85 inline TInt RSchedhookTest::GetThreadContext(TThreadId aThreadId,TDes8& aContext)
       
    86 	{ return DoControl(EGetThreadContext,(TAny*)(TUint)aThreadId,&aContext); }
       
    87 #endif
       
    88 
       
    89 #endif
       
    90