| 0 |      1 | // Copyright (c) 2007-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\nkern\x86\ncmonitor.cia
 | 
|  |     15 | // 
 | 
|  |     16 | //
 | 
|  |     17 | 
 | 
|  |     18 | #include "nk_priv.h"
 | 
|  |     19 | #include <x86.h>
 | 
|  |     20 | #include <kernel/monitor.h>
 | 
|  |     21 | 
 | 
|  |     22 | const TLinAddr Monitor_Leave = (TLinAddr)&Monitor::Leave;
 | 
|  |     23 | 
 | 
|  |     24 | __NAKED__ void Monitor::HandleException()
 | 
|  |     25 | //
 | 
|  |     26 | // Handle an exception while the monitor is running
 | 
|  |     27 | //
 | 
|  |     28 | 	{
 | 
|  |     29 | 	// EBP points to saved exception frame
 | 
|  |     30 | 	asm("mov ecx, dword ptr [%a0]": : "i"(&TheMonitorPtr));
 | 
|  |     31 | 	asm("lea ecx, [ecx+%0]": : "i"_FOFF(Monitor,iExceptionInfo));
 | 
|  |     32 | 	asm("mov eax, [ebp+%0]": : "i"_FOFF(TX86ExcInfo,iEip));
 | 
|  |     33 | 	asm("mov ebx, [ebp+%0]": : "i"_FOFF(TX86ExcInfo,iFaultAddress));
 | 
|  |     34 | 	asm("mov edx, [ebp+%0]": : "i"_FOFF(TX86ExcInfo,iExcErrorCode));
 | 
|  |     35 | 	asm("mov esi, [ebp+%0]": : "i"_FOFF(TX86ExcInfo,iExcId));
 | 
|  |     36 | 	asm("mov [ecx+0], eax");
 | 
|  |     37 | 	asm("mov [ecx+4], ebx");
 | 
|  |     38 | 	asm("mov [ecx+8], ecx");
 | 
|  |     39 | 	asm("mov [ecx+12], esi");
 | 
|  |     40 | 
 | 
|  |     41 | 	//Monitor::Leave(KErrAbort);
 | 
|  |     42 | 	asm("push %0": :"i"(KErrAbort));
 | 
|  |     43 | 	asm("call %a0": :"i"(Monitor_Leave));
 | 
|  |     44 | 	asm("add esp,4");
 | 
|  |     45 | 	}
 | 
|  |     46 | 
 |