diff -r 000000000000 -r bde4ae8d615e os/kernelhwsrv/kernel/eka/drivers/debug/smdebug/d_sm_staticinfo.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/os/kernelhwsrv/kernel/eka/drivers/debug/smdebug/d_sm_staticinfo.cpp Fri Jun 15 03:10:57 2012 +0200 @@ -0,0 +1,84 @@ +// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of the License "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// Responsible for dealing with static info in the Stop Mode framework +// + +/** + * @file + * @internalComponent + * @prototype + */ + +#ifdef __LAUNCH_AS_EXTENSION__ + +#include +#include +#include +#include "d_rmd_breakpoints.h" + +using namespace Debug; + +const TInt KBUFSIZE = 128; + +/** + * Stop Mode routine to retrieve the static info and place it in the response buffer + * @param aItem List item describing the list + * @return One of the system wide error codes + */ +TInt StopModeDebug::GetStaticInfo(const TListItem* aItem, bool aCheckConsistent) + { + __KTRACE_OPT(KDEBUGGER,Kern::Printf("\nDumping the static information")); + + if(aItem->iListScope != EScopeGlobal) + { + return KErrArgument; //No other scope makes sense for static info + } + + TUint8* buffer = (TUint8*)aItem->iBufferAddress; + TUint8* bufferPos = Align4(buffer + sizeof(TListReturn)); + TUint8* bufferEnd = buffer + aItem->iBufferSize; + + TListReturn* listResp = (TListReturn*)buffer; + listResp->iReqNo = EStaticInfo; + listResp->iNumberItems = 1; //there in only one structure of TStaticListEntry + listResp->iDataSize = sizeof(TStaticListEntry); + + if (bufferPos < bufferEnd) + { + // making sure we have enough space to write the static info + TStaticListEntry& entry = *(TStaticListEntry*)(bufferPos); + + // build version and rom build time + TRomHeader rHdr = Epoc::RomHeader(); + entry.iTime = rHdr.iTime; + entry.iBuildNumber = rHdr.iVersion.iBuild; + entry.iMajorVersion = rHdr.iVersion.iMajor; + entry.iMinorVersion = rHdr.iVersion.iMinor; + + //Number of CPUs + entry.iCpuNumbers = NKern::NumberOfCpus(); + + TBuf bufTime64; + bufTime64.Num(rHdr.iTime); + + __KTRACE_OPT(KDEBUGGER,Kern::Printf("Version%d.%02d(%03d) %d", rHdr.iVersion.iMajor, rHdr.iVersion.iMinor, rHdr.iVersion.iBuild)); + __KTRACE_OPT(KDEBUGGER,Kern::Printf("Build Time %S ms", &bufTime64)); + __KTRACE_OPT(KDEBUGGER,Kern::Printf("Number of CPUs in the system: %d", entry.iCpuNumbers)); + } + + return KErrNone; + } + +#endif +