1 | #ifndef␉_exc_user_␊ |
2 | #define␉_exc_user_␊ |
3 | ␊ |
4 | /* Module exc */␊ |
5 | ␊ |
6 | #include <string.h>␊ |
7 | #include <mach/ndr.h>␊ |
8 | #include <mach/boolean.h>␊ |
9 | #include <mach/kern_return.h>␊ |
10 | #include <mach/notify.h>␊ |
11 | #include <mach/mach_types.h>␊ |
12 | #include <mach/message.h>␊ |
13 | #include <mach/mig_errors.h>␊ |
14 | #include <mach/port.h>␊ |
15 | ␊ |
16 | #ifdef AUTOTEST␊ |
17 | #ifndef FUNCTION_PTR_T␊ |
18 | #define FUNCTION_PTR_T␊ |
19 | typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t);␊ |
20 | typedef struct {␊ |
21 | char *name;␊ |
22 | function_ptr_t function;␊ |
23 | } function_table_entry;␊ |
24 | typedef function_table_entry *function_table_t;␊ |
25 | #endif /* FUNCTION_PTR_T */␊ |
26 | #endif /* AUTOTEST */␊ |
27 | ␊ |
28 | #ifndef␉exc_MSG_COUNT␊ |
29 | #define␉exc_MSG_COUNT␉3␊ |
30 | #endif␉/* exc_MSG_COUNT */␊ |
31 | ␊ |
32 | #include <mach/std_types.h>␊ |
33 | #include <mach/mig.h>␊ |
34 | #include <mach/mig.h>␊ |
35 | #include <mach/mach_types.h>␊ |
36 | ␊ |
37 | #ifdef __BeforeMigUserHeader␊ |
38 | __BeforeMigUserHeader␊ |
39 | #endif /* __BeforeMigUserHeader */␊ |
40 | ␊ |
41 | #include <sys/cdefs.h>␊ |
42 | __BEGIN_DECLS␊ |
43 | ␊ |
44 | ␊ |
45 | /* Routine exception_raise */␊ |
46 | #ifdef␉mig_external␊ |
47 | mig_external␊ |
48 | #else␊ |
49 | extern␊ |
50 | #endif␉/* mig_external */␊ |
51 | kern_return_t exception_raise␊ |
52 | (␊ |
53 | ␉mach_port_t exception_port,␊ |
54 | ␉mach_port_t thread,␊ |
55 | ␉mach_port_t task,␊ |
56 | ␉exception_type_t exception,␊ |
57 | ␉exception_data_t code,␊ |
58 | ␉mach_msg_type_number_t codeCnt␊ |
59 | );␊ |
60 | ␊ |
61 | /* Routine exception_raise_state */␊ |
62 | #ifdef␉mig_external␊ |
63 | mig_external␊ |
64 | #else␊ |
65 | extern␊ |
66 | #endif␉/* mig_external */␊ |
67 | kern_return_t exception_raise_state␊ |
68 | (␊ |
69 | ␉mach_port_t exception_port,␊ |
70 | ␉exception_type_t exception,␊ |
71 | ␉const exception_data_t code,␊ |
72 | ␉mach_msg_type_number_t codeCnt,␊ |
73 | ␉int *flavor,␊ |
74 | ␉const thread_state_t old_state,␊ |
75 | ␉mach_msg_type_number_t old_stateCnt,␊ |
76 | ␉thread_state_t new_state,␊ |
77 | ␉mach_msg_type_number_t *new_stateCnt␊ |
78 | );␊ |
79 | ␊ |
80 | /* Routine exception_raise_state_identity */␊ |
81 | #ifdef␉mig_external␊ |
82 | mig_external␊ |
83 | #else␊ |
84 | extern␊ |
85 | #endif␉/* mig_external */␊ |
86 | kern_return_t exception_raise_state_identity␊ |
87 | (␊ |
88 | ␉mach_port_t exception_port,␊ |
89 | ␉mach_port_t thread,␊ |
90 | ␉mach_port_t task,␊ |
91 | ␉exception_type_t exception,␊ |
92 | ␉exception_data_t code,␊ |
93 | ␉mach_msg_type_number_t codeCnt,␊ |
94 | ␉int *flavor,␊ |
95 | ␉thread_state_t old_state,␊ |
96 | ␉mach_msg_type_number_t old_stateCnt,␊ |
97 | ␉thread_state_t new_state,␊ |
98 | ␉mach_msg_type_number_t *new_stateCnt␊ |
99 | );␊ |
100 | ␊ |
101 | __END_DECLS␊ |
102 | ␊ |
103 | /********************** Caution **************************/␊ |
104 | /* The following data types should be used to calculate */␊ |
105 | /* maximum message sizes only. The actual message may be */␊ |
106 | /* smaller, and the position of the arguments within the */␊ |
107 | /* message layout may vary from what is presented here. */␊ |
108 | /* For example, if any of the arguments are variable- */␊ |
109 | /* sized, and less than the maximum is sent, the data */␊ |
110 | /* will be packed tight in the actual message to reduce */␊ |
111 | /* the presence of holes. */␊ |
112 | /********************** Caution **************************/␊ |
113 | ␊ |
114 | /* typedefs for all requests */␊ |
115 | ␊ |
116 | #ifndef __Request__exc_subsystem__defined␊ |
117 | #define __Request__exc_subsystem__defined␊ |
118 | ␊ |
119 | #ifdef __MigPackStructs␊ |
120 | #pragma pack(4)␊ |
121 | #endif␊ |
122 | ␉typedef struct {␊ |
123 | ␉␉mach_msg_header_t Head;␊ |
124 | ␉␉/* start of the kernel processed data */␊ |
125 | ␉␉mach_msg_body_t msgh_body;␊ |
126 | ␉␉mach_msg_port_descriptor_t thread;␊ |
127 | ␉␉mach_msg_port_descriptor_t task;␊ |
128 | ␉␉/* end of the kernel processed data */␊ |
129 | ␉␉NDR_record_t NDR;␊ |
130 | ␉␉exception_type_t exception;␊ |
131 | ␉␉mach_msg_type_number_t codeCnt;␊ |
132 | ␉␉integer_t code[2];␊ |
133 | ␉} __Request__exception_raise_t;␊ |
134 | #ifdef __MigPackStructs␊ |
135 | #pragma pack()␊ |
136 | #endif␊ |
137 | ␊ |
138 | #ifdef __MigPackStructs␊ |
139 | #pragma pack(4)␊ |
140 | #endif␊ |
141 | ␉typedef struct {␊ |
142 | ␉␉mach_msg_header_t Head;␊ |
143 | ␉␉NDR_record_t NDR;␊ |
144 | ␉␉exception_type_t exception;␊ |
145 | ␉␉mach_msg_type_number_t codeCnt;␊ |
146 | ␉␉integer_t code[2];␊ |
147 | ␉␉int flavor;␊ |
148 | ␉␉mach_msg_type_number_t old_stateCnt;␊ |
149 | ␉␉natural_t old_state[224];␊ |
150 | ␉} __Request__exception_raise_state_t;␊ |
151 | #ifdef __MigPackStructs␊ |
152 | #pragma pack()␊ |
153 | #endif␊ |
154 | ␊ |
155 | #ifdef __MigPackStructs␊ |
156 | #pragma pack(4)␊ |
157 | #endif␊ |
158 | ␉typedef struct {␊ |
159 | ␉␉mach_msg_header_t Head;␊ |
160 | ␉␉/* start of the kernel processed data */␊ |
161 | ␉␉mach_msg_body_t msgh_body;␊ |
162 | ␉␉mach_msg_port_descriptor_t thread;␊ |
163 | ␉␉mach_msg_port_descriptor_t task;␊ |
164 | ␉␉/* end of the kernel processed data */␊ |
165 | ␉␉NDR_record_t NDR;␊ |
166 | ␉␉exception_type_t exception;␊ |
167 | ␉␉mach_msg_type_number_t codeCnt;␊ |
168 | ␉␉integer_t code[2];␊ |
169 | ␉␉int flavor;␊ |
170 | ␉␉mach_msg_type_number_t old_stateCnt;␊ |
171 | ␉␉natural_t old_state[224];␊ |
172 | ␉} __Request__exception_raise_state_identity_t;␊ |
173 | #ifdef __MigPackStructs␊ |
174 | #pragma pack()␊ |
175 | #endif␊ |
176 | #endif /* !__Request__exc_subsystem__defined */␊ |
177 | ␊ |
178 | /* union of all requests */␊ |
179 | ␊ |
180 | #ifndef __RequestUnion__exc_subsystem__defined␊ |
181 | #define __RequestUnion__exc_subsystem__defined␊ |
182 | union __RequestUnion__exc_subsystem {␊ |
183 | ␉__Request__exception_raise_t Request_exception_raise;␊ |
184 | ␉__Request__exception_raise_state_t Request_exception_raise_state;␊ |
185 | ␉__Request__exception_raise_state_identity_t Request_exception_raise_state_identity;␊ |
186 | };␊ |
187 | #endif /* !__RequestUnion__exc_subsystem__defined */␊ |
188 | /* typedefs for all replies */␊ |
189 | ␊ |
190 | #ifndef __Reply__exc_subsystem__defined␊ |
191 | #define __Reply__exc_subsystem__defined␊ |
192 | ␊ |
193 | #ifdef __MigPackStructs␊ |
194 | #pragma pack(4)␊ |
195 | #endif␊ |
196 | ␉typedef struct {␊ |
197 | ␉␉mach_msg_header_t Head;␊ |
198 | ␉␉NDR_record_t NDR;␊ |
199 | ␉␉kern_return_t RetCode;␊ |
200 | ␉} __Reply__exception_raise_t;␊ |
201 | #ifdef __MigPackStructs␊ |
202 | #pragma pack()␊ |
203 | #endif␊ |
204 | ␊ |
205 | #ifdef __MigPackStructs␊ |
206 | #pragma pack(4)␊ |
207 | #endif␊ |
208 | ␉typedef struct {␊ |
209 | ␉␉mach_msg_header_t Head;␊ |
210 | ␉␉NDR_record_t NDR;␊ |
211 | ␉␉kern_return_t RetCode;␊ |
212 | ␉␉int flavor;␊ |
213 | ␉␉mach_msg_type_number_t new_stateCnt;␊ |
214 | ␉␉natural_t new_state[224];␊ |
215 | ␉} __Reply__exception_raise_state_t;␊ |
216 | #ifdef __MigPackStructs␊ |
217 | #pragma pack()␊ |
218 | #endif␊ |
219 | ␊ |
220 | #ifdef __MigPackStructs␊ |
221 | #pragma pack(4)␊ |
222 | #endif␊ |
223 | ␉typedef struct {␊ |
224 | ␉␉mach_msg_header_t Head;␊ |
225 | ␉␉NDR_record_t NDR;␊ |
226 | ␉␉kern_return_t RetCode;␊ |
227 | ␉␉int flavor;␊ |
228 | ␉␉mach_msg_type_number_t new_stateCnt;␊ |
229 | ␉␉natural_t new_state[224];␊ |
230 | ␉} __Reply__exception_raise_state_identity_t;␊ |
231 | #ifdef __MigPackStructs␊ |
232 | #pragma pack()␊ |
233 | #endif␊ |
234 | #endif /* !__Reply__exc_subsystem__defined */␊ |
235 | ␊ |
236 | /* union of all replies */␊ |
237 | ␊ |
238 | #ifndef __ReplyUnion__exc_subsystem__defined␊ |
239 | #define __ReplyUnion__exc_subsystem__defined␊ |
240 | union __ReplyUnion__exc_subsystem {␊ |
241 | ␉__Reply__exception_raise_t Reply_exception_raise;␊ |
242 | ␉__Reply__exception_raise_state_t Reply_exception_raise_state;␊ |
243 | ␉__Reply__exception_raise_state_identity_t Reply_exception_raise_state_identity;␊ |
244 | };␊ |
245 | #endif /* !__RequestUnion__exc_subsystem__defined */␊ |
246 | ␊ |
247 | #ifndef subsystem_to_name_map_exc␊ |
248 | #define subsystem_to_name_map_exc \␊ |
249 | { "exception_raise", 2401 },\␊ |
250 | { "exception_raise_state", 2402 },\␊ |
251 | { "exception_raise_state_identity", 2403 }␊ |
252 | #endif␊ |
253 | ␊ |
254 | #ifdef __AfterMigUserHeader␊ |
255 | __AfterMigUserHeader␊ |
256 | #endif /* __AfterMigUserHeader */␊ |
257 | ␊ |
258 | #endif␉ /* _exc_user_ */␊ |
259 | |