kernel/eka/memmodel/epoc/flexible/mmu/mmanager.cpp
branchRCL_3
changeset 22 2f92ad2dc5db
parent 0 a41df078684a
child 26 c734af59ce98
equal deleted inserted replaced
21:e7d2d738d3c2 22:2f92ad2dc5db
    64 	{
    64 	{
    65 	return KErrNotSupported;
    65 	return KErrNotSupported;
    66 	}
    66 	}
    67 
    67 
    68 
    68 
    69 TInt DMemoryManager::AddPages(DMemoryObject* /*aMemory*/, TUint /*aIndex*/, TUint /*aCount*/, TPhysAddr* /*aPages*/)
    69 TInt DMemoryManager::AddPages(DMemoryObject* /*aMemory*/, TUint /*aIndex*/, TUint /*aCount*/, const TPhysAddr* /*aPages*/)
    70 	{
    70 	{
    71 	return KErrNotSupported;
    71 	return KErrNotSupported;
    72 	}
    72 	}
    73 
    73 
    74 
    74 
  1160 class DHardwareMemoryManager : public DMemoryManager
  1160 class DHardwareMemoryManager : public DMemoryManager
  1161 	{
  1161 	{
  1162 public:
  1162 public:
  1163 	// from DMemoryManager...
  1163 	// from DMemoryManager...
  1164 	virtual void Destruct(DMemoryObject* aMemory);
  1164 	virtual void Destruct(DMemoryObject* aMemory);
  1165 	virtual TInt AddPages(DMemoryObject* aMemory, TUint aIndex, TUint aCount, TPhysAddr* aPages);
  1165 	virtual TInt AddPages(DMemoryObject* aMemory, TUint aIndex, TUint aCount, const TPhysAddr* aPages);
  1166 	virtual TInt AddContiguous(DMemoryObject* aMemory, TUint aIndex, TUint aCount, TPhysAddr aPhysAddr);
  1166 	virtual TInt AddContiguous(DMemoryObject* aMemory, TUint aIndex, TUint aCount, TPhysAddr aPhysAddr);
  1167 	virtual TInt RemovePages(DMemoryObject* aMemory, TUint aIndex, TUint aCount, TPhysAddr* aPages);
  1167 	virtual TInt RemovePages(DMemoryObject* aMemory, TUint aIndex, TUint aCount, TPhysAddr* aPages);
  1168 	virtual TInt Pin(DMemoryObject* aMemory, DMemoryMappingBase* aMapping, TPinArgs& aPinArgs);
  1168 	virtual TInt Pin(DMemoryObject* aMemory, DMemoryMappingBase* aMapping, TPinArgs& aPinArgs);
  1169 	virtual void Unpin(DMemoryObject* aMemory, DMemoryMappingBase* aMapping, TPinArgs& aPinArgs);
  1169 	virtual void Unpin(DMemoryObject* aMemory, DMemoryMappingBase* aMapping, TPinArgs& aPinArgs);
  1170 
  1170 
  1225 	MemoryObjectLock::Unlock(aMemory);
  1225 	MemoryObjectLock::Unlock(aMemory);
  1226 	aMemory->Close();
  1226 	aMemory->Close();
  1227 	}
  1227 	}
  1228 
  1228 
  1229 
  1229 
  1230 TInt DHardwareMemoryManager::AddPages(DMemoryObject* aMemory, TUint aIndex, TUint aCount, TPhysAddr* aPages)
  1230 TInt DHardwareMemoryManager::AddPages(DMemoryObject* aMemory, TUint aIndex, TUint aCount, const TPhysAddr* aPages)
  1231 	{
  1231 	{
  1232 	TRACE2(("DHardwareMemoryManager::AddPages(0x%08x,0x%x,0x%x,?)",aMemory, aIndex, aCount));
  1232 	TRACE2(("DHardwareMemoryManager::AddPages(0x%08x,0x%x,0x%x,?)",aMemory, aIndex, aCount));
  1233 	__NK_ASSERT_DEBUG(MemoryObjectLock::IsHeld(aMemory));
  1233 	__NK_ASSERT_DEBUG(MemoryObjectLock::IsHeld(aMemory));
  1234 
  1234 
  1235 	// validate arguments...
  1235 	// validate arguments...
  1236 	TPhysAddr* pages = aPages;
  1236 	const TPhysAddr* pages = aPages;
  1237 	TPhysAddr* pagesEnd = aPages+aCount;
  1237 	const TPhysAddr* pagesEnd = aPages+aCount;
  1238 	TPhysAddr checkMask = 0;
  1238 	TPhysAddr checkMask = 0;
  1239 	do checkMask |= *pages++;
  1239 	do checkMask |= *pages++;
  1240 	while(pages<pagesEnd);
  1240 	while(pages<pagesEnd);
  1241 	if(checkMask&KPageMask)
  1241 	if(checkMask&KPageMask)
  1242 		return KErrArgument;
  1242 		return KErrArgument;