240 KErrInUse if the page became pinned or was subject to a page fault, |
240 KErrInUse if the page became pinned or was subject to a page fault, |
241 KErrNotSupported if the manager doesn't support this function, |
241 KErrNotSupported if the manager doesn't support this function, |
242 otherwise one of the system wide error codes. |
242 otherwise one of the system wide error codes. |
243 |
243 |
244 @pre RamAllocLock held. |
244 @pre RamAllocLock held. |
|
245 @pre If the page is dirty the PageCleaning lock must be held. |
245 @pre MmuLock held. |
246 @pre MmuLock held. |
246 */ |
247 */ |
247 virtual TInt StealPage(DMemoryObject* aMemory, SPageInfo* aPageInfo); |
248 virtual TInt StealPage(DMemoryObject* aMemory, SPageInfo* aPageInfo); |
248 |
249 |
249 /** |
250 /** |
263 otherwise one of the system wide error codes. |
264 otherwise one of the system wide error codes. |
264 */ |
265 */ |
265 virtual TInt RestrictPage(DMemoryObject* aMemory, SPageInfo* aPageInfo, TRestrictPagesType aRestriction); |
266 virtual TInt RestrictPage(DMemoryObject* aMemory, SPageInfo* aPageInfo, TRestrictPagesType aRestriction); |
266 |
267 |
267 /** |
268 /** |
268 Clean a page of RAM by saving any modifications to it out to backing store. |
269 Clean multiple pages of RAM by saving any modifications to it out to backing store. |
269 |
270 |
270 This function must only be called when there are no writable MMU mappings of the page. |
271 This function must only be called when there are no writable MMU mappings of the pages. |
271 |
272 |
272 The function must only return a success after determining no writable MMU mappings |
273 The function takes an array of SPageInfo pointers indicating the pages to clean. On return, the |
273 were created for the page, in which case it should also mark the page as clean using |
274 elements of this array are unchanged if the page was successfully cleaned, or set to NULL if |
274 SPageInfo::SetClean. |
275 cleaning was abandoned (by the page being written to, for example). |
275 |
276 |
276 This is only intended for use by #StealPage. |
277 The pages passed must be sequential in their page colour (index & KPageColourMask). |
277 |
278 |
278 @param aMemory A memory object associated with this manager. |
279 Those pages that are successfully cleaned are marked as clean using SPageInfo::SetClean. |
279 @param aPageInfo The page information structure of the page to be cleaned. |
280 |
280 This must be owned by \a aMemory. |
281 This is intended for use by #StealPage and #CleanSomePages. |
281 @param aPageArrayEntry Reference to the page's page array entry in \a aMemory->iPages. |
282 |
282 |
283 @param aPageCount Number of pages to clean. |
283 @return KErrNone if successful, |
284 @param aPageInfos Pointer to an array of aPageCount page info pointers. |
284 KErrInUse if the page state changed, e.g. became pinned or was subject to a page fault making it writable, |
285 @param aBackground Whether the activity should be ignored when determining whether the |
285 KErrNotSupported if the manager doesn't support this function, |
286 paging device is busy. |
286 otherwise one of the system wide error codes. |
|
287 |
287 |
288 @pre MmuLock held |
288 @pre MmuLock held |
|
289 @pre PageCleaning lock held |
289 @pre The memory page must not have any writeable MMU mappings. |
290 @pre The memory page must not have any writeable MMU mappings. |
290 @post MmuLock held (but may have been released by this function) |
291 @post MmuLock held (but may have been released by this function) |
291 */ |
292 */ |
292 virtual TInt CleanPage(DMemoryObject* aMemory, SPageInfo* aPageInfo, TPhysAddr*& aPageArrayEntry); |
293 virtual void CleanPages(TUint aPageCount, SPageInfo** aPageInfos, TBool aBackground); |
293 |
294 |
294 /** |
295 /** |
295 Process a page fault in memory associated with this manager. |
296 Process a page fault in memory associated with this manager. |
296 |
297 |
297 This is only intended for use by #DPager::HandlePageFault. |
298 This is only intended for use by #DPager::HandlePageFault. |
565 otherwise one of the system wide error codes. |
566 otherwise one of the system wide error codes. |
566 */ |
567 */ |
567 virtual TInt ReadPages(DMemoryObject* aMemory, TUint aIndex, TUint aCount, TPhysAddr* aPages, DPageReadRequest* aRequest) =0; |
568 virtual TInt ReadPages(DMemoryObject* aMemory, TUint aIndex, TUint aCount, TPhysAddr* aPages, DPageReadRequest* aRequest) =0; |
568 |
569 |
569 /** |
570 /** |
570 Save the data content of a specified region of a memory object by writing it to |
|
571 storage media. This is intended for use by an implementation of #CleanPage. |
|
572 |
|
573 The memory region must be the same as, or a subset of, the region used when obtaining |
|
574 the request object \a aRequest. |
|
575 |
|
576 @param aMemory A memory object associated with this manager. |
|
577 @param aIndex Page index for the start of the region. |
|
578 @param aCount Number of pages in the region. |
|
579 @param aPages Pointer to array of pages to read into. This must contain \a aCount |
|
580 number of physical page addresses which are each page aligned. |
|
581 @param aRequest A request object previously obtained with #AcquirePageWriteRequest. |
|
582 |
|
583 @return KErrNone if successful, |
|
584 otherwise one of the system wide error codes. |
|
585 */ |
|
586 virtual TInt WritePages(DMemoryObject* aMemory, TUint aIndex, TUint aCount, TPhysAddr* aPages, DPageWriteRequest* aRequest); |
|
587 |
|
588 /** |
|
589 Check if a region of a memory object has been allocated. E.g. that #Alloc |
571 Check if a region of a memory object has been allocated. E.g. that #Alloc |
590 has reserved backing store for the memory and this has has not yet been freed |
572 has reserved backing store for the memory and this has has not yet been freed |
591 by #Free or #Destruct. |
573 by #Free or #Destruct. |
592 |
574 |
593 @param aMemory A memory object associated with this manager. |
575 @param aMemory A memory object associated with this manager. |