2ee739cc |
1 | /* |
2 | * seh.h |
3 | * |
4 | * [Generated from seh, 25 September 1996] |
5 | */ |
6 | |
7 | #if !defined(__CC_NORCROFT) || !defined(__arm) |
8 | #error You must use the Norcroft ARM Compiler for Sapphire programs |
9 | #endif |
10 | |
11 | #pragma include_only_once |
12 | #pragma force_top_level |
13 | |
14 | #ifndef __seh_h |
15 | #define __seh_h |
16 | |
17 | #ifndef __sapphire_h |
18 | #include "sapphire.h" |
19 | #endif |
20 | |
21 | /*----- Overview ----------------------------------------------------------* |
22 | * |
23 | * Functions provided: |
24 | * |
25 | * seh_try |
26 | * seh_unTry |
27 | * seh_throw |
28 | * seh_throwErrors |
29 | * seh_setListBase |
30 | * seh_init |
31 | */ |
32 | |
33 | /* --- seh_try --- * |
34 | * |
35 | * On entry: R0 == pointer to catch definition block |
36 | * |
37 | * On exit: R13 dropped by a (small) amount |
38 | * |
39 | * Use: Inserts an exception handler at the current position. |
40 | * Exceptions are matched against those described in the catch |
41 | * block. If there is a handler for the exception, the |
42 | * corresponding handler is called, and expected to resume |
43 | * normally. Otherwise the tidy-up routine is called and we |
44 | * unwind the stack further to find an appropriate handler. |
45 | * |
46 | * The catch block has the following format: |
47 | * |
48 | * word B to tidy-up routine |
49 | * word 1st exception mask |
50 | * word 1st B to catch routine |
51 | * word 2nd exception mask |
52 | * word 2nd B to catch routine |
53 | * ... |
54 | * word 0 |
55 | * |
56 | * An exception mask contains two halfwords. Bits 16-31 are the |
57 | * class to match, or -1 for all classes. Bits 0-15 are the |
58 | * subtype to match, or -1 for all subtypes. You can do really |
59 | * odd things if you set bits 16-31 to -1 and leave 0-15 |
60 | * matching specific subtypes -- do this at your own risk. |
61 | */ |
62 | |
63 | extern routine seh_try; |
64 | |
65 | /* --- seh_unTry --- * |
66 | * |
67 | * On entry: -- |
68 | * |
69 | * On exit: R13 moved to position before corresponding seh_try |
70 | * |
71 | * Use: Removes the try block marker in the stack at the current |
72 | * position. Note that the stack will be unwound to where it |
73 | * was when seh_try was called. |
74 | */ |
75 | |
76 | extern routine seh_unTry; |
77 | |
78 | /* --- seh_throw --- * |
79 | * |
80 | * On entry: R0 == exception to match |
81 | * R1-R3 == useful bits of information |
82 | * |
83 | * On exit: Doesn't return, unless you've done something /really/ odd |
84 | * |
85 | * Use: Throws an exception. The stack is unwound until we find |
86 | * a handler which can cope. If there is no handler, we abort |
87 | * the program. |
88 | */ |
89 | |
90 | extern routine seh_throw; |
91 | |
92 | /* --- seh_throwErrors --- * |
93 | * |
94 | * On entry: -- |
95 | * |
96 | * On exit: -- |
97 | * |
98 | * Use: Sets up an except-style error handler to throw errors |
99 | * as SEH exceptions. |
100 | */ |
101 | |
102 | extern routine seh_throwErrors; |
103 | |
104 | /* --- seh_setListBase --- * |
105 | * |
106 | * On entry: R0 == pointer to try block list base, or 0 to use global |
107 | * |
108 | * On exit: -- |
109 | * |
110 | * Use: Sets the try block list base. This should only be used by |
111 | * coroutine providers, like coRoutine and thread. |
112 | */ |
113 | |
114 | extern routine seh_setListBase; |
115 | |
116 | /* --- seh_init --- * |
117 | * |
118 | * On entry: -- |
119 | * |
120 | * On exit: -- |
121 | * |
122 | * Use: Initialises SEH's facilities. |
123 | */ |
124 | |
125 | extern routine seh_init; |
126 | |
127 | /*----- That's all, folks -------------------------------------------------*/ |
128 | |
129 | #endif |