563 // This precondition is violated by various parts of the system under some conditions, |
563 // This precondition is violated by various parts of the system under some conditions, |
564 // e.g. when __FLUSH_PT_INTO_RAM__ is defined. This function might also be called by |
564 // e.g. when __FLUSH_PT_INTO_RAM__ is defined. This function might also be called by |
565 // a higher-level RTOS for which these conditions are meaningless. Thus, it's been |
565 // a higher-level RTOS for which these conditions are meaningless. Thus, it's been |
566 // disabled for now. |
566 // disabled for now. |
567 // CHECK_PRECONDITIONS(MASK_KERNEL_UNLOCKED|MASK_INTERRUPTS_ENABLED|MASK_NOT_ISR|MASK_NOT_IDFC,"Epoc::LinearToPhysical"); |
567 // CHECK_PRECONDITIONS(MASK_KERNEL_UNLOCKED|MASK_INTERRUPTS_ENABLED|MASK_NOT_ISR|MASK_NOT_IDFC,"Epoc::LinearToPhysical"); |
568 DMemModelProcess* pP=(DMemModelProcess*)TheCurrentThread->iOwningProcess; |
568 |
569 // Get the os asid of current thread's process so no need to open a reference on it. |
569 // When called by a higher-level OS we may not be in a DThread context, so avoid looking up the |
570 TInt osAsid = pP->OsAsid(); |
570 // current process in the DThread for a global address |
|
571 TInt osAsid = KKernelOsAsid; |
|
572 if (aLinAddr < KGlobalMemoryBase) |
|
573 { |
|
574 // Get the os asid of current thread's process so no need to open a reference on it. |
|
575 DMemModelProcess* pP=(DMemModelProcess*)TheCurrentThread->iOwningProcess; |
|
576 osAsid = pP->OsAsid(); |
|
577 } |
|
578 |
571 #if 1 |
579 #if 1 |
572 return Mmu::UncheckedLinearToPhysical(aLinAddr, osAsid); |
580 return Mmu::UncheckedLinearToPhysical(aLinAddr, osAsid); |
573 #else |
581 #else |
574 MmuLock::Lock(); |
582 MmuLock::Lock(); |
575 TPhysAddr addr = Mmu::LinearToPhysical(aLinAddr, osAsid); |
583 TPhysAddr addr = Mmu::LinearToPhysical(aLinAddr, osAsid); |