sl@0
|
1 |
// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of the License "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
// e32\nkern\x86\ncmonitor.cia
|
sl@0
|
15 |
//
|
sl@0
|
16 |
//
|
sl@0
|
17 |
|
sl@0
|
18 |
#include "nk_priv.h"
|
sl@0
|
19 |
#include <x86.h>
|
sl@0
|
20 |
#include <kernel/monitor.h>
|
sl@0
|
21 |
|
sl@0
|
22 |
const TLinAddr Monitor_Leave = (TLinAddr)&Monitor::Leave;
|
sl@0
|
23 |
|
sl@0
|
24 |
__NAKED__ void Monitor::HandleException()
|
sl@0
|
25 |
//
|
sl@0
|
26 |
// Handle an exception while the monitor is running
|
sl@0
|
27 |
//
|
sl@0
|
28 |
{
|
sl@0
|
29 |
// EBP points to saved exception frame
|
sl@0
|
30 |
asm("mov ecx, dword ptr [%a0]": : "i"(&TheMonitorPtr));
|
sl@0
|
31 |
asm("lea ecx, [ecx+%0]": : "i"_FOFF(Monitor,iExceptionInfo));
|
sl@0
|
32 |
asm("mov eax, [ebp+%0]": : "i"_FOFF(TX86ExcInfo,iEip));
|
sl@0
|
33 |
asm("mov ebx, [ebp+%0]": : "i"_FOFF(TX86ExcInfo,iFaultAddress));
|
sl@0
|
34 |
asm("mov edx, [ebp+%0]": : "i"_FOFF(TX86ExcInfo,iExcErrorCode));
|
sl@0
|
35 |
asm("mov esi, [ebp+%0]": : "i"_FOFF(TX86ExcInfo,iExcId));
|
sl@0
|
36 |
asm("mov [ecx+0], eax");
|
sl@0
|
37 |
asm("mov [ecx+4], ebx");
|
sl@0
|
38 |
asm("mov [ecx+8], ecx");
|
sl@0
|
39 |
asm("mov [ecx+12], esi");
|
sl@0
|
40 |
|
sl@0
|
41 |
//Monitor::Leave(KErrAbort);
|
sl@0
|
42 |
asm("push %0": :"i"(KErrAbort));
|
sl@0
|
43 |
asm("call %a0": :"i"(Monitor_Leave));
|
sl@0
|
44 |
asm("add esp,4");
|
sl@0
|
45 |
}
|
sl@0
|
46 |
|