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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // e32\include\kernel\scmonitor.h
15 // Kernel System crash monitor header file
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.
27 #ifndef __SCMONITOR_H__
28 #define __SCMONITOR_H__
30 #include <plat_priv.h>
31 #include <kernel/monitor.h>
34 #include <variant_norflash_layout.h>
36 #include <scmdatatypes.h>
37 #include <scmbytestreamutil.h>
38 #include <scmconfig.h>
39 #include <scmdatasave.h>
41 using namespace Debug;
45 const TInt KFlashAlignment = sizeof(TInt32);
47 const TInt KFlashEraseAttempts = 10;
49 * System crash monitor responsible for writing crash data to flash in
50 * the event of a crash
52 class SCMonitor: public Monitor
58 virtual void Print(const TDesC8& aDes);
59 virtual TInt Init2(TAny* aCategory, TInt aReason);
64 void StableConstruction();
70 void DumpVariantSpecific();
72 enum TSysCrashLogState
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);
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();
93 SCMDataSave* iDataSave;
94 Debug::SCMConfiguration* iScmConfig;
95 SCMMultiCrashInfo* iMultiCrashInfo;
100 #endif //__SCMONITOR_H__