sl@0: // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "ARM EABI LICENCE.txt" sl@0: // which accompanies this distribution, and is available sl@0: // in kernel/eka/compsupp. sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // This file is part of drtrvct.dll and drtrvct_vfpv2.dll. sl@0: // sl@0: // sl@0: sl@0: #include sl@0: #include sl@0: #include // Will be found among RVCT's header files. sl@0: sl@0: sl@0: extern "C" EXPORT_C TInt __rt_raise(TInt signal, TInt type) sl@0: { sl@0: TExcType aExc = EExcGeneral; sl@0: sl@0: // Translate the signal into an EPOC exception. sl@0: switch (signal) sl@0: { sl@0: case SIGABRT : sl@0: aExc = EExcAbort; sl@0: break; sl@0: sl@0: case SIGFPE : sl@0: switch (type) sl@0: { sl@0: case DIVBYZERO : sl@0: aExc = EExcAbort; sl@0: break; sl@0: default: sl@0: aExc = EExcFloatInvalidOperation; sl@0: } sl@0: break; sl@0: sl@0: case SIGILL : sl@0: aExc = EExcCodeAbort; sl@0: break; sl@0: sl@0: case SIGINT : sl@0: aExc = EExcUserInterrupt; sl@0: break; sl@0: sl@0: case SIGSEGV : sl@0: aExc = EExcDataAbort; sl@0: break; sl@0: sl@0: case SIGTERM : sl@0: aExc = EExcKill; sl@0: break; sl@0: } sl@0: sl@0: User::RaiseException(aExc); sl@0: sl@0: return signal; sl@0: } sl@0: