os/kernelhwsrv/kernel/eka/nkernsmp/x86/ncmonitor.cia
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/kernelhwsrv/kernel/eka/nkernsmp/x86/ncmonitor.cia	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,46 @@
     1.4 +// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of the License "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +// e32\nkern\x86\ncmonitor.cia
    1.18 +// 
    1.19 +//
    1.20 +
    1.21 +#include "nk_priv.h"
    1.22 +#include <x86.h>
    1.23 +#include <kernel/monitor.h>
    1.24 +
    1.25 +const TLinAddr Monitor_Leave = (TLinAddr)&Monitor::Leave;
    1.26 +
    1.27 +__NAKED__ void Monitor::HandleException()
    1.28 +//
    1.29 +// Handle an exception while the monitor is running
    1.30 +//
    1.31 +	{
    1.32 +	// EBP points to saved exception frame
    1.33 +	asm("mov ecx, dword ptr [%a0]": : "i"(&TheMonitorPtr));
    1.34 +	asm("lea ecx, [ecx+%0]": : "i"_FOFF(Monitor,iExceptionInfo));
    1.35 +	asm("mov eax, [ebp+%0]": : "i"_FOFF(TX86ExcInfo,iEip));
    1.36 +	asm("mov ebx, [ebp+%0]": : "i"_FOFF(TX86ExcInfo,iFaultAddress));
    1.37 +	asm("mov edx, [ebp+%0]": : "i"_FOFF(TX86ExcInfo,iExcErrorCode));
    1.38 +	asm("mov esi, [ebp+%0]": : "i"_FOFF(TX86ExcInfo,iExcId));
    1.39 +	asm("mov [ecx+0], eax");
    1.40 +	asm("mov [ecx+4], ebx");
    1.41 +	asm("mov [ecx+8], ecx");
    1.42 +	asm("mov [ecx+12], esi");
    1.43 +
    1.44 +	//Monitor::Leave(KErrAbort);
    1.45 +	asm("push %0": :"i"(KErrAbort));
    1.46 +	asm("call %a0": :"i"(Monitor_Leave));
    1.47 +	asm("add esp,4");
    1.48 +	}
    1.49 +