ReactOS 0.4.16-dev-2104-gb84fa49
except_arm.c
Go to the documentation of this file.
1/*
2 * msvcrt C++ exception handling
3 *
4 * Copyright 2011 Alexandre Julliard
5 * Copyright 2013 André Hentschel
6 *
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.
11 *
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.
16 *
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
20 */
21
22#ifdef __arm__
23
24#include <setjmp.h>
25#include <stdarg.h>
26#include <fpieee.h>
27
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"
36
37#include "cppexcept.h"
38
40
41
42extern 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}" )
50
51
52/*******************************************************************
53 * call_catch_handler
54 */
56{
57 ULONG_PTR frame = rec->ExceptionInformation[1];
58 void *handler = (void *)rec->ExceptionInformation[5];
59 BYTE *nonvol_regs = (BYTE *)rec->ExceptionInformation[10];
60
61 TRACE( "calling %p frame %Ix\n", handler, frame );
62 return call_exc_handler( handler, frame, 0x100, nonvol_regs );
63}
64
65
66/*******************************************************************
67 * call_unwind_handler
68 */
70{
71 TRACE( "calling %p frame %Ix\n", handler, frame );
72 return call_exc_handler( handler, frame, 0x100, dispatch->NonVolatileRegisters );
73}
74
75
76/*******************************************************************
77 * get_exception_pc
78 */
80{
81 ULONG_PTR pc = dispatch->ControlPc;
82 if (dispatch->ControlPcIsUnwound) pc -= 2;
83 return pc;
84}
85
86
87/*********************************************************************
88 * handle_fpieee_flt
89 */
92{
93 FIXME("(%lx %p %p)\n", exception_code, ep, handler);
95}
96
97#endif /* __arm__ */
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
void dispatch(HANDLE hStopEvent)
Definition: dispatch.c:70
#define FIXME(fmt,...)
Definition: precomp.h:53
UINT(* handler)(MSIPACKAGE *)
Definition: action.c:7512
void * call_unwind_handler(void *func, uintptr_t frame, DISPATCHER_CONTEXT *dispatch)
int handle_fpieee_flt(__msvcrt_ulong exception_code, EXCEPTION_POINTERS *ep, int(__cdecl *handler)(_FPIEEE_RECORD *))
void * call_catch_handler(EXCEPTION_RECORD *rec)
ULONG_PTR get_exception_pc(DISPATCHER_CONTEXT *dispatch)
#define __cdecl
Definition: corecrt.h:121
unsigned long __msvcrt_ulong
Definition: corecrt.h:168
GLbitfield flags
Definition: glext.h:7161
#define exception_code
Definition: excpt.h:84
#define EXCEPTION_CONTINUE_SEARCH
Definition: excpt.h:91
#define __ASM_GLOBAL_FUNC(name, code)
Definition: port.h:201
unsigned int UINT
Definition: ndis.h:50
#define TRACE(s)
Definition: solgame.cpp:4
uint32_t ULONG_PTR
Definition: typedefs.h:65
unsigned char BYTE
Definition: xxhash.c:193