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