Release 9.12.
[wine.git] / dlls / msvcrt / except_arm.c
blobb2bf94d533817e8d4a8d88163fff4bf2755984e6
1 /*
2 * msvcrt C++ exception handling
4 * Copyright 2011 Alexandre Julliard
5 * Copyright 2013 André Hentschel
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 #ifdef __arm__
24 #include <setjmp.h>
25 #include <stdarg.h>
26 #include <fpieee.h>
28 #include "ntstatus.h"
29 #define WIN32_NO_STATUS
30 #include "windef.h"
31 #include "winbase.h"
32 #include "winternl.h"
33 #include "msvcrt.h"
34 #include "excpt.h"
35 #include "wine/debug.h"
37 #include "cppexcept.h"
39 WINE_DEFAULT_DEBUG_CHANNEL(seh);
42 extern void *call_exc_handler( void *handler, ULONG_PTR frame, UINT flags, BYTE *nonvol_regs );
43 __ASM_GLOBAL_FUNC( call_exc_handler,
44 "push {r1,r4-r11,lr}\n\t"
45 ".seh_save_regs_w {r1,r4-r11,lr}\n\t"
46 ".seh_endprologue\n\t"
47 "ldm r3, {r4-r11}\n\t"
48 "blx r0\n\t"
49 "pop {r3-r11,pc}" )
52 /*******************************************************************
53 * call_catch_handler
55 void *call_catch_handler( EXCEPTION_RECORD *rec )
57 ULONG_PTR frame = rec->ExceptionInformation[1];
58 void *handler = (void *)rec->ExceptionInformation[5];
59 BYTE *nonvol_regs = (BYTE *)rec->ExceptionInformation[10];
61 TRACE( "calling %p frame %Ix\n", handler, frame );
62 return call_exc_handler( handler, frame, 0x100, nonvol_regs );
66 /*******************************************************************
67 * call_unwind_handler
69 void *call_unwind_handler( void *handler, ULONG_PTR frame, DISPATCHER_CONTEXT *dispatch )
71 TRACE( "calling %p frame %Ix\n", handler, frame );
72 return call_exc_handler( handler, frame, 0x100, dispatch->NonVolatileRegisters );
76 /*******************************************************************
77 * get_exception_pc
79 ULONG_PTR get_exception_pc( DISPATCHER_CONTEXT *dispatch )
81 ULONG_PTR pc = dispatch->ControlPc;
82 if (dispatch->ControlPcIsUnwound) pc -= 2;
83 return pc;
87 /*********************************************************************
88 * handle_fpieee_flt
90 int handle_fpieee_flt( __msvcrt_ulong exception_code, EXCEPTION_POINTERS *ep,
91 int (__cdecl *handler)(_FPIEEE_RECORD*) )
93 FIXME("(%lx %p %p)\n", exception_code, ep, handler);
94 return EXCEPTION_CONTINUE_SEARCH;
97 #endif /* __arm__ */