0
|
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 |
// Definitions for the data types the SCM stores to flash
|
|
15 |
//
|
|
16 |
// WARNING: This file contains some APIs which are internal and are subject
|
|
17 |
// to change without notice. Such APIs should therefore not be used
|
|
18 |
// outside the Kernel and Hardware Services package.
|
|
19 |
//
|
|
20 |
|
|
21 |
|
|
22 |
#ifndef __SCMDATATYPES_H_INCLUDED__
|
|
23 |
#define __SCMDATATYPES_H_INCLUDED__
|
|
24 |
|
|
25 |
#include <rm_debug_api.h>
|
|
26 |
#include <e32rom.h>
|
|
27 |
|
|
28 |
#include <scmbytestreamutil.h>
|
|
29 |
#include <scmtrace.h>
|
|
30 |
|
|
31 |
/**
|
|
32 |
@file
|
|
33 |
@internalComponent
|
|
34 |
*/
|
|
35 |
|
|
36 |
namespace Debug
|
|
37 |
{
|
|
38 |
/** SCM Data Types Major Number */
|
|
39 |
static const TInt KSCMDataTypesMajorVersion = 1;
|
|
40 |
|
|
41 |
/** SCM Data Types Minor Number */
|
|
42 |
static const TInt KSCMDataTypesMinorVersion = 0;
|
|
43 |
|
|
44 |
/** SCM Data Types Build Number */
|
|
45 |
static const TInt KSCMDataTypesBuildNumber = 0;
|
|
46 |
|
|
47 |
/**
|
|
48 |
* This enum defines the type of struct we are dealing with when we
|
|
49 |
* are serialising/deserialising
|
|
50 |
*/
|
|
51 |
enum SCMStructId
|
|
52 |
{
|
|
53 |
ESCMFirst,
|
|
54 |
ESCMOffsetsHeader,
|
|
55 |
ESCMTCrashInfo,
|
|
56 |
ESCMProcessData,
|
|
57 |
ESCMThreadData,
|
|
58 |
ESCMThreadStack,
|
|
59 |
ESCMRegisterValue,
|
|
60 |
ESCMRegisterSet,
|
|
61 |
ESCMMemory,
|
|
62 |
ESCMCodeSegSet,
|
|
63 |
ESCMCodeSeg,
|
|
64 |
ESCMRawData,
|
|
65 |
ESCMTraceData,
|
|
66 |
ESCMLocks,
|
|
67 |
ESCMKernelHeap,
|
|
68 |
ESCMVariantData,
|
|
69 |
ESCMRomHeader,
|
|
70 |
ESCMLast
|
|
71 |
};
|
|
72 |
|
|
73 |
/**
|
|
74 |
* This class represents the header at the start of a crash log
|
|
75 |
* describing the size of the crash log and minimal location
|
|
76 |
* information
|
|
77 |
*/
|
|
78 |
class TCrashOffsetsHeader : public MByteStreamSerializable
|
|
79 |
{
|
|
80 |
public:
|
|
81 |
|
|
82 |
static const TInt KSCMCrashOffsetsMaxSize = 20 * sizeof(TUint32) + sizeof(TUint16);
|
|
83 |
|
|
84 |
enum TCrashHeaderVersion
|
|
85 |
{
|
|
86 |
EChVersion1 = 1
|
|
87 |
};
|
|
88 |
|
|
89 |
TCrashOffsetsHeader();
|
|
90 |
|
|
91 |
//From MByteStreamSerializable
|
|
92 |
virtual TInt Serialize(TByteStreamWriter& aWriter);
|
|
93 |
virtual TInt Deserialize(TByteStreamReader& aReader);
|
|
94 |
virtual TInt GetSize() const;
|
|
95 |
|
|
96 |
TBool operator == (const TCrashOffsetsHeader& aOther) const;
|
|
97 |
|
|
98 |
SCMStructId iId;
|
|
99 |
TCrashHeaderVersion iVersion;
|
|
100 |
|
|
101 |
//These next members are offsets to the crash data in the log
|
|
102 |
TUint32 iCTFullRegOffset;
|
|
103 |
TUint32 iCTUsrStkOffset;
|
|
104 |
TUint32 iCTSvrStkOffset;
|
|
105 |
TUint32 iCPMetaOffset;
|
|
106 |
TUint32 iCTMetaOffset;
|
|
107 |
TUint32 iCPCodeSegOffset;
|
|
108 |
TUint32 iSysUsrStkOffset;
|
|
109 |
TUint32 iSysSvrStkOffset;
|
|
110 |
TUint32 iSysUsrRegOffset;
|
|
111 |
TUint32 iSysSvrRegOffset;
|
|
112 |
TUint32 iTLstOffset;
|
|
113 |
TUint32 iPLstOffset;
|
|
114 |
TUint32 iSysCodeSegOffset;
|
|
115 |
TUint32 iExcStkOffset;
|
|
116 |
TUint32 iTraceOffset;
|
|
117 |
TUint32 iScmLocksOffset;
|
|
118 |
TUint32 iKernelHeapOffset;
|
|
119 |
TUint32 iVarSpecInfOffset;
|
|
120 |
TUint32 iRomInfoOffset;
|
|
121 |
|
|
122 |
TUint32 iSpare1;
|
|
123 |
TUint32 iSpare2;
|
|
124 |
TUint32 iSpare3;
|
|
125 |
TUint32 iSpare4;
|
|
126 |
TUint32 iSpare5;
|
|
127 |
TUint32 iSpare6;
|
|
128 |
|
|
129 |
};
|
|
130 |
|
|
131 |
/**
|
|
132 |
* This class stores meta data for a given crash
|
|
133 |
*/
|
|
134 |
class TCrashInfoHeader : public MByteStreamSerializable
|
|
135 |
{
|
|
136 |
public:
|
|
137 |
|
|
138 |
static const TInt KMaxCatSize = 80;
|
|
139 |
static const TInt KSCMCrashInfoMaxSize = 76 + KMaxCatSize;
|
|
140 |
|
|
141 |
enum TCrashInfoHeaderVersion { ECiVersion1 = 1 };
|
|
142 |
TCrashInfoHeader();
|
|
143 |
|
|
144 |
// from MByteStreamSerializable
|
|
145 |
virtual TInt Serialize(TByteStreamWriter& aWriter);
|
|
146 |
virtual TInt Deserialize(TByteStreamReader& aReader);
|
|
147 |
virtual TInt GetSize() const;
|
|
148 |
|
|
149 |
TBool operator == (const TCrashInfoHeader& aOther) const;
|
|
150 |
|
|
151 |
|
|
152 |
SCMStructId iId;
|
|
153 |
TCrashInfoHeaderVersion iVersion;
|
|
154 |
TInt32 iLogSize;
|
|
155 |
TInt32 iFlashAlign;
|
|
156 |
TInt32 iCachedWriterSize;
|
|
157 |
TUint64 iPid;
|
|
158 |
TUint64 iTid;
|
|
159 |
TInt32 iExitType;
|
|
160 |
TInt32 iExitReason;
|
|
161 |
TInt32 iExcCode;
|
|
162 |
TInt64 iCrashTime;
|
|
163 |
TInt32 iCrashId;
|
|
164 |
TInt32 iFlashBlockSize;
|
|
165 |
TInt32 iFlashPartitionSize;
|
|
166 |
TVersion iSCMDataTypesVersion;
|
|
167 |
TUint32 iCategorySize;
|
|
168 |
TBuf8<KMaxCatSize> iCategory;
|
|
169 |
|
|
170 |
TInt32 iSpare1;
|
|
171 |
TInt32 iSpare2;
|
|
172 |
};
|
|
173 |
|
|
174 |
/**
|
|
175 |
* This class is used for a raw memory dump. It will always be preceded by a TMemoryDump.
|
|
176 |
*
|
|
177 |
* Note: This class contains a TPtr8 to store the data
|
|
178 |
* name. Due to us not being able to allocate memory when the system
|
|
179 |
* is down, we assume that the memory to which this points is owned
|
|
180 |
* by someone else. It is constructed to point to NULL. To make use
|
|
181 |
* of this, before serialising the data, ensure to set it to point to
|
|
182 |
* the location required. Equally, when derserialising, ensure to allocate
|
|
183 |
* a descriptor of required bytes (determined from TMemoryDump) and set it to iData, otherwise
|
|
184 |
* the name will be ignored upon reading.
|
|
185 |
*/
|
|
186 |
class TRawData : public MByteStreamSerializable
|
|
187 |
{
|
|
188 |
public:
|
|
189 |
|
|
190 |
//Note this doesnt include the data, as this number is not determinable
|
|
191 |
static const TInt KSCMRawDataMaxSize = 2 * sizeof(TUint32) + sizeof(TUint16);
|
|
192 |
|
|
193 |
enum TTRawDataVersion { ETRawData1 = 1 };
|
|
194 |
TRawData();
|
|
195 |
|
|
196 |
// from MByteStreamSerializable
|
|
197 |
virtual TInt Serialize(TByteStreamWriter& aWriter);
|
|
198 |
virtual TInt Deserialize(TByteStreamReader& aReader);
|
|
199 |
virtual TInt GetSize() const;
|
|
200 |
|
|
201 |
TInt Deserialize(TInt aStartPos, TByteStreamReader& aReader);
|
|
202 |
|
|
203 |
SCMStructId iId;
|
|
204 |
TTRawDataVersion iVersion;
|
|
205 |
|
|
206 |
TInt32 iLength;
|
|
207 |
TPtr8 iData;
|
|
208 |
|
|
209 |
};
|
|
210 |
|
|
211 |
/**
|
|
212 |
* This class stores meta data for a given process
|
|
213 |
*/
|
|
214 |
class TProcessData : public MByteStreamSerializable
|
|
215 |
{
|
|
216 |
public:
|
|
217 |
|
|
218 |
static const TInt KSCMProcessDataMaxSize = sizeof(TUint16) + sizeof(TUint64) + 2 * sizeof(TUint32) + KMaxProcessName;
|
|
219 |
|
|
220 |
enum TProcessDataVersion { EProcData1 = 1 };
|
|
221 |
TProcessData();
|
|
222 |
|
|
223 |
// from MByteStreamSerializable
|
|
224 |
virtual TInt Serialize(TByteStreamWriter& aWriter);
|
|
225 |
virtual TInt Deserialize(TByteStreamReader& aReader);
|
|
226 |
virtual TInt GetSize() const;
|
|
227 |
|
|
228 |
SCMStructId iId;
|
|
229 |
TProcessDataVersion iVersion;
|
|
230 |
|
|
231 |
TUint64 iPid;
|
|
232 |
TUint32 iNamesize; //Length of process filename in bytes
|
|
233 |
TInt32 iPriority;
|
|
234 |
|
|
235 |
TBuf8<KMaxProcessName> iName;
|
|
236 |
|
|
237 |
TInt32 iSpare1;
|
|
238 |
TInt32 iSpare2;
|
|
239 |
TInt32 iSpare3;
|
|
240 |
};
|
|
241 |
|
|
242 |
/**
|
|
243 |
* This class stores meta data for a given thread
|
|
244 |
*/
|
|
245 |
class TThreadData : public MByteStreamSerializable
|
|
246 |
{
|
|
247 |
public:
|
|
248 |
|
|
249 |
static const TInt KMaxThreadName = KMaxProcessName;
|
|
250 |
static const TInt KSCMThreadDataMaxSize = sizeof(TUint32) + sizeof(TUint16) + 11 * sizeof(TUint32) + 2 * sizeof(TUint64) + KMaxThreadName;
|
|
251 |
|
|
252 |
enum TThreadDataVersion { EThreadData1 = 1 };
|
|
253 |
TThreadData();
|
|
254 |
|
|
255 |
// from MByteStreamSerializable
|
|
256 |
virtual TInt Serialize(TByteStreamWriter& aWriter);
|
|
257 |
virtual TInt Deserialize(TByteStreamReader& aReader);
|
|
258 |
virtual TInt GetSize() const;
|
|
259 |
|
|
260 |
SCMStructId iId;
|
|
261 |
TInt32 iVersion;
|
|
262 |
TInt32 iPriority;
|
|
263 |
TUint64 iTid;
|
|
264 |
TUint64 iOwnerId;
|
|
265 |
TInt32 iSvcSP;
|
|
266 |
TInt32 iSvcStack;
|
|
267 |
TInt32 iSvcStacksize;
|
|
268 |
TInt32 iUsrSP;
|
|
269 |
TInt32 iUsrStack;
|
|
270 |
TInt32 iUsrStacksize;
|
|
271 |
TUint32 iNamesize;
|
|
272 |
TUint32 iLastCpu;
|
|
273 |
TInt32 iSvcHeap;
|
|
274 |
TInt32 iSvcHeapSize;
|
|
275 |
|
|
276 |
TBuf8<KMaxThreadName> iName;
|
|
277 |
|
|
278 |
TInt32 iSpare1;
|
|
279 |
TInt32 iSpare2;
|
|
280 |
};
|
|
281 |
|
|
282 |
/**
|
|
283 |
* This class stores the stack for a given thread. The type (user or supervisor) is given
|
|
284 |
* by iStackType. It will be followed by a TMemoryDump containing the stack
|
|
285 |
*/
|
|
286 |
class TThreadStack : public MByteStreamSerializable
|
|
287 |
{
|
|
288 |
public:
|
|
289 |
|
|
290 |
static const TInt KSCMThreadStackMaxSize = sizeof(TUint32) + sizeof(TUint16) + 2 * sizeof(TUint32) + sizeof(TUint64);
|
|
291 |
|
|
292 |
enum TThreadStackVersion { EStackVersion1 = 1 };
|
|
293 |
|
|
294 |
enum TThreadStackType
|
|
295 |
{
|
|
296 |
EUsrStack,
|
|
297 |
ESvrStack,
|
|
298 |
EIRQStack,
|
|
299 |
EFIQStack,
|
|
300 |
ELast
|
|
301 |
};
|
|
302 |
|
|
303 |
TThreadStack();
|
|
304 |
|
|
305 |
// from MByteStreamSerializable
|
|
306 |
virtual TInt Serialize(TByteStreamWriter& aWriter);
|
|
307 |
virtual TInt Deserialize(TByteStreamReader& aReader);
|
|
308 |
virtual TInt GetSize() const;
|
|
309 |
|
|
310 |
SCMStructId iId;
|
|
311 |
TThreadStackVersion iVersion;
|
|
312 |
TThreadStackType iStackType;
|
|
313 |
TUint64 iThreadId;
|
|
314 |
TUint32 iStackSize;
|
|
315 |
|
|
316 |
TInt32 iSpare1;
|
|
317 |
TInt32 iSpare2;
|
|
318 |
};
|
|
319 |
|
|
320 |
/**
|
|
321 |
* Stores the value of a given register and tells you its type
|
|
322 |
*/
|
|
323 |
class TRegisterValue : public MByteStreamSerializable
|
|
324 |
{
|
|
325 |
public:
|
|
326 |
|
|
327 |
static const TInt KSCMRegisterValueMaxSize = sizeof(TUint32) + sizeof(TUint16) + 2 * sizeof(TUint8) + sizeof(TUint16) + sizeof(TUint32) + 2 * sizeof(TUint64);
|
|
328 |
|
|
329 |
TRegisterValue();
|
|
330 |
|
|
331 |
enum TRegisterValueVersion { ERegisterValueVersion1 = 1 };
|
|
332 |
|
|
333 |
// from MByteStreamSerializable
|
|
334 |
virtual TInt Serialize(TByteStreamWriter& aWriter);
|
|
335 |
virtual TInt Deserialize(TByteStreamReader& aReader);
|
|
336 |
virtual TInt GetSize() const;
|
|
337 |
|
|
338 |
SCMStructId iId;
|
|
339 |
TRegisterValueVersion iVersion;
|
|
340 |
TInt64 iOwnId;
|
|
341 |
|
|
342 |
/**
|
|
343 |
* Same as Sym32_reginfod::rd_id
|
|
344 |
* if rid_class == ESYM_REG_CORE
|
|
345 |
* rd_id is one of rm_debug_api.h::TFunctionalityRegister
|
|
346 |
* else
|
|
347 |
* rd_id is CoProcessor number, eg 15 for ARM CP15
|
|
348 |
*/
|
|
349 |
TUint32 iType;
|
|
350 |
|
|
351 |
TUint8 iClass; //Same as Sym32_reginfod::rid_class
|
|
352 |
TUint16 iSubId; //used for coprocessors
|
|
353 |
|
|
354 |
/**
|
|
355 |
* Same as Sym32_reginfod::rd_repre
|
|
356 |
* ESYM_REG_8 == 0,
|
|
357 |
* ESYM_REG_16 == 1,
|
|
358 |
* ESYM_REG_32 == 2,
|
|
359 |
* ESYM_REG_64 == 3
|
|
360 |
*/
|
|
361 |
TUint8 iSize; //register size
|
|
362 |
|
|
363 |
// Register value
|
|
364 |
union
|
|
365 |
{
|
|
366 |
// Value of an 8 bit register
|
|
367 |
TUint8 iValue8;
|
|
368 |
|
|
369 |
// Value of a 16 bit register
|
|
370 |
TUint16 iValue16;
|
|
371 |
|
|
372 |
// Value of a 32 bit register
|
|
373 |
TUint32 iValue32;
|
|
374 |
|
|
375 |
// Value of a 64 bit register
|
|
376 |
TUint64 iValue64;
|
|
377 |
};
|
|
378 |
|
|
379 |
|
|
380 |
};
|
|
381 |
|
|
382 |
/**
|
|
383 |
* This class is a header for our register set.
|
|
384 |
*/
|
|
385 |
class TRegisterSet : public MByteStreamSerializable
|
|
386 |
{
|
|
387 |
public:
|
|
388 |
|
|
389 |
static const TInt KSCMRegisterSetMaxSize = sizeof(TUint32) + sizeof(TUint16) + sizeof(TUint32);
|
|
390 |
|
|
391 |
TRegisterSet();
|
|
392 |
|
|
393 |
enum TRegisterSetVersion { ETRegisterSetVersion1 = 1 };
|
|
394 |
|
|
395 |
// from MByteStreamSerializable
|
|
396 |
virtual TInt Serialize(TByteStreamWriter& aWriter);
|
|
397 |
virtual TInt Deserialize(TByteStreamReader& aReader);
|
|
398 |
virtual TInt GetSize() const;
|
|
399 |
|
|
400 |
TRegisterSetVersion iVersion;
|
|
401 |
SCMStructId iId;
|
|
402 |
TInt32 iNumRegisters;
|
|
403 |
};
|
|
404 |
|
|
405 |
/**
|
|
406 |
* This class describes a memory dump and will be followed by a TRawData
|
|
407 |
*/
|
|
408 |
class TMemoryDump : public MByteStreamSerializable
|
|
409 |
{
|
|
410 |
public:
|
|
411 |
|
|
412 |
static const TInt KSCMMemDumpMaxSize = sizeof(TUint32) + sizeof(TUint16) + 2 * sizeof(TUint32) + sizeof(TUint64);
|
|
413 |
|
|
414 |
enum TMemDumpVersionVersion { EMemDumpVersion1 = 1 };
|
|
415 |
|
|
416 |
TMemoryDump();
|
|
417 |
|
|
418 |
//From MByteStreamSerializable
|
|
419 |
virtual TInt Serialize(TByteStreamWriter& aWriter);
|
|
420 |
virtual TInt Deserialize(TByteStreamReader& aReader);
|
|
421 |
virtual TInt GetSize() const;
|
|
422 |
|
|
423 |
SCMStructId iId;
|
|
424 |
TMemDumpVersionVersion iVersion;
|
|
425 |
TUint32 iStartAddress;
|
|
426 |
|
|
427 |
TInt64 iPid;
|
|
428 |
TInt32 iLength;
|
|
429 |
};
|
|
430 |
|
|
431 |
/**
|
|
432 |
* class to represent a set of code segs corrosponding to a given process
|
|
433 |
*/
|
|
434 |
class TCodeSegmentSet : public MByteStreamSerializable
|
|
435 |
{
|
|
436 |
public:
|
|
437 |
|
|
438 |
static const TInt KSCMCodeSegSetMaxSize = KMaxProcessName;
|
|
439 |
|
|
440 |
TCodeSegmentSet();
|
|
441 |
|
|
442 |
enum TCodeSegmentSetVersion { ETCodeSegmentSetVersion1 = 1 };
|
|
443 |
|
|
444 |
// from MByteStreamSerializable
|
|
445 |
virtual TInt Serialize(TByteStreamWriter& aWriter);
|
|
446 |
virtual TInt Deserialize(TByteStreamReader& aReader);
|
|
447 |
virtual TInt GetSize() const;
|
|
448 |
|
|
449 |
TInt GetMaxSize() const;
|
|
450 |
|
|
451 |
SCMStructId iId; /**< Id that uniquely identifies this data */
|
|
452 |
TCodeSegmentSetVersion iVersion; /**< Version of this data */
|
|
453 |
TInt32 iNumSegs; /**< The number of code segments following this struct that relate to this process ID */
|
|
454 |
TInt64 iPid; /**< Process Id that owns the following code segments */
|
|
455 |
};
|
|
456 |
|
|
457 |
/**
|
|
458 |
* class to represent a code segment in the SCM Log
|
|
459 |
*/
|
|
460 |
class TCodeSegment : public MByteStreamSerializable
|
|
461 |
{
|
|
462 |
public:
|
|
463 |
|
|
464 |
static const TInt KMaxSegmentNameSize = KMaxProcessName;
|
|
465 |
|
|
466 |
//50 is the sum of the size of members that get serialised
|
|
467 |
static const TInt KSCMCodeSegMaxSize = 50 + KMaxSegmentNameSize;
|
|
468 |
|
|
469 |
TCodeSegment();
|
|
470 |
|
|
471 |
enum TCodeSegmentVersion { ETCodeSegmentVersion1 = 1 };
|
|
472 |
|
|
473 |
// from MByteStreamSerializable
|
|
474 |
virtual TInt Serialize(TByteStreamWriter& aWriter);
|
|
475 |
virtual TInt Deserialize(TByteStreamReader& aReader);
|
|
476 |
virtual TInt GetSize() const;
|
|
477 |
|
|
478 |
TInt GetMaxSize() const;
|
|
479 |
|
|
480 |
SCMStructId iId; /**< Id that uniquely identifies this data */
|
|
481 |
TCodeSegmentVersion iVersion; /**< Version of this data */
|
|
482 |
TCodeSegType iCodeSegType; /**< @see TCodeSegType */
|
|
483 |
TModuleMemoryInfo iCodeSegMemInfo; /**< holds the memory info for this code segment (8 TUint32's)*/
|
|
484 |
TBool iXip; /**< If this code segment is XIP */
|
|
485 |
TInt32 iNameLength; /**< Length of the name of this code segment name */
|
|
486 |
TBuf8<KMaxSegmentNameSize> iName; /**< Name of this code segment */
|
|
487 |
|
|
488 |
};
|
|
489 |
|
|
490 |
/**
|
|
491 |
* This class represents a trace dump in the crash log. It will be immediately followed
|
|
492 |
* in the crash log by a TRawData structure
|
|
493 |
*/
|
|
494 |
class TTraceDump : public MByteStreamSerializable
|
|
495 |
{
|
|
496 |
public:
|
|
497 |
|
|
498 |
static const TInt KSCMTraceDumpMaxSize = sizeof(TUint32) + sizeof(TUint16) + 2 * sizeof(TUint32);
|
|
499 |
|
|
500 |
TTraceDump();
|
|
501 |
|
|
502 |
enum TTraceDumpVersion { ETraceDumpVersion1 = 1 };
|
|
503 |
|
|
504 |
// from MByteStreamSerializable
|
|
505 |
virtual TInt Serialize(TByteStreamWriter& aWriter);
|
|
506 |
virtual TInt Deserialize(TByteStreamReader& aReader);
|
|
507 |
virtual TInt GetSize() const;
|
|
508 |
|
|
509 |
SCMStructId iId; /**< Id that uniquely identifies this data */
|
|
510 |
TTraceDumpVersion iVersion; /**< Version of this data */
|
|
511 |
TInt32 iSizeOfMemory; /**< Size of the trace data that will be dumped in the following Memory Dump */
|
|
512 |
TInt32 iNumberOfParts; /**< Number of TRawData structs that will follow */
|
|
513 |
|
|
514 |
};
|
|
515 |
|
|
516 |
/**
|
|
517 |
* This represents variant specific data in the crash log. It will be followed
|
|
518 |
* immediately by a TRawData that contains the data
|
|
519 |
*/
|
|
520 |
class TVariantSpecificData : public MByteStreamSerializable
|
|
521 |
{
|
|
522 |
public:
|
|
523 |
|
|
524 |
//sizeof(TUint32) + sizeof(TUint16) + sizeof(TUint32)
|
|
525 |
static const TInt KSCMVarSpecMaxSize = 10;
|
|
526 |
|
|
527 |
TVariantSpecificData();
|
|
528 |
|
|
529 |
enum TVariantSpecificDataVersion { EVariantSpecificDataVersion1 = 1 };
|
|
530 |
|
|
531 |
// from MByteStreamSerializable
|
|
532 |
virtual TInt Serialize(TByteStreamWriter& aWriter);
|
|
533 |
virtual TInt Deserialize(TByteStreamReader& aReader);
|
|
534 |
virtual TInt GetSize() const;
|
|
535 |
|
|
536 |
SCMStructId iId; /**< Id that uniquely identifies this data */
|
|
537 |
TVariantSpecificDataVersion iVersion; /**< Version of this data */
|
|
538 |
TUint32 iSize; /**< Size of the raw data (ie the var spec info) that will follow */
|
|
539 |
};
|
|
540 |
|
|
541 |
/**
|
|
542 |
* This represents the Rom Header Data in the crash Log
|
|
543 |
*/
|
|
544 |
class TRomHeaderData : public MByteStreamSerializable
|
|
545 |
{
|
|
546 |
public:
|
|
547 |
|
|
548 |
static const TInt KSCMRomHdrMaxSize = sizeof(TUint32) + sizeof(TUint16) + sizeof(TUint64) + 2 * sizeof(TUint8) +sizeof(TUint16);
|
|
549 |
|
|
550 |
TRomHeaderData();
|
|
551 |
|
|
552 |
enum TRomHeaderDataVersion { ERomHeaderDataVersion1 = 1 };
|
|
553 |
|
|
554 |
// from MByteStreamSerializable
|
|
555 |
virtual TInt Serialize(TByteStreamWriter& aWriter);
|
|
556 |
virtual TInt Deserialize(TByteStreamReader& aReader);
|
|
557 |
virtual TInt GetSize() const;
|
|
558 |
|
|
559 |
SCMStructId iId; /**< Id that uniquely identifies this data */
|
|
560 |
TRomHeaderDataVersion iVersion; /**< Version of this data */
|
|
561 |
TUint8 iMajorVersion; /**< Major Version of ROM build */
|
|
562 |
TUint8 iMinorVersion; /**< Minor Version of ROM build */
|
|
563 |
TUint16 iBuildNumber; /**< ROM build number */
|
|
564 |
TUint64 iTime; /**< Build time of ROM in miliseconds */
|
|
565 |
};
|
|
566 |
|
|
567 |
/**
|
|
568 |
* This represents the kernel lock info in the crash log
|
|
569 |
*/
|
|
570 |
class TSCMLockData : public MByteStreamSerializable
|
|
571 |
{
|
|
572 |
public:
|
|
573 |
|
|
574 |
static const TInt KSCMLockDataMaxSize = sizeof(TUint32) + 3 * sizeof(TUint16);
|
|
575 |
|
|
576 |
TSCMLockData();
|
|
577 |
|
|
578 |
// from MByteStreamSerializable
|
|
579 |
virtual TInt Serialize(TByteStreamWriter& aWriter);
|
|
580 |
virtual TInt Deserialize(TByteStreamReader& aReader);
|
|
581 |
virtual TInt GetSize() const;
|
|
582 |
|
|
583 |
TInt MutexHoldCount() const;
|
|
584 |
void SetMutexHoldCount(TInt aMutexHoldCount);
|
|
585 |
|
|
586 |
TInt MutexThreadWaitCount() const;
|
|
587 |
void SetMutexThreadWaitCount(TInt aMutexThreadWaitCount);
|
|
588 |
|
|
589 |
TInt LockCount() const;
|
|
590 |
void SetLockCount(TInt aLockCount);
|
|
591 |
|
|
592 |
TBool operator == (const TSCMLockData& aOther) const;
|
|
593 |
TBool operator != (const TSCMLockData& aOther) const;
|
|
594 |
|
|
595 |
private:
|
|
596 |
SCMStructId iId;
|
|
597 |
TInt iMutexHoldCount; // if mutex is valid number of holds on the mutex from current thread
|
|
598 |
TInt iMutexThreadWaitCount; // if mutex is valid number of threads waiting on the mutex
|
|
599 |
TInt iLockCount;
|
|
600 |
|
|
601 |
};
|
|
602 |
|
|
603 |
/**
|
|
604 |
* TScmChecksum class is used to provide a level of sanity checking for the data it processes
|
|
605 |
* the check sum produced is not intended to be computationally unique
|
|
606 |
* This implementation has been chosen as there are restrictions in the data may only be available
|
|
607 |
* in small chunks and the entire data may not be unable to be read (ie comm port implementation)
|
|
608 |
* These restrictions rule out the use of more sophisticated checksums that produce a checksum value for
|
|
609 |
* an entire block of data
|
|
610 |
*/
|
|
611 |
class TScmChecksum : MByteStreamSerializable
|
|
612 |
{
|
|
613 |
public:
|
|
614 |
TScmChecksum();
|
|
615 |
|
|
616 |
void ChecksumBlock(const TUint8* aData, TUint aLen);
|
|
617 |
void ChecksumBlock(const TDesC8& aDes);
|
|
618 |
TBool operator == (const TScmChecksum& aOther) const;
|
|
619 |
TBool operator != (const TScmChecksum& aOther) const;
|
|
620 |
void Reset();
|
|
621 |
|
|
622 |
// from MByteStreamSerializable
|
|
623 |
TInt Serialize(TByteStreamWriter& aWriter);
|
|
624 |
TInt Deserialize(TByteStreamReader& aReader);
|
|
625 |
TInt GetSize() const;
|
|
626 |
|
|
627 |
private:
|
|
628 |
/** Total length of all data in bytes*/
|
|
629 |
TUint32 iLength;
|
|
630 |
/** Sum of all bytes*/
|
|
631 |
TUint32 iSum;
|
|
632 |
/** Count of Bytes with value 0*/
|
|
633 |
TUint32 iZeroCount;
|
|
634 |
|
|
635 |
};
|
|
636 |
|
|
637 |
/** class to describe a flash block */
|
|
638 |
class SCMCrashBlockEntry
|
|
639 |
{
|
|
640 |
public:
|
|
641 |
|
|
642 |
SCMCrashBlockEntry()
|
|
643 |
: iBlockNumber(0)
|
|
644 |
, iBlockOffset(0)
|
|
645 |
, iBlockSize(0)
|
|
646 |
, iNext(NULL)
|
|
647 |
{
|
|
648 |
|
|
649 |
}
|
|
650 |
|
|
651 |
SCMCrashBlockEntry(TInt aBlockNumber, TInt aBlockOffset, TInt aBlockSize)
|
|
652 |
: iBlockNumber(aBlockNumber)
|
|
653 |
, iBlockOffset(aBlockOffset)
|
|
654 |
, iBlockSize(aBlockSize)
|
|
655 |
, iNext(NULL)
|
|
656 |
{
|
|
657 |
|
|
658 |
}
|
|
659 |
|
|
660 |
/** The offset in bytes to this block from start of flash*/
|
|
661 |
TInt iBlockNumber;
|
|
662 |
/** The offset in bytes to this block from start of flash*/
|
|
663 |
TInt iBlockOffset;
|
|
664 |
/** the size of the flash block in bytes */
|
|
665 |
TInt iBlockSize;
|
|
666 |
/** pointer to next in list*/
|
|
667 |
SCMCrashBlockEntry* iNext;
|
|
668 |
|
|
669 |
};
|
|
670 |
|
|
671 |
/** Because of limitations in flash memory driver available to the
|
|
672 |
* system crash monitor - this class is used to describe the locations
|
|
673 |
* on flash where crashes will be stored
|
|
674 |
* we store 1 crash per block of flash ! This eliminates the
|
|
675 |
* need to for the scmonitor to hold memory required for bufering write data to flash
|
|
676 |
* class used to describe locations (typically in flash)
|
|
677 |
* where
|
|
678 |
* holds a linked list of SCMCrashBlockEntry which describe an area we can write to
|
|
679 |
*/
|
|
680 |
class SCMMultiCrashInfo
|
|
681 |
{
|
|
682 |
public:
|
|
683 |
|
|
684 |
/** constructor */
|
|
685 |
SCMMultiCrashInfo();
|
|
686 |
|
|
687 |
/** destructor */
|
|
688 |
~SCMMultiCrashInfo();
|
|
689 |
|
|
690 |
/** add a pointer to a block to the list - takes ownership of block */
|
|
691 |
void AddBlock(SCMCrashBlockEntry* aBlockEntry);
|
|
692 |
|
|
693 |
/** GetNextBlock returns NULL when no more blocks */
|
|
694 |
SCMCrashBlockEntry* GetNextBlock();
|
|
695 |
|
|
696 |
/** sets current block to first in list */
|
|
697 |
void Reset();
|
|
698 |
|
|
699 |
/** clear all entries in the list */
|
|
700 |
void ClearList();
|
|
701 |
|
|
702 |
|
|
703 |
private:
|
|
704 |
SCMCrashBlockEntry* iFirstBlock;
|
|
705 |
SCMCrashBlockEntry* iCurrentBlock;
|
|
706 |
TInt iSpare;
|
|
707 |
};
|
|
708 |
|
|
709 |
/**
|
|
710 |
* This constant gives us the maximum size of the Core Crash Header which consists of the Crash Info, the Offsets
|
|
711 |
* Header and the Core Registers
|
|
712 |
*/
|
|
713 |
static const TInt KMaxCoreHeaderSize = TCrashInfoHeader::KSCMCrashInfoMaxSize //Crash Info - always there
|
|
714 |
+ TCrashOffsetsHeader::KSCMCrashOffsetsMaxSize //offsets header - optional
|
|
715 |
+ TRegisterSet::KSCMRegisterSetMaxSize //The crash context - always there
|
|
716 |
+ TRegisterValue::KSCMRegisterValueMaxSize * 37; //could be up to 37 register values
|
|
717 |
|
|
718 |
}
|
|
719 |
|
|
720 |
#endif //__SCMDATATYPES_H_INCLUDED__
|
|
721 |
|
|
722 |
//eof scmdatatypes.h
|