kernel/eka/common/arm/gccehlp.cpp
author Mike Kinghan <mikek@symbian.org>
Mon, 26 Jul 2010 13:44:21 +0100
branchGCC_SURGE
changeset 232 9143fc12f708
parent 203 71dce6d9df02
child 238 959c796a6191
permissions -rw-r--r--
Fix for Bug 3387 - [GCCE] Attempt to use private members from class DDmaRequest in class TDmac
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
188
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
     1
// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
     2
// All rights reserved.
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
     3
// This component and the accompanying materials are made available
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
     4
// under the terms of the License "Eclipse Public License v1.0"
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
     5
// which accompanies this distribution, and is available
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
     7
//
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
     8
// Initial Contributors:
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
     9
// Mike Kinghan, mikek@symbian.org, for Symbian Foundation
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
    10
//
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
    11
// Contributors:
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
    12
//
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
    13
// Description:
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
    14
// kernelhwsrv/kernel/eka/common/arm/gccehlp.cpp
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
    15
// 
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
    16
//
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
    17
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
    18
#include "../common.h"
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
    19
#include <nkern.h>
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
    20
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
    21
extern "C" {
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
    22
EXPORT_C int __aeabi_idiv0 (int return_value)
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
    23
    {
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
    24
      FAULT();
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
    25
      return return_value;
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
    26
    }
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
    27
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
    28
EXPORT_C long long __aeabi_ldiv0 (long long return_value)
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
    29
    {
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
    30
      FAULT();
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
    31
      return return_value;
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
    32
    }
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
    33
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
    34
EXPORT_C int __cxa_pure_virtual()
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
    35
//
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
    36
// Gets called for any unreplaced pure virtual methods.
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
    37
//
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
    38
	{
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
    39
#ifdef __STANDALONE_NANOKERNEL__
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
    40
	__NK_ASSERT_ALWAYS(0);
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
    41
#else
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
    42
	Panic(EPureVirtualCalled);
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
    43
#endif
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
    44
	return 0;
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
    45
	}
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
    46
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
    47
#ifdef __KERNEL_MODE__
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
    48
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
    49
void __cxa_end_catch(){}
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
    50
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
    51
void __cxa_begin_catch(){}
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
    52
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
    53
void __cxa_rethrow(){}
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
    54
// std::terminate
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
    55
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
    56
void __cxa_call_unexpected() {}
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
    57
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
    58
void __aeabi_unwind_cpp_pr0() {}
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
    59
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
    60
void __cxa_end_cleanup() {}
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
    61
203
71dce6d9df02 Interim solution for bug 3117 and 2979.
Mike Kinghan <mikek@symbian.org>
parents: 191
diff changeset
    62
EXPORT_C void __cxa_guard_abort() {}
71dce6d9df02 Interim solution for bug 3117 and 2979.
Mike Kinghan <mikek@symbian.org>
parents: 191
diff changeset
    63
71dce6d9df02 Interim solution for bug 3117 and 2979.
Mike Kinghan <mikek@symbian.org>
parents: 191
diff changeset
    64
EXPORT_C void __cxa_guard_acquire() {}
71dce6d9df02 Interim solution for bug 3117 and 2979.
Mike Kinghan <mikek@symbian.org>
parents: 191
diff changeset
    65
71dce6d9df02 Interim solution for bug 3117 and 2979.
Mike Kinghan <mikek@symbian.org>
parents: 191
diff changeset
    66
EXPORT_C void __cxa_guard_release() {}
71dce6d9df02 Interim solution for bug 3117 and 2979.
Mike Kinghan <mikek@symbian.org>
parents: 191
diff changeset
    67
188
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
    68
#endif
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
    69
}
38a7352e23d3 1) Fix for Bug 3117 - [GCCE] Missing symbols in linkage of template_ekern.exe
mikek
parents:
diff changeset
    70
203
71dce6d9df02 Interim solution for bug 3117 and 2979.
Mike Kinghan <mikek@symbian.org>
parents: 191
diff changeset
    71
//
71dce6d9df02 Interim solution for bug 3117 and 2979.
Mike Kinghan <mikek@symbian.org>
parents: 191
diff changeset
    72
// The global new operator.
71dce6d9df02 Interim solution for bug 3117 and 2979.
Mike Kinghan <mikek@symbian.org>
parents: 191
diff changeset
    73
//
71dce6d9df02 Interim solution for bug 3117 and 2979.
Mike Kinghan <mikek@symbian.org>
parents: 191
diff changeset
    74
#include <kernel/kernel.h>
71dce6d9df02 Interim solution for bug 3117 and 2979.
Mike Kinghan <mikek@symbian.org>
parents: 191
diff changeset
    75
71dce6d9df02 Interim solution for bug 3117 and 2979.
Mike Kinghan <mikek@symbian.org>
parents: 191
diff changeset
    76
EXPORT_C TAny* operator new[](TUint aSize, const std::nothrow_t&) __NO_THROW
71dce6d9df02 Interim solution for bug 3117 and 2979.
Mike Kinghan <mikek@symbian.org>
parents: 191
diff changeset
    77
	{
71dce6d9df02 Interim solution for bug 3117 and 2979.
Mike Kinghan <mikek@symbian.org>
parents: 191
diff changeset
    78
	return Kern::Alloc(aSize);
71dce6d9df02 Interim solution for bug 3117 and 2979.
Mike Kinghan <mikek@symbian.org>
parents: 191
diff changeset
    79
	}
71dce6d9df02 Interim solution for bug 3117 and 2979.
Mike Kinghan <mikek@symbian.org>
parents: 191
diff changeset
    80
71dce6d9df02 Interim solution for bug 3117 and 2979.
Mike Kinghan <mikek@symbian.org>
parents: 191
diff changeset
    81
EXPORT_C TAny* operator new(TUint aSize, const std::nothrow_t&) __NO_THROW
71dce6d9df02 Interim solution for bug 3117 and 2979.
Mike Kinghan <mikek@symbian.org>
parents: 191
diff changeset
    82
	{
71dce6d9df02 Interim solution for bug 3117 and 2979.
Mike Kinghan <mikek@symbian.org>
parents: 191
diff changeset
    83
	return Kern::Alloc(aSize);
71dce6d9df02 Interim solution for bug 3117 and 2979.
Mike Kinghan <mikek@symbian.org>
parents: 191
diff changeset
    84
	}
71dce6d9df02 Interim solution for bug 3117 and 2979.
Mike Kinghan <mikek@symbian.org>
parents: 191
diff changeset
    85
71dce6d9df02 Interim solution for bug 3117 and 2979.
Mike Kinghan <mikek@symbian.org>
parents: 191
diff changeset
    86
71dce6d9df02 Interim solution for bug 3117 and 2979.
Mike Kinghan <mikek@symbian.org>
parents: 191
diff changeset
    87
71dce6d9df02 Interim solution for bug 3117 and 2979.
Mike Kinghan <mikek@symbian.org>
parents: 191
diff changeset
    88
__NAKED__ void __rt_exporter_dummy(void)
71dce6d9df02 Interim solution for bug 3117 and 2979.
Mike Kinghan <mikek@symbian.org>
parents: 191
diff changeset
    89
	{
71dce6d9df02 Interim solution for bug 3117 and 2979.
Mike Kinghan <mikek@symbian.org>
parents: 191
diff changeset
    90
// Ensure that "vtable for __cxxabiv1::__si_class_type_info" is available from ekern.exe
71dce6d9df02 Interim solution for bug 3117 and 2979.
Mike Kinghan <mikek@symbian.org>
parents: 191
diff changeset
    91
// ** This is almost certainly just creating an instance of the symbol, without supplying the 
71dce6d9df02 Interim solution for bug 3117 and 2979.
Mike Kinghan <mikek@symbian.org>
parents: 191
diff changeset
    92
// ** required functionality!
71dce6d9df02 Interim solution for bug 3117 and 2979.
Mike Kinghan <mikek@symbian.org>
parents: 191
diff changeset
    93
71dce6d9df02 Interim solution for bug 3117 and 2979.
Mike Kinghan <mikek@symbian.org>
parents: 191
diff changeset
    94
#define COMM_SYMBOL(x)  asm(".comm " x ",4")
71dce6d9df02 Interim solution for bug 3117 and 2979.
Mike Kinghan <mikek@symbian.org>
parents: 191
diff changeset
    95
71dce6d9df02 Interim solution for bug 3117 and 2979.
Mike Kinghan <mikek@symbian.org>
parents: 191
diff changeset
    96
COMM_SYMBOL("_ZTVN10__cxxabiv117__class_type_infoE");     // vtable for __cxxabiv1::__class_type_info
71dce6d9df02 Interim solution for bug 3117 and 2979.
Mike Kinghan <mikek@symbian.org>
parents: 191
diff changeset
    97
COMM_SYMBOL("_ZTVN10__cxxabiv120__si_class_type_infoE");  // vtable for __cxxabiv1::__si_class_type_info
71dce6d9df02 Interim solution for bug 3117 and 2979.
Mike Kinghan <mikek@symbian.org>
parents: 191
diff changeset
    98
COMM_SYMBOL("_ZTVN10__cxxabiv121__vmi_class_type_infoE"); // vtable for __cxxabiv1::__vmi_class_type_info
71dce6d9df02 Interim solution for bug 3117 and 2979.
Mike Kinghan <mikek@symbian.org>
parents: 191
diff changeset
    99
71dce6d9df02 Interim solution for bug 3117 and 2979.
Mike Kinghan <mikek@symbian.org>
parents: 191
diff changeset
   100
// Implementations exist as globals in libgcc.a, we just need to pull them in
71dce6d9df02 Interim solution for bug 3117 and 2979.
Mike Kinghan <mikek@symbian.org>
parents: 191
diff changeset
   101
#define IMPORT_GLOBAL(x)  asm(".global " x );
71dce6d9df02 Interim solution for bug 3117 and 2979.
Mike Kinghan <mikek@symbian.org>
parents: 191
diff changeset
   102
71dce6d9df02 Interim solution for bug 3117 and 2979.
Mike Kinghan <mikek@symbian.org>
parents: 191
diff changeset
   103
IMPORT_GLOBAL("__aeabi_lasr");
71dce6d9df02 Interim solution for bug 3117 and 2979.
Mike Kinghan <mikek@symbian.org>
parents: 191
diff changeset
   104
IMPORT_GLOBAL("__aeabi_lcmp");
71dce6d9df02 Interim solution for bug 3117 and 2979.
Mike Kinghan <mikek@symbian.org>
parents: 191
diff changeset
   105
IMPORT_GLOBAL("__aeabi_llsl");
71dce6d9df02 Interim solution for bug 3117 and 2979.
Mike Kinghan <mikek@symbian.org>
parents: 191
diff changeset
   106
IMPORT_GLOBAL("__aeabi_llsr");
71dce6d9df02 Interim solution for bug 3117 and 2979.
Mike Kinghan <mikek@symbian.org>
parents: 191
diff changeset
   107
IMPORT_GLOBAL("__aeabi_lmul");
71dce6d9df02 Interim solution for bug 3117 and 2979.
Mike Kinghan <mikek@symbian.org>
parents: 191
diff changeset
   108
IMPORT_GLOBAL("__aeabi_ulcmp");
71dce6d9df02 Interim solution for bug 3117 and 2979.
Mike Kinghan <mikek@symbian.org>
parents: 191
diff changeset
   109
71dce6d9df02 Interim solution for bug 3117 and 2979.
Mike Kinghan <mikek@symbian.org>
parents: 191
diff changeset
   110
// Implementations exist as "hidden" in libgcc.a, so we need to pull them in and reveal them
71dce6d9df02 Interim solution for bug 3117 and 2979.
Mike Kinghan <mikek@symbian.org>
parents: 191
diff changeset
   111
// ** This version will completely fail to do that, but creates junk to be exported
71dce6d9df02 Interim solution for bug 3117 and 2979.
Mike Kinghan <mikek@symbian.org>
parents: 191
diff changeset
   112
#define IMPORT_HIDDEN(x)  asm(".comm " x ",4");
71dce6d9df02 Interim solution for bug 3117 and 2979.
Mike Kinghan <mikek@symbian.org>
parents: 191
diff changeset
   113
71dce6d9df02 Interim solution for bug 3117 and 2979.
Mike Kinghan <mikek@symbian.org>
parents: 191
diff changeset
   114
// unaligned-funcs.c
71dce6d9df02 Interim solution for bug 3117 and 2979.
Mike Kinghan <mikek@symbian.org>
parents: 191
diff changeset
   115
IMPORT_HIDDEN("__aeabi_uread4");
71dce6d9df02 Interim solution for bug 3117 and 2979.
Mike Kinghan <mikek@symbian.org>
parents: 191
diff changeset
   116
IMPORT_HIDDEN("__aeabi_uread8");
71dce6d9df02 Interim solution for bug 3117 and 2979.
Mike Kinghan <mikek@symbian.org>
parents: 191
diff changeset
   117
IMPORT_HIDDEN("__aeabi_uwrite4");
71dce6d9df02 Interim solution for bug 3117 and 2979.
Mike Kinghan <mikek@symbian.org>
parents: 191
diff changeset
   118
IMPORT_HIDDEN("__aeabi_uwrite8");
71dce6d9df02 Interim solution for bug 3117 and 2979.
Mike Kinghan <mikek@symbian.org>
parents: 191
diff changeset
   119
71dce6d9df02 Interim solution for bug 3117 and 2979.
Mike Kinghan <mikek@symbian.org>
parents: 191
diff changeset
   120
	}
71dce6d9df02 Interim solution for bug 3117 and 2979.
Mike Kinghan <mikek@symbian.org>
parents: 191
diff changeset
   121