author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 18 Aug 2010 11:08:29 +0300 | |
changeset 247 | d8d70de2bd36 |
parent 201 | 43365a9b78a3 |
permissions | -rw-r--r-- |
0 | 1 |
// Copyright (c) 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". |
|
7 |
// |
|
8 |
// Initial Contributors: |
|
9 |
// Nokia Corporation - initial contribution. |
|
10 |
// |
|
11 |
// Contributors: |
|
12 |
// |
|
13 |
// Description: mdefrag.inl |
|
14 |
// In line utility functions used by the defragbase.cpp and ramalloc.cpp |
|
15 |
||
16 |
/** |
|
17 |
@file |
|
18 |
@internalComponent |
|
19 |
*/ |
|
20 |
||
21 |
#include "mm.h" |
|
22 |
#include "mmu.h" |
|
23 |
#include "mpager.h" |
|
24 |
||
25 |
||
26 |
inline TInt M::PageShift() |
|
27 |
{ |
|
28 |
return KPageShift; |
|
29 |
} |
|
30 |
||
31 |
||
32 |
inline void M::RamAllocLock() |
|
33 |
{ |
|
34 |
RamAllocLock::Lock(); |
|
35 |
} |
|
36 |
||
37 |
||
38 |
inline void M::RamAllocUnlock() |
|
39 |
{ |
|
40 |
RamAllocLock::Unlock(); |
|
41 |
} |
|
42 |
||
43 |
||
44 |
inline void M::RamAllocIsLocked() |
|
45 |
{ |
|
46 |
#ifdef _DEBUG |
|
47 |
if (!K::Initialising) |
|
48 |
__NK_ASSERT_DEBUG(RamAllocLock::IsHeld()); |
|
49 |
#endif |
|
50 |
} |
|
51 |
||
52 |
||
201
43365a9b78a3
Revision: 201027
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
53 |
inline TInt M::DiscardPage(TPhysAddr aAddr, TUint aBlockZoneId, TUint aMoveDisFlags) |
0 | 54 |
{ |
55 |
TPhysAddr newAddr; |
|
201
43365a9b78a3
Revision: 201027
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
56 |
return MovePage(aAddr, newAddr, aBlockZoneId, aMoveDisFlags); |
0 | 57 |
} |
58 |
||
59 |
||
60 |
inline TUint M::NumberOfFreeDpPages() |
|
61 |
{ |
|
62 |
return ThePager.NumberOfFreePages(); |
|
63 |
} |
|
64 |
||
65 |
||
66 |
inline TUint M::NumberOfDirtyDpPages() |
|
67 |
{ |
|
68 |
return ThePager.NumberOfDirtyPages(); |
|
69 |
} |
|
70 |
||
71 |
||
72 |
inline void M::RamZoneClaimed(SZone* aZone) |
|
73 |
{ |
|
74 |
TheMmu.AllocatedPhysicalRam(aZone->iPhysBase, |
|
75 |
aZone->iPhysPages, |
|
76 |
(Mmu::TRamAllocFlags)EMemAttStronglyOrdered); |
|
77 |
} |
|
201
43365a9b78a3
Revision: 201027
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
78 |
|
43365a9b78a3
Revision: 201027
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
79 |
|
43365a9b78a3
Revision: 201027
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
80 |
inline TBool M::GetFreePages(TUint aNumPages) |
43365a9b78a3
Revision: 201027
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
81 |
{ |
43365a9b78a3
Revision: 201027
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
82 |
return ThePager.GetFreePages(aNumPages); |
43365a9b78a3
Revision: 201027
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
83 |
} |