Update contrib.
1 // Copyright (c) 2006-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\defrag\d_pagemove.h
18 #if !defined(__D_PAGEMOVE_H__)
19 #define __D_PAGEMOVE_H__
21 #ifndef __KERNEL_MODE__
26 _LIT(KPageMoveLddName,"d_pagemove");
28 class TCapsPageMoveV01
34 class RPageMove : public RBusLogicalChannel
39 EControlTryMovingKHeap,
40 EControlTryMovingKStack,
41 EControlTryMovingUserPage,
42 EControlTryMovingKCode,
43 EControlTryMovingLocale,
44 EControlPerfMovingKData,
46 EControlTryMovingPhysAddr,
47 EControlTryMovingPageTable,
48 EControlTryMovingPageTableInfo,
54 inline TInt TryMovingKHeap();
55 inline TInt TryMovingKStack();
56 inline TInt TryMovingUserPage(TAny* aAddr, TBool aEchoOff=EFalse);
57 inline TInt TryMovingKCode();
58 inline TInt TryMovingLocaleDll(TAny *aAddr);
59 inline TInt TestKernelDataMovePerformance(void);
60 inline TInt GetPhysAddr(TAny* aLinAddr, TAny* aPhysAddr);
61 inline TInt TryMovingPhysAddr(TAny* aPhysAddr, TAny* aNewPhysAddr);
62 inline TInt TryMovingPageTable(TAny* aAddr);
63 inline TInt TryMovingPageTableInfo(TAny* aAddr);
64 inline TUint NumberOfCpus();
68 #ifndef __KERNEL_MODE__
69 inline TInt RPageMove::Open()
71 TInt r=User::LoadLogicalDevice(KPageMoveLddName);
72 if(r==KErrNone || r==KErrAlreadyExists)
73 r=DoCreate(KPageMoveLddName,TVersion(0,1,1),KNullUnit,NULL,NULL);
77 inline TInt RPageMove::TryMovingKHeap()
78 { return DoControl(EControlTryMovingKHeap); }
80 inline TInt RPageMove::TryMovingKStack()
81 { return DoControl(EControlTryMovingKStack); }
83 inline TInt RPageMove::TryMovingUserPage(TAny* aAddr, TBool aEchoOff)
84 { return DoControl(EControlTryMovingUserPage, aAddr, (TAny*)aEchoOff); }
86 inline TInt RPageMove::TryMovingKCode()
87 { return DoControl(EControlTryMovingKCode); }
89 inline TInt RPageMove::TryMovingLocaleDll(TAny* aAddr)
90 { return DoControl(EControlTryMovingLocale, aAddr, (TAny*)EFalse); }
92 inline TInt RPageMove::TestKernelDataMovePerformance(void)
93 { return DoControl(EControlPerfMovingKData); }
95 inline TInt RPageMove::GetPhysAddr(TAny* aLinAddr, TAny* aPhysAddr)
96 { return DoControl(EControlGetPhysAddr, aLinAddr, aPhysAddr); }
98 inline TInt RPageMove::TryMovingPhysAddr(TAny* aPhysAddr, TAny* aNewPhysAddr)
99 { return DoControl(EControlTryMovingPhysAddr, aPhysAddr, aNewPhysAddr); }
101 inline TInt RPageMove::TryMovingPageTable(TAny* aLinAddr)
102 { return DoControl(EControlTryMovingPageTable, aLinAddr); }
104 inline TInt RPageMove::TryMovingPageTableInfo(TAny* aLinAddr)
105 { return DoControl(EControlTryMovingPageTableInfo, aLinAddr); }
107 inline TUint RPageMove::NumberOfCpus()
108 { return DoControl(EControlNumberOfCpus);}