memspy/Driver/Kernel/Source/SubChannels/MemSpyDriverLogChanHeapBase.cpp
branchRCL_3
changeset 18 3406c99bc375
parent 0 a03f92240627
child 20 ca8a1b6995f6
equal deleted inserted replaced
16:8f8df8006c40 18:3406c99bc375
   965     TInt r = OpenKernelHeap( heap, chunk, aClientHeapChunkName );
   965     TInt r = OpenKernelHeap( heap, chunk, aClientHeapChunkName );
   966 	
   966 	
   967     TRACE_KH( Kern::Printf("DMemSpyDriverLogChanHeapBase::OpenKernelHeap(CP) - open err: %d", r ) );
   967     TRACE_KH( Kern::Printf("DMemSpyDriverLogChanHeapBase::OpenKernelHeap(CP) - open err: %d", r ) );
   968     if  ( r == KErrNone )
   968     if  ( r == KErrNone )
   969         {
   969         {
       
   970 #ifdef __SYMBIAN_KERNEL_HYBRID_HEAP__
       
   971 		// RAllocator::Size() not exported on hybrid heap
       
   972 		const TInt heapSize = heap->DebugFunction(RAllocator::EGetSize);
       
   973 #else
   970         const TInt heapSize = heap->Size();
   974         const TInt heapSize = heap->Size();
       
   975 #endif
   971         TRACE_KH( Kern::Printf("DMemSpyDriverLogChanHeapBase::OpenKernelHeap(CP) - heapSize: %d, heap: 0x%08x, chunkBase: 0x%08x", heapSize, heap, chunk->Base() ) );
   976         TRACE_KH( Kern::Printf("DMemSpyDriverLogChanHeapBase::OpenKernelHeap(CP) - heapSize: %d, heap: 0x%08x, chunkBase: 0x%08x", heapSize, heap, chunk->Base() ) );
   972 
   977 
   973         // Make a new chunk that we can copy the kernel heap into. We cannot lock the system the entire time
   978         // Make a new chunk that we can copy the kernel heap into. We cannot lock the system the entire time
   974         // we need to do this, therefore there is no guarantee that the chunk will be large enough to hold the
   979         // we need to do this, therefore there is no guarantee that the chunk will be large enough to hold the
   975         // (current) heap data at the time we need to make the copy. We oversize the chunk by 1mb in the "hope"
   980         // (current) heap data at the time we need to make the copy. We oversize the chunk by 1mb in the "hope"
  1008             else
  1013             else
  1009                 {
  1014                 {
  1010                 TRACE_KH( Kern::Printf("DMemSpyDriverLogChanHeapBase::OpenKernelHeap(CP) - heapCopyChunk->iSize: 0x%08x, heapCopyChunk->iBase: 0x%08x, heapCopyChunkAddress: 0x%08x, physicalAddress: 0x%08x", heapCopyChunk->iSize, heapCopyChunk->iBase, heapCopyChunkAddress, physicalAddress));
  1015                 TRACE_KH( Kern::Printf("DMemSpyDriverLogChanHeapBase::OpenKernelHeap(CP) - heapCopyChunk->iSize: 0x%08x, heapCopyChunk->iBase: 0x%08x, heapCopyChunkAddress: 0x%08x, physicalAddress: 0x%08x", heapCopyChunk->iSize, heapCopyChunk->iBase, heapCopyChunkAddress, physicalAddress));
  1011 
  1016 
  1012                 NKern::LockSystem();
  1017                 NKern::LockSystem();
  1013                 const TUint32 copyLength = Min( heap->Size(), heapSize );
  1018                 const TUint32 copyLength = heapSize; // TODO Min( heap->Size(), heapSize );
  1014 
  1019 
  1015                 TRACE_KH( Kern::Printf("DMemSpyDriverLogChanHeapBase::OpenKernelHeap(CP) - trying to copy %d (vs orig estimate of %d) bytes from kernel allocator address: 0x%08x", copyLength, heapSize, heap->Base() ));
  1020                 TRACE_KH( Kern::Printf("DMemSpyDriverLogChanHeapBase::OpenKernelHeap(CP) - trying to copy %d (vs orig estimate of %d) bytes from kernel allocator address: 0x%08x", copyLength, heapSize, heap->Base() ));
  1016                 memcpy( (TUint8*) heapCopyChunkAddress, heap, copyLength );
  1021                 memcpy( (TUint8*) heapCopyChunkAddress, heap, copyLength );
  1017 
  1022 
  1018                 NKern::UnlockSystem();
  1023                 NKern::UnlockSystem();