kernel/eka/memmodel/epoc/mmubase/mmubase.cpp
branchRCL_3
changeset 22 2f92ad2dc5db
parent 14 5d2844f35677
child 26 c734af59ce98
equal deleted inserted replaced
21:e7d2d738d3c2 22:2f92ad2dc5db
  1261 		NKern::ThreadLeaveCS();
  1261 		NKern::ThreadLeaveCS();
  1262 		}
  1262 		}
  1263 #endif
  1263 #endif
  1264 
  1264 
  1265 #ifdef BTRACE_RAM_ALLOCATOR
  1265 #ifdef BTRACE_RAM_ALLOCATOR
  1266 	// Must check for -1 as that is the default value of aCategroy for
  1266 	// Must check for -1 as that is the default value of aCategory for
  1267 	// BTrace::Prime() which is intended to prime all categories that are 
  1267 	// BTrace::Prime() which is intended to prime all categories that are 
  1268 	// currently enabled via a single invocation of BTrace::Prime().
  1268 	// currently enabled via a single invocation of BTrace::Prime().
  1269 	if(aCategory==BTrace::ERamAllocator || (TInt)aCategory == -1)
  1269 	if(aCategory==BTrace::ERamAllocator || (TInt)aCategory == -1)
  1270 		{
  1270 		{
  1271 		NKern::ThreadEnterCS();
  1271 		NKern::ThreadEnterCS();
  1272 		Mmu::Wait();
  1272 		Mmu::Wait();
  1273 		Mmu::Get().iRamPageAllocator->SendInitialBtraceLogs();
  1273 		Mmu::Get().iRamPageAllocator->DoBTracePrime();
  1274 		Mmu::Signal();
  1274 		Mmu::Signal();
  1275 		NKern::ThreadLeaveCS();
  1275 		NKern::ThreadLeaveCS();
  1276 		}
  1276 		}
  1277 #endif
  1277 #endif
  1278 	}
  1278 	}
  2681 void RamCache::DonateRamCachePage(SPageInfo* aPageInfo)
  2681 void RamCache::DonateRamCachePage(SPageInfo* aPageInfo)
  2682 	{
  2682 	{
  2683 	SPageInfo::TType type = aPageInfo->Type();
  2683 	SPageInfo::TType type = aPageInfo->Type();
  2684 	if(type==SPageInfo::EChunk)
  2684 	if(type==SPageInfo::EChunk)
  2685 		{
  2685 		{
  2686 		//Must not donate locked page. An example is DMA trasferred memory.
  2686 		// Must not donate locked page. An example is DMA transferred memory.
  2687 		__NK_ASSERT_DEBUG(0 == aPageInfo->LockCount());
  2687 		__NK_ASSERT_DEBUG(!aPageInfo->LockCount());
  2688 
  2688 
  2689 		aPageInfo->Change(SPageInfo::EPagedCache,SPageInfo::EStatePagedYoung);
  2689 		aPageInfo->Change(SPageInfo::EPagedCache,SPageInfo::EStatePagedYoung);
  2690 		iPageList.Add(&aPageInfo->iLink);
  2690 		iPageList.Add(&aPageInfo->iLink);
  2691 		++iNumberOfFreePages;
  2691 		++iNumberOfFreePages;
  2692 		// Update ram allocator counts as this page has changed its type
  2692 		// Update ram allocator counts as this page has changed its type
  3696 	{
  3696 	{
  3697 	__NK_ASSERT_DEBUG(iMinimumPageCount + iNumberOfFreePages <= iMaximumPageCount);
  3697 	__NK_ASSERT_DEBUG(iMinimumPageCount + iNumberOfFreePages <= iMaximumPageCount);
  3698 	SPageInfo::TType type = aPageInfo->Type();
  3698 	SPageInfo::TType type = aPageInfo->Type();
  3699 	if(type==SPageInfo::EChunk)
  3699 	if(type==SPageInfo::EChunk)
  3700 		{
  3700 		{
  3701 		//Must not donate locked page. An example is DMA trasferred memory.
  3701 		// Must not donate locked page. An example is DMA transferred memory.
  3702 		__NK_ASSERT_DEBUG(0 == aPageInfo->LockCount());
  3702 		__NK_ASSERT_DEBUG(!aPageInfo->LockCount());
  3703 		
  3703 		
  3704 		aPageInfo->Change(SPageInfo::EPagedCache,SPageInfo::EStatePagedYoung);
  3704 		aPageInfo->Change(SPageInfo::EPagedCache,SPageInfo::EStatePagedYoung);
  3705 
  3705 
  3706 		// Update ram allocator counts as this page has changed its type
  3706 		// Update ram allocator counts as this page has changed its type
  3707 		DMemModelChunk* chunk = (DMemModelChunk*)aPageInfo->Owner();
  3707 		DMemModelChunk* chunk = (DMemModelChunk*)aPageInfo->Owner();