diff -r b42b9ce90ea9 -r 661475905584 kernel/eka/memmodel/epoc/flexible/mmu/mm.cpp --- a/kernel/eka/memmodel/epoc/flexible/mmu/mm.cpp Fri Apr 23 22:02:01 2010 +0100 +++ b/kernel/eka/memmodel/epoc/flexible/mmu/mm.cpp Fri Apr 23 22:08:41 2010 +0100 @@ -394,7 +394,7 @@ } -TInt MM::MemoryAddPages(DMemoryObject* aMemory, TUint aIndex, TUint aCount, TPhysAddr* aPages) +TInt MM::MemoryAddPages(DMemoryObject* aMemory, TUint aIndex, TUint aCount, const TPhysAddr* aPages) { TRACE(("MM::MemoryAddPages(0x%08x,0x%08x,0x%08x,?)",aMemory,aIndex,aCount)); MemoryObjectLock::Lock(aMemory); @@ -785,6 +785,30 @@ } +DMemoryMapping* MM::FindMappingInProcess(DMemModelProcess* aProcess, TLinAddr aAddr, TUint aSize, + TUint& aOffsetInMapping, TUint& aInstanceCount) + { + if(aAddr>=KGlobalMemoryBase) + { + // Address in global region, so look it up in kernel's address space... + return MM::FindMappingInAddressSpace(KKernelOsAsid, aAddr, aSize, aOffsetInMapping, aInstanceCount); + } + + // Address in thread's process address space so open a reference to its os asid + // so that it remains valid for FindMappingInAddressSpace() call. + TInt osAsid = aProcess->TryOpenOsAsid(); + if (osAsid < 0) + {// The process no longer owns an address space so can't have any mappings. + return NULL; + } + + DMemoryMapping* r = MM::FindMappingInAddressSpace(osAsid, aAddr, aSize, aOffsetInMapping, aInstanceCount); + + aProcess->CloseOsAsid(); + return r; + } + + DMemoryMapping* MM::FindMappingInAddressSpace( TUint aOsAsid, TLinAddr aAddr, TUint aSize, TUint& aOffsetInMapping, TUint& aInstanceCount) { @@ -1117,5 +1141,3 @@ attr&EMemoryAttributeUseECC ); } - -