equal
deleted
inserted
replaced
19 */ |
19 */ |
20 |
20 |
21 #ifndef MPAGER_H |
21 #ifndef MPAGER_H |
22 #define MPAGER_H |
22 #define MPAGER_H |
23 |
23 |
|
24 #include "mmu.h" |
24 #include <kern_priv.h> |
25 #include <kern_priv.h> |
25 |
26 |
26 /** |
27 /** |
27 Maximum number of pages to attempt to clean in one go. |
28 Maximum number of pages to attempt to clean in one go. |
28 */ |
29 */ |
54 TUint ret; |
55 TUint ret; |
55 MmuLock::Lock(); |
56 MmuLock::Lock(); |
56 ret = iNumberOfDirtyPages; |
57 ret = iNumberOfDirtyPages; |
57 MmuLock::Unlock(); |
58 MmuLock::Unlock(); |
58 return ret; |
59 return ret; |
|
60 } |
|
61 |
|
62 FORCE_INLINE TUint MinimumPageCount() |
|
63 { |
|
64 return iMinimumPageCount; |
59 } |
65 } |
60 |
66 |
61 FORCE_INLINE void SetWritable(SPageInfo& aPageInfo) |
67 FORCE_INLINE void SetWritable(SPageInfo& aPageInfo) |
62 { |
68 { |
63 if (!aPageInfo.IsDirty()) |
69 if (!aPageInfo.IsDirty()) |
139 /** |
145 /** |
140 Flush (unmap) all memory which is demand paged. |
146 Flush (unmap) all memory which is demand paged. |
141 This reduces the live page list to a minimum. |
147 This reduces the live page list to a minimum. |
142 */ |
148 */ |
143 void FlushAll(); |
149 void FlushAll(); |
|
150 |
|
151 /** |
|
152 Flush demand paged pages in a specified region. |
|
153 |
|
154 The memory must reside in a single memory object. |
|
155 |
|
156 @param aProcess The process containing the pages to flush. |
|
157 @param aStart The start address of the region. |
|
158 @param aSize The size of the region in bytes. |
|
159 |
|
160 @return KErrBadDescriptor If the memory region is invalid or spans more than one memory object, |
|
161 otherwise KErrNone. |
|
162 */ |
|
163 TInt FlushRegion(DMemModelProcess* aProcess, TLinAddr aStartAddress, TUint aSize); |
144 |
164 |
145 /** |
165 /** |
146 Give pages to paging system for managing. |
166 Give pages to paging system for managing. |
147 */ |
167 */ |
148 void DonatePages(TUint aCount, TPhysAddr* aPages); |
168 void DonatePages(TUint aCount, TPhysAddr* aPages); |