kernel/eka/memmodel/epoc/flexible/mmu/mrom.cpp
branchRCL_3
changeset 257 3e88ff8f41d5
parent 256 c1f20ce4abcf
child 294 039a3e647356
--- a/kernel/eka/memmodel/epoc/flexible/mmu/mrom.cpp	Tue Aug 31 16:34:26 2010 +0300
+++ b/kernel/eka/memmodel/epoc/flexible/mmu/mrom.cpp	Wed Sep 01 12:34:56 2010 +0100
@@ -558,11 +558,6 @@
 								KPageSize >> readUnitShift, DPagingDevice::EDriveRomPaging);
 			__NK_ASSERT_DEBUG(r!=KErrNoMemory); // not allowed to allocated memory, therefore can't fail with KErrNoMemory
 			END_PAGING_BENCHMARK(EPagingBmReadMedia);
-			if (r != KErrNone)
-				{
-				__KTRACE_OPT(KPANIC, Kern::Printf("DRomMemoryManager::ReadPage: error reading media at %08x + %x: %d", dataOffset, KPageSize, r));
-				}
-			r = ThePager.EmbedErrorContext(EPagingErrorContextRomRead, r);
 			}
 		else
 			{
@@ -589,9 +584,6 @@
 				r = iDevice->Read(&message, buffer, readStart, readSize, DPagingDevice::EDriveRomPaging);
 				__NK_ASSERT_DEBUG(r!=KErrNoMemory); // not allowed to allocated memory, therefore can't fail with KErrNoMemory
 				END_PAGING_BENCHMARK(EPagingBmReadMedia);
-				if(r!=KErrNone)
-					__KTRACE_OPT(KPANIC, Kern::Printf("DRomMemoryManager::ReadPage: error reading media at %08x + %x: %d", dataOffset, dataSize, r));
-				r = ThePager.EmbedErrorContext(EPagingErrorContextRomRead, r);
 				if(r==KErrNone)
 					{
 					// Decompress data, remembering that the data to decompress may be offset from 
@@ -600,13 +592,16 @@
 					const TLinAddr data = buffer + dataOffset - (readStart << readUnitShift);
 					__ASSERT_COMPILE(SRomPageInfo::ENoCompression==0); // decompress assumes this
 					r = Decompress(romPageInfo->iCompressionType, linAddr, KPageSize, data, dataSize);
-					if (r >= 0)
-						r = (r == KPageSize) ? KErrNone : KErrCorrupt;
-					if (r != KErrNone)
-						__KTRACE_OPT(KPANIC, Kern::Printf("DRomMemoryManager::ReadPage: error decompressing page at %08x + %x: %d", dataOffset, dataSize, r));
-					__NK_ASSERT_DEBUG(r == KErrNone);
-					r = ThePager.EmbedErrorContext(EPagingErrorContextRomDecompress, r);
+					if(r >= 0)
+						{
+						if (r != KPageSize)
+							__KTRACE_OPT(KPANIC, Kern::Printf("DRomMemoryManager::ReadPage: error decompressing page at %08x + %x: %d", dataOffset, dataSize, r));
+						__NK_ASSERT_ALWAYS(r == KPageSize);
+						r = KErrNone;
+						}
 					}
+				else
+					__KTRACE_OPT(KPANIC, Kern::Printf("DRomMemoryManager::ReadPage: error reading media at %08x + %x: %d", dataOffset, dataSize, r));
 				}
 			}
 		END_PAGING_BENCHMARK(EPagingBmReadRomPage);
@@ -616,7 +611,7 @@
 		}
 
 	aRequest->UnmapPages(true);
-	
+
 	return r;
 	}