symport/e32/euser/epoc/x86/uc_trp.cpp
changeset 1 0a7b44b10206
child 2 806186ab5e14
equal deleted inserted replaced
0:c55016431358 1:0a7b44b10206
       
     1 // Copyright (c) 1995-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 "Symbian Foundation License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // e32\euser\epoc\x86\uc_trp.cpp
       
    15 // 
       
    16 //
       
    17 
       
    18 #include <u32exec.h>
       
    19 #include <e32panic.h>
       
    20 
       
    21 GLREF_C void Panic(TCdtPanic);
       
    22 
       
    23 #ifndef __LEAVE_EQUALS_THROW__
       
    24 
       
    25 void DoLeave(TTrap*);
       
    26 
       
    27 void __stdcall DoTrap(TTrap* aFrame)
       
    28 	{
       
    29 	TTrapHandler* pH=Exec::PushTrapFrame(aFrame);
       
    30 	if (pH)
       
    31 		pH->Trap();
       
    32 	}
       
    33 
       
    34 EXPORT_C void User::Leave(TInt aReason)
       
    35 //
       
    36 // Leave to the current control region.
       
    37 //
       
    38 	{
       
    39 	TTrap* pF=Exec::PopTrapFrame();
       
    40 	if (!pF)
       
    41 		::Panic(EUserLeaveWithoutTrap);
       
    42 	*pF->iResult=aReason;
       
    43 	TTrapHandler* pH=pF->iHandler;
       
    44 	if (pH)
       
    45 		pH->Leave(aReason);
       
    46 	DoLeave(pF);
       
    47 	}
       
    48 
       
    49 #endif // !__LEAVE_EQUALS_THROW__