1 | #ifndef _upl_user_ |
2 | #define _upl_user_ |
3 | |
4 | /* Module upl */ |
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 upl_MSG_COUNT |
55 | #define upl_MSG_COUNT 4 |
56 | #endif /* upl_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 upl_abort */ |
72 | #ifdef mig_external |
73 | mig_external |
74 | #else |
75 | extern |
76 | #endif /* mig_external */ |
77 | kern_return_t upl_abort |
78 | ( |
79 | upl_t upl_object, |
80 | integer_t abort_cond |
81 | ); |
82 | |
83 | /* Routine upl_abort_range */ |
84 | #ifdef mig_external |
85 | mig_external |
86 | #else |
87 | extern |
88 | #endif /* mig_external */ |
89 | kern_return_t upl_abort_range |
90 | ( |
91 | upl_t upl_object, |
92 | upl_offset_t offset, |
93 | upl_size_t size, |
94 | integer_t abort_cond, |
95 | boolean_t *empty |
96 | ); |
97 | |
98 | /* Routine upl_commit */ |
99 | #ifdef mig_external |
100 | mig_external |
101 | #else |
102 | extern |
103 | #endif /* mig_external */ |
104 | kern_return_t upl_commit |
105 | ( |
106 | upl_t upl_object, |
107 | upl_page_info_array_t page_list, |
108 | mach_msg_type_number_t page_listCnt |
109 | ); |
110 | |
111 | /* Routine upl_commit_range */ |
112 | #ifdef mig_external |
113 | mig_external |
114 | #else |
115 | extern |
116 | #endif /* mig_external */ |
117 | kern_return_t upl_commit_range |
118 | ( |
119 | upl_t upl_object, |
120 | upl_offset_t offset, |
121 | upl_size_t size, |
122 | integer_t cntrl_flags, |
123 | upl_page_info_array_t page_list, |
124 | mach_msg_type_number_t page_listCnt, |
125 | boolean_t *empty |
126 | ); |
127 | |
128 | __END_DECLS |
129 | |
130 | /********************** Caution **************************/ |
131 | /* The following data types should be used to calculate */ |
132 | /* maximum message sizes only. The actual message may be */ |
133 | /* smaller, and the position of the arguments within the */ |
134 | /* message layout may vary from what is presented here. */ |
135 | /* For example, if any of the arguments are variable- */ |
136 | /* sized, and less than the maximum is sent, the data */ |
137 | /* will be packed tight in the actual message to reduce */ |
138 | /* the presence of holes. */ |
139 | /********************** Caution **************************/ |
140 | |
141 | /* typedefs for all requests */ |
142 | |
143 | #ifndef __Request__upl_subsystem__defined |
144 | #define __Request__upl_subsystem__defined |
145 | |
146 | #ifdef __MigPackStructs |
147 | #pragma pack(4) |
148 | #endif |
149 | typedef struct { |
150 | mach_msg_header_t Head; |
151 | NDR_record_t NDR; |
152 | integer_t abort_cond; |
153 | } __Request__upl_abort_t __attribute__((unused)); |
154 | #ifdef __MigPackStructs |
155 | #pragma pack() |
156 | #endif |
157 | |
158 | #ifdef __MigPackStructs |
159 | #pragma pack(4) |
160 | #endif |
161 | typedef struct { |
162 | mach_msg_header_t Head; |
163 | NDR_record_t NDR; |
164 | upl_offset_t offset; |
165 | upl_size_t size; |
166 | integer_t abort_cond; |
167 | } __Request__upl_abort_range_t __attribute__((unused)); |
168 | #ifdef __MigPackStructs |
169 | #pragma pack() |
170 | #endif |
171 | |
172 | #ifdef __MigPackStructs |
173 | #pragma pack(4) |
174 | #endif |
175 | typedef struct { |
176 | mach_msg_header_t Head; |
177 | NDR_record_t NDR; |
178 | mach_msg_type_number_t page_listCnt; |
179 | upl_page_info_t page_list[256]; |
180 | } __Request__upl_commit_t __attribute__((unused)); |
181 | #ifdef __MigPackStructs |
182 | #pragma pack() |
183 | #endif |
184 | |
185 | #ifdef __MigPackStructs |
186 | #pragma pack(4) |
187 | #endif |
188 | typedef struct { |
189 | mach_msg_header_t Head; |
190 | NDR_record_t NDR; |
191 | upl_offset_t offset; |
192 | upl_size_t size; |
193 | integer_t cntrl_flags; |
194 | mach_msg_type_number_t page_listCnt; |
195 | upl_page_info_t page_list[256]; |
196 | } __Request__upl_commit_range_t __attribute__((unused)); |
197 | #ifdef __MigPackStructs |
198 | #pragma pack() |
199 | #endif |
200 | #endif /* !__Request__upl_subsystem__defined */ |
201 | |
202 | /* union of all requests */ |
203 | |
204 | #ifndef __RequestUnion__upl_subsystem__defined |
205 | #define __RequestUnion__upl_subsystem__defined |
206 | union __RequestUnion__upl_subsystem { |
207 | __Request__upl_abort_t Request_upl_abort; |
208 | __Request__upl_abort_range_t Request_upl_abort_range; |
209 | __Request__upl_commit_t Request_upl_commit; |
210 | __Request__upl_commit_range_t Request_upl_commit_range; |
211 | }; |
212 | #endif /* !__RequestUnion__upl_subsystem__defined */ |
213 | /* typedefs for all replies */ |
214 | |
215 | #ifndef __Reply__upl_subsystem__defined |
216 | #define __Reply__upl_subsystem__defined |
217 | |
218 | #ifdef __MigPackStructs |
219 | #pragma pack(4) |
220 | #endif |
221 | typedef struct { |
222 | mach_msg_header_t Head; |
223 | NDR_record_t NDR; |
224 | kern_return_t RetCode; |
225 | } __Reply__upl_abort_t __attribute__((unused)); |
226 | #ifdef __MigPackStructs |
227 | #pragma pack() |
228 | #endif |
229 | |
230 | #ifdef __MigPackStructs |
231 | #pragma pack(4) |
232 | #endif |
233 | typedef struct { |
234 | mach_msg_header_t Head; |
235 | NDR_record_t NDR; |
236 | kern_return_t RetCode; |
237 | boolean_t empty; |
238 | } __Reply__upl_abort_range_t __attribute__((unused)); |
239 | #ifdef __MigPackStructs |
240 | #pragma pack() |
241 | #endif |
242 | |
243 | #ifdef __MigPackStructs |
244 | #pragma pack(4) |
245 | #endif |
246 | typedef struct { |
247 | mach_msg_header_t Head; |
248 | NDR_record_t NDR; |
249 | kern_return_t RetCode; |
250 | } __Reply__upl_commit_t __attribute__((unused)); |
251 | #ifdef __MigPackStructs |
252 | #pragma pack() |
253 | #endif |
254 | |
255 | #ifdef __MigPackStructs |
256 | #pragma pack(4) |
257 | #endif |
258 | typedef struct { |
259 | mach_msg_header_t Head; |
260 | NDR_record_t NDR; |
261 | kern_return_t RetCode; |
262 | boolean_t empty; |
263 | } __Reply__upl_commit_range_t __attribute__((unused)); |
264 | #ifdef __MigPackStructs |
265 | #pragma pack() |
266 | #endif |
267 | #endif /* !__Reply__upl_subsystem__defined */ |
268 | |
269 | /* union of all replies */ |
270 | |
271 | #ifndef __ReplyUnion__upl_subsystem__defined |
272 | #define __ReplyUnion__upl_subsystem__defined |
273 | union __ReplyUnion__upl_subsystem { |
274 | __Reply__upl_abort_t Reply_upl_abort; |
275 | __Reply__upl_abort_range_t Reply_upl_abort_range; |
276 | __Reply__upl_commit_t Reply_upl_commit; |
277 | __Reply__upl_commit_range_t Reply_upl_commit_range; |
278 | }; |
279 | #endif /* !__RequestUnion__upl_subsystem__defined */ |
280 | |
281 | #ifndef subsystem_to_name_map_upl |
282 | #define subsystem_to_name_map_upl \ |
283 | { "upl_abort", 2050 },\ |
284 | { "upl_abort_range", 2051 },\ |
285 | { "upl_commit", 2052 },\ |
286 | { "upl_commit_range", 2053 } |
287 | #endif |
288 | |
289 | #ifdef __AfterMigUserHeader |
290 | __AfterMigUserHeader |
291 | #endif /* __AfterMigUserHeader */ |
292 | |
293 | #endif /* _upl_user_ */ |
294 | |