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; |