kernel/eka/memmodel/epoc/flexible/mmu/mpdalloc.cpp
branchRCL_3
changeset 87 2f92ad2dc5db
parent 0 a41df078684a
--- a/kernel/eka/memmodel/epoc/flexible/mmu/mpdalloc.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/kernel/eka/memmodel/epoc/flexible/mmu/mpdalloc.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -134,7 +134,14 @@
 	RamAllocLock::Lock();
 	TInt r = m.AllocContiguousRam(pdPhys, KLocalPdPages, KLocalPdShift-KPageShift, iPageDirectoryMemory->RamAllocFlags());
 	if(r==KErrNone)
+		{
 		AssignPages(offset>>KPageShift,KLocalPdPages,pdPhys);
+
+#ifdef BTRACE_KERNEL_MEMORY
+		BTrace4(BTrace::EKernelMemory, BTrace::EKernelMemoryMiscAlloc, KLocalPdPages << KPageShift);
+		Epoc::KernelMiscPages += KLocalPdPages;
+#endif
+		}
 	RamAllocLock::Unlock();
 
 	if(r==KErrNone)
@@ -147,6 +154,11 @@
 			{
 			RamAllocLock::Lock();
 			m.FreeContiguousRam(pdPhys,KLocalPdPages);
+
+#ifdef BTRACE_KERNEL_MEMORY
+			BTrace4(BTrace::EKernelMemory, BTrace::EKernelMemoryMiscFree, KLocalPdPages << KPageShift);
+			Epoc::KernelMiscPages -= KLocalPdPages;
+#endif
 			RamAllocLock::Unlock();
 			}
 		else
@@ -206,6 +218,11 @@
 	Mmu& m = TheMmu;
 	// Page directories are fixed.
 	m.FreeRam(pages, KLocalPdPages, EPageFixed);
+
+#ifdef BTRACE_KERNEL_MEMORY
+	BTrace4(BTrace::EKernelMemory, BTrace::EKernelMemoryMiscFree, KLocalPdPages << KPageShift);
+	Epoc::KernelMiscPages -= KLocalPdPages;
+#endif
 	RamAllocLock::Unlock();
 	}