os/kernelhwsrv/kernel/eka/euser/epoc/x86/uc_trp.cpp
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     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 "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-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__