508 return KErrNone; |
508 return KErrNone; |
509 } |
509 } |
510 |
510 |
511 |
511 |
512 /** |
512 /** |
513 Free a RAM zone which was previously allocated by one of these methods: |
|
514 Epoc::AllocPhysicalRam(), Epoc::ZoneAllocPhysicalRam() or |
|
515 TRamDefragRequest::ClaimRamZone(). |
|
516 |
|
517 All of the pages in the RAM zone must be allocated and only via one of the methods |
|
518 listed above, otherwise a system panic will occur. |
|
519 |
|
520 @param aZoneId The ID of the RAM zone to free. |
|
521 @return KErrNone If the operation was successful. |
|
522 KErrArgument If a RAM zone with ID aZoneId was not found. |
|
523 |
|
524 @pre Calling thread must be in a critical section. |
|
525 @pre Interrupts must be enabled. |
|
526 @pre Kernel must be unlocked. |
|
527 @pre No fast mutex can be held. |
|
528 @pre Call in a thread context. |
|
529 @pre Can be used in a device driver. |
|
530 */ |
|
531 EXPORT_C TInt Epoc::FreeRamZone(TUint aZoneId) |
|
532 { |
|
533 CHECK_PRECONDITIONS(MASK_THREAD_CRITICAL,"Epoc::FreeRamZone"); |
|
534 RamAllocLock::Lock(); |
|
535 TInt r = TheMmu.FreeRamZone(aZoneId); |
|
536 RamAllocLock::Unlock(); |
|
537 return r; |
|
538 } |
|
539 |
|
540 |
|
541 /** |
|
542 Allocate a specific block of physically contiguous RAM, specified by physical |
513 Allocate a specific block of physically contiguous RAM, specified by physical |
543 base address and size. |
514 base address and size. |
544 If and when the RAM is no longer required it should be freed using |
515 If and when the RAM is no longer required it should be freed using |
545 Epoc::FreePhysicalRam() |
516 Epoc::FreePhysicalRam() |
546 |
517 |