7 ".seh_proc __seh2_global_filter_func\n"
8 "__seh2_global_filter_func:\n"
12 "\t.seh_pushreg %rbp\n"
14 "\t.seh_stackalloc 32\n"
15 "\t.seh_endprologue\n"
22 "__seh2_global_filter_func_exit:\n"
29#define STRINGIFY(a) #a
30#define EMIT_PRAGMA_(params) \
31 _Pragma( STRINGIFY(params) )
32#define EMIT_PRAGMA(type,line) \
33 EMIT_PRAGMA_(REACTOS seh(type,line))
35#define _SEH3$_EMIT_DEFS_AND_PRAGMA__(Line, Type) \
37 __asm__ __volatile__ goto ("\n" \
38 "\t__seh2$$begin_try__" #Line "=%l0\n"
\
39 "\t__seh2$$end_try__" #Line "=%l1 + 1\n"
\
40 "\t__seh2$$filter__" #Line "=%l2\n"
\
41 "\t__seh2$$begin_except__" #Line "=%l3\n"
\
45 : __seh2$$begin_try__, \
48 __seh2$$begin_except__); \
50 EMIT_PRAGMA(Type,Line)
52#define _SEH3$_EMIT_DEFS_AND_PRAGMA_(Line, Type) _SEH3$_EMIT_DEFS_AND_PRAGMA__(Line, Type)
53#define _SEH3$_EMIT_DEFS_AND_PRAGMA(Type) _SEH3$_EMIT_DEFS_AND_PRAGMA_(__LINE__, Type)
57 __label__ __seh2$$filter__; \
58 __label__ __seh2$$begin_except__; \
59 __label__ __seh2$$begin_try__; \
60 __label__ __seh2$$end_try__; \
70 __label__ __seh2$$leave_scope__;
72#define _SEH2_EXCEPT(...) \
73__seh2$$leave_scope__: __MINGW_ATTRIB_UNUSED; \
75__seh2$$end_try__:(void)0; \
77 _SEH3$_EMIT_DEFS_AND_PRAGMA(__seh$$except); \
80 __label__ __seh2$$leave_scope__; \
81 LONG __MINGW_ATTRIB_UNUSED __seh2$$exception_code__; \
86 __label__ __seh2$$filter_funclet__; \
88 __asm__ __volatile__ goto( \
89 "\tleaq %l1(%%rip), %%r8\n" \
90 "\tjmp __seh2_global_filter_func\n" \
92 : "a"(__builtin_frame_address(0)) \
94 : __seh2$$filter_funclet__); \
96 struct _EXCEPTION_POINTERS* __seh2$$exception_ptr__; \
97 __seh2$$filter_funclet__: \
99 __asm__ __volatile__("" \
100 : "=c"(__seh2$$exception_ptr__)
\
103 "%rax", "%rbx","%rdx", "%rdi", "%rsi", \
104 "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15"); \
106 __seh2$$exception_code__ = __seh2$$exception_ptr__->ExceptionRecord->ExceptionCode; \
108 register long __MINGW_ATTRIB_UNUSED __seh2$$filter_funclet_ret __asm__("eax") = \
111 __asm__("jmp __seh2_global_filter_func_exit"); \
116 __seh2$$abnormal_termination__ = 0 \
118 __seh2$$begin_except__:
120#define _SEH2_FINALLY \
121__seh2$$leave_scope__: __MINGW_ATTRIB_UNUSED; \
124__seh2$$begin_except__: __MINGW_ATTRIB_UNUSED; \
126 _SEH3$_EMIT_DEFS_AND_PRAGMA(__seh$$finally); \
129 __label__ __seh2$$finally__; \
130 __label__ __seh2$$begin_finally__; \
131 __label__ __seh2$$leave_scope__; \
132 __asm__ __volatile__ goto("" : : : : __seh2$$finally__); \
133 int __seh2$$abnormal_termination__; \
137 __seh2$$filter__: __MINGW_ATTRIB_UNUSED; \
138 __seh2$$finally__: __MINGW_ATTRIB_UNUSED; \
139 __asm__ __volatile__ goto( \
141 "\tleaq %l1(%%rip), %%r8\n" \
142 "\tjmp __seh2_global_filter_func\n" \
144 : "a"(__builtin_frame_address(0)) \
146 : __seh2$$begin_finally__); \
150 __asm__ __volatile__("xor %%rcx, %%rcx" \
154 "%rax", "%rbx", "%rcx", "%rdx", "%rdi", "%rsi", \
155 "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15"); \
157 __seh2$$begin_finally__: \
158 __asm__ __volatile__("" \
159 : "=c" (__seh2$$abnormal_termination__));
162 __seh2$$leave_scope__: __MINGW_ATTRIB_UNUSED; \
163 if (__seh2$$abnormal_termination__) \
165 __asm__("jmp __seh2_global_filter_func_exit"); \
170#define _SEH2_GetExceptionInformation() __seh2$$exception_ptr__
171#define _SEH2_GetExceptionCode() __seh2$$exception_code__
172#define _SEH2_AbnormalTermination() __seh2$$abnormal_termination__
173#define _SEH2_LEAVE goto __seh2$$leave_scope__
174#define _SEH2_YIELD(__stmt) __stmt
175#define _SEH2_VOLATILE volatile
178#define __try _SEH2_TRY
179#define __except _SEH2_EXCEPT
180#define __finally _SEH2_FINALLY
181#define __endtry _SEH2_END
182#define __leave goto __seh2$$leave_scope__
183#define _exception_info() __seh2$$exception_ptr__
184#define _exception_code() __seh2$$exception_code__
185#define _abnormal_termination() __seh2$$abnormal_termination__
__asm__(".p2align 4, 0x90\n" ".seh_proc __seh2_global_filter_func\n" "__seh2_global_filter_func:\n" "\tsub %rbp, %rax\n" "\tpush %rbp\n" "\t.seh_pushreg %rbp\n" "\tsub $32, %rsp\n" "\t.seh_stackalloc 32\n" "\t.seh_endprologue\n" "\tsub %rax, %rdx\n" "\tmov %rdx, %rbp\n" "\tjmp *%r8\n" "__seh2_global_filter_func_exit:\n" "\t.p2align 4\n" "\tadd $32, %rsp\n" "\tpop %rbp\n" "\tret\n" "\t.seh_endproc")