1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
2 // All rights reserved. |
3 // This component and the accompanying materials are made available |
3 // This component and the accompanying materials are made available |
4 // under the terms of the License "ARM EABI LICENCE.txt" |
4 // under the terms of the License "ARM EABI LICENCE.txt" |
5 // which accompanies this distribution, and is available |
5 // which accompanies this distribution, and is available |
6 // in kernel/eka/compsupp. |
6 // in kernel/eka/compsupp. |
37 |
37 |
38 TInt CallThrdProcEntry(TInt (*aFn)(void*), void* aPtr, TInt aNotFirst) |
38 TInt CallThrdProcEntry(TInt (*aFn)(void*), void* aPtr, TInt aNotFirst) |
39 { |
39 { |
40 TCppRTExceptionsGlobals aExceptionGlobals; |
40 TCppRTExceptionsGlobals aExceptionGlobals; |
41 |
41 |
|
42 #if ENABLE_2ND_EMERGENCY_BUFFER |
|
43 aExceptionGlobals.Init2ndEmergencyBuffer(); |
|
44 #endif |
|
45 |
42 if (!aNotFirst) |
46 if (!aNotFirst) |
43 { |
47 { |
44 // Init statics for implicitly linked DLLs |
48 // Init statics for implicitly linked DLLs |
45 User::InitProcess(); |
49 User::InitProcess(); |
46 |
50 |
47 // Init statics for EXE |
|
48 //pick up export table if we're an exexp |
51 //pick up export table if we're an exexp |
49 __DLL_Export_Table__(); |
52 __DLL_Export_Table__(); |
|
53 // Init statics for EXE |
50 __cpp_initialize__aeabi_(); |
54 __cpp_initialize__aeabi_(); |
51 } |
55 } |
52 #ifdef __LEAVE_EQUALS_THROW__ |
56 #ifdef __LEAVE_EQUALS_THROW__ |
53 TInt r = KErrNone; |
57 TInt r = KErrNone; |
54 |
58 |
55 try { |
59 try { |
56 r = aNotFirst ? (*aFn)(aPtr) : E32Main(); |
60 r = aNotFirst ? (*aFn)(aPtr) : E32Main(); |
|
61 #if ENABLE_2ND_EMERGENCY_BUFFER |
|
62 aExceptionGlobals.Kill2ndEmergencyBuffer(); |
|
63 #endif |
57 } |
64 } |
58 catch (XLeaveException&) |
65 catch (XLeaveException&) |
59 { |
66 { |
|
67 #if ENABLE_2ND_EMERGENCY_BUFFER |
|
68 aExceptionGlobals.Kill2ndEmergencyBuffer(); |
|
69 #endif |
60 User::Panic(KLitUser, EUserLeaveWithoutTrap); |
70 User::Panic(KLitUser, EUserLeaveWithoutTrap); |
61 } |
71 } |
62 |
72 |
63 return r; |
73 return r; |
64 #else |
74 #else |