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