kernel/eka/compsupp/gcce/ucppinit.cpp
author William Roberts <williamr@symbian.org>
Thu, 29 Jul 2010 23:52:13 +0100
branchGCC_SURGE
changeset 237 2604c9de91e0
permissions -rw-r--r--
Add ksrt_gcce.lib with ucppini.cpp and ucppfini.cpp, as new fix for bug 3359 Remove the older fix which added ksrt4_0.lib as a static library in lots of places
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
237
2604c9de91e0 Add ksrt_gcce.lib with ucppini.cpp and ucppfini.cpp, as new fix for bug 3359
William Roberts <williamr@symbian.org>
parents:
diff changeset
     1
// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
2604c9de91e0 Add ksrt_gcce.lib with ucppini.cpp and ucppfini.cpp, as new fix for bug 3359
William Roberts <williamr@symbian.org>
parents:
diff changeset
     2
// All rights reserved.
2604c9de91e0 Add ksrt_gcce.lib with ucppini.cpp and ucppfini.cpp, as new fix for bug 3359
William Roberts <williamr@symbian.org>
parents:
diff changeset
     3
// This component and the accompanying materials are made available
2604c9de91e0 Add ksrt_gcce.lib with ucppini.cpp and ucppfini.cpp, as new fix for bug 3359
William Roberts <williamr@symbian.org>
parents:
diff changeset
     4
// under the terms of the License "ARM EABI LICENCE.txt"
2604c9de91e0 Add ksrt_gcce.lib with ucppini.cpp and ucppfini.cpp, as new fix for bug 3359
William Roberts <williamr@symbian.org>
parents:
diff changeset
     5
// which accompanies this distribution, and is available
2604c9de91e0 Add ksrt_gcce.lib with ucppini.cpp and ucppfini.cpp, as new fix for bug 3359
William Roberts <williamr@symbian.org>
parents:
diff changeset
     6
// in kernel/eka/compsupp.
2604c9de91e0 Add ksrt_gcce.lib with ucppini.cpp and ucppfini.cpp, as new fix for bug 3359
William Roberts <williamr@symbian.org>
parents:
diff changeset
     7
//
2604c9de91e0 Add ksrt_gcce.lib with ucppini.cpp and ucppfini.cpp, as new fix for bug 3359
William Roberts <williamr@symbian.org>
parents:
diff changeset
     8
// Initial Contributors:
2604c9de91e0 Add ksrt_gcce.lib with ucppini.cpp and ucppfini.cpp, as new fix for bug 3359
William Roberts <williamr@symbian.org>
parents:
diff changeset
     9
// Nokia Corporation - initial contribution.
2604c9de91e0 Add ksrt_gcce.lib with ucppini.cpp and ucppfini.cpp, as new fix for bug 3359
William Roberts <williamr@symbian.org>
parents:
diff changeset
    10
//
2604c9de91e0 Add ksrt_gcce.lib with ucppini.cpp and ucppfini.cpp, as new fix for bug 3359
William Roberts <williamr@symbian.org>
parents:
diff changeset
    11
// Contributors:
2604c9de91e0 Add ksrt_gcce.lib with ucppini.cpp and ucppfini.cpp, as new fix for bug 3359
William Roberts <williamr@symbian.org>
parents:
diff changeset
    12
// Mike Kinghan, mikek@symbian.org, for Symbian Foundation.
2604c9de91e0 Add ksrt_gcce.lib with ucppini.cpp and ucppfini.cpp, as new fix for bug 3359
William Roberts <williamr@symbian.org>
parents:
diff changeset
    13
//
2604c9de91e0 Add ksrt_gcce.lib with ucppini.cpp and ucppfini.cpp, as new fix for bug 3359
William Roberts <williamr@symbian.org>
parents:
diff changeset
    14
// Description:
2604c9de91e0 Add ksrt_gcce.lib with ucppini.cpp and ucppfini.cpp, as new fix for bug 3359
William Roberts <williamr@symbian.org>
parents:
diff changeset
    15
// This file is part of usrt.lib and ksrt.lib.
2604c9de91e0 Add ksrt_gcce.lib with ucppini.cpp and ucppfini.cpp, as new fix for bug 3359
William Roberts <williamr@symbian.org>
parents:
diff changeset
    16
// 
2604c9de91e0 Add ksrt_gcce.lib with ucppini.cpp and ucppfini.cpp, as new fix for bug 3359
William Roberts <williamr@symbian.org>
parents:
diff changeset
    17
//
2604c9de91e0 Add ksrt_gcce.lib with ucppini.cpp and ucppfini.cpp, as new fix for bug 3359
William Roberts <williamr@symbian.org>
parents:
diff changeset
    18
2604c9de91e0 Add ksrt_gcce.lib with ucppini.cpp and ucppfini.cpp, as new fix for bug 3359
William Roberts <williamr@symbian.org>
parents:
diff changeset
    19
2604c9de91e0 Add ksrt_gcce.lib with ucppini.cpp and ucppfini.cpp, as new fix for bug 3359
William Roberts <williamr@symbian.org>
parents:
diff changeset
    20
extern "C" __NAKED__ void __cpp_initialize__aeabi_()
2604c9de91e0 Add ksrt_gcce.lib with ucppini.cpp and ucppfini.cpp, as new fix for bug 3359
William Roberts <williamr@symbian.org>
parents:
diff changeset
    21
    {
2604c9de91e0 Add ksrt_gcce.lib with ucppini.cpp and ucppfini.cpp, as new fix for bug 3359
William Roberts <williamr@symbian.org>
parents:
diff changeset
    22
    asm(".code 32");
2604c9de91e0 Add ksrt_gcce.lib with ucppini.cpp and ucppfini.cpp, as new fix for bug 3359
William Roberts <williamr@symbian.org>
parents:
diff changeset
    23
	asm(".weak SHT$$INIT_ARRAY$$Base");
2604c9de91e0 Add ksrt_gcce.lib with ucppini.cpp and ucppfini.cpp, as new fix for bug 3359
William Roberts <williamr@symbian.org>
parents:
diff changeset
    24
	asm(".weak SHT$$INIT_ARRAY$$Limit");
2604c9de91e0 Add ksrt_gcce.lib with ucppini.cpp and ucppfini.cpp, as new fix for bug 3359
William Roberts <williamr@symbian.org>
parents:
diff changeset
    25
	asm(".global _ZSt7nothrow");     
2604c9de91e0 Add ksrt_gcce.lib with ucppini.cpp and ucppfini.cpp, as new fix for bug 3359
William Roberts <williamr@symbian.org>
parents:
diff changeset
    26
	asm("STMFD    r13!,{r3-r5,r14}");
2604c9de91e0 Add ksrt_gcce.lib with ucppini.cpp and ucppfini.cpp, as new fix for bug 3359
William Roberts <williamr@symbian.org>
parents:
diff changeset
    27
	asm("LDR      r4,base");
2604c9de91e0 Add ksrt_gcce.lib with ucppini.cpp and ucppfini.cpp, as new fix for bug 3359
William Roberts <williamr@symbian.org>
parents:
diff changeset
    28
	asm("LDR      r5,limit");
2604c9de91e0 Add ksrt_gcce.lib with ucppini.cpp and ucppfini.cpp, as new fix for bug 3359
William Roberts <williamr@symbian.org>
parents:
diff changeset
    29
	asm("CMP      r4,r5");
2604c9de91e0 Add ksrt_gcce.lib with ucppini.cpp and ucppfini.cpp, as new fix for bug 3359
William Roberts <williamr@symbian.org>
parents:
diff changeset
    30
    // Exit if the array is empty.
2604c9de91e0 Add ksrt_gcce.lib with ucppini.cpp and ucppfini.cpp, as new fix for bug 3359
William Roberts <williamr@symbian.org>
parents:
diff changeset
    31
    asm("LDMEQFD  r13!,{r3-r5,pc}");
2604c9de91e0 Add ksrt_gcce.lib with ucppini.cpp and ucppfini.cpp, as new fix for bug 3359
William Roberts <williamr@symbian.org>
parents:
diff changeset
    32
	asm("loop:");
2604c9de91e0 Add ksrt_gcce.lib with ucppini.cpp and ucppfini.cpp, as new fix for bug 3359
William Roberts <williamr@symbian.org>
parents:
diff changeset
    33
    asm("LDR      r0,[r4,#0]");
2604c9de91e0 Add ksrt_gcce.lib with ucppini.cpp and ucppfini.cpp, as new fix for bug 3359
William Roberts <williamr@symbian.org>
parents:
diff changeset
    34
    asm("ADD      r0,r0,r4");
2604c9de91e0 Add ksrt_gcce.lib with ucppini.cpp and ucppfini.cpp, as new fix for bug 3359
William Roberts <williamr@symbian.org>
parents:
diff changeset
    35
#ifdef __MARM_ARMV4__
2604c9de91e0 Add ksrt_gcce.lib with ucppini.cpp and ucppfini.cpp, as new fix for bug 3359
William Roberts <williamr@symbian.org>
parents:
diff changeset
    36
    asm("ADR      r14,ret");
2604c9de91e0 Add ksrt_gcce.lib with ucppini.cpp and ucppfini.cpp, as new fix for bug 3359
William Roberts <williamr@symbian.org>
parents:
diff changeset
    37
    asm("MOV      pc,r0");
2604c9de91e0 Add ksrt_gcce.lib with ucppini.cpp and ucppfini.cpp, as new fix for bug 3359
William Roberts <williamr@symbian.org>
parents:
diff changeset
    38
#else
2604c9de91e0 Add ksrt_gcce.lib with ucppini.cpp and ucppfini.cpp, as new fix for bug 3359
William Roberts <williamr@symbian.org>
parents:
diff changeset
    39
    asm("BLX      r0");
2604c9de91e0 Add ksrt_gcce.lib with ucppini.cpp and ucppfini.cpp, as new fix for bug 3359
William Roberts <williamr@symbian.org>
parents:
diff changeset
    40
#endif
2604c9de91e0 Add ksrt_gcce.lib with ucppini.cpp and ucppfini.cpp, as new fix for bug 3359
William Roberts <williamr@symbian.org>
parents:
diff changeset
    41
	asm("ret:");
2604c9de91e0 Add ksrt_gcce.lib with ucppini.cpp and ucppfini.cpp, as new fix for bug 3359
William Roberts <williamr@symbian.org>
parents:
diff changeset
    42
    asm("ADD      r4,r4,#4");
2604c9de91e0 Add ksrt_gcce.lib with ucppini.cpp and ucppfini.cpp, as new fix for bug 3359
William Roberts <williamr@symbian.org>
parents:
diff changeset
    43
    asm("CMP      r4,r5");
2604c9de91e0 Add ksrt_gcce.lib with ucppini.cpp and ucppfini.cpp, as new fix for bug 3359
William Roberts <williamr@symbian.org>
parents:
diff changeset
    44
    asm("BNE      loop");
2604c9de91e0 Add ksrt_gcce.lib with ucppini.cpp and ucppfini.cpp, as new fix for bug 3359
William Roberts <williamr@symbian.org>
parents:
diff changeset
    45
    asm("LDMFD    r13!,{r3-r5,pc}");
2604c9de91e0 Add ksrt_gcce.lib with ucppini.cpp and ucppfini.cpp, as new fix for bug 3359
William Roberts <williamr@symbian.org>
parents:
diff changeset
    46
	asm("base:");
2604c9de91e0 Add ksrt_gcce.lib with ucppini.cpp and ucppfini.cpp, as new fix for bug 3359
William Roberts <williamr@symbian.org>
parents:
diff changeset
    47
    asm(".word SHT$$INIT_ARRAY$$Base");
2604c9de91e0 Add ksrt_gcce.lib with ucppini.cpp and ucppfini.cpp, as new fix for bug 3359
William Roberts <williamr@symbian.org>
parents:
diff changeset
    48
	asm("limit:");
2604c9de91e0 Add ksrt_gcce.lib with ucppini.cpp and ucppfini.cpp, as new fix for bug 3359
William Roberts <williamr@symbian.org>
parents:
diff changeset
    49
    asm(".word SHT$$INIT_ARRAY$$Limit");
2604c9de91e0 Add ksrt_gcce.lib with ucppini.cpp and ucppfini.cpp, as new fix for bug 3359
William Roberts <williamr@symbian.org>
parents:
diff changeset
    50
	asm("_ZSt7nothrow:");
2604c9de91e0 Add ksrt_gcce.lib with ucppini.cpp and ucppfini.cpp, as new fix for bug 3359
William Roberts <williamr@symbian.org>
parents:
diff changeset
    51
    }
2604c9de91e0 Add ksrt_gcce.lib with ucppini.cpp and ucppfini.cpp, as new fix for bug 3359
William Roberts <williamr@symbian.org>
parents:
diff changeset
    52