1159 class DHardwareMemoryManager : public DMemoryManager |
1159 class DHardwareMemoryManager : public DMemoryManager |
1160 { |
1160 { |
1161 public: |
1161 public: |
1162 // from DMemoryManager... |
1162 // from DMemoryManager... |
1163 virtual void Destruct(DMemoryObject* aMemory); |
1163 virtual void Destruct(DMemoryObject* aMemory); |
1164 virtual TInt AddPages(DMemoryObject* aMemory, TUint aIndex, TUint aCount, TPhysAddr* aPages); |
1164 virtual TInt AddPages(DMemoryObject* aMemory, TUint aIndex, TUint aCount, const TPhysAddr* aPages); |
1165 virtual TInt AddContiguous(DMemoryObject* aMemory, TUint aIndex, TUint aCount, TPhysAddr aPhysAddr); |
1165 virtual TInt AddContiguous(DMemoryObject* aMemory, TUint aIndex, TUint aCount, TPhysAddr aPhysAddr); |
1166 virtual TInt RemovePages(DMemoryObject* aMemory, TUint aIndex, TUint aCount, TPhysAddr* aPages); |
1166 virtual TInt RemovePages(DMemoryObject* aMemory, TUint aIndex, TUint aCount, TPhysAddr* aPages); |
1167 virtual TInt Pin(DMemoryObject* aMemory, DMemoryMappingBase* aMapping, TPinArgs& aPinArgs); |
1167 virtual TInt Pin(DMemoryObject* aMemory, DMemoryMappingBase* aMapping, TPinArgs& aPinArgs); |
1168 virtual void Unpin(DMemoryObject* aMemory, DMemoryMappingBase* aMapping, TPinArgs& aPinArgs); |
1168 virtual void Unpin(DMemoryObject* aMemory, DMemoryMappingBase* aMapping, TPinArgs& aPinArgs); |
1169 |
1169 |
1224 MemoryObjectLock::Unlock(aMemory); |
1224 MemoryObjectLock::Unlock(aMemory); |
1225 aMemory->Close(); |
1225 aMemory->Close(); |
1226 } |
1226 } |
1227 |
1227 |
1228 |
1228 |
1229 TInt DHardwareMemoryManager::AddPages(DMemoryObject* aMemory, TUint aIndex, TUint aCount, TPhysAddr* aPages) |
1229 TInt DHardwareMemoryManager::AddPages(DMemoryObject* aMemory, TUint aIndex, TUint aCount, const TPhysAddr* aPages) |
1230 { |
1230 { |
1231 TRACE2(("DHardwareMemoryManager::AddPages(0x%08x,0x%x,0x%x,?)",aMemory, aIndex, aCount)); |
1231 TRACE2(("DHardwareMemoryManager::AddPages(0x%08x,0x%x,0x%x,?)",aMemory, aIndex, aCount)); |
1232 __NK_ASSERT_DEBUG(MemoryObjectLock::IsHeld(aMemory)); |
1232 __NK_ASSERT_DEBUG(MemoryObjectLock::IsHeld(aMemory)); |
1233 |
1233 |
1234 // validate arguments... |
1234 // validate arguments... |
1235 TPhysAddr* pages = aPages; |
1235 const TPhysAddr* pages = aPages; |
1236 TPhysAddr* pagesEnd = aPages+aCount; |
1236 const TPhysAddr* pagesEnd = aPages+aCount; |
1237 TPhysAddr checkMask = 0; |
1237 TPhysAddr checkMask = 0; |
1238 do checkMask |= *pages++; |
1238 do checkMask |= *pages++; |
1239 while(pages<pagesEnd); |
1239 while(pages<pagesEnd); |
1240 if(checkMask&KPageMask) |
1240 if(checkMask&KPageMask) |
1241 return KErrArgument; |
1241 return KErrArgument; |