author | arunabha |
Thu, 19 Nov 2009 19:10:45 +0000 | |
branch | GCCE_COMPATIBILITY |
changeset 3 | 9a3ffdc955cd |
parent 0 | a41df078684a |
permissions | -rw-r--r-- |
0 | 1 |
// Copyright (c) 1998-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". |
|
7 |
// |
|
8 |
// Initial Contributors: |
|
9 |
// Nokia Corporation - initial contribution. |
|
10 |
// |
|
11 |
// Contributors: |
|
12 |
// |
|
13 |
// Description: |
|
14 |
// e32\kernel\arm\x_entry.cpp |
|
15 |
// |
|
16 |
// |
|
17 |
||
18 |
#include <kernel/klib.h> |
|
19 |
||
20 |
GLREF_C TInt KernelModuleEntry(TInt); |
|
21 |
||
22 |
extern "C" { |
|
23 |
||
24 |
#if defined(__GCC32__) |
|
25 |
||
26 |
typedef void (*PFV)(); |
|
27 |
||
28 |
extern PFV __CTOR_LIST__[]; |
|
29 |
||
30 |
GLDEF_C TInt _E32Dll_Body(TInt aReason) |
|
31 |
// |
|
32 |
// Call extension global constructors |
|
33 |
// |
|
34 |
{ |
|
35 |
if (aReason==KModuleEntryReasonExtensionInit1) |
|
36 |
{ |
|
37 |
TUint i=1; |
|
38 |
while (__CTOR_LIST__[i]) |
|
39 |
(*__CTOR_LIST__[i++])(); |
|
40 |
} |
|
41 |
return KernelModuleEntry(aReason); |
|
42 |
} |
|
43 |
||
3
9a3ffdc955cd
Bug 341 - [GCCE] Enabling support for gcce in cia files
arunabha
parents:
0
diff
changeset
|
44 |
#elif defined(__EABI__) |
0 | 45 |
|
46 |
void __DLL_Export_Table__(void); |
|
47 |
void __cpp_initialize__aeabi_(); |
|
48 |
||
49 |
// The compiler generates calls to this when it reckons a top-level construction |
|
50 |
// needs destruction. But the kernel never will need this so, define it as a nop |
|
51 |
void __record_needed_destruction (void * d){} |
|
52 |
// 2.1 calls __aeabi_atexit passing __dso_handle. This can just be a label since its not used. |
|
3
9a3ffdc955cd
Bug 341 - [GCCE] Enabling support for gcce in cia files
arunabha
parents:
0
diff
changeset
|
53 |
__NAKED__ void __dso_handle(void){} |
0 | 54 |
void __aeabi_atexit(void *object, void (*dtor)(void *), void *handle){} |
55 |
||
56 |
GLDEF_C TInt _E32Dll_Body(TInt aReason) |
|
57 |
// |
|
58 |
// Call extension global constructors |
|
59 |
// |
|
60 |
{ |
|
61 |
if (aReason==KModuleEntryReasonExtensionInit1) |
|
62 |
{ |
|
63 |
__DLL_Export_Table__(); |
|
64 |
__cpp_initialize__aeabi_(); |
|
65 |
} |
|
66 |
return KernelModuleEntry(aReason); |
|
67 |
} |
|
68 |
||
69 |
#else |
|
70 |
#error not supported |
|
71 |
#endif |
|
72 |
||
73 |
} |
|
74 |