kernel/eka/compsupp/rvct3_1/sftfpini.cpp
changeset 9 96e5fb8b040d
child 10 36bfc973b146
equal deleted inserted replaced
-1:000000000000 9:96e5fb8b040d
       
     1 /*
       
     2 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 * This file is part of drtrvct.dll and drtrvct_vfpv2.dll.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #include <e32std.h>
       
    21 #include <e32std_private.h>
       
    22 
       
    23 
       
    24 extern "C" {
       
    25   
       
    26 EXPORT_C  void _fp_init() 
       
    27     {
       
    28     }
       
    29   
       
    30 EXPORT_C TAny * __rt_fp_status_addr() 
       
    31     { 
       
    32     TAny* aTls = Dll::Tls();
       
    33 
       
    34     if (aTls)
       
    35         return aTls;
       
    36 
       
    37     // If this is the first time we are called we need to set up some TLS for
       
    38     // the FP status word.
       
    39 
       
    40     TUint32* aReg = (TUint32*)User::AllocZ(sizeof(TUint32));
       
    41 
       
    42     _LIT(KFpGeneralPanic, "FP Emulator");
       
    43 
       
    44     if (aReg) 
       
    45         {
       
    46         TInt r = Dll::SetTls(aReg);
       
    47         if (r==KErrNone)
       
    48             return aReg;
       
    49 
       
    50         // if we get here we really in trouble. Just Panic.
       
    51         User::Panic(KFpGeneralPanic, KErrGeneral);
       
    52         }
       
    53     else
       
    54         {
       
    55         // If we get here, we're toast anyway....
       
    56         User::Panic(KFpGeneralPanic, KErrNoMemory);
       
    57         }
       
    58 
       
    59     return 0;
       
    60     }
       
    61 
       
    62 }
       
    63