1 | #ifndef _mach_exc_user_ |
2 | #define _mach_exc_user_ |
3 | |
4 | /* Module mach_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 | /* BEGIN MIG_STRNCPY_ZEROFILL CODE */ |
17 | |
18 | #if defined(__has_include) |
19 | #if __has_include(<mach/mig_strncpy_zerofill_support.h>) |
20 | #ifndef USING_MIG_STRNCPY_ZEROFILL |
21 | #define USING_MIG_STRNCPY_ZEROFILL |
22 | #endif |
23 | #ifndef __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ |
24 | #define __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ |
25 | #ifdef __cplusplus |
26 | extern "C" { |
27 | #endif |
28 | extern int mig_strncpy_zerofill(char *dest, const char *src, int len) __attribute__((weak_import)); |
29 | #ifdef __cplusplus |
30 | } |
31 | #endif |
32 | #endif /* __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ */ |
33 | #endif /* __has_include(<mach/mig_strncpy_zerofill_support.h>) */ |
34 | #endif /* __has_include */ |
35 | |
36 | /* END MIG_STRNCPY_ZEROFILL CODE */ |
37 | |
38 | #if (__MigKernelSpecificCode) || (_MIG_KERNEL_SPECIFIC_CODE_) |
39 | #include <kern/ipc_mig.h> |
40 | #endif /* __MigKernelSpecificCode */ |
41 | |
42 | #ifdef AUTOTEST |
43 | #ifndef FUNCTION_PTR_T |
44 | #define FUNCTION_PTR_T |
45 | typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); |
46 | typedef struct { |
47 | char *name; |
48 | function_ptr_t function; |
49 | } function_table_entry; |
50 | typedef function_table_entry *function_table_t; |
51 | #endif /* FUNCTION_PTR_T */ |
52 | #endif /* AUTOTEST */ |
53 | |
54 | #ifndef mach_exc_MSG_COUNT |
55 | #define mach_exc_MSG_COUNT 3 |
56 | #endif /* mach_exc_MSG_COUNT */ |
57 | |
58 | #include <mach/std_types.h> |
59 | #include <mach/mig.h> |
60 | #include <mach/mig.h> |
61 | #include <mach/mach_types.h> |
62 | |
63 | #ifdef __BeforeMigUserHeader |
64 | __BeforeMigUserHeader |
65 | #endif /* __BeforeMigUserHeader */ |
66 | |
67 | #include <sys/cdefs.h> |
68 | __BEGIN_DECLS |
69 | |
70 | |
71 | /* Routine mach_exception_raise */ |
72 | #ifdef mig_external |
73 | mig_external |
74 | #else |
75 | extern |
76 | #endif /* mig_external */ |
77 | kern_return_t mach_exception_raise |
78 | ( |
79 | mach_port_t exception_port, |
80 | mach_port_t thread, |
81 | mach_port_t task, |
82 | exception_type_t exception, |
83 | mach_exception_data_t code, |
84 | mach_msg_type_number_t codeCnt |
85 | ); |
86 | |
87 | /* Routine mach_exception_raise_state */ |
88 | #ifdef mig_external |
89 | mig_external |
90 | #else |
91 | extern |
92 | #endif /* mig_external */ |
93 | kern_return_t mach_exception_raise_state |
94 | ( |
95 | mach_port_t exception_port, |
96 | exception_type_t exception, |
97 | const mach_exception_data_t code, |
98 | mach_msg_type_number_t codeCnt, |
99 | int *flavor, |
100 | const thread_state_t old_state, |
101 | mach_msg_type_number_t old_stateCnt, |
102 | thread_state_t new_state, |
103 | mach_msg_type_number_t *new_stateCnt |
104 | ); |
105 | |
106 | /* Routine mach_exception_raise_state_identity */ |
107 | #ifdef mig_external |
108 | mig_external |
109 | #else |
110 | extern |
111 | #endif /* mig_external */ |
112 | kern_return_t mach_exception_raise_state_identity |
113 | ( |
114 | mach_port_t exception_port, |
115 | mach_port_t thread, |
116 | mach_port_t task, |
117 | exception_type_t exception, |
118 | mach_exception_data_t code, |
119 | mach_msg_type_number_t codeCnt, |
120 | int *flavor, |
121 | thread_state_t old_state, |
122 | mach_msg_type_number_t old_stateCnt, |
123 | thread_state_t new_state, |
124 | mach_msg_type_number_t *new_stateCnt |
125 | ); |
126 | |
127 | __END_DECLS |
128 | |
129 | /********************** Caution **************************/ |
130 | /* The following data types should be used to calculate */ |
131 | /* maximum message sizes only. The actual message may be */ |
132 | /* smaller, and the position of the arguments within the */ |
133 | /* message layout may vary from what is presented here. */ |
134 | /* For example, if any of the arguments are variable- */ |
135 | /* sized, and less than the maximum is sent, the data */ |
136 | /* will be packed tight in the actual message to reduce */ |
137 | /* the presence of holes. */ |
138 | /********************** Caution **************************/ |
139 | |
140 | /* typedefs for all requests */ |
141 | |
142 | #ifndef __Request__mach_exc_subsystem__defined |
143 | #define __Request__mach_exc_subsystem__defined |
144 | |
145 | #ifdef __MigPackStructs |
146 | #pragma pack(4) |
147 | #endif |
148 | typedef struct { |
149 | mach_msg_header_t Head; |
150 | /* start of the kernel processed data */ |
151 | mach_msg_body_t msgh_body; |
152 | mach_msg_port_descriptor_t thread; |
153 | mach_msg_port_descriptor_t task; |
154 | /* end of the kernel processed data */ |
155 | NDR_record_t NDR; |
156 | exception_type_t exception; |
157 | mach_msg_type_number_t codeCnt; |
158 | int64_t code[2]; |
159 | } __Request__mach_exception_raise_t __attribute__((unused)); |
160 | #ifdef __MigPackStructs |
161 | #pragma pack() |
162 | #endif |
163 | |
164 | #ifdef __MigPackStructs |
165 | #pragma pack(4) |
166 | #endif |
167 | typedef struct { |
168 | mach_msg_header_t Head; |
169 | NDR_record_t NDR; |
170 | exception_type_t exception; |
171 | mach_msg_type_number_t codeCnt; |
172 | int64_t code[2]; |
173 | int flavor; |
174 | mach_msg_type_number_t old_stateCnt; |
175 | natural_t old_state[614]; |
176 | } __Request__mach_exception_raise_state_t __attribute__((unused)); |
177 | #ifdef __MigPackStructs |
178 | #pragma pack() |
179 | #endif |
180 | |
181 | #ifdef __MigPackStructs |
182 | #pragma pack(4) |
183 | #endif |
184 | typedef struct { |
185 | mach_msg_header_t Head; |
186 | /* start of the kernel processed data */ |
187 | mach_msg_body_t msgh_body; |
188 | mach_msg_port_descriptor_t thread; |
189 | mach_msg_port_descriptor_t task; |
190 | /* end of the kernel processed data */ |
191 | NDR_record_t NDR; |
192 | exception_type_t exception; |
193 | mach_msg_type_number_t codeCnt; |
194 | int64_t code[2]; |
195 | int flavor; |
196 | mach_msg_type_number_t old_stateCnt; |
197 | natural_t old_state[614]; |
198 | } __Request__mach_exception_raise_state_identity_t __attribute__((unused)); |
199 | #ifdef __MigPackStructs |
200 | #pragma pack() |
201 | #endif |
202 | #endif /* !__Request__mach_exc_subsystem__defined */ |
203 | |
204 | /* union of all requests */ |
205 | |
206 | #ifndef __RequestUnion__mach_exc_subsystem__defined |
207 | #define __RequestUnion__mach_exc_subsystem__defined |
208 | union __RequestUnion__mach_exc_subsystem { |
209 | __Request__mach_exception_raise_t Request_mach_exception_raise; |
210 | __Request__mach_exception_raise_state_t Request_mach_exception_raise_state; |
211 | __Request__mach_exception_raise_state_identity_t Request_mach_exception_raise_state_identity; |
212 | }; |
213 | #endif /* !__RequestUnion__mach_exc_subsystem__defined */ |
214 | /* typedefs for all replies */ |
215 | |
216 | #ifndef __Reply__mach_exc_subsystem__defined |
217 | #define __Reply__mach_exc_subsystem__defined |
218 | |
219 | #ifdef __MigPackStructs |
220 | #pragma pack(4) |
221 | #endif |
222 | typedef struct { |
223 | mach_msg_header_t Head; |
224 | NDR_record_t NDR; |
225 | kern_return_t RetCode; |
226 | } __Reply__mach_exception_raise_t __attribute__((unused)); |
227 | #ifdef __MigPackStructs |
228 | #pragma pack() |
229 | #endif |
230 | |
231 | #ifdef __MigPackStructs |
232 | #pragma pack(4) |
233 | #endif |
234 | typedef struct { |
235 | mach_msg_header_t Head; |
236 | NDR_record_t NDR; |
237 | kern_return_t RetCode; |
238 | int flavor; |
239 | mach_msg_type_number_t new_stateCnt; |
240 | natural_t new_state[614]; |
241 | } __Reply__mach_exception_raise_state_t __attribute__((unused)); |
242 | #ifdef __MigPackStructs |
243 | #pragma pack() |
244 | #endif |
245 | |
246 | #ifdef __MigPackStructs |
247 | #pragma pack(4) |
248 | #endif |
249 | typedef struct { |
250 | mach_msg_header_t Head; |
251 | NDR_record_t NDR; |
252 | kern_return_t RetCode; |
253 | int flavor; |
254 | mach_msg_type_number_t new_stateCnt; |
255 | natural_t new_state[614]; |
256 | } __Reply__mach_exception_raise_state_identity_t __attribute__((unused)); |
257 | #ifdef __MigPackStructs |
258 | #pragma pack() |
259 | #endif |
260 | #endif /* !__Reply__mach_exc_subsystem__defined */ |
261 | |
262 | /* union of all replies */ |
263 | |
264 | #ifndef __ReplyUnion__mach_exc_subsystem__defined |
265 | #define __ReplyUnion__mach_exc_subsystem__defined |
266 | union __ReplyUnion__mach_exc_subsystem { |
267 | __Reply__mach_exception_raise_t Reply_mach_exception_raise; |
268 | __Reply__mach_exception_raise_state_t Reply_mach_exception_raise_state; |
269 | __Reply__mach_exception_raise_state_identity_t Reply_mach_exception_raise_state_identity; |
270 | }; |
271 | #endif /* !__RequestUnion__mach_exc_subsystem__defined */ |
272 | |
273 | #ifndef subsystem_to_name_map_mach_exc |
274 | #define subsystem_to_name_map_mach_exc \ |
275 | { "mach_exception_raise", 2405 },\ |
276 | { "mach_exception_raise_state", 2406 },\ |
277 | { "mach_exception_raise_state_identity", 2407 } |
278 | #endif |
279 | |
280 | #ifdef __AfterMigUserHeader |
281 | __AfterMigUserHeader |
282 | #endif /* __AfterMigUserHeader */ |
283 | |
284 | #endif /* _mach_exc_user_ */ |
285 | |