sl@0: // Copyright (c) 2007-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 "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // e32\nkern\x86\ncmonitor.cia sl@0: // sl@0: // sl@0: sl@0: #include "nk_priv.h" sl@0: #include sl@0: #include sl@0: sl@0: const TLinAddr Monitor_Leave = (TLinAddr)&Monitor::Leave; sl@0: sl@0: __NAKED__ void Monitor::HandleException() sl@0: // sl@0: // Handle an exception while the monitor is running sl@0: // sl@0: { sl@0: // EBP points to saved exception frame sl@0: asm("mov ecx, dword ptr [%a0]": : "i"(&TheMonitorPtr)); sl@0: asm("lea ecx, [ecx+%0]": : "i"_FOFF(Monitor,iExceptionInfo)); sl@0: asm("mov eax, [ebp+%0]": : "i"_FOFF(TX86ExcInfo,iEip)); sl@0: asm("mov ebx, [ebp+%0]": : "i"_FOFF(TX86ExcInfo,iFaultAddress)); sl@0: asm("mov edx, [ebp+%0]": : "i"_FOFF(TX86ExcInfo,iExcErrorCode)); sl@0: asm("mov esi, [ebp+%0]": : "i"_FOFF(TX86ExcInfo,iExcId)); sl@0: asm("mov [ecx+0], eax"); sl@0: asm("mov [ecx+4], ebx"); sl@0: asm("mov [ecx+8], ecx"); sl@0: asm("mov [ecx+12], esi"); sl@0: sl@0: //Monitor::Leave(KErrAbort); sl@0: asm("push %0": :"i"(KErrAbort)); sl@0: asm("call %a0": :"i"(Monitor_Leave)); sl@0: asm("add esp,4"); sl@0: } sl@0: