ReactOS 0.4.16-dev-2104-gb84fa49
except_arm64.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 * Copyright 2017 Martin Storsjo
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 */
22
23#ifdef __aarch64__
24
25#include <setjmp.h>
26#include <stdarg.h>
27#include <fpieee.h>
28
29#include "ntstatus.h"
30#define WIN32_NO_STATUS
31#include "windef.h"
32#include "winbase.h"
33#include "winternl.h"
34#include "msvcrt.h"
35#include "excpt.h"
36#include "wine/debug.h"
37
38#include "cppexcept.h"
39
41
42
43extern void *call_exc_handler( void *handler, ULONG_PTR frame, UINT flags, BYTE *nonvol_regs );
44__ASM_GLOBAL_FUNC( call_exc_handler,
45 "stp x29, x30, [sp, #-96]!\n\t"
46 ".seh_save_fplr_x 96\n\t"
47 "stp x19, x20, [sp, #16]\n\t"
48 ".seh_save_regp x19, 16\n\t"
49 "stp x21, x22, [sp, #32]\n\t"
50 ".seh_save_regp x21, 32\n\t"
51 "stp x23, x24, [sp, #48]\n\t"
52 ".seh_save_regp x23, 48\n\t"
53 "stp x25, x26, [sp, #64]\n\t"
54 ".seh_save_regp x25, 64\n\t"
55 "stp x27, x28, [sp, #80]\n\t"
56 ".seh_save_regp x27, 80\n\t"
57 "str x1, [sp, #-16]!\n\t"
58 ".seh_stackalloc 16\n\t"
59 ".seh_endprologue\n\t"
60 "ldp x19, x20, [x3, #0]\n\t" /* nonvolatile regs */
61 "ldp x21, x22, [x3, #16]\n\t"
62 "ldp x23, x24, [x3, #32]\n\t"
63 "ldp x25, x26, [x3, #48]\n\t"
64 "ldp x27, x28, [x3, #64]\n\t"
65 "ldr x29, [x3, #80]\n\t"
66 "blr x0\n\t"
67 "add sp, sp, 16\n\t"
68 "ldp x19, x20, [sp, #16]\n\t"
69 "ldp x21, x22, [sp, #32]\n\t"
70 "ldp x23, x24, [sp, #48]\n\t"
71 "ldp x25, x26, [sp, #64]\n\t"
72 "ldp x27, x28, [sp, #80]\n\t"
73 "ldp x29, x30, [sp], #96\n\t"
74 "ret" )
75
76
77/*******************************************************************
78 * call_catch_handler
79 */
81{
82 ULONG_PTR frame = rec->ExceptionInformation[1];
83 void *handler = (void *)rec->ExceptionInformation[5];
84 BYTE *nonvol_regs = (BYTE *)rec->ExceptionInformation[10];
85
86 TRACE( "calling %p frame %Ix\n", handler, frame );
87 return call_exc_handler( handler, frame, 0x100, nonvol_regs );
88}
89
90
91/*******************************************************************
92 * call_unwind_handler
93 */
95{
96 TRACE( "calling %p frame %Ix\n", handler, frame );
97 return call_exc_handler( handler, frame, 0x100, dispatch->NonVolatileRegisters );
98}
99
100
101/*******************************************************************
102 * get_exception_pc
103 */
105{
106 ULONG_PTR pc = dispatch->ControlPc;
107 if (dispatch->ControlPcIsUnwound) pc -= 4;
108 return pc;
109}
110
111
112/*******************************************************************
113 * _setjmp (MSVCRT.@)
114 */
115__ASM_GLOBAL_FUNC( _setjmp, "b _setjmpex" );
116
117
118/*********************************************************************
119 * handle_fpieee_flt
120 */
123{
124 FIXME("(%lx %p %p)\n", exception_code, ep, handler);
126}
127
128#endif /* __aarch64__ */
#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