author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Thu, 02 Sep 2010 21:54:16 +0300 | |
changeset 259 | 57b9594f5772 |
parent 0 | a41df078684a |
child 257 | 3e88ff8f41d5 |
permissions | -rw-r--r-- |
259
57b9594f5772
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1 |
// Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). |
0 | 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 |
// Responsible for dealing with static info in the Stop Mode framework |
|
15 |
// |
|
16 |
||
17 |
/** |
|
18 |
* @file |
|
19 |
* @internalComponent |
|
20 |
* @prototype |
|
21 |
*/ |
|
22 |
||
23 |
#include <sm_debug_api.h> |
|
24 |
#include <e32rom.h> |
|
25 |
||
26 |
using namespace Debug; |
|
27 |
||
28 |
const TInt KBUFSIZE = 128; |
|
29 |
||
30 |
/** |
|
31 |
* Stop Mode routine to retrieve the static info and place it in the response buffer |
|
32 |
* @param aItem List item describing the list |
|
33 |
* @return One of the system wide error codes |
|
34 |
*/ |
|
35 |
TInt StopModeDebug::GetStaticInfo(const TListItem* aItem, bool aCheckConsistent) |
|
36 |
{ |
|
37 |
__KTRACE_OPT(KDEBUGGER,Kern::Printf("\nDumping the static information")); |
|
38 |
||
39 |
if(aItem->iListScope != EScopeGlobal) |
|
40 |
{ |
|
41 |
return KErrArgument; //No other scope makes sense for static info |
|
42 |
} |
|
43 |
||
44 |
TUint8* buffer = (TUint8*)aItem->iBufferAddress; |
|
45 |
TUint8* bufferPos = Align4(buffer + sizeof(TListReturn)); |
|
46 |
TUint8* bufferEnd = buffer + aItem->iBufferSize; |
|
47 |
||
48 |
TListReturn* listResp = (TListReturn*)buffer; |
|
49 |
listResp->iReqNo = EStaticInfo; |
|
50 |
listResp->iNumberItems = 1; //there in only one structure of TStaticListEntry |
|
51 |
listResp->iDataSize = sizeof(TStaticListEntry); |
|
52 |
||
53 |
if (bufferPos < bufferEnd) |
|
54 |
{ |
|
55 |
// making sure we have enough space to write the static info |
|
56 |
TStaticListEntry& entry = *(TStaticListEntry*)(bufferPos); |
|
57 |
||
58 |
// build version and rom build time |
|
59 |
TRomHeader rHdr = Epoc::RomHeader(); |
|
60 |
entry.iTime = rHdr.iTime; |
|
61 |
entry.iBuildNumber = rHdr.iVersion.iBuild; |
|
62 |
entry.iMajorVersion = rHdr.iVersion.iMajor; |
|
63 |
entry.iMinorVersion = rHdr.iVersion.iMinor; |
|
64 |
||
65 |
//Number of CPUs |
|
66 |
entry.iCpuNumbers = NKern::NumberOfCpus(); |
|
67 |
||
68 |
TBuf<KBUFSIZE> bufTime64; |
|
69 |
bufTime64.Num(rHdr.iTime); |
|
70 |
||
71 |
__KTRACE_OPT(KDEBUGGER,Kern::Printf("Version%d.%02d(%03d) %d", rHdr.iVersion.iMajor, rHdr.iVersion.iMinor, rHdr.iVersion.iBuild)); |
|
72 |
__KTRACE_OPT(KDEBUGGER,Kern::Printf("Build Time %S ms", &bufTime64)); |
|
73 |
__KTRACE_OPT(KDEBUGGER,Kern::Printf("Number of CPUs in the system: %d", entry.iCpuNumbers)); |
|
74 |
} |
|
75 |
||
76 |
return KErrNone; |
|
77 |
} |
|
78 |
||
79 |