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\euser\epoc\x86\uc_trp.cia sl@0: // sl@0: // sl@0: sl@0: #include sl@0: #include sl@0: sl@0: sl@0: #ifndef __LEAVE_EQUALS_THROW__ sl@0: sl@0: void __stdcall DoTrap(TTrap* aFrame); sl@0: sl@0: EXPORT_C __NAKED__ TInt TTrap::Trap(TInt& /*aResult*/) sl@0: // sl@0: // Save the enter frame state and return 0. sl@0: // sl@0: { sl@0: THISCALL_PROLOG1() sl@0: asm("mov edx, [esp]"); sl@0: asm("mov [ecx+0], edx"); sl@0: asm("mov [ecx+4], ebx"); sl@0: asm("mov [ecx+8], ebp"); sl@0: asm("mov [ecx+12], esp"); sl@0: asm("mov [ecx+16], esi"); sl@0: asm("mov [ecx+20], edi"); sl@0: asm("mov [ecx+24], ds"); sl@0: asm("mov [ecx+28], es"); sl@0: asm("mov [ecx+32], fs"); sl@0: asm("mov [ecx+36], gs"); sl@0: asm("mov edx, [esp+4]"); sl@0: asm("xor eax, eax"); sl@0: asm("mov [edx], eax"); sl@0: asm("mov [ecx+%0], edx": : "i"_FOFF(TTrap,iResult)); sl@0: asm("push ecx"); sl@0: asm("call %a0": : "i"(&DoTrap)); sl@0: asm("xor eax, eax"); sl@0: THISCALL_EPILOG1() sl@0: } sl@0: sl@0: __NAKED__ void DoLeave(TTrap*) sl@0: { sl@0: asm("mov ecx, [esp+4]"); sl@0: asm("mov edx, [ecx+0]"); sl@0: asm("mov ebx, [ecx+4]"); sl@0: asm("mov ebp, [ecx+8]"); sl@0: asm("mov esp, [ecx+12]"); sl@0: asm("mov esi, [ecx+16]"); sl@0: asm("mov edi, [ecx+20]"); sl@0: asm("mov ds, [ecx+24]"); sl@0: asm("mov es, [ecx+28]"); sl@0: asm("mov fs, [ecx+32]"); sl@0: asm("mov gs, [ecx+36]"); sl@0: asm("mov [esp], edx"); sl@0: asm("mov eax, 1"); sl@0: THISCALL_EPILOG1() sl@0: } sl@0: sl@0: #endif // !__LEAVE_EQUALS_THROW__