author | John Imhofe |
Wed, 09 Jun 2010 10:31:37 +0100 | |
branch | RCL_3 |
changeset 141 | cc88aabd867b |
parent 117 | 5b5d147c7838 |
permissions | -rw-r--r-- |
0 | 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". |
|
7 |
// |
|
8 |
// Initial Contributors: |
|
9 |
// Nokia Corporation - initial contribution. |
|
10 |
// |
|
11 |
// Contributors: |
|
12 |
// |
|
13 |
// Description: |
|
14 |
// e32\include\memmodel\epoc\mmubase\mmubase.inl |
|
15 |
// |
|
16 |
// |
|
17 |
||
18 |
#ifndef __MMUBASE_INL__ |
|
19 |
#define __MMUBASE_INL__ |
|
20 |
||
21 |
#include <mmboot.h> |
|
22 |
||
23 |
const TInt KPageInfosPerPageShift = KPageShift-KPageInfoShift; |
|
24 |
const TInt KPageInfosPerPage = 1<<KPageInfosPerPageShift; |
|
25 |
const TInt KNumPageInfoPagesShift = 32-KPageShift-KPageInfosPerPageShift; |
|
26 |
const TInt KNumPageInfoPages = 1<<KNumPageInfoPagesShift; |
|
27 |
||
28 |
inline SPageInfo* SPageInfo::FromPhysAddr(TPhysAddr aAddress) |
|
29 |
{ |
|
30 |
return ((SPageInfo*)KPageInfoLinearBase)+(aAddress>>KPageShift); |
|
31 |
} |
|
32 |
||
33 |
inline TPhysAddr SPageInfo::PhysAddr() |
|
34 |
{ |
|
35 |
return ((TPhysAddr)this)<<KPageInfosPerPageShift; |
|
36 |
} |
|
37 |
||
38 |
||
39 |
// |
|
40 |
// M class implementations of ram allocator and defrag methods |
|
41 |
// Make these inline as they are just memory model independent interface |
|
42 |
// for the ram allocator and defrag classes. |
|
43 |
// |
|
44 |
||
45 |
inline TInt M::PageShift() |
|
46 |
{ |
|
47 |
return KPageShift; |
|
48 |
} |
|
49 |
||
50 |
||
51 |
inline void M::RamAllocLock() |
|
52 |
{ |
|
53 |
MmuBase::Wait(); |
|
54 |
} |
|
55 |
||
56 |
||
57 |
inline void M::RamAllocUnlock() |
|
58 |
{ |
|
59 |
MmuBase::Signal(); |
|
60 |
} |
|
61 |
||
62 |
||
63 |
inline void M::RamAllocIsLocked() |
|
64 |
{ |
|
65 |
#ifdef _DEBUG |
|
66 |
if (!K::Initialising) |
|
67 |
__ASSERT_MUTEX(MmuBase::RamAllocatorMutex); |
|
68 |
#endif |
|
69 |
} |
|
70 |
||
71 |
||
72 |
inline TUint M::NumberOfFreeDpPages() |
|
73 |
{ |
|
74 |
return Mmu::Get().NumberOfFreeDpPages(); |
|
75 |
} |
|
76 |
||
77 |
||
78 |
inline TUint M::NumberOfDirtyDpPages() |
|
79 |
{// This memory model doesn't support data paging so can't get dirty paged pages. |
|
80 |
return 0; |
|
81 |
} |
|
82 |
||
83 |
||
117
5b5d147c7838
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
84 |
inline TInt M::MovePage(TPhysAddr aOld, TPhysAddr& aNew, TUint aBlockZoneId, TUint aMoveDisFlags) |
0 | 85 |
{ |
117
5b5d147c7838
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
86 |
return Mmu::Get().MovePage( aOld, aNew, aBlockZoneId, |
5b5d147c7838
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
87 |
(aMoveDisFlags & M::EMoveDisBlockRest)!=0); |
0 | 88 |
} |
89 |
||
90 |
||
117
5b5d147c7838
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
91 |
inline TInt M::DiscardPage(TPhysAddr aAddr, TUint aBlockZoneId, TUint aMoveDisFlags) |
0 | 92 |
{ |
117
5b5d147c7838
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
93 |
return Mmu::Get().DiscardPage( aAddr, aBlockZoneId, |
5b5d147c7838
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
94 |
(aMoveDisFlags & M::EMoveDisBlockRest)!=0); |
0 | 95 |
} |
96 |
#endif |
|
97 |
||
98 |