author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Fri, 17 Sep 2010 08:37:04 +0300 | |
changeset 266 | 0008ccd16016 |
parent 0 | a41df078684a |
permissions | -rw-r--r-- |
266
0008ccd16016
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1 |
// Copyright (c) 2004-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 "ARM EABI LICENCE.txt" |
|
5 |
// which accompanies this distribution, and is available |
|
6 |
// in kernel/eka/compsupp. |
|
7 |
// |
|
8 |
// Initial Contributors: |
|
9 |
// Nokia Corporation - initial contribution. |
|
10 |
// |
|
11 |
// Contributors: |
|
12 |
// |
|
13 |
// Description: |
|
14 |
// e32\compsupp\symaehabi\callfirstprocessfn.cpp |
|
15 |
// |
|
16 |
// |
|
17 |
||
18 |
#include "unwind_env.h" |
|
19 |
#include "unwinder.h" |
|
20 |
#include "symbian_support.h" |
|
21 |
#include <e32panic.h> |
|
22 |
||
23 |
#ifdef __LEAVE_EQUALS_THROW__ |
|
24 |
_LIT(KLitUser,"USER"); |
|
25 |
#endif |
|
26 |
||
27 |
TInt E32Main(); |
|
28 |
||
29 |
#ifdef __KERNEL_MODE__ |
|
30 |
#error This file should not be compiled in kernel mode |
|
31 |
#endif |
|
32 |
||
33 |
extern "C" { |
|
34 |
||
35 |
void __cpp_initialize__aeabi_(); |
|
36 |
void __DLL_Export_Table__(); |
|
37 |
||
38 |
TInt CallThrdProcEntry(TInt (*aFn)(void*), void* aPtr, TInt aNotFirst) |
|
39 |
{ |
|
40 |
TCppRTExceptionsGlobals aExceptionGlobals; |
|
41 |
||
266
0008ccd16016
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
42 |
#if ENABLE_2ND_EMERGENCY_BUFFER |
0008ccd16016
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
43 |
aExceptionGlobals.Init2ndEmergencyBuffer(); |
0008ccd16016
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
44 |
#endif |
0008ccd16016
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
45 |
|
0 | 46 |
if (!aNotFirst) |
47 |
{ |
|
48 |
// Init statics for implicitly linked DLLs |
|
49 |
User::InitProcess(); |
|
50 |
||
51 |
//pick up export table if we're an exexp |
|
52 |
__DLL_Export_Table__(); |
|
266
0008ccd16016
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
53 |
// Init statics for EXE |
0 | 54 |
__cpp_initialize__aeabi_(); |
55 |
} |
|
56 |
#ifdef __LEAVE_EQUALS_THROW__ |
|
57 |
TInt r = KErrNone; |
|
58 |
||
59 |
try { |
|
60 |
r = aNotFirst ? (*aFn)(aPtr) : E32Main(); |
|
266
0008ccd16016
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
61 |
#if ENABLE_2ND_EMERGENCY_BUFFER |
0008ccd16016
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
62 |
aExceptionGlobals.Kill2ndEmergencyBuffer(); |
0008ccd16016
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
63 |
#endif |
0 | 64 |
} |
65 |
catch (XLeaveException&) |
|
66 |
{ |
|
266
0008ccd16016
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
67 |
#if ENABLE_2ND_EMERGENCY_BUFFER |
0008ccd16016
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
68 |
aExceptionGlobals.Kill2ndEmergencyBuffer(); |
0008ccd16016
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
69 |
#endif |
0 | 70 |
User::Panic(KLitUser, EUserLeaveWithoutTrap); |
71 |
} |
|
72 |
||
73 |
return r; |
|
74 |
#else |
|
75 |
return aNotFirst ? (*aFn)(aPtr) : E32Main(); |
|
76 |
#endif |
|
77 |
} |
|
78 |
} |