1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/kernelhwsrv/kernel/eka/debug/crashMonitor/inc/scmonitor.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,101 @@
1.4 +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of the License "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +// e32\include\kernel\scmonitor.h
1.18 +// Kernel System crash monitor header file
1.19 +//
1.20 +// WARNING: This file contains some APIs which are internal and are subject
1.21 +// to change without notice. Such APIs should therefore not be used
1.22 +// outside the Kernel and Hardware Services package.
1.23 +//
1.24 +
1.25 +/**
1.26 + @file
1.27 + @internalComponent
1.28 +*/
1.29 +
1.30 +#ifndef __SCMONITOR_H__
1.31 +#define __SCMONITOR_H__
1.32 +
1.33 +#include <plat_priv.h>
1.34 +#include <kernel/monitor.h>
1.35 +#include <e32des8.h>
1.36 +#include <arm.h>
1.37 +#include <variant_norflash_layout.h>
1.38 +
1.39 +#include <scmdatatypes.h>
1.40 +#include <scmbytestreamutil.h>
1.41 +#include <scmconfig.h>
1.42 +#include <scmdatasave.h>
1.43 +
1.44 +using namespace Debug;
1.45 +
1.46 +class CrashFlash;
1.47 +
1.48 +const TInt KFlashAlignment = sizeof(TInt32);
1.49 +
1.50 +const TInt KFlashEraseAttempts = 10;
1.51 +/**
1.52 + * System crash monitor responsible for writing crash data to flash in
1.53 + * the event of a crash
1.54 + */
1.55 +class SCMonitor: public Monitor
1.56 + {
1.57 + public:
1.58 + SCMonitor();
1.59 + ~SCMonitor();
1.60 +
1.61 + virtual void Print(const TDesC8& aDes);
1.62 + virtual TInt Init2(TAny* aCategory, TInt aReason);
1.63 +
1.64 + void VariantInit();
1.65 + TInt InitFlash();
1.66 +
1.67 + void StableConstruction();
1.68 +
1.69 + public:
1.70 + CrashFlash* iFlash;
1.71 +
1.72 + protected:
1.73 + void DumpVariantSpecific();
1.74 +
1.75 + enum TSysCrashLogState
1.76 + {
1.77 + EUndefined = 0
1.78 + };
1.79 +
1.80 +
1.81 + private:
1.82 + TInt ProcessCrash(const SCMCrashBlockEntry& aBlockEntry, const TUint aCrashId, TBool aCommit);
1.83 + TInt LogProcessMetaData(SCMDataSave::TDumpScope aDumpScope, TUint& aSizeDumped) const;
1.84 + TInt LogThreadMetaData(SCMDataSave::TDumpScope aDumpScope, TUint& aSizeDumped) const;
1.85 + TInt LogObjectContainers(TObjectType aObjectType, SCMDataSave::TDumpScope aDumpScope, const SCMDataSave::TDataToDump& aDataToDump, TUint& aSizeDumped) const;
1.86 + TInt GetNextCrashStartPoint(SCMCrashBlockEntry& aBlockEntry);
1.87 + void DoCrash(TAny* aCategory, TInt aReason);
1.88 +
1.89 + private:
1.90 + TInt HelpDumpStacks(DObject* aObject, TObjectType aObjectType, TUint& aSizeDumped, SCMDataSave::TStackType aStkType) const;
1.91 + TInt HelpDumpMetaData(DObject* aObject, TObjectType aObjectType, TUint& aSizeDumped) const;
1.92 + TInt EraseFlashBlock(const SCMCrashBlockEntry& aBlock);
1.93 + TInt EraseEntireFlashPartition();
1.94 +
1.95 + private:
1.96 + SCMDataSave* iDataSave;
1.97 + Debug::SCMConfiguration* iScmConfig;
1.98 + SCMMultiCrashInfo* iMultiCrashInfo;
1.99 + };
1.100 +
1.101 +
1.102 +
1.103 +#endif //__SCMONITOR_H__
1.104 +//EOF scmonitor.h