--- a/kernel/eka/memmodel/epoc/flexible/mmu/mm.cpp Thu Aug 19 11:14:22 2010 +0300
+++ b/kernel/eka/memmodel/epoc/flexible/mmu/mm.cpp Tue Aug 31 16:34:26 2010 +0300
@@ -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
);
}
-
-