os/kernelhwsrv/kerneltest/e32test/debug/d_codemodifier.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/kernelhwsrv/kerneltest/e32test/debug/d_codemodifier.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,95 @@
     1.4 +// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of the License "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +// e32test\debug\d_codemodifier.h
    1.18 +// 
    1.19 +//
    1.20 +
    1.21 +#ifndef __D_CODEMODIFIER_H__
    1.22 +#define __D_CODEMODIFIER_H__
    1.23 +
    1.24 +#include <e32cmn.h>
    1.25 +#ifndef __KERNEL_MODE__
    1.26 +#include <e32std.h>
    1.27 +#endif
    1.28 +
    1.29 +_LIT(KCodeModifierName,"d_codemodifier");
    1.30 +
    1.31 +/**
    1.32 +The user side class for controlling trace handler hook.
    1.33 +*/
    1.34 +class RCodeModifierDevice : public RBusLogicalChannel
    1.35 +	{
    1.36 +public:
    1.37 +	enum TControl
    1.38 +		{
    1.39 +		EControlThreadId,
    1.40 +
    1.41 +		EInitialiseCodeModifier,
    1.42 +		ECloseCodeModifier,
    1.43 +
    1.44 +		EControlWriteCode, 
    1.45 +		EControlRestoreCode,
    1.46 +
    1.47 +		EControlReadWord,
    1.48 +		EControlWriteWord,
    1.49 +
    1.50 +		EControlAllocShadowPage,
    1.51 +		EControlFreeShadowPage
    1.52 +		};
    1.53 +
    1.54 +	//Used by all device calls	
    1.55 +	struct TData
    1.56 +		{
    1.57 +		TData(){};
    1.58 +		TData(TInt aServer, TInt aThreadId, TUint aAddress, TInt aSize):
    1.59 +		iServer(aServer),iThreadId(aThreadId),iAddress(aAddress),iSize(aSize){};
    1.60 +		
    1.61 +		TInt  iServer; //0-XIP server, otherwise - NONXIP server
    1.62 +		TInt  iThreadId; //threadID
    1.63 +		TUint iAddress; 
    1.64 +		TInt iSize;
    1.65 +		};
    1.66 +public:
    1.67 +#ifndef __KERNEL_MODE__
    1.68 +	TInt Open()
    1.69 +		{return DoCreate(KCodeModifierName,TVersion(1,0,0),KNullUnit,NULL,NULL);}
    1.70 +
    1.71 +	TInt InitialiseCodeModifier(TInt aSize)
    1.72 +		{TData data(0,0,0,aSize);return DoControl(EInitialiseCodeModifier, reinterpret_cast<TAny*>(&data));}
    1.73 +	TInt CloseCodeModifier()
    1.74 +		{TData data(0,0,0,0);return DoControl(ECloseCodeModifier, reinterpret_cast<TAny*>(&data));}
    1.75 +
    1.76 +	TInt ThreadId(TInt aServer, TInt aThreadId)
    1.77 +		{TData data(aServer,aThreadId,0,0);	return DoControl(EControlThreadId, reinterpret_cast<TAny*>(&data));}
    1.78 +
    1.79 +	TInt ReadWord(TInt aServer, TInt aAddress, TInt* aValue)
    1.80 +		{TData data(aServer,0,aAddress,0);	return DoControl(EControlReadWord, reinterpret_cast<TAny*>(&data), reinterpret_cast<TAny*>(aValue));}
    1.81 +	TInt WriteWord(TInt aServer, TInt aAddress, TInt aValue)
    1.82 +		{TData data(aServer,0,aAddress,0);	return DoControl(EControlWriteWord, reinterpret_cast<TAny*>(&data), reinterpret_cast<TAny*>(aValue));}
    1.83 +
    1.84 +	TInt WriteCode(TInt aServer, TUint aAddress, TInt aValue, TInt aSize)
    1.85 +		{TData data(aServer,0,aAddress,aSize);return DoControl(EControlWriteCode, reinterpret_cast<TAny*>(&data), reinterpret_cast<TAny*>(aValue));}
    1.86 +	TInt RestoreCode(TInt aServer, TUint aAddress)
    1.87 +		{TData data(aServer,0,aAddress,0);	return DoControl(EControlRestoreCode, reinterpret_cast<TAny*>(&data));}
    1.88 +
    1.89 +
    1.90 +	TInt AllocShadowPage(TInt aAddress)
    1.91 +		{TData data(0,0,aAddress,0);return DoControl(EControlAllocShadowPage, reinterpret_cast<TAny*>(&data));}
    1.92 +	TInt FreeShadowPage(TInt aAddress)
    1.93 +		{TData data(0,0,aAddress,0);return DoControl(EControlFreeShadowPage, reinterpret_cast<TAny*>(&data));}
    1.94 +
    1.95 +#endif //__KERNEL_MODE__
    1.96 +	};
    1.97 +
    1.98 +#endif //__D_LOGTOFILE_H__