| 1 | /* |
| 2 | * IDENTIFICATION: |
| 3 | * stub generated Tue Apr 9 11:33:41 2019 |
| 4 | * with a MiG generated by bootstrap_cmds-96.20.2.200.4 |
| 5 | * OPTIONS: |
| 6 | * KernelServer |
| 7 | */ |
| 8 | |
| 9 | /* Module upl */ |
| 10 | |
| 11 | #define __MIG_check__Request__upl_subsystem__ 1 |
| 12 | |
| 13 | #include "upl_server.h" |
| 14 | |
| 15 | #ifndef mig_internal |
| 16 | #define mig_internal static __inline__ |
| 17 | #endif /* mig_internal */ |
| 18 | |
| 19 | #ifndef mig_external |
| 20 | #define mig_external |
| 21 | #endif /* mig_external */ |
| 22 | |
| 23 | #if !defined(__MigTypeCheck) && defined(TypeCheck) |
| 24 | #define __MigTypeCheck TypeCheck /* Legacy setting */ |
| 25 | #endif /* !defined(__MigTypeCheck) */ |
| 26 | |
| 27 | #if !defined(__MigKernelSpecificCode) && defined(_MIG_KERNEL_SPECIFIC_CODE_) |
| 28 | #define __MigKernelSpecificCode _MIG_KERNEL_SPECIFIC_CODE_ /* Legacy setting */ |
| 29 | #endif /* !defined(__MigKernelSpecificCode) */ |
| 30 | |
| 31 | #ifndef LimitCheck |
| 32 | #define LimitCheck 0 |
| 33 | #endif /* LimitCheck */ |
| 34 | |
| 35 | #ifndef min |
| 36 | #define min(a,b) ( ((a) < (b))? (a): (b) ) |
| 37 | #endif /* min */ |
| 38 | |
| 39 | #if !defined(_WALIGN_) |
| 40 | #define _WALIGN_(x) (((x) + 3) & ~3) |
| 41 | #endif /* !defined(_WALIGN_) */ |
| 42 | |
| 43 | #if !defined(_WALIGNSZ_) |
| 44 | #define _WALIGNSZ_(x) _WALIGN_(sizeof(x)) |
| 45 | #endif /* !defined(_WALIGNSZ_) */ |
| 46 | |
| 47 | #ifndef UseStaticTemplates |
| 48 | #define UseStaticTemplates 0 |
| 49 | #endif /* UseStaticTemplates */ |
| 50 | |
| 51 | #ifndef __DeclareRcvRpc |
| 52 | #define __DeclareRcvRpc(_NUM_, _NAME_) |
| 53 | #endif /* __DeclareRcvRpc */ |
| 54 | |
| 55 | #ifndef __BeforeRcvRpc |
| 56 | #define __BeforeRcvRpc(_NUM_, _NAME_) |
| 57 | #endif /* __BeforeRcvRpc */ |
| 58 | |
| 59 | #ifndef __AfterRcvRpc |
| 60 | #define __AfterRcvRpc(_NUM_, _NAME_) |
| 61 | #endif /* __AfterRcvRpc */ |
| 62 | |
| 63 | #ifndef __DeclareRcvSimple |
| 64 | #define __DeclareRcvSimple(_NUM_, _NAME_) |
| 65 | #endif /* __DeclareRcvSimple */ |
| 66 | |
| 67 | #ifndef __BeforeRcvSimple |
| 68 | #define __BeforeRcvSimple(_NUM_, _NAME_) |
| 69 | #endif /* __BeforeRcvSimple */ |
| 70 | |
| 71 | #ifndef __AfterRcvSimple |
| 72 | #define __AfterRcvSimple(_NUM_, _NAME_) |
| 73 | #endif /* __AfterRcvSimple */ |
| 74 | |
| 75 | #define novalue void |
| 76 | |
| 77 | #if __MigKernelSpecificCode |
| 78 | #define msgh_request_port msgh_remote_port |
| 79 | #define MACH_MSGH_BITS_REQUEST(bits) MACH_MSGH_BITS_REMOTE(bits) |
| 80 | #define msgh_reply_port msgh_local_port |
| 81 | #define MACH_MSGH_BITS_REPLY(bits) MACH_MSGH_BITS_LOCAL(bits) |
| 82 | #else |
| 83 | #define msgh_request_port msgh_local_port |
| 84 | #define MACH_MSGH_BITS_REQUEST(bits) MACH_MSGH_BITS_LOCAL(bits) |
| 85 | #define msgh_reply_port msgh_remote_port |
| 86 | #define MACH_MSGH_BITS_REPLY(bits) MACH_MSGH_BITS_REMOTE(bits) |
| 87 | #endif /* __MigKernelSpecificCode */ |
| 88 | |
| 89 | #define MIG_RETURN_ERROR(X, code) {\ |
| 90 | ((mig_reply_error_t *)X)->RetCode = code;\ |
| 91 | ((mig_reply_error_t *)X)->NDR = NDR_record;\ |
| 92 | return;\ |
| 93 | } |
| 94 | |
| 95 | /* Forward Declarations */ |
| 96 | |
| 97 | |
| 98 | mig_internal novalue _Xupl_abort |
| 99 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 100 | |
| 101 | mig_internal novalue _Xupl_abort_range |
| 102 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 103 | |
| 104 | mig_internal novalue _Xupl_commit |
| 105 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 106 | |
| 107 | mig_internal novalue _Xupl_commit_range |
| 108 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 109 | |
| 110 | |
| 111 | #if ( __MigTypeCheck ) |
| 112 | #if __MIG_check__Request__upl_subsystem__ |
| 113 | #if !defined(__MIG_check__Request__upl_abort_t__defined) |
| 114 | #define __MIG_check__Request__upl_abort_t__defined |
| 115 | |
| 116 | mig_internal kern_return_t __MIG_check__Request__upl_abort_t(__attribute__((__unused__)) __Request__upl_abort_t *In0P) |
| 117 | { |
| 118 | |
| 119 | typedef __Request__upl_abort_t __Request; |
| 120 | #if __MigTypeCheck |
| 121 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 122 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 123 | return MIG_BAD_ARGUMENTS; |
| 124 | #endif /* __MigTypeCheck */ |
| 125 | |
| 126 | return MACH_MSG_SUCCESS; |
| 127 | } |
| 128 | #endif /* !defined(__MIG_check__Request__upl_abort_t__defined) */ |
| 129 | #endif /* __MIG_check__Request__upl_subsystem__ */ |
| 130 | #endif /* ( __MigTypeCheck ) */ |
| 131 | |
| 132 | |
| 133 | /* Routine upl_abort */ |
| 134 | mig_internal novalue _Xupl_abort |
| 135 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 136 | { |
| 137 | |
| 138 | #ifdef __MigPackStructs |
| 139 | #pragma pack(4) |
| 140 | #endif |
| 141 | typedef struct { |
| 142 | mach_msg_header_t Head; |
| 143 | NDR_record_t NDR; |
| 144 | integer_t abort_cond; |
| 145 | mach_msg_trailer_t trailer; |
| 146 | } Request __attribute__((unused)); |
| 147 | #ifdef __MigPackStructs |
| 148 | #pragma pack() |
| 149 | #endif |
| 150 | typedef __Request__upl_abort_t __Request; |
| 151 | typedef __Reply__upl_abort_t Reply __attribute__((unused)); |
| 152 | |
| 153 | /* |
| 154 | * typedef struct { |
| 155 | * mach_msg_header_t Head; |
| 156 | * NDR_record_t NDR; |
| 157 | * kern_return_t RetCode; |
| 158 | * } mig_reply_error_t; |
| 159 | */ |
| 160 | |
| 161 | Request *In0P = (Request *) InHeadP; |
| 162 | Reply *OutP = (Reply *) OutHeadP; |
| 163 | #ifdef __MIG_check__Request__upl_abort_t__defined |
| 164 | kern_return_t check_result; |
| 165 | #endif /* __MIG_check__Request__upl_abort_t__defined */ |
| 166 | |
| 167 | #if __MigKernelSpecificCode |
| 168 | #else |
| 169 | #endif /* __MigKernelSpecificCode */ |
| 170 | upl_t upl_object; |
| 171 | |
| 172 | __DeclareRcvRpc(2050, "upl_abort" ) |
| 173 | __BeforeRcvRpc(2050, "upl_abort" ) |
| 174 | |
| 175 | #if defined(__MIG_check__Request__upl_abort_t__defined) |
| 176 | check_result = __MIG_check__Request__upl_abort_t((__Request *)In0P); |
| 177 | if (check_result != MACH_MSG_SUCCESS) |
| 178 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 179 | #endif /* defined(__MIG_check__Request__upl_abort_t__defined) */ |
| 180 | |
| 181 | upl_object = convert_port_to_upl(In0P->Head.msgh_request_port); |
| 182 | |
| 183 | OutP->RetCode = upl_abort(upl_object, In0P->abort_cond); |
| 184 | upl_deallocate(upl_object); |
| 185 | #if __MigKernelSpecificCode |
| 186 | #endif /* __MigKernelSpecificCode */ |
| 187 | |
| 188 | OutP->NDR = NDR_record; |
| 189 | |
| 190 | |
| 191 | __AfterRcvRpc(2050, "upl_abort" ) |
| 192 | } |
| 193 | |
| 194 | #if ( __MigTypeCheck ) |
| 195 | #if __MIG_check__Request__upl_subsystem__ |
| 196 | #if !defined(__MIG_check__Request__upl_abort_range_t__defined) |
| 197 | #define __MIG_check__Request__upl_abort_range_t__defined |
| 198 | |
| 199 | mig_internal kern_return_t __MIG_check__Request__upl_abort_range_t(__attribute__((__unused__)) __Request__upl_abort_range_t *In0P) |
| 200 | { |
| 201 | |
| 202 | typedef __Request__upl_abort_range_t __Request; |
| 203 | #if __MigTypeCheck |
| 204 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 205 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 206 | return MIG_BAD_ARGUMENTS; |
| 207 | #endif /* __MigTypeCheck */ |
| 208 | |
| 209 | return MACH_MSG_SUCCESS; |
| 210 | } |
| 211 | #endif /* !defined(__MIG_check__Request__upl_abort_range_t__defined) */ |
| 212 | #endif /* __MIG_check__Request__upl_subsystem__ */ |
| 213 | #endif /* ( __MigTypeCheck ) */ |
| 214 | |
| 215 | |
| 216 | /* Routine upl_abort_range */ |
| 217 | mig_internal novalue _Xupl_abort_range |
| 218 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 219 | { |
| 220 | |
| 221 | #ifdef __MigPackStructs |
| 222 | #pragma pack(4) |
| 223 | #endif |
| 224 | typedef struct { |
| 225 | mach_msg_header_t Head; |
| 226 | NDR_record_t NDR; |
| 227 | upl_offset_t offset; |
| 228 | upl_size_t size; |
| 229 | integer_t abort_cond; |
| 230 | mach_msg_trailer_t trailer; |
| 231 | } Request __attribute__((unused)); |
| 232 | #ifdef __MigPackStructs |
| 233 | #pragma pack() |
| 234 | #endif |
| 235 | typedef __Request__upl_abort_range_t __Request; |
| 236 | typedef __Reply__upl_abort_range_t Reply __attribute__((unused)); |
| 237 | |
| 238 | /* |
| 239 | * typedef struct { |
| 240 | * mach_msg_header_t Head; |
| 241 | * NDR_record_t NDR; |
| 242 | * kern_return_t RetCode; |
| 243 | * } mig_reply_error_t; |
| 244 | */ |
| 245 | |
| 246 | Request *In0P = (Request *) InHeadP; |
| 247 | Reply *OutP = (Reply *) OutHeadP; |
| 248 | #ifdef __MIG_check__Request__upl_abort_range_t__defined |
| 249 | kern_return_t check_result; |
| 250 | #endif /* __MIG_check__Request__upl_abort_range_t__defined */ |
| 251 | |
| 252 | #if __MigKernelSpecificCode |
| 253 | #else |
| 254 | #endif /* __MigKernelSpecificCode */ |
| 255 | upl_t upl_object; |
| 256 | |
| 257 | __DeclareRcvRpc(2051, "upl_abort_range" ) |
| 258 | __BeforeRcvRpc(2051, "upl_abort_range" ) |
| 259 | |
| 260 | #if defined(__MIG_check__Request__upl_abort_range_t__defined) |
| 261 | check_result = __MIG_check__Request__upl_abort_range_t((__Request *)In0P); |
| 262 | if (check_result != MACH_MSG_SUCCESS) |
| 263 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 264 | #endif /* defined(__MIG_check__Request__upl_abort_range_t__defined) */ |
| 265 | |
| 266 | upl_object = convert_port_to_upl(In0P->Head.msgh_request_port); |
| 267 | |
| 268 | OutP->RetCode = upl_abort_range(upl_object, In0P->offset, In0P->size, In0P->abort_cond, &OutP->empty); |
| 269 | upl_deallocate(upl_object); |
| 270 | if (OutP->RetCode != KERN_SUCCESS) { |
| 271 | MIG_RETURN_ERROR(OutP, OutP->RetCode); |
| 272 | } |
| 273 | #if __MigKernelSpecificCode |
| 274 | #endif /* __MigKernelSpecificCode */ |
| 275 | |
| 276 | OutP->NDR = NDR_record; |
| 277 | |
| 278 | |
| 279 | OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply)); |
| 280 | __AfterRcvRpc(2051, "upl_abort_range" ) |
| 281 | } |
| 282 | |
| 283 | #if ( __MigTypeCheck ) |
| 284 | #if __MIG_check__Request__upl_subsystem__ |
| 285 | #if !defined(__MIG_check__Request__upl_commit_t__defined) |
| 286 | #define __MIG_check__Request__upl_commit_t__defined |
| 287 | |
| 288 | mig_internal kern_return_t __MIG_check__Request__upl_commit_t(__attribute__((__unused__)) __Request__upl_commit_t *In0P) |
| 289 | { |
| 290 | |
| 291 | typedef __Request__upl_commit_t __Request; |
| 292 | #if __MigTypeCheck |
| 293 | unsigned int msgh_size; |
| 294 | #endif /* __MigTypeCheck */ |
| 295 | |
| 296 | #if __MigTypeCheck |
| 297 | msgh_size = In0P->Head.msgh_size; |
| 298 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 299 | (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 2048)) || (msgh_size > (mach_msg_size_t)sizeof(__Request))) |
| 300 | return MIG_BAD_ARGUMENTS; |
| 301 | #endif /* __MigTypeCheck */ |
| 302 | |
| 303 | #if defined(__NDR_convert__int_rep__Request__upl_commit_t__page_listCnt__defined) |
| 304 | if (In0P->NDR.int_rep != NDR_record.int_rep) |
| 305 | __NDR_convert__int_rep__Request__upl_commit_t__page_listCnt(&In0P->page_listCnt, In0P->NDR.int_rep); |
| 306 | #endif /* __NDR_convert__int_rep__Request__upl_commit_t__page_listCnt__defined */ |
| 307 | #if __MigTypeCheck |
| 308 | if ( In0P->page_listCnt > 512 ) |
| 309 | return MIG_BAD_ARGUMENTS; |
| 310 | if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 2048)) / 8 < In0P->page_listCnt) || |
| 311 | (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 2048) + (8 * In0P->page_listCnt))) |
| 312 | return MIG_BAD_ARGUMENTS; |
| 313 | #endif /* __MigTypeCheck */ |
| 314 | |
| 315 | return MACH_MSG_SUCCESS; |
| 316 | } |
| 317 | #endif /* !defined(__MIG_check__Request__upl_commit_t__defined) */ |
| 318 | #endif /* __MIG_check__Request__upl_subsystem__ */ |
| 319 | #endif /* ( __MigTypeCheck ) */ |
| 320 | |
| 321 | |
| 322 | /* Routine upl_commit */ |
| 323 | mig_internal novalue _Xupl_commit |
| 324 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 325 | { |
| 326 | |
| 327 | #ifdef __MigPackStructs |
| 328 | #pragma pack(4) |
| 329 | #endif |
| 330 | typedef struct { |
| 331 | mach_msg_header_t Head; |
| 332 | NDR_record_t NDR; |
| 333 | mach_msg_type_number_t page_listCnt; |
| 334 | upl_page_info_t page_list[256]; |
| 335 | mach_msg_trailer_t trailer; |
| 336 | } Request __attribute__((unused)); |
| 337 | #ifdef __MigPackStructs |
| 338 | #pragma pack() |
| 339 | #endif |
| 340 | typedef __Request__upl_commit_t __Request; |
| 341 | typedef __Reply__upl_commit_t Reply __attribute__((unused)); |
| 342 | |
| 343 | /* |
| 344 | * typedef struct { |
| 345 | * mach_msg_header_t Head; |
| 346 | * NDR_record_t NDR; |
| 347 | * kern_return_t RetCode; |
| 348 | * } mig_reply_error_t; |
| 349 | */ |
| 350 | |
| 351 | Request *In0P = (Request *) InHeadP; |
| 352 | Reply *OutP = (Reply *) OutHeadP; |
| 353 | #ifdef __MIG_check__Request__upl_commit_t__defined |
| 354 | kern_return_t check_result; |
| 355 | #endif /* __MIG_check__Request__upl_commit_t__defined */ |
| 356 | |
| 357 | #if __MigKernelSpecificCode |
| 358 | #else |
| 359 | #endif /* __MigKernelSpecificCode */ |
| 360 | upl_t upl_object; |
| 361 | |
| 362 | __DeclareRcvRpc(2052, "upl_commit" ) |
| 363 | __BeforeRcvRpc(2052, "upl_commit" ) |
| 364 | |
| 365 | #if defined(__MIG_check__Request__upl_commit_t__defined) |
| 366 | check_result = __MIG_check__Request__upl_commit_t((__Request *)In0P); |
| 367 | if (check_result != MACH_MSG_SUCCESS) |
| 368 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 369 | #endif /* defined(__MIG_check__Request__upl_commit_t__defined) */ |
| 370 | |
| 371 | upl_object = convert_port_to_upl(In0P->Head.msgh_request_port); |
| 372 | |
| 373 | OutP->RetCode = upl_commit(upl_object, In0P->page_list, In0P->page_listCnt); |
| 374 | upl_deallocate(upl_object); |
| 375 | #if __MigKernelSpecificCode |
| 376 | #endif /* __MigKernelSpecificCode */ |
| 377 | |
| 378 | OutP->NDR = NDR_record; |
| 379 | |
| 380 | |
| 381 | __AfterRcvRpc(2052, "upl_commit" ) |
| 382 | } |
| 383 | |
| 384 | #if ( __MigTypeCheck ) |
| 385 | #if __MIG_check__Request__upl_subsystem__ |
| 386 | #if !defined(__MIG_check__Request__upl_commit_range_t__defined) |
| 387 | #define __MIG_check__Request__upl_commit_range_t__defined |
| 388 | |
| 389 | mig_internal kern_return_t __MIG_check__Request__upl_commit_range_t(__attribute__((__unused__)) __Request__upl_commit_range_t *In0P) |
| 390 | { |
| 391 | |
| 392 | typedef __Request__upl_commit_range_t __Request; |
| 393 | #if __MigTypeCheck |
| 394 | unsigned int msgh_size; |
| 395 | #endif /* __MigTypeCheck */ |
| 396 | |
| 397 | #if __MigTypeCheck |
| 398 | msgh_size = In0P->Head.msgh_size; |
| 399 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 400 | (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 2048)) || (msgh_size > (mach_msg_size_t)sizeof(__Request))) |
| 401 | return MIG_BAD_ARGUMENTS; |
| 402 | #endif /* __MigTypeCheck */ |
| 403 | |
| 404 | #if defined(__NDR_convert__int_rep__Request__upl_commit_range_t__page_listCnt__defined) |
| 405 | if (In0P->NDR.int_rep != NDR_record.int_rep) |
| 406 | __NDR_convert__int_rep__Request__upl_commit_range_t__page_listCnt(&In0P->page_listCnt, In0P->NDR.int_rep); |
| 407 | #endif /* __NDR_convert__int_rep__Request__upl_commit_range_t__page_listCnt__defined */ |
| 408 | #if __MigTypeCheck |
| 409 | if ( In0P->page_listCnt > 512 ) |
| 410 | return MIG_BAD_ARGUMENTS; |
| 411 | if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 2048)) / 8 < In0P->page_listCnt) || |
| 412 | (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 2048) + (8 * In0P->page_listCnt))) |
| 413 | return MIG_BAD_ARGUMENTS; |
| 414 | #endif /* __MigTypeCheck */ |
| 415 | |
| 416 | return MACH_MSG_SUCCESS; |
| 417 | } |
| 418 | #endif /* !defined(__MIG_check__Request__upl_commit_range_t__defined) */ |
| 419 | #endif /* __MIG_check__Request__upl_subsystem__ */ |
| 420 | #endif /* ( __MigTypeCheck ) */ |
| 421 | |
| 422 | |
| 423 | /* Routine upl_commit_range */ |
| 424 | mig_internal novalue _Xupl_commit_range |
| 425 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 426 | { |
| 427 | |
| 428 | #ifdef __MigPackStructs |
| 429 | #pragma pack(4) |
| 430 | #endif |
| 431 | typedef struct { |
| 432 | mach_msg_header_t Head; |
| 433 | NDR_record_t NDR; |
| 434 | upl_offset_t offset; |
| 435 | upl_size_t size; |
| 436 | integer_t cntrl_flags; |
| 437 | mach_msg_type_number_t page_listCnt; |
| 438 | upl_page_info_t page_list[256]; |
| 439 | mach_msg_trailer_t trailer; |
| 440 | } Request __attribute__((unused)); |
| 441 | #ifdef __MigPackStructs |
| 442 | #pragma pack() |
| 443 | #endif |
| 444 | typedef __Request__upl_commit_range_t __Request; |
| 445 | typedef __Reply__upl_commit_range_t Reply __attribute__((unused)); |
| 446 | |
| 447 | /* |
| 448 | * typedef struct { |
| 449 | * mach_msg_header_t Head; |
| 450 | * NDR_record_t NDR; |
| 451 | * kern_return_t RetCode; |
| 452 | * } mig_reply_error_t; |
| 453 | */ |
| 454 | |
| 455 | Request *In0P = (Request *) InHeadP; |
| 456 | Reply *OutP = (Reply *) OutHeadP; |
| 457 | #ifdef __MIG_check__Request__upl_commit_range_t__defined |
| 458 | kern_return_t check_result; |
| 459 | #endif /* __MIG_check__Request__upl_commit_range_t__defined */ |
| 460 | |
| 461 | #if __MigKernelSpecificCode |
| 462 | #else |
| 463 | #endif /* __MigKernelSpecificCode */ |
| 464 | upl_t upl_object; |
| 465 | |
| 466 | __DeclareRcvRpc(2053, "upl_commit_range" ) |
| 467 | __BeforeRcvRpc(2053, "upl_commit_range" ) |
| 468 | |
| 469 | #if defined(__MIG_check__Request__upl_commit_range_t__defined) |
| 470 | check_result = __MIG_check__Request__upl_commit_range_t((__Request *)In0P); |
| 471 | if (check_result != MACH_MSG_SUCCESS) |
| 472 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 473 | #endif /* defined(__MIG_check__Request__upl_commit_range_t__defined) */ |
| 474 | |
| 475 | upl_object = convert_port_to_upl(In0P->Head.msgh_request_port); |
| 476 | |
| 477 | OutP->RetCode = upl_commit_range(upl_object, In0P->offset, In0P->size, In0P->cntrl_flags, In0P->page_list, In0P->page_listCnt, &OutP->empty); |
| 478 | upl_deallocate(upl_object); |
| 479 | if (OutP->RetCode != KERN_SUCCESS) { |
| 480 | MIG_RETURN_ERROR(OutP, OutP->RetCode); |
| 481 | } |
| 482 | #if __MigKernelSpecificCode |
| 483 | #endif /* __MigKernelSpecificCode */ |
| 484 | |
| 485 | OutP->NDR = NDR_record; |
| 486 | |
| 487 | |
| 488 | OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply)); |
| 489 | __AfterRcvRpc(2053, "upl_commit_range" ) |
| 490 | } |
| 491 | |
| 492 | |
| 493 | |
| 494 | /* Description of this subsystem, for use in direct RPC */ |
| 495 | const struct upl_subsystem upl_subsystem = { |
| 496 | upl_server_routine, |
| 497 | 2050, |
| 498 | 2054, |
| 499 | (mach_msg_size_t)sizeof(union __ReplyUnion__upl_subsystem), |
| 500 | (vm_address_t)0, |
| 501 | { |
| 502 | { (mig_impl_routine_t) 0, |
| 503 | (mig_stub_routine_t) _Xupl_abort, 2, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__upl_abort_t)}, |
| 504 | { (mig_impl_routine_t) 0, |
| 505 | (mig_stub_routine_t) _Xupl_abort_range, 5, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__upl_abort_range_t)}, |
| 506 | { (mig_impl_routine_t) 0, |
| 507 | (mig_stub_routine_t) _Xupl_commit, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__upl_commit_t)}, |
| 508 | { (mig_impl_routine_t) 0, |
| 509 | (mig_stub_routine_t) _Xupl_commit_range, 7, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__upl_commit_range_t)}, |
| 510 | } |
| 511 | }; |
| 512 | |
| 513 | mig_external boolean_t upl_server |
| 514 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 515 | { |
| 516 | /* |
| 517 | * typedef struct { |
| 518 | * mach_msg_header_t Head; |
| 519 | * NDR_record_t NDR; |
| 520 | * kern_return_t RetCode; |
| 521 | * } mig_reply_error_t; |
| 522 | */ |
| 523 | |
| 524 | register mig_routine_t routine; |
| 525 | |
| 526 | OutHeadP->msgh_bits = MACH_MSGH_BITS(MACH_MSGH_BITS_REPLY(InHeadP->msgh_bits), 0); |
| 527 | OutHeadP->msgh_remote_port = InHeadP->msgh_reply_port; |
| 528 | /* Minimal size: routine() will update it if different */ |
| 529 | OutHeadP->msgh_size = (mach_msg_size_t)sizeof(mig_reply_error_t); |
| 530 | OutHeadP->msgh_local_port = MACH_PORT_NULL; |
| 531 | OutHeadP->msgh_id = InHeadP->msgh_id + 100; |
| 532 | OutHeadP->msgh_reserved = 0; |
| 533 | |
| 534 | if ((InHeadP->msgh_id > 2053) || (InHeadP->msgh_id < 2050) || |
| 535 | ((routine = upl_subsystem.routine[InHeadP->msgh_id - 2050].stub_routine) == 0)) { |
| 536 | ((mig_reply_error_t *)OutHeadP)->NDR = NDR_record; |
| 537 | ((mig_reply_error_t *)OutHeadP)->RetCode = MIG_BAD_ID; |
| 538 | return FALSE; |
| 539 | } |
| 540 | (*routine) (InHeadP, OutHeadP); |
| 541 | return TRUE; |
| 542 | } |
| 543 | |
| 544 | mig_external mig_routine_t upl_server_routine |
| 545 | (mach_msg_header_t *InHeadP) |
| 546 | { |
| 547 | register int msgh_id; |
| 548 | |
| 549 | msgh_id = InHeadP->msgh_id - 2050; |
| 550 | |
| 551 | if ((msgh_id > 3) || (msgh_id < 0)) |
| 552 | return 0; |
| 553 | |
| 554 | return upl_subsystem.routine[msgh_id].stub_routine; |
| 555 | } |
| 556 | |