1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/kernelhwsrv/kerneltest/e32test/defrag/d_pagemove.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,111 @@
1.4 +// Copyright (c) 2006-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\defrag\d_pagemove.h
1.18 +//
1.19 +//
1.20 +
1.21 +#if !defined(__D_PAGEMOVE_H__)
1.22 +#define __D_PAGEMOVE_H__
1.23 +#include <e32cmn.h>
1.24 +#ifndef __KERNEL_MODE__
1.25 +#include <e32std.h>
1.26 +#endif
1.27 +
1.28 +
1.29 +_LIT(KPageMoveLddName,"d_pagemove");
1.30 +
1.31 +class TCapsPageMoveV01
1.32 + {
1.33 +public:
1.34 + TVersion iVersion;
1.35 + };
1.36 +
1.37 +class RPageMove : public RBusLogicalChannel
1.38 + {
1.39 +public:
1.40 + enum TControl
1.41 + {
1.42 + EControlTryMovingKHeap,
1.43 + EControlTryMovingKStack,
1.44 + EControlTryMovingUserPage,
1.45 + EControlTryMovingKCode,
1.46 + EControlTryMovingLocale,
1.47 + EControlPerfMovingKData,
1.48 + EControlGetPhysAddr,
1.49 + EControlTryMovingPhysAddr,
1.50 + EControlTryMovingPageTable,
1.51 + EControlTryMovingPageTableInfo,
1.52 + EControlNumberOfCpus,
1.53 + };
1.54 +
1.55 +public:
1.56 + inline TInt Open();
1.57 + inline TInt TryMovingKHeap();
1.58 + inline TInt TryMovingKStack();
1.59 + inline TInt TryMovingUserPage(TAny* aAddr, TBool aEchoOff=EFalse);
1.60 + inline TInt TryMovingKCode();
1.61 + inline TInt TryMovingLocaleDll(TAny *aAddr);
1.62 + inline TInt TestKernelDataMovePerformance(void);
1.63 + inline TInt GetPhysAddr(TAny* aLinAddr, TAny* aPhysAddr);
1.64 + inline TInt TryMovingPhysAddr(TAny* aPhysAddr, TAny* aNewPhysAddr);
1.65 + inline TInt TryMovingPageTable(TAny* aAddr);
1.66 + inline TInt TryMovingPageTableInfo(TAny* aAddr);
1.67 + inline TUint NumberOfCpus();
1.68 + };
1.69 +
1.70 +
1.71 +#ifndef __KERNEL_MODE__
1.72 +inline TInt RPageMove::Open()
1.73 + {
1.74 + TInt r=User::LoadLogicalDevice(KPageMoveLddName);
1.75 + if(r==KErrNone || r==KErrAlreadyExists)
1.76 + r=DoCreate(KPageMoveLddName,TVersion(0,1,1),KNullUnit,NULL,NULL);
1.77 + return r;
1.78 + }
1.79 +
1.80 +inline TInt RPageMove::TryMovingKHeap()
1.81 + { return DoControl(EControlTryMovingKHeap); }
1.82 +
1.83 +inline TInt RPageMove::TryMovingKStack()
1.84 + { return DoControl(EControlTryMovingKStack); }
1.85 +
1.86 +inline TInt RPageMove::TryMovingUserPage(TAny* aAddr, TBool aEchoOff)
1.87 + { return DoControl(EControlTryMovingUserPage, aAddr, (TAny*)aEchoOff); }
1.88 +
1.89 +inline TInt RPageMove::TryMovingKCode()
1.90 + { return DoControl(EControlTryMovingKCode); }
1.91 +
1.92 +inline TInt RPageMove::TryMovingLocaleDll(TAny* aAddr)
1.93 + { return DoControl(EControlTryMovingLocale, aAddr, (TAny*)EFalse); }
1.94 +
1.95 +inline TInt RPageMove::TestKernelDataMovePerformance(void)
1.96 + { return DoControl(EControlPerfMovingKData); }
1.97 +
1.98 +inline TInt RPageMove::GetPhysAddr(TAny* aLinAddr, TAny* aPhysAddr)
1.99 + { return DoControl(EControlGetPhysAddr, aLinAddr, aPhysAddr); }
1.100 +
1.101 +inline TInt RPageMove::TryMovingPhysAddr(TAny* aPhysAddr, TAny* aNewPhysAddr)
1.102 + { return DoControl(EControlTryMovingPhysAddr, aPhysAddr, aNewPhysAddr); }
1.103 +
1.104 +inline TInt RPageMove::TryMovingPageTable(TAny* aLinAddr)
1.105 + { return DoControl(EControlTryMovingPageTable, aLinAddr); }
1.106 +
1.107 +inline TInt RPageMove::TryMovingPageTableInfo(TAny* aLinAddr)
1.108 + { return DoControl(EControlTryMovingPageTableInfo, aLinAddr); }
1.109 +
1.110 +inline TUint RPageMove::NumberOfCpus()
1.111 + { return DoControl(EControlNumberOfCpus);}
1.112 +#endif
1.113 +
1.114 +#endif