diff -r 2d65c2f76d7b -r 947f0dc9f7a8 kernel/eka/memmodel/epoc/flexible/mmu/mmanager.h --- a/kernel/eka/memmodel/epoc/flexible/mmu/mmanager.h Tue Feb 02 01:24:03 2010 +0200 +++ b/kernel/eka/memmodel/epoc/flexible/mmu/mmanager.h Fri Apr 16 16:24:37 2010 +0300 @@ -242,6 +242,7 @@ otherwise one of the system wide error codes. @pre RamAllocLock held. + @pre If the page is dirty the PageCleaning lock must be held. @pre MmuLock held. */ virtual TInt StealPage(DMemoryObject* aMemory, SPageInfo* aPageInfo); @@ -265,31 +266,31 @@ virtual TInt RestrictPage(DMemoryObject* aMemory, SPageInfo* aPageInfo, TRestrictPagesType aRestriction); /** - Clean a page of RAM by saving any modifications to it out to backing store. + Clean multiple pages of RAM by saving any modifications to it out to backing store. - This function must only be called when there are no writable MMU mappings of the page. + This function must only be called when there are no writable MMU mappings of the pages. - The function must only return a success after determining no writable MMU mappings - were created for the page, in which case it should also mark the page as clean using - SPageInfo::SetClean. - - This is only intended for use by #StealPage. + The function takes an array of SPageInfo pointers indicating the pages to clean. On return, the + elements of this array are unchanged if the page was successfully cleaned, or set to NULL if + cleaning was abandoned (by the page being written to, for example). - @param aMemory A memory object associated with this manager. - @param aPageInfo The page information structure of the page to be cleaned. - This must be owned by \a aMemory. - @param aPageArrayEntry Reference to the page's page array entry in \a aMemory->iPages. + The pages passed must be sequential in their page colour (index & KPageColourMask). + + Those pages that are successfully cleaned are marked as clean using SPageInfo::SetClean. - @return KErrNone if successful, - KErrInUse if the page state changed, e.g. became pinned or was subject to a page fault making it writable, - KErrNotSupported if the manager doesn't support this function, - otherwise one of the system wide error codes. + This is intended for use by #StealPage and #CleanSomePages. + + @param aPageCount Number of pages to clean. + @param aPageInfos Pointer to an array of aPageCount page info pointers. + @param aBackground Whether the activity should be ignored when determining whether the + paging device is busy. @pre MmuLock held + @pre PageCleaning lock held @pre The memory page must not have any writeable MMU mappings. @post MmuLock held (but may have been released by this function) */ - virtual TInt CleanPage(DMemoryObject* aMemory, SPageInfo* aPageInfo, TPhysAddr*& aPageArrayEntry); + virtual void CleanPages(TUint aPageCount, SPageInfo** aPageInfos, TBool aBackground); /** Process a page fault in memory associated with this manager. @@ -567,25 +568,6 @@ virtual TInt ReadPages(DMemoryObject* aMemory, TUint aIndex, TUint aCount, TPhysAddr* aPages, DPageReadRequest* aRequest) =0; /** - Save the data content of a specified region of a memory object by writing it to - storage media. This is intended for use by an implementation of #CleanPage. - - The memory region must be the same as, or a subset of, the region used when obtaining - the request object \a aRequest. - - @param aMemory A memory object associated with this manager. - @param aIndex Page index for the start of the region. - @param aCount Number of pages in the region. - @param aPages Pointer to array of pages to read into. This must contain \a aCount - number of physical page addresses which are each page aligned. - @param aRequest A request object previously obtained with #AcquirePageWriteRequest. - - @return KErrNone if successful, - otherwise one of the system wide error codes. - */ - virtual TInt WritePages(DMemoryObject* aMemory, TUint aIndex, TUint aCount, TPhysAddr* aPages, DPageWriteRequest* aRequest); - - /** Check if a region of a memory object has been allocated. E.g. that #Alloc has reserved backing store for the memory and this has has not yet been freed by #Free or #Destruct.