b1feae5531fba7ee3f6586770b6d29a55dd1ac34
[tpg/acess2.git] / Usermode / Libraries / libc++.so_src / exception_handling.h
1 /*
2  */
3 #ifndef _EXCEPTION_HANLDING_H_
4 #define _EXCEPTION_HANLDING_H_
5
6 typedef void *(unexpected_handler)(void);
7 typedef void *(terminate_handler)(void);
8
9 struct _Unwind_Context;
10
11 typedef enum {
12         _URC_NO_REASON = 0,
13         _URC_FOREIGN_EXCEPTION_CAUGHT = 1,
14         _URC_FATAL_PHASE2_ERROR = 2,
15         _URC_FATAL_PHASE1_ERROR = 3,
16         _URC_NORMAL_STOP = 4,
17         _URC_END_OF_STACK = 5,
18         _URC_HANDLER_FOUND = 6,
19         _URC_INSTALL_CONTEXT = 7,
20         _URC_CONTINUE_UNWIND = 8
21 } _Unwind_Reason_Code;
22
23 typedef void    (*_Unwind_Exception_Cleanup_Fn)(_Unwind_Reason_Code reason, struct _Unwind_Exception *exc);
24
25 struct _Unwind_Exception
26 {
27         uint64_t        exception_class;
28         _Unwind_Exception_Cleanup_Fn    exception_cleanup;
29         uint64_t        private_1;
30         uint64_t        private_2;
31 };
32
33 struct __cxa_exception
34 {
35         std::type_info* exceptionType;
36         void (*exceptionDestructor)(void *);
37         unexpected_handler      unexpectedHandler;
38         terminate_handler       terminateHandler;
39         __cxa_exception*        nextException;
40         
41         int     handlerCount;
42         
43         int     handlerSwitchValue;
44         const char*     actionRecord;
45         const char*     languageSpecificData;
46         void*   catchTemp;
47         void*   adjustedPtr;
48         
49         _Unwind_Exception       unwindHeader;
50 };
51
52
53 extern "C" void __cxa_call_unexpected(void *);
54 extern "C" void *__cxa_allocate_exception(size_t thrown_size);
55 extern "C" void __cxa_free_exception(void *thrown_exception);
56 extern "C" void __cxa_throw(void *thrown_exception, std::type_info *tinfo, void (*dest)(void*));
57 extern "C" void *__cxa_begin_catch(void *exceptionObject);
58 extern "C" void __cxa_end_catch();
59
60 extern "C" void _Unwind_RaiseException(void *thrown_exception);
61
62 #endif
63

UCC git Repository :: git.ucc.asn.au