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 // e32\include\memmodel\epoc\mmubase\mmubase.inl
18 #ifndef __MMUBASE_INL__
19 #define __MMUBASE_INL__
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;
28 inline SPageInfo* SPageInfo::FromPhysAddr(TPhysAddr aAddress)
30 return ((SPageInfo*)KPageInfoLinearBase)+(aAddress>>KPageShift);
33 inline TPhysAddr SPageInfo::PhysAddr()
35 return ((TPhysAddr)this)<<KPageInfosPerPageShift;
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.
45 inline TInt M::PageShift()
51 inline void M::RamAllocLock()
57 inline void M::RamAllocUnlock()
63 inline void M::RamAllocIsLocked()
67 __ASSERT_MUTEX(MmuBase::RamAllocatorMutex);
72 inline TUint M::NumberOfFreeDpPages()
74 return Mmu::Get().NumberOfFreeDpPages();
78 inline TUint M::NumberOfDirtyDpPages()
79 {// This memory model doesn't support data paging so can't get dirty paged pages.
84 inline TInt M::MovePage(TPhysAddr aOld, TPhysAddr& aNew, TUint aBlockZoneId, TBool aBlockRest)
86 return Mmu::Get().MovePage(aOld, aNew, aBlockZoneId, aBlockRest);
90 inline TInt M::DiscardPage(TPhysAddr aAddr, TUint aBlockZoneId, TBool aBlockRest)
92 return Mmu::Get().DiscardPage(aAddr, aBlockZoneId, aBlockRest);