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