First public contribution.
1 // Copyright (c) 2005-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\debug\d_codemodifier.h
18 #ifndef __D_CODEMODIFIER_H__
19 #define __D_CODEMODIFIER_H__
22 #ifndef __KERNEL_MODE__
26 _LIT(KCodeModifierName,"d_codemodifier");
29 The user side class for controlling trace handler hook.
31 class RCodeModifierDevice : public RBusLogicalChannel
38 EInitialiseCodeModifier,
47 EControlAllocShadowPage,
48 EControlFreeShadowPage
51 //Used by all device calls
55 TData(TInt aServer, TInt aThreadId, TUint aAddress, TInt aSize):
56 iServer(aServer),iThreadId(aThreadId),iAddress(aAddress),iSize(aSize){};
58 TInt iServer; //0-XIP server, otherwise - NONXIP server
59 TInt iThreadId; //threadID
64 #ifndef __KERNEL_MODE__
66 {return DoCreate(KCodeModifierName,TVersion(1,0,0),KNullUnit,NULL,NULL);}
68 TInt InitialiseCodeModifier(TInt aSize)
69 {TData data(0,0,0,aSize);return DoControl(EInitialiseCodeModifier, reinterpret_cast<TAny*>(&data));}
70 TInt CloseCodeModifier()
71 {TData data(0,0,0,0);return DoControl(ECloseCodeModifier, reinterpret_cast<TAny*>(&data));}
73 TInt ThreadId(TInt aServer, TInt aThreadId)
74 {TData data(aServer,aThreadId,0,0); return DoControl(EControlThreadId, reinterpret_cast<TAny*>(&data));}
76 TInt ReadWord(TInt aServer, TInt aAddress, TInt* aValue)
77 {TData data(aServer,0,aAddress,0); return DoControl(EControlReadWord, reinterpret_cast<TAny*>(&data), reinterpret_cast<TAny*>(aValue));}
78 TInt WriteWord(TInt aServer, TInt aAddress, TInt aValue)
79 {TData data(aServer,0,aAddress,0); return DoControl(EControlWriteWord, reinterpret_cast<TAny*>(&data), reinterpret_cast<TAny*>(aValue));}
81 TInt WriteCode(TInt aServer, TUint aAddress, TInt aValue, TInt aSize)
82 {TData data(aServer,0,aAddress,aSize);return DoControl(EControlWriteCode, reinterpret_cast<TAny*>(&data), reinterpret_cast<TAny*>(aValue));}
83 TInt RestoreCode(TInt aServer, TUint aAddress)
84 {TData data(aServer,0,aAddress,0); return DoControl(EControlRestoreCode, reinterpret_cast<TAny*>(&data));}
87 TInt AllocShadowPage(TInt aAddress)
88 {TData data(0,0,aAddress,0);return DoControl(EControlAllocShadowPage, reinterpret_cast<TAny*>(&data));}
89 TInt FreeShadowPage(TInt aAddress)
90 {TData data(0,0,aAddress,0);return DoControl(EControlFreeShadowPage, reinterpret_cast<TAny*>(&data));}
92 #endif //__KERNEL_MODE__
95 #endif //__D_LOGTOFILE_H__