ReactOS  0.4.13-dev-563-g0561610
pseh3.h File Reference
#include <excpt.h>
Include dependency graph for pseh3.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  $_SCOPE_TABLE
 
struct  $_EXCEPTION_POINTERS
 
struct  $_REGISTRATION_FRAME
 

Macros

#define _PSEH3_H_
 
#define PRAGMA_DIAGNOSTIC_IGNORED_DECLARATION_AFTER_STATEMENT   _Pragma("GCC diagnostic ignored \"-Wdeclaration-after-statement\"")
 
#define _SEH3   $_AUTO_CLEANUP __attribute__((cleanup(_SEH3$_AutoCleanup)))
 
#define _SEH3   $_EnforceFramePointer() asm volatile ("#\n" : : "m"(*(char*)__builtin_alloca(0)) : "%esp", "memory")
 
#define _SEH3   $_ASM_GOTO(...) asm goto ("#\n" : : : "memory" : __VA_ARGS__)
 
#define _SEH3
 
#define _SEH3
 
#define _SEH3
 
#define _SEH3
 
#define _SEH3
 
#define _SEH3
 
#define _SEH3
 
#define _SEH3
 
#define _SEH3
 
#define _SEH3
 
#define _SEH3   $_FINALLY(_Finally) (_Finally)
 
#define _SEH3
 
#define _SEH3
 
#define _SEH3
 
#define _SEH3_TRY
 
#define _SEH3_EXCEPT(...)
 
#define _SEH3_FINALLY
 
#define _SEH3_END
 
#define _SEH3_LEAVE   goto _SEH3$_l_AfterTry
 
#define _SEH3_VOLATILE   volatile
 

Typedefs

typedef struct _SEH3 $_SCOPE_TABLE$ _SCOPE_TABLE
 
typedef struct _SEH3 $_EXCEPTION_POINTERS$ _EXCEPTION_POINTERS
 
typedef struct _SEH3 $_REGISTRATION_FRAME$ _REGISTRATION_FRAME
 

Enumerations

enum  { $_NESTED_HANDLER = 0, $_CPP_HANDLER = 1, $_CLANG_HANDLER = 2, $_HANDLER_TYPE = _SEH3$_NESTED_HANDLER }
 
enum  { $_TryLevel = 0 }
 

Functions

static __attribute__ ((always_inline)) __attribute__((returns_twice)) void _SEH3 $_PreventInlining()
 
 __attribute__ ((always_inline, gnu_inline)) void _SEH3 $_UnregisterFrame(volatile SEH3 $_REGISTRATION_FRAME *RegistrationFrame)
 
int __cdecl __attribute__ ((error("Can only be used inside a __finally block."))) _abnormal_termination(void)
 
unsigned long __cdecl __attribute__ ((error("Can only be used inside an exception filter or __except block."))) _exception_code(void)
 
void *__cdecl __attribute__ ((error("Can only be used inside an exception filter."))) _exception_info(void)
 
int __attribute__ ((regparm(3))) __attribute__((returns_twice)) _SEH3 $_RegisterFrameWithNonVolatiles(volatile SEH3 $_REGISTRATION_FRAME *RegistrationFrame
 

Variables

int const SEH3 $_SCOPE_TABLEScopeTable
 
int const SEH3 $_SCOPE_TABLE voidAllocaFrame
 

Macro Definition Documentation

◆ _PSEH3_H_

#define _PSEH3_H_

Definition at line 11 of file pseh3.h.

◆ _SEH3 [1/17]

#define _SEH3   $_AUTO_CLEANUP __attribute__((cleanup(_SEH3$_AutoCleanup)))

Definition at line 329 of file pseh3.h.

◆ _SEH3 [2/17]

#define _SEH3   $_EnforceFramePointer() asm volatile ("#\n" : : "m"(*(char*)__builtin_alloca(0)) : "%esp", "memory")

Definition at line 329 of file pseh3.h.

◆ _SEH3 [3/17]

#define _SEH3   $_ASM_GOTO(...) asm goto ("#\n" : : : "memory" : __VA_ARGS__)

Definition at line 329 of file pseh3.h.

◆ _SEH3 [4/17]

#define _SEH3
Value:
$_CALL_WRAPPER(_Function, _TrylevelFrame, _DataTable) \
asm goto ("leal %0, %%eax\n\t" \
"leal %1, %%edx\n\t" \
"call " #_Function \
: \
: "m" (*(_TrylevelFrame)), "m" (*(_DataTable)), "p" (_SEH3$_RegisterFrameWithNonVolatiles) \
: "eax", "edx", "ecx", "memory" \
: _SEH3$_l_BeforeTry, _SEH3$_l_HandlerTarget, _SEH3$_l_OnException, _SEH3$_l_BeforeFilterOrFinally, _SEH3$_l_FilterOrFinally)
#define _SEH3
Definition: pseh3.h:329

Definition at line 329 of file pseh3.h.

◆ _SEH3 [5/17]

#define _SEH3
Value:
$_RegisterFrame_(_TrylevelFrame, _DataTable) \
_SEH3$_CALL_WRAPPER(__SEH3$_RegisterFrame, _TrylevelFrame, _DataTable)

Definition at line 329 of file pseh3.h.

◆ _SEH3 [6/17]

#define _SEH3
Value:
$_RegisterTryLevel_(_TrylevelFrame, _DataTable) \
_SEH3$_CALL_WRAPPER(__SEH3$_RegisterTryLevel, _TrylevelFrame, _DataTable)

Definition at line 329 of file pseh3.h.

◆ _SEH3 [7/17]

#define _SEH3
Value:
$_SCARE_GCC() \
void *plabel; \
_SEH3$_ASM_GOTO(_SEH3$_l_BeforeTry, _SEH3$_l_HandlerTarget, _SEH3$_l_OnException, _SEH3$_l_BeforeFilterOrFinally, _SEH3$_l_FilterOrFinally); \
asm volatile ("#" : "=a"(plabel) : "p"(&&_SEH3$_l_BeforeTry), "p"(&&_SEH3$_l_HandlerTarget), "p"(&&_SEH3$_l_OnException), "p"(&&_SEH3$_l_FilterOrFinally) \
: "ebx", "ecx", "edx", "esi", "edi", "flags", "memory" ); \
goto _SEH3$_l_OnException;
#define _SEH3
Definition: pseh3.h:329

Definition at line 329 of file pseh3.h.

◆ _SEH3 [8/17]

#define _SEH3
Value:
$_DECLARE_EXCEPT_INTRINSICS() \
inline __attribute__((always_inline, gnu_inline)) \
unsigned long _exception_code() { return _SEH3$_TrylevelFrame.ExceptionCode; }
static __attribute__((always_inline)) __attribute__((returns_twice)) void _SEH3 $_PreventInlining()
Definition: pseh3.h:92
#define _SEH3
Definition: pseh3.h:329

Definition at line 329 of file pseh3.h.

◆ _SEH3 [9/17]

#define _SEH3
Value:
$_DECLARE_FILTER_FUNC(_Name) \
auto int __fastcall _Name(int Action)
#define __fastcall
Definition: sync.c:41
_In_ PLIST_ENTRY _In_ PSTRING _In_ USHORT _In_opt_ PSTRING _In_opt_ PSTRING _In_ ULONG _In_ ULONG Action
Definition: fsrtlfuncs.h:738

Definition at line 329 of file pseh3.h.

◆ _SEH3 [10/17]

#define _SEH3
Value:
$_NESTED_FUNC_OPEN(_Name) \
int __fastcall _Name(int Action) \
{ \
/* This is a fancy way to get information about the frame layout */ \
if (Action == 0) return (int)&_SEH3$_TrylevelFrame;
return
Definition: dirsup.c:529
#define __fastcall
Definition: sync.c:41
#define _SEH3
Definition: pseh3.h:329
_In_ PLIST_ENTRY _In_ PSTRING _In_ USHORT _In_opt_ PSTRING _In_opt_ PSTRING _In_ ULONG _In_ ULONG Action
Definition: fsrtlfuncs.h:738

Definition at line 329 of file pseh3.h.

◆ _SEH3 [11/17]

#define _SEH3
Value:
$_DEFINE_FILTER_FUNC(_Name, expression) \
_SEH3$_NESTED_FUNC_OPEN(_Name) \
/* Declare the intrinsics for exception filters */ \
_Pragma("GCC diagnostic push") \
_Pragma("GCC diagnostic ignored \"-Wshadow\"") \
inline __attribute__((always_inline, gnu_inline)) \
unsigned long _exception_code() { return _SEH3$_TrylevelFrame.ExceptionCode; } \
inline __attribute__((always_inline, gnu_inline)) \
void * _exception_info() { return _SEH3$_TrylevelFrame.ExceptionPointers; } \
_Pragma("GCC diagnostic pop") \
\
/* Now handle the actual filter expression */ \
return (expression); \
}
static __attribute__((always_inline)) __attribute__((returns_twice)) void _SEH3 $_PreventInlining()
Definition: pseh3.h:92
#define _SEH3
Definition: pseh3.h:329

Definition at line 329 of file pseh3.h.

◆ _SEH3 [12/17]

#define _SEH3
Value:
$_FINALLY_FUNC_OPEN(_Name) \
_SEH3$_NESTED_FUNC_OPEN(_Name) \
/* Declare the intrinsics for the finally function */ \
inline __attribute__((always_inline, gnu_inline)) \
int _abnormal_termination() { return (_SEH3$_TrylevelFrame.ExceptionPointers != 0); } \
\
/* This construct makes sure that the finally function returns */ \
/* a proper value at the end */ \
for (; ; (void)({return 0; 0;}))
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
static __attribute__((always_inline)) __attribute__((returns_twice)) void _SEH3 $_PreventInlining()
Definition: pseh3.h:92
#define _SEH3
Definition: pseh3.h:329
void _abnormal_termination()
Definition: stubs.c:222

Definition at line 329 of file pseh3.h.

◆ _SEH3 [13/17]

#define _SEH3
Value:
$_FILTER(_Filter, _FilterExpression) \
(__builtin_constant_p(_FilterExpression) ? (void*)(unsigned long)(unsigned char)(unsigned long)(_FilterExpression) : _Filter)
unsigned char
Definition: typeof.h:29

Definition at line 329 of file pseh3.h.

◆ _SEH3 [14/17]

#define _SEH3   $_FINALLY(_Finally) (_Finally)

Definition at line 329 of file pseh3.h.

◆ _SEH3 [15/17]

#define _SEH3
Value:
$_DEFINE_DUMMY_FINALLY(_Name) \
auto inline __attribute__((always_inline,gnu_inline)) int _Name(int Action) { (void)Action; return 0; }
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
static __attribute__((always_inline)) __attribute__((returns_twice)) void _SEH3 $_PreventInlining()
Definition: pseh3.h:92
_In_ PLIST_ENTRY _In_ PSTRING _In_ USHORT _In_opt_ PSTRING _In_opt_ PSTRING _In_ ULONG _In_ ULONG Action
Definition: fsrtlfuncs.h:738

Definition at line 329 of file pseh3.h.

◆ _SEH3 [16/17]

#define _SEH3
Value:
$_DECLARE_CLEANUP_FUNC(_Name) \
auto inline __attribute__((always_inline,gnu_inline)) void _Name(volatile SEH3$_REGISTRATION_FRAME *p)
static __attribute__((always_inline)) __attribute__((returns_twice)) void _SEH3 $_PreventInlining()
Definition: pseh3.h:92
GLfloat GLfloat p
Definition: glext.h:8902

Definition at line 329 of file pseh3.h.

◆ _SEH3 [17/17]

#define _SEH3
Value:
$_DEFINE_CLEANUP_FUNC(_Name) \
_SEH3$_DECLARE_CLEANUP_FUNC(_Name) \
{ \
(void)p; \
/* Unregister the frame */ \
if (_SEH3$_TryLevel == 1) _SEH3$_UnregisterFrame(&_SEH3$_TrylevelFrame); \
else _SEH3$_UnregisterTryLevel(&_SEH3$_TrylevelFrame); \
\
/* Invoke the finally function (an inline dummy in the __except case) */ \
_SEH3$_FinallyFunction(1); \
}
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
else
Definition: tritemp.h:161
#define _SEH3
Definition: pseh3.h:329
GLfloat GLfloat p
Definition: glext.h:8902

Definition at line 329 of file pseh3.h.

◆ _SEH3_END

#define _SEH3_END
Value:
}; \
goto _SEH3$_l_EndTry; \
\
_SEH3$_l_OnException: (void)0; \
/* Force GCC to create proper code pathes */ \
_SEH3$_SCARE_GCC(); \
\
_SEH3$_l_EndTry:(void)0; \
_SEH3$_ASM_GOTO(_SEH3$_l_OnException); \
\
/* Implementation of the auto cleanup function */ \
_SEH3$_DEFINE_CLEANUP_FUNC(_SEH3$_AutoCleanup); \
\
_Pragma("GCC diagnostic pop") \
\
/* Close the outer scope */ \
}
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
#define _SEH3
Definition: pseh3.h:329

Definition at line 469 of file pseh3.h.

◆ _SEH3_EXCEPT

#define _SEH3_EXCEPT (   ...)

Definition at line 386 of file pseh3.h.

◆ _SEH3_FINALLY

#define _SEH3_FINALLY

Definition at line 433 of file pseh3.h.

◆ _SEH3_LEAVE

#define _SEH3_LEAVE   goto _SEH3$_l_AfterTry

Definition at line 488 of file pseh3.h.

◆ _SEH3_TRY

#define _SEH3_TRY

Definition at line 345 of file pseh3.h.

◆ _SEH3_VOLATILE

#define _SEH3_VOLATILE   volatile

Definition at line 490 of file pseh3.h.

◆ PRAGMA_DIAGNOSTIC_IGNORED_DECLARATION_AFTER_STATEMENT

#define PRAGMA_DIAGNOSTIC_IGNORED_DECLARATION_AFTER_STATEMENT   _Pragma("GCC diagnostic ignored \"-Wdeclaration-after-statement\"")

Definition at line 22 of file pseh3.h.

Typedef Documentation

◆ _EXCEPTION_POINTERS

◆ _REGISTRATION_FRAME

◆ _SCOPE_TABLE

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
$_NESTED_HANDLER 
$_CPP_HANDLER 
$_CLANG_HANDLER 
$_HANDLER_TYPE 

Definition at line 30 of file pseh3.h.

31 {
35 #ifdef __clang__
37 #elif defined(__cplusplus)
39 #else
41 #endif
42 };
#define _SEH3
Definition: pseh3.h:329

◆ anonymous enum

anonymous enum
Enumerator
$_TryLevel 

Definition at line 113 of file pseh3.h.

114 {
115  _SEH3$_TryLevel = 0,
116 };
#define _SEH3
Definition: pseh3.h:329

Function Documentation

◆ __attribute__() [1/6]

static __attribute__ ( (always_inline)  )
inlinestatic

Definition at line 92 of file pseh3.h.

92 {}

◆ __attribute__() [2/6]

__attribute__ ( (always_inline, gnu_inline)  ) volatile
inline

Definition at line 95 of file pseh3.h.

97 {
98  asm volatile ("movl %k[NewHead], %%fs:0"
99  : : [NewHead] "ir" (RegistrationFrame->Next) : "memory");
100 }

◆ __attribute__() [3/6]

int __cdecl __attribute__ ( (error("Can only be used inside a __finally block."))  )

◆ __attribute__() [4/6]

unsigned long __cdecl __attribute__ ( (error("Can only be used inside an exception filter or __except block."))  )

◆ __attribute__() [5/6]

void* __cdecl __attribute__ ( (error("Can only be used inside an exception filter."))  )

◆ __attribute__() [6/6]

int __attribute__ ( (regparm(3))  ) volatile

Variable Documentation

◆ AllocaFrame

int const SEH3 $_SCOPE_TABLE void * AllocaFrame

Definition at line 133 of file pseh3.h.

◆ ScopeTable

int const SEH3 $_SCOPE_TABLE * ScopeTable

Definition at line 133 of file pseh3.h.