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