1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/kernelhwsrv/kernel/eka/euser/epoc/x86/uc_trp.cia Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,71 @@
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\euser\epoc\x86\uc_trp.cia
1.18 +//
1.19 +//
1.20 +
1.21 +#include <u32exec.h>
1.22 +#include <e32panic.h>
1.23 +
1.24 +
1.25 +#ifndef __LEAVE_EQUALS_THROW__
1.26 +
1.27 +void __stdcall DoTrap(TTrap* aFrame);
1.28 +
1.29 +EXPORT_C __NAKED__ TInt TTrap::Trap(TInt& /*aResult*/)
1.30 +//
1.31 +// Save the enter frame state and return 0.
1.32 +//
1.33 + {
1.34 + THISCALL_PROLOG1()
1.35 + asm("mov edx, [esp]");
1.36 + asm("mov [ecx+0], edx");
1.37 + asm("mov [ecx+4], ebx");
1.38 + asm("mov [ecx+8], ebp");
1.39 + asm("mov [ecx+12], esp");
1.40 + asm("mov [ecx+16], esi");
1.41 + asm("mov [ecx+20], edi");
1.42 + asm("mov [ecx+24], ds");
1.43 + asm("mov [ecx+28], es");
1.44 + asm("mov [ecx+32], fs");
1.45 + asm("mov [ecx+36], gs");
1.46 + asm("mov edx, [esp+4]");
1.47 + asm("xor eax, eax");
1.48 + asm("mov [edx], eax");
1.49 + asm("mov [ecx+%0], edx": : "i"_FOFF(TTrap,iResult));
1.50 + asm("push ecx");
1.51 + asm("call %a0": : "i"(&DoTrap));
1.52 + asm("xor eax, eax");
1.53 + THISCALL_EPILOG1()
1.54 + }
1.55 +
1.56 +__NAKED__ void DoLeave(TTrap*)
1.57 + {
1.58 + asm("mov ecx, [esp+4]");
1.59 + asm("mov edx, [ecx+0]");
1.60 + asm("mov ebx, [ecx+4]");
1.61 + asm("mov ebp, [ecx+8]");
1.62 + asm("mov esp, [ecx+12]");
1.63 + asm("mov esi, [ecx+16]");
1.64 + asm("mov edi, [ecx+20]");
1.65 + asm("mov ds, [ecx+24]");
1.66 + asm("mov es, [ecx+28]");
1.67 + asm("mov fs, [ecx+32]");
1.68 + asm("mov gs, [ecx+36]");
1.69 + asm("mov [esp], edx");
1.70 + asm("mov eax, 1");
1.71 + THISCALL_EPILOG1()
1.72 + }
1.73 +
1.74 +#endif // !__LEAVE_EQUALS_THROW__