kernel/eka/memmodel/epoc/flexible/mmu/mpagearray.cpp
changeset 176 af6ec97d9189
parent 0 a41df078684a
equal deleted inserted replaced
175:5af6c74cd793 176:af6ec97d9189
   256 	TRACE2(("RPageArray::TIter::AddFind returns 0x%x+0x%x",startIndex,n));
   256 	TRACE2(("RPageArray::TIter::AddFind returns 0x%x+0x%x",startIndex,n));
   257 	return n;
   257 	return n;
   258 	}
   258 	}
   259 
   259 
   260 
   260 
   261 void RPageArray::TIter::Add(TUint aCount, TPhysAddr* aPages)
   261 void RPageArray::TIter::Add(TUint aCount, const TPhysAddr* aPages)
   262 	{
   262 	{
   263 	// MmuLock NOT required because...
   263 	// MmuLock NOT required because...
   264 	// 1. AddStart has ensured all segments are allocated and locked (so they can't be deleted)
   264 	// 1. AddStart has ensured all segments are allocated and locked (so they can't be deleted)
   265 	// 2. AddFind returns an unallocated region. This can only be changed by Adding pages
   265 	// 2. AddFind returns an unallocated region. This can only be changed by Adding pages
   266 	//    and we only allow one thread to do this at a time (i.e. the thread calling this function.)
   266 	//    and we only allow one thread to do this at a time (i.e. the thread calling this function.)
  1156 	TPhysAddr page = *p;
  1156 	TPhysAddr page = *p;
  1157 	if(State(page) <= RPageArray::EMoving)
  1157 	if(State(page) <= RPageArray::EMoving)
  1158 		return NULL;
  1158 		return NULL;
  1159 
  1159 
  1160 	*p = (page & ~EStateMask) | EMoving;
  1160 	*p = (page & ~EStateMask) | EMoving;
       
  1161 	s->Lock();
  1161 
  1162 
  1162 	aPageList.Set(iSegments, aIndex, aIndex+1);
  1163 	aPageList.Set(iSegments, aIndex, aIndex+1);
  1163 
  1164 
  1164 	return p;
  1165 	return p;
  1165 	}
  1166 	}