|
1 // Copyright (c) 1997-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 "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 // |
|
15 |
|
16 |
|
17 /** @file |
|
18 * |
|
19 * Implements the startup code for C32 server |
|
20 */ |
|
21 |
|
22 #include "CS_STD.H" |
|
23 #include <e32svr.h> |
|
24 #include "C32LOG.H" |
|
25 |
|
26 _LIT(KC32FaultReason, "C32-fault"); |
|
27 |
|
28 GLDEF_C void Fault(TECommFault aFault, TRefByValue<const TDesC8> aFmt, ...) |
|
29 /** |
|
30 Panic the server |
|
31 If the supplied aFmt defaults to a blank string, we don't check here since |
|
32 we can't actually evaluate the TRefByValue string here. |
|
33 If using Fault in __ASSERT_ALWAYS or other release code, make sure not to provide log strings |
|
34 since these will use up ROM space. |
|
35 (For a time we did check for blank strings instead inside the printf, but this became |
|
36 too hard once we started writing worker id too - so now on fault there will come a blank line |
|
37 in many cases - not such a big deal) |
|
38 |
|
39 * @param aFault Fault code as defined in cs_std.h |
|
40 */ |
|
41 { |
|
42 #ifdef __FLOG_ACTIVE |
|
43 VA_LIST list; |
|
44 VA_START(list,aFmt); |
|
45 C32_STATIC_LOG2(KC32Warning,aFmt,list); |
|
46 VA_END (list); |
|
47 #else |
|
48 (void)aFmt; |
|
49 #endif |
|
50 User::Panic(KC32FaultReason, aFault); |
|
51 } |
|
52 |
|
53 |
|
54 GLDEF_C void Fault(TECommFault aFault, TRefByValue<const TDesC16> aFmt, ...) |
|
55 /** |
|
56 Panic the server |
|
57 If the supplied aFmt defaults to a blank string, we don't check here since |
|
58 we can't actually evaluate the TRefByValue string here. |
|
59 If using Fault in __ASSERT_ALWAYS or other release code, make sure not to provide log strings |
|
60 since these will use up ROM space. |
|
61 (For a time we did check for blank strings instead inside the printf, but this became |
|
62 too hard once we started writing worker id too - so now on fault there will come a blank line |
|
63 in many cases - not such a big deal) |
|
64 * @param aFault Fault code as defined in cs_std.h |
|
65 */ |
|
66 { |
|
67 #ifdef __FLOG_ACTIVE |
|
68 VA_LIST list; |
|
69 VA_START(list,aFmt); |
|
70 C32_STATIC_LOG2(KC32Warning,aFmt,list); |
|
71 VA_END (list); |
|
72 #else |
|
73 (void)aFmt; |
|
74 #endif |
|
75 User::Panic(KC32FaultReason, aFault); |
|
76 } |
|
77 |
|
78 // EOF - CS_UTL.CPP |