kernel/eka/memmodel/epoc/flexible/mmu/mexport.cpp
branchRCL_3
changeset 43 c1f20ce4abcf
parent 26 c734af59ce98
child 44 3e88ff8f41d5
--- a/kernel/eka/memmodel/epoc/flexible/mmu/mexport.cpp	Thu Aug 19 11:14:22 2010 +0300
+++ b/kernel/eka/memmodel/epoc/flexible/mmu/mexport.cpp	Tue Aug 31 16:34:26 2010 +0300
@@ -510,6 +510,35 @@
 
 
 /**
+Free a RAM zone which was previously allocated by one of these methods:
+Epoc::AllocPhysicalRam(), Epoc::ZoneAllocPhysicalRam() or 
+TRamDefragRequest::ClaimRamZone().
+
+All of the pages in the RAM zone must be allocated and only via one of the methods 
+listed above, otherwise a system panic will occur.
+
+@param	aZoneId			The ID of the RAM zone to free.
+@return	KErrNone 		If the operation was successful.
+		KErrArgument 	If a RAM zone with ID aZoneId was not found.
+
+@pre Calling thread must be in a critical section.
+@pre Interrupts must be enabled.
+@pre Kernel must be unlocked.
+@pre No fast mutex can be held.
+@pre Call in a thread context.
+@pre Can be used in a device driver.
+*/
+EXPORT_C TInt Epoc::FreeRamZone(TUint aZoneId)
+	{
+	CHECK_PRECONDITIONS(MASK_THREAD_CRITICAL,"Epoc::FreeRamZone");
+	RamAllocLock::Lock();
+	TInt r = TheMmu.FreeRamZone(aZoneId);
+	RamAllocLock::Unlock();
+	return r;
+	}
+
+
+/**
 Allocate a specific block of physically contiguous RAM, specified by physical
 base address and size.
 If and when the RAM is no longer required it should be freed using