sl@0
|
1 |
// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of the License "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
// e32test\debug\d_codemodifier.h
|
sl@0
|
15 |
//
|
sl@0
|
16 |
//
|
sl@0
|
17 |
|
sl@0
|
18 |
#ifndef __D_CODEMODIFIER_H__
|
sl@0
|
19 |
#define __D_CODEMODIFIER_H__
|
sl@0
|
20 |
|
sl@0
|
21 |
#include <e32cmn.h>
|
sl@0
|
22 |
#ifndef __KERNEL_MODE__
|
sl@0
|
23 |
#include <e32std.h>
|
sl@0
|
24 |
#endif
|
sl@0
|
25 |
|
sl@0
|
26 |
_LIT(KCodeModifierName,"d_codemodifier");
|
sl@0
|
27 |
|
sl@0
|
28 |
/**
|
sl@0
|
29 |
The user side class for controlling trace handler hook.
|
sl@0
|
30 |
*/
|
sl@0
|
31 |
class RCodeModifierDevice : public RBusLogicalChannel
|
sl@0
|
32 |
{
|
sl@0
|
33 |
public:
|
sl@0
|
34 |
enum TControl
|
sl@0
|
35 |
{
|
sl@0
|
36 |
EControlThreadId,
|
sl@0
|
37 |
|
sl@0
|
38 |
EInitialiseCodeModifier,
|
sl@0
|
39 |
ECloseCodeModifier,
|
sl@0
|
40 |
|
sl@0
|
41 |
EControlWriteCode,
|
sl@0
|
42 |
EControlRestoreCode,
|
sl@0
|
43 |
|
sl@0
|
44 |
EControlReadWord,
|
sl@0
|
45 |
EControlWriteWord,
|
sl@0
|
46 |
|
sl@0
|
47 |
EControlAllocShadowPage,
|
sl@0
|
48 |
EControlFreeShadowPage
|
sl@0
|
49 |
};
|
sl@0
|
50 |
|
sl@0
|
51 |
//Used by all device calls
|
sl@0
|
52 |
struct TData
|
sl@0
|
53 |
{
|
sl@0
|
54 |
TData(){};
|
sl@0
|
55 |
TData(TInt aServer, TInt aThreadId, TUint aAddress, TInt aSize):
|
sl@0
|
56 |
iServer(aServer),iThreadId(aThreadId),iAddress(aAddress),iSize(aSize){};
|
sl@0
|
57 |
|
sl@0
|
58 |
TInt iServer; //0-XIP server, otherwise - NONXIP server
|
sl@0
|
59 |
TInt iThreadId; //threadID
|
sl@0
|
60 |
TUint iAddress;
|
sl@0
|
61 |
TInt iSize;
|
sl@0
|
62 |
};
|
sl@0
|
63 |
public:
|
sl@0
|
64 |
#ifndef __KERNEL_MODE__
|
sl@0
|
65 |
TInt Open()
|
sl@0
|
66 |
{return DoCreate(KCodeModifierName,TVersion(1,0,0),KNullUnit,NULL,NULL);}
|
sl@0
|
67 |
|
sl@0
|
68 |
TInt InitialiseCodeModifier(TInt aSize)
|
sl@0
|
69 |
{TData data(0,0,0,aSize);return DoControl(EInitialiseCodeModifier, reinterpret_cast<TAny*>(&data));}
|
sl@0
|
70 |
TInt CloseCodeModifier()
|
sl@0
|
71 |
{TData data(0,0,0,0);return DoControl(ECloseCodeModifier, reinterpret_cast<TAny*>(&data));}
|
sl@0
|
72 |
|
sl@0
|
73 |
TInt ThreadId(TInt aServer, TInt aThreadId)
|
sl@0
|
74 |
{TData data(aServer,aThreadId,0,0); return DoControl(EControlThreadId, reinterpret_cast<TAny*>(&data));}
|
sl@0
|
75 |
|
sl@0
|
76 |
TInt ReadWord(TInt aServer, TInt aAddress, TInt* aValue)
|
sl@0
|
77 |
{TData data(aServer,0,aAddress,0); return DoControl(EControlReadWord, reinterpret_cast<TAny*>(&data), reinterpret_cast<TAny*>(aValue));}
|
sl@0
|
78 |
TInt WriteWord(TInt aServer, TInt aAddress, TInt aValue)
|
sl@0
|
79 |
{TData data(aServer,0,aAddress,0); return DoControl(EControlWriteWord, reinterpret_cast<TAny*>(&data), reinterpret_cast<TAny*>(aValue));}
|
sl@0
|
80 |
|
sl@0
|
81 |
TInt WriteCode(TInt aServer, TUint aAddress, TInt aValue, TInt aSize)
|
sl@0
|
82 |
{TData data(aServer,0,aAddress,aSize);return DoControl(EControlWriteCode, reinterpret_cast<TAny*>(&data), reinterpret_cast<TAny*>(aValue));}
|
sl@0
|
83 |
TInt RestoreCode(TInt aServer, TUint aAddress)
|
sl@0
|
84 |
{TData data(aServer,0,aAddress,0); return DoControl(EControlRestoreCode, reinterpret_cast<TAny*>(&data));}
|
sl@0
|
85 |
|
sl@0
|
86 |
|
sl@0
|
87 |
TInt AllocShadowPage(TInt aAddress)
|
sl@0
|
88 |
{TData data(0,0,aAddress,0);return DoControl(EControlAllocShadowPage, reinterpret_cast<TAny*>(&data));}
|
sl@0
|
89 |
TInt FreeShadowPage(TInt aAddress)
|
sl@0
|
90 |
{TData data(0,0,aAddress,0);return DoControl(EControlFreeShadowPage, reinterpret_cast<TAny*>(&data));}
|
sl@0
|
91 |
|
sl@0
|
92 |
#endif //__KERNEL_MODE__
|
sl@0
|
93 |
};
|
sl@0
|
94 |
|
sl@0
|
95 |
#endif //__D_LOGTOFILE_H__
|