| 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 lock_set */ |
| 10 | |
| 11 | #define __MIG_check__Request__lock_set_subsystem__ 1 |
| 12 | |
| 13 | #include "lock_set_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 _Xlock_acquire |
| 99 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 100 | |
| 101 | mig_internal novalue _Xlock_release |
| 102 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 103 | |
| 104 | mig_internal novalue _Xlock_try |
| 105 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 106 | |
| 107 | mig_internal novalue _Xlock_make_stable |
| 108 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 109 | |
| 110 | mig_internal novalue _Xlock_handoff |
| 111 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 112 | |
| 113 | mig_internal novalue _Xlock_handoff_accept |
| 114 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 115 | |
| 116 | |
| 117 | #if ( __MigTypeCheck ) |
| 118 | #if __MIG_check__Request__lock_set_subsystem__ |
| 119 | #if !defined(__MIG_check__Request__lock_acquire_t__defined) |
| 120 | #define __MIG_check__Request__lock_acquire_t__defined |
| 121 | |
| 122 | mig_internal kern_return_t __MIG_check__Request__lock_acquire_t(__attribute__((__unused__)) __Request__lock_acquire_t *In0P) |
| 123 | { |
| 124 | |
| 125 | typedef __Request__lock_acquire_t __Request; |
| 126 | #if __MigTypeCheck |
| 127 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 128 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 129 | return MIG_BAD_ARGUMENTS; |
| 130 | #endif /* __MigTypeCheck */ |
| 131 | |
| 132 | return MACH_MSG_SUCCESS; |
| 133 | } |
| 134 | #endif /* !defined(__MIG_check__Request__lock_acquire_t__defined) */ |
| 135 | #endif /* __MIG_check__Request__lock_set_subsystem__ */ |
| 136 | #endif /* ( __MigTypeCheck ) */ |
| 137 | |
| 138 | |
| 139 | /* Routine lock_acquire */ |
| 140 | mig_internal novalue _Xlock_acquire |
| 141 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 142 | { |
| 143 | |
| 144 | #ifdef __MigPackStructs |
| 145 | #pragma pack(4) |
| 146 | #endif |
| 147 | typedef struct { |
| 148 | mach_msg_header_t Head; |
| 149 | NDR_record_t NDR; |
| 150 | int lock_id; |
| 151 | mach_msg_trailer_t trailer; |
| 152 | } Request __attribute__((unused)); |
| 153 | #ifdef __MigPackStructs |
| 154 | #pragma pack() |
| 155 | #endif |
| 156 | typedef __Request__lock_acquire_t __Request; |
| 157 | typedef __Reply__lock_acquire_t Reply __attribute__((unused)); |
| 158 | |
| 159 | /* |
| 160 | * typedef struct { |
| 161 | * mach_msg_header_t Head; |
| 162 | * NDR_record_t NDR; |
| 163 | * kern_return_t RetCode; |
| 164 | * } mig_reply_error_t; |
| 165 | */ |
| 166 | |
| 167 | Request *In0P = (Request *) InHeadP; |
| 168 | Reply *OutP = (Reply *) OutHeadP; |
| 169 | #ifdef __MIG_check__Request__lock_acquire_t__defined |
| 170 | kern_return_t check_result; |
| 171 | #endif /* __MIG_check__Request__lock_acquire_t__defined */ |
| 172 | |
| 173 | #if __MigKernelSpecificCode |
| 174 | #else |
| 175 | #endif /* __MigKernelSpecificCode */ |
| 176 | lock_set_t lock_set; |
| 177 | |
| 178 | __DeclareRcvRpc(617000, "lock_acquire" ) |
| 179 | __BeforeRcvRpc(617000, "lock_acquire" ) |
| 180 | |
| 181 | #if defined(__MIG_check__Request__lock_acquire_t__defined) |
| 182 | check_result = __MIG_check__Request__lock_acquire_t((__Request *)In0P); |
| 183 | if (check_result != MACH_MSG_SUCCESS) |
| 184 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 185 | #endif /* defined(__MIG_check__Request__lock_acquire_t__defined) */ |
| 186 | |
| 187 | lock_set = convert_port_to_lock_set(In0P->Head.msgh_request_port); |
| 188 | |
| 189 | OutP->RetCode = lock_acquire(lock_set, In0P->lock_id); |
| 190 | lock_set_dereference(lock_set); |
| 191 | #if __MigKernelSpecificCode |
| 192 | #endif /* __MigKernelSpecificCode */ |
| 193 | |
| 194 | OutP->NDR = NDR_record; |
| 195 | |
| 196 | |
| 197 | __AfterRcvRpc(617000, "lock_acquire" ) |
| 198 | } |
| 199 | |
| 200 | #if ( __MigTypeCheck ) |
| 201 | #if __MIG_check__Request__lock_set_subsystem__ |
| 202 | #if !defined(__MIG_check__Request__lock_release_t__defined) |
| 203 | #define __MIG_check__Request__lock_release_t__defined |
| 204 | |
| 205 | mig_internal kern_return_t __MIG_check__Request__lock_release_t(__attribute__((__unused__)) __Request__lock_release_t *In0P) |
| 206 | { |
| 207 | |
| 208 | typedef __Request__lock_release_t __Request; |
| 209 | #if __MigTypeCheck |
| 210 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 211 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 212 | return MIG_BAD_ARGUMENTS; |
| 213 | #endif /* __MigTypeCheck */ |
| 214 | |
| 215 | return MACH_MSG_SUCCESS; |
| 216 | } |
| 217 | #endif /* !defined(__MIG_check__Request__lock_release_t__defined) */ |
| 218 | #endif /* __MIG_check__Request__lock_set_subsystem__ */ |
| 219 | #endif /* ( __MigTypeCheck ) */ |
| 220 | |
| 221 | |
| 222 | /* Routine lock_release */ |
| 223 | mig_internal novalue _Xlock_release |
| 224 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 225 | { |
| 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 | int lock_id; |
| 234 | mach_msg_trailer_t trailer; |
| 235 | } Request __attribute__((unused)); |
| 236 | #ifdef __MigPackStructs |
| 237 | #pragma pack() |
| 238 | #endif |
| 239 | typedef __Request__lock_release_t __Request; |
| 240 | typedef __Reply__lock_release_t Reply __attribute__((unused)); |
| 241 | |
| 242 | /* |
| 243 | * typedef struct { |
| 244 | * mach_msg_header_t Head; |
| 245 | * NDR_record_t NDR; |
| 246 | * kern_return_t RetCode; |
| 247 | * } mig_reply_error_t; |
| 248 | */ |
| 249 | |
| 250 | Request *In0P = (Request *) InHeadP; |
| 251 | Reply *OutP = (Reply *) OutHeadP; |
| 252 | #ifdef __MIG_check__Request__lock_release_t__defined |
| 253 | kern_return_t check_result; |
| 254 | #endif /* __MIG_check__Request__lock_release_t__defined */ |
| 255 | |
| 256 | #if __MigKernelSpecificCode |
| 257 | #else |
| 258 | #endif /* __MigKernelSpecificCode */ |
| 259 | lock_set_t lock_set; |
| 260 | |
| 261 | __DeclareRcvRpc(617001, "lock_release" ) |
| 262 | __BeforeRcvRpc(617001, "lock_release" ) |
| 263 | |
| 264 | #if defined(__MIG_check__Request__lock_release_t__defined) |
| 265 | check_result = __MIG_check__Request__lock_release_t((__Request *)In0P); |
| 266 | if (check_result != MACH_MSG_SUCCESS) |
| 267 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 268 | #endif /* defined(__MIG_check__Request__lock_release_t__defined) */ |
| 269 | |
| 270 | lock_set = convert_port_to_lock_set(In0P->Head.msgh_request_port); |
| 271 | |
| 272 | OutP->RetCode = lock_release(lock_set, In0P->lock_id); |
| 273 | lock_set_dereference(lock_set); |
| 274 | #if __MigKernelSpecificCode |
| 275 | #endif /* __MigKernelSpecificCode */ |
| 276 | |
| 277 | OutP->NDR = NDR_record; |
| 278 | |
| 279 | |
| 280 | __AfterRcvRpc(617001, "lock_release" ) |
| 281 | } |
| 282 | |
| 283 | #if ( __MigTypeCheck ) |
| 284 | #if __MIG_check__Request__lock_set_subsystem__ |
| 285 | #if !defined(__MIG_check__Request__lock_try_t__defined) |
| 286 | #define __MIG_check__Request__lock_try_t__defined |
| 287 | |
| 288 | mig_internal kern_return_t __MIG_check__Request__lock_try_t(__attribute__((__unused__)) __Request__lock_try_t *In0P) |
| 289 | { |
| 290 | |
| 291 | typedef __Request__lock_try_t __Request; |
| 292 | #if __MigTypeCheck |
| 293 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 294 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 295 | return MIG_BAD_ARGUMENTS; |
| 296 | #endif /* __MigTypeCheck */ |
| 297 | |
| 298 | return MACH_MSG_SUCCESS; |
| 299 | } |
| 300 | #endif /* !defined(__MIG_check__Request__lock_try_t__defined) */ |
| 301 | #endif /* __MIG_check__Request__lock_set_subsystem__ */ |
| 302 | #endif /* ( __MigTypeCheck ) */ |
| 303 | |
| 304 | |
| 305 | /* Routine lock_try */ |
| 306 | mig_internal novalue _Xlock_try |
| 307 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 308 | { |
| 309 | |
| 310 | #ifdef __MigPackStructs |
| 311 | #pragma pack(4) |
| 312 | #endif |
| 313 | typedef struct { |
| 314 | mach_msg_header_t Head; |
| 315 | NDR_record_t NDR; |
| 316 | int lock_id; |
| 317 | mach_msg_trailer_t trailer; |
| 318 | } Request __attribute__((unused)); |
| 319 | #ifdef __MigPackStructs |
| 320 | #pragma pack() |
| 321 | #endif |
| 322 | typedef __Request__lock_try_t __Request; |
| 323 | typedef __Reply__lock_try_t Reply __attribute__((unused)); |
| 324 | |
| 325 | /* |
| 326 | * typedef struct { |
| 327 | * mach_msg_header_t Head; |
| 328 | * NDR_record_t NDR; |
| 329 | * kern_return_t RetCode; |
| 330 | * } mig_reply_error_t; |
| 331 | */ |
| 332 | |
| 333 | Request *In0P = (Request *) InHeadP; |
| 334 | Reply *OutP = (Reply *) OutHeadP; |
| 335 | #ifdef __MIG_check__Request__lock_try_t__defined |
| 336 | kern_return_t check_result; |
| 337 | #endif /* __MIG_check__Request__lock_try_t__defined */ |
| 338 | |
| 339 | #if __MigKernelSpecificCode |
| 340 | #else |
| 341 | #endif /* __MigKernelSpecificCode */ |
| 342 | lock_set_t lock_set; |
| 343 | |
| 344 | __DeclareRcvRpc(617002, "lock_try" ) |
| 345 | __BeforeRcvRpc(617002, "lock_try" ) |
| 346 | |
| 347 | #if defined(__MIG_check__Request__lock_try_t__defined) |
| 348 | check_result = __MIG_check__Request__lock_try_t((__Request *)In0P); |
| 349 | if (check_result != MACH_MSG_SUCCESS) |
| 350 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 351 | #endif /* defined(__MIG_check__Request__lock_try_t__defined) */ |
| 352 | |
| 353 | lock_set = convert_port_to_lock_set(In0P->Head.msgh_request_port); |
| 354 | |
| 355 | OutP->RetCode = lock_try(lock_set, In0P->lock_id); |
| 356 | lock_set_dereference(lock_set); |
| 357 | #if __MigKernelSpecificCode |
| 358 | #endif /* __MigKernelSpecificCode */ |
| 359 | |
| 360 | OutP->NDR = NDR_record; |
| 361 | |
| 362 | |
| 363 | __AfterRcvRpc(617002, "lock_try" ) |
| 364 | } |
| 365 | |
| 366 | #if ( __MigTypeCheck ) |
| 367 | #if __MIG_check__Request__lock_set_subsystem__ |
| 368 | #if !defined(__MIG_check__Request__lock_make_stable_t__defined) |
| 369 | #define __MIG_check__Request__lock_make_stable_t__defined |
| 370 | |
| 371 | mig_internal kern_return_t __MIG_check__Request__lock_make_stable_t(__attribute__((__unused__)) __Request__lock_make_stable_t *In0P) |
| 372 | { |
| 373 | |
| 374 | typedef __Request__lock_make_stable_t __Request; |
| 375 | #if __MigTypeCheck |
| 376 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 377 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 378 | return MIG_BAD_ARGUMENTS; |
| 379 | #endif /* __MigTypeCheck */ |
| 380 | |
| 381 | return MACH_MSG_SUCCESS; |
| 382 | } |
| 383 | #endif /* !defined(__MIG_check__Request__lock_make_stable_t__defined) */ |
| 384 | #endif /* __MIG_check__Request__lock_set_subsystem__ */ |
| 385 | #endif /* ( __MigTypeCheck ) */ |
| 386 | |
| 387 | |
| 388 | /* Routine lock_make_stable */ |
| 389 | mig_internal novalue _Xlock_make_stable |
| 390 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 391 | { |
| 392 | |
| 393 | #ifdef __MigPackStructs |
| 394 | #pragma pack(4) |
| 395 | #endif |
| 396 | typedef struct { |
| 397 | mach_msg_header_t Head; |
| 398 | NDR_record_t NDR; |
| 399 | int lock_id; |
| 400 | mach_msg_trailer_t trailer; |
| 401 | } Request __attribute__((unused)); |
| 402 | #ifdef __MigPackStructs |
| 403 | #pragma pack() |
| 404 | #endif |
| 405 | typedef __Request__lock_make_stable_t __Request; |
| 406 | typedef __Reply__lock_make_stable_t Reply __attribute__((unused)); |
| 407 | |
| 408 | /* |
| 409 | * typedef struct { |
| 410 | * mach_msg_header_t Head; |
| 411 | * NDR_record_t NDR; |
| 412 | * kern_return_t RetCode; |
| 413 | * } mig_reply_error_t; |
| 414 | */ |
| 415 | |
| 416 | Request *In0P = (Request *) InHeadP; |
| 417 | Reply *OutP = (Reply *) OutHeadP; |
| 418 | #ifdef __MIG_check__Request__lock_make_stable_t__defined |
| 419 | kern_return_t check_result; |
| 420 | #endif /* __MIG_check__Request__lock_make_stable_t__defined */ |
| 421 | |
| 422 | #if __MigKernelSpecificCode |
| 423 | #else |
| 424 | #endif /* __MigKernelSpecificCode */ |
| 425 | lock_set_t lock_set; |
| 426 | |
| 427 | __DeclareRcvRpc(617003, "lock_make_stable" ) |
| 428 | __BeforeRcvRpc(617003, "lock_make_stable" ) |
| 429 | |
| 430 | #if defined(__MIG_check__Request__lock_make_stable_t__defined) |
| 431 | check_result = __MIG_check__Request__lock_make_stable_t((__Request *)In0P); |
| 432 | if (check_result != MACH_MSG_SUCCESS) |
| 433 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 434 | #endif /* defined(__MIG_check__Request__lock_make_stable_t__defined) */ |
| 435 | |
| 436 | lock_set = convert_port_to_lock_set(In0P->Head.msgh_request_port); |
| 437 | |
| 438 | OutP->RetCode = lock_make_stable(lock_set, In0P->lock_id); |
| 439 | lock_set_dereference(lock_set); |
| 440 | #if __MigKernelSpecificCode |
| 441 | #endif /* __MigKernelSpecificCode */ |
| 442 | |
| 443 | OutP->NDR = NDR_record; |
| 444 | |
| 445 | |
| 446 | __AfterRcvRpc(617003, "lock_make_stable" ) |
| 447 | } |
| 448 | |
| 449 | #if ( __MigTypeCheck ) |
| 450 | #if __MIG_check__Request__lock_set_subsystem__ |
| 451 | #if !defined(__MIG_check__Request__lock_handoff_t__defined) |
| 452 | #define __MIG_check__Request__lock_handoff_t__defined |
| 453 | |
| 454 | mig_internal kern_return_t __MIG_check__Request__lock_handoff_t(__attribute__((__unused__)) __Request__lock_handoff_t *In0P) |
| 455 | { |
| 456 | |
| 457 | typedef __Request__lock_handoff_t __Request; |
| 458 | #if __MigTypeCheck |
| 459 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 460 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 461 | return MIG_BAD_ARGUMENTS; |
| 462 | #endif /* __MigTypeCheck */ |
| 463 | |
| 464 | return MACH_MSG_SUCCESS; |
| 465 | } |
| 466 | #endif /* !defined(__MIG_check__Request__lock_handoff_t__defined) */ |
| 467 | #endif /* __MIG_check__Request__lock_set_subsystem__ */ |
| 468 | #endif /* ( __MigTypeCheck ) */ |
| 469 | |
| 470 | |
| 471 | /* Routine lock_handoff */ |
| 472 | mig_internal novalue _Xlock_handoff |
| 473 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 474 | { |
| 475 | |
| 476 | #ifdef __MigPackStructs |
| 477 | #pragma pack(4) |
| 478 | #endif |
| 479 | typedef struct { |
| 480 | mach_msg_header_t Head; |
| 481 | NDR_record_t NDR; |
| 482 | int lock_id; |
| 483 | mach_msg_trailer_t trailer; |
| 484 | } Request __attribute__((unused)); |
| 485 | #ifdef __MigPackStructs |
| 486 | #pragma pack() |
| 487 | #endif |
| 488 | typedef __Request__lock_handoff_t __Request; |
| 489 | typedef __Reply__lock_handoff_t Reply __attribute__((unused)); |
| 490 | |
| 491 | /* |
| 492 | * typedef struct { |
| 493 | * mach_msg_header_t Head; |
| 494 | * NDR_record_t NDR; |
| 495 | * kern_return_t RetCode; |
| 496 | * } mig_reply_error_t; |
| 497 | */ |
| 498 | |
| 499 | Request *In0P = (Request *) InHeadP; |
| 500 | Reply *OutP = (Reply *) OutHeadP; |
| 501 | #ifdef __MIG_check__Request__lock_handoff_t__defined |
| 502 | kern_return_t check_result; |
| 503 | #endif /* __MIG_check__Request__lock_handoff_t__defined */ |
| 504 | |
| 505 | #if __MigKernelSpecificCode |
| 506 | #else |
| 507 | #endif /* __MigKernelSpecificCode */ |
| 508 | lock_set_t lock_set; |
| 509 | |
| 510 | __DeclareRcvRpc(617004, "lock_handoff" ) |
| 511 | __BeforeRcvRpc(617004, "lock_handoff" ) |
| 512 | |
| 513 | #if defined(__MIG_check__Request__lock_handoff_t__defined) |
| 514 | check_result = __MIG_check__Request__lock_handoff_t((__Request *)In0P); |
| 515 | if (check_result != MACH_MSG_SUCCESS) |
| 516 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 517 | #endif /* defined(__MIG_check__Request__lock_handoff_t__defined) */ |
| 518 | |
| 519 | lock_set = convert_port_to_lock_set(In0P->Head.msgh_request_port); |
| 520 | |
| 521 | OutP->RetCode = lock_handoff(lock_set, In0P->lock_id); |
| 522 | lock_set_dereference(lock_set); |
| 523 | #if __MigKernelSpecificCode |
| 524 | #endif /* __MigKernelSpecificCode */ |
| 525 | |
| 526 | OutP->NDR = NDR_record; |
| 527 | |
| 528 | |
| 529 | __AfterRcvRpc(617004, "lock_handoff" ) |
| 530 | } |
| 531 | |
| 532 | #if ( __MigTypeCheck ) |
| 533 | #if __MIG_check__Request__lock_set_subsystem__ |
| 534 | #if !defined(__MIG_check__Request__lock_handoff_accept_t__defined) |
| 535 | #define __MIG_check__Request__lock_handoff_accept_t__defined |
| 536 | |
| 537 | mig_internal kern_return_t __MIG_check__Request__lock_handoff_accept_t(__attribute__((__unused__)) __Request__lock_handoff_accept_t *In0P) |
| 538 | { |
| 539 | |
| 540 | typedef __Request__lock_handoff_accept_t __Request; |
| 541 | #if __MigTypeCheck |
| 542 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 543 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 544 | return MIG_BAD_ARGUMENTS; |
| 545 | #endif /* __MigTypeCheck */ |
| 546 | |
| 547 | return MACH_MSG_SUCCESS; |
| 548 | } |
| 549 | #endif /* !defined(__MIG_check__Request__lock_handoff_accept_t__defined) */ |
| 550 | #endif /* __MIG_check__Request__lock_set_subsystem__ */ |
| 551 | #endif /* ( __MigTypeCheck ) */ |
| 552 | |
| 553 | |
| 554 | /* Routine lock_handoff_accept */ |
| 555 | mig_internal novalue _Xlock_handoff_accept |
| 556 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 557 | { |
| 558 | |
| 559 | #ifdef __MigPackStructs |
| 560 | #pragma pack(4) |
| 561 | #endif |
| 562 | typedef struct { |
| 563 | mach_msg_header_t Head; |
| 564 | NDR_record_t NDR; |
| 565 | int lock_id; |
| 566 | mach_msg_trailer_t trailer; |
| 567 | } Request __attribute__((unused)); |
| 568 | #ifdef __MigPackStructs |
| 569 | #pragma pack() |
| 570 | #endif |
| 571 | typedef __Request__lock_handoff_accept_t __Request; |
| 572 | typedef __Reply__lock_handoff_accept_t Reply __attribute__((unused)); |
| 573 | |
| 574 | /* |
| 575 | * typedef struct { |
| 576 | * mach_msg_header_t Head; |
| 577 | * NDR_record_t NDR; |
| 578 | * kern_return_t RetCode; |
| 579 | * } mig_reply_error_t; |
| 580 | */ |
| 581 | |
| 582 | Request *In0P = (Request *) InHeadP; |
| 583 | Reply *OutP = (Reply *) OutHeadP; |
| 584 | #ifdef __MIG_check__Request__lock_handoff_accept_t__defined |
| 585 | kern_return_t check_result; |
| 586 | #endif /* __MIG_check__Request__lock_handoff_accept_t__defined */ |
| 587 | |
| 588 | #if __MigKernelSpecificCode |
| 589 | #else |
| 590 | #endif /* __MigKernelSpecificCode */ |
| 591 | lock_set_t lock_set; |
| 592 | |
| 593 | __DeclareRcvRpc(617005, "lock_handoff_accept" ) |
| 594 | __BeforeRcvRpc(617005, "lock_handoff_accept" ) |
| 595 | |
| 596 | #if defined(__MIG_check__Request__lock_handoff_accept_t__defined) |
| 597 | check_result = __MIG_check__Request__lock_handoff_accept_t((__Request *)In0P); |
| 598 | if (check_result != MACH_MSG_SUCCESS) |
| 599 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 600 | #endif /* defined(__MIG_check__Request__lock_handoff_accept_t__defined) */ |
| 601 | |
| 602 | lock_set = convert_port_to_lock_set(In0P->Head.msgh_request_port); |
| 603 | |
| 604 | OutP->RetCode = lock_handoff_accept(lock_set, In0P->lock_id); |
| 605 | lock_set_dereference(lock_set); |
| 606 | #if __MigKernelSpecificCode |
| 607 | #endif /* __MigKernelSpecificCode */ |
| 608 | |
| 609 | OutP->NDR = NDR_record; |
| 610 | |
| 611 | |
| 612 | __AfterRcvRpc(617005, "lock_handoff_accept" ) |
| 613 | } |
| 614 | |
| 615 | |
| 616 | |
| 617 | /* Description of this subsystem, for use in direct RPC */ |
| 618 | const struct lock_set_subsystem lock_set_subsystem = { |
| 619 | lock_set_server_routine, |
| 620 | 617000, |
| 621 | 617006, |
| 622 | (mach_msg_size_t)sizeof(union __ReplyUnion__lock_set_subsystem), |
| 623 | (vm_address_t)0, |
| 624 | { |
| 625 | { (mig_impl_routine_t) 0, |
| 626 | (mig_stub_routine_t) _Xlock_acquire, 2, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__lock_acquire_t)}, |
| 627 | { (mig_impl_routine_t) 0, |
| 628 | (mig_stub_routine_t) _Xlock_release, 2, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__lock_release_t)}, |
| 629 | { (mig_impl_routine_t) 0, |
| 630 | (mig_stub_routine_t) _Xlock_try, 2, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__lock_try_t)}, |
| 631 | { (mig_impl_routine_t) 0, |
| 632 | (mig_stub_routine_t) _Xlock_make_stable, 2, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__lock_make_stable_t)}, |
| 633 | { (mig_impl_routine_t) 0, |
| 634 | (mig_stub_routine_t) _Xlock_handoff, 2, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__lock_handoff_t)}, |
| 635 | { (mig_impl_routine_t) 0, |
| 636 | (mig_stub_routine_t) _Xlock_handoff_accept, 2, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__lock_handoff_accept_t)}, |
| 637 | } |
| 638 | }; |
| 639 | |
| 640 | mig_external boolean_t lock_set_server |
| 641 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 642 | { |
| 643 | /* |
| 644 | * typedef struct { |
| 645 | * mach_msg_header_t Head; |
| 646 | * NDR_record_t NDR; |
| 647 | * kern_return_t RetCode; |
| 648 | * } mig_reply_error_t; |
| 649 | */ |
| 650 | |
| 651 | register mig_routine_t routine; |
| 652 | |
| 653 | OutHeadP->msgh_bits = MACH_MSGH_BITS(MACH_MSGH_BITS_REPLY(InHeadP->msgh_bits), 0); |
| 654 | OutHeadP->msgh_remote_port = InHeadP->msgh_reply_port; |
| 655 | /* Minimal size: routine() will update it if different */ |
| 656 | OutHeadP->msgh_size = (mach_msg_size_t)sizeof(mig_reply_error_t); |
| 657 | OutHeadP->msgh_local_port = MACH_PORT_NULL; |
| 658 | OutHeadP->msgh_id = InHeadP->msgh_id + 100; |
| 659 | OutHeadP->msgh_reserved = 0; |
| 660 | |
| 661 | if ((InHeadP->msgh_id > 617005) || (InHeadP->msgh_id < 617000) || |
| 662 | ((routine = lock_set_subsystem.routine[InHeadP->msgh_id - 617000].stub_routine) == 0)) { |
| 663 | ((mig_reply_error_t *)OutHeadP)->NDR = NDR_record; |
| 664 | ((mig_reply_error_t *)OutHeadP)->RetCode = MIG_BAD_ID; |
| 665 | return FALSE; |
| 666 | } |
| 667 | (*routine) (InHeadP, OutHeadP); |
| 668 | return TRUE; |
| 669 | } |
| 670 | |
| 671 | mig_external mig_routine_t lock_set_server_routine |
| 672 | (mach_msg_header_t *InHeadP) |
| 673 | { |
| 674 | register int msgh_id; |
| 675 | |
| 676 | msgh_id = InHeadP->msgh_id - 617000; |
| 677 | |
| 678 | if ((msgh_id > 5) || (msgh_id < 0)) |
| 679 | return 0; |
| 680 | |
| 681 | return lock_set_subsystem.routine[msgh_id].stub_routine; |
| 682 | } |
| 683 | |