os/kernelhwsrv/kernel/eka/debug/crashMonitor/inc/scmonitor.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     4 // under the terms of the License "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 // e32\include\kernel\scmonitor.h
    15 // Kernel System crash monitor header file
    16 // 
    17 // WARNING: This file contains some APIs which are internal and are subject
    18 //          to change without notice. Such APIs should therefore not be used
    19 //          outside the Kernel and Hardware Services package.
    20 //
    21 
    22 /**
    23  @file
    24  @internalComponent
    25 */
    26 
    27 #ifndef __SCMONITOR_H__
    28 #define __SCMONITOR_H__
    29 
    30 #include <plat_priv.h>
    31 #include <kernel/monitor.h>
    32 #include <e32des8.h>	
    33 #include <arm.h>
    34 #include <variant_norflash_layout.h>
    35 
    36 #include <scmdatatypes.h>
    37 #include <scmbytestreamutil.h>
    38 #include <scmconfig.h>
    39 #include <scmdatasave.h>
    40 
    41 using namespace Debug;
    42 
    43 class CrashFlash;
    44 
    45 const TInt KFlashAlignment = sizeof(TInt32);
    46 
    47 const TInt KFlashEraseAttempts = 10;
    48 /**
    49  * System crash monitor responsible for writing crash data to flash in 
    50  * the event of a crash
    51  */
    52 class SCMonitor: public Monitor
    53 	{
    54 	public:
    55 		SCMonitor();	
    56 		~SCMonitor();
    57 		
    58 		virtual void Print(const TDesC8& aDes);				
    59 		virtual TInt Init2(TAny* aCategory, TInt aReason);
    60 	
    61 		void VariantInit();
    62 		TInt InitFlash();
    63 		
    64 		void StableConstruction(); 		
    65 		
    66 	public:		
    67 		CrashFlash* iFlash;		
    68 			
    69 	protected:	
    70 		void DumpVariantSpecific();
    71 	
    72 		enum TSysCrashLogState
    73 			{
    74 			EUndefined = 0
    75 			};
    76 		
    77 		
    78 	private:	
    79 		TInt ProcessCrash(const SCMCrashBlockEntry& aBlockEntry, const TUint aCrashId, TBool aCommit);
    80 		TInt LogProcessMetaData(SCMDataSave::TDumpScope aDumpScope, TUint& aSizeDumped) const;
    81 		TInt LogThreadMetaData(SCMDataSave::TDumpScope aDumpScope, TUint& aSizeDumped) const;
    82 		TInt LogObjectContainers(TObjectType aObjectType, SCMDataSave::TDumpScope aDumpScope, const SCMDataSave::TDataToDump& aDataToDump, TUint& aSizeDumped) const;
    83 		TInt GetNextCrashStartPoint(SCMCrashBlockEntry& aBlockEntry);
    84 		void DoCrash(TAny* aCategory, TInt aReason);
    85 		
    86 	private:
    87 		TInt HelpDumpStacks(DObject* aObject, TObjectType aObjectType, TUint& aSizeDumped, SCMDataSave::TStackType aStkType) const;
    88 		TInt HelpDumpMetaData(DObject* aObject, TObjectType aObjectType, TUint& aSizeDumped) const;
    89 		TInt EraseFlashBlock(const SCMCrashBlockEntry& aBlock);
    90 		TInt EraseEntireFlashPartition();
    91 		
    92 	private:		
    93 		SCMDataSave* iDataSave;
    94 		Debug::SCMConfiguration* iScmConfig;
    95 		SCMMultiCrashInfo* iMultiCrashInfo;
    96 	};
    97 
    98 
    99 	
   100 #endif //__SCMONITOR_H__
   101 //EOF scmonitor.h