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