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 // Hardware Configuration Repository Platform Independent Layer (PIL)
15 // Contains debugging macros used in PIL and PSL source code of HCR.
26 #include <kernel/kernel.h>
29 // MACROs for log statements in code
34 #define HCR_LOG0(_text) __KTRACE_OPT(KHCR, Kern::Printf("=== "_text))
35 #define HCR_LOG1(_text, _a1) __KTRACE_OPT(KHCR, Kern::Printf("... "_text, (_a1)))
39 #define HCR_LOG0(_text)
40 #define HCR_LOG1(_text, _a1)
46 // MACROs for trace statements in code
51 #define HCR_TRACE0(_text) Kern::Printf((_text))
52 #define HCR_TRACE1(_text, _a1) Kern::Printf((_text), (_a1))
53 #define HCR_TRACE2(_text, _a1, _a2) Kern::Printf((_text), (_a1), (_a2))
54 #define HCR_TRACE3(_text, _a1, _a2, _a3) Kern::Printf((_text), (_a1), (_a2), (_a3))
55 #define HCR_TRACE4(_text, _a1, _a2, _a3, _a4) Kern::Printf((_text), (_a1), (_a2), (_a3), (_a4))
56 #define HCR_TRACE5(_text, _a1, _a2, _a3, _a4, _a5) Kern::Printf((_text), (_a1), (_a2), (_a3), (_a4), (_a5))
57 #define HCR_TRACE6(_text, _a1, _a2, _a3, _a4, _a5, _a6) Kern::Printf((_text), (_a1), (_a2), (_a3), (_a4), (_a5), (_a6))
58 #define HCR_TRACE_RETURN(_r1) return (Kern::Printf("!-- Function exit return(%d) (%s:%d)", (_r1), __FILE__, __LINE__), _r1)
59 #define HCR_TRACEMSG_RETURN(_s1, _r1) return (Kern::Printf("!-- "_s1" (%d)", (_r1)), _r1)
60 #define HCR_FUNC(_text) TEntryExit _entryexit(_text)
62 #define HCR_HEX_DUMP_ABS(_address, _length) HexDump((_address), (_length)); //Hex dump with absolute address
63 #define HCR_HEX_DUMP_REL(_address, _length) HexDump((_address), (_length), EFalse); //Hex dump with relative (from) address
68 inline TEntryExit(const char *aFn);
75 TEntryExit::TEntryExit(const char* aFn)
78 HCR_TRACE1("--> %s " , iName);
81 TEntryExit::~TEntryExit()
83 HCR_TRACE1("<-- %s " , iName);
87 void HexDump(TUint8* aStartAddress, TUint32 aLength, TBool aAbsolute = ETrue);
92 #define HCR_TRACE0(_text) __KTRACE_OPT(KHCR, Kern::Printf((_text)))
93 #define HCR_TRACE1(_text, _a1) __KTRACE_OPT(KHCR, Kern::Printf((_text), (_a1)))
94 #define HCR_TRACE2(_text, _a1, _a2) __KTRACE_OPT(KHCR, Kern::Printf((_text), (_a1), (_a2)))
95 #define HCR_TRACE3(_text, _a1, _a2, _a3) __KTRACE_OPT(KHCR, Kern::Printf((_text), (_a1), (_a2), (_a3)))
96 #define HCR_TRACE4(_text, _a1, _a2, _a3, _a4) __KTRACE_OPT(KHCR, Kern::Printf((_text), (_a1), (_a2), (_a3), (_a4)))
97 #define HCR_TRACE5(_text, _a1, _a2, _a3, _a4, _a5) __KTRACE_OPT(KHCR, Kern::Printf((_text), (_a1), (_a2), (_a3), (_a4), (_a5)))
98 #define HCR_TRACE6(_text, _a1, _a2, _a3, _a4, _a5, _a6) __KTRACE_OPT(KHCR, Kern::Printf((_text), (_a1), (_a2), (_a3), (_a4), (_a5), (_a6)))
99 #define HCR_TRACE_RETURN(_r1) { __KTRACE_OPT(KHCR, Kern::Printf("!-- Function exit return(%d) (%s:%d)", (_r1), __FILE__, __LINE__)); return (_r1);}
100 #define HCR_TRACEMSG_RETURN(_s1, _r1) { __KTRACE_OPT(KHCR, Kern::Printf("!-- "_s1" (%d)", (_r1))); return (_r1);}
101 #define HCR_FUNC(_text)
103 #define HCR_HEX_DUMP_ABS(_address, _length)
104 #define HCR_HEX_DUMP_REL(_address, _length)
109 #endif // HCR_DEBUG_H