kernel/eka/memmodel/epoc/flexible/mmu/mpager.h
branchRCL_3
changeset 39 2bb754abd467
parent 36 bbf8bed59bcb
child 43 c1f20ce4abcf
--- a/kernel/eka/memmodel/epoc/flexible/mmu/mpager.h	Wed Jun 09 11:10:19 2010 +0300
+++ b/kernel/eka/memmodel/epoc/flexible/mmu/mpager.h	Mon Jun 21 17:12:14 2010 +0300
@@ -442,7 +442,8 @@
 	If the oldest page is on any other list (i.e. is an old or young page) this will steal it,
 	aquiring the page cleaning mutex first if it is dirty.
 
-	Called from #PageInAllocPage and #TryReturnOldestPageToSystem.
+	Called from #PageInAllocPage, #TryReturnOldestPageToSystem, #AllowAddFreePage and 
+	#AllowAddFreePages.
 	
 	@param aAllowAlloc Indicates whether the method should try to allocate a page from the system
 	
@@ -503,6 +504,29 @@
 	TBool TryReturnOldestPageToSystem();
 
 	/**
+	Ensure adding a page to the paging cache will be within the maximum size.
+	
+	@param aPageInfo	On return this is set to the SPageInfo of a page that must be returned
+						to the system before a page can be added to the paging cache, or
+						NULL if no page must be returned to the system.
+	*/
+	void AllowAddFreePage(SPageInfo*& aPageInfo);
+
+	/**
+	Ensure adding aNumPages pages to the paging cache will be within the maximum size.
+	
+	@param aPageInfo	On return this is set to the SPageInfo of a page that must be returned
+						to the system before any more pages can be added to the paging cache, or
+						NULL if no page must be returned to the system.
+	@param aNumPages	The number of pages the caller wishes to add to the paging cache.
+	
+	@return If aPageInfo == NULL on return, this is the number of pages it is possible to
+			add to the paging cache or 1 if aPageInfo != NULL, i.e. a page will need 
+			to be returned to the system.
+	*/
+	TUint AllowAddFreePages(SPageInfo*& aPageInfo, TUint aNumPages);
+	
+	/**
 	Put a specific page back on the system's free pool.
 
 	@pre RamAllocLock held.