| 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 clock_priv */ |
| 10 | |
| 11 | #define __MIG_check__Request__clock_priv_subsystem__ 1 |
| 12 | |
| 13 | #include "clock_priv_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 _Xclock_set_time |
| 99 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 100 | |
| 101 | mig_internal novalue _Xclock_set_attributes |
| 102 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP); |
| 103 | |
| 104 | |
| 105 | #if ( __MigTypeCheck ) |
| 106 | #if __MIG_check__Request__clock_priv_subsystem__ |
| 107 | #if !defined(__MIG_check__Request__clock_set_time_t__defined) |
| 108 | #define __MIG_check__Request__clock_set_time_t__defined |
| 109 | |
| 110 | mig_internal kern_return_t __MIG_check__Request__clock_set_time_t(__attribute__((__unused__)) __Request__clock_set_time_t *In0P) |
| 111 | { |
| 112 | |
| 113 | typedef __Request__clock_set_time_t __Request; |
| 114 | #if __MigTypeCheck |
| 115 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 116 | (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request))) |
| 117 | return MIG_BAD_ARGUMENTS; |
| 118 | #endif /* __MigTypeCheck */ |
| 119 | |
| 120 | return MACH_MSG_SUCCESS; |
| 121 | } |
| 122 | #endif /* !defined(__MIG_check__Request__clock_set_time_t__defined) */ |
| 123 | #endif /* __MIG_check__Request__clock_priv_subsystem__ */ |
| 124 | #endif /* ( __MigTypeCheck ) */ |
| 125 | |
| 126 | |
| 127 | /* Routine clock_set_time */ |
| 128 | mig_internal novalue _Xclock_set_time |
| 129 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 130 | { |
| 131 | |
| 132 | #ifdef __MigPackStructs |
| 133 | #pragma pack(4) |
| 134 | #endif |
| 135 | typedef struct { |
| 136 | mach_msg_header_t Head; |
| 137 | NDR_record_t NDR; |
| 138 | mach_timespec_t new_time; |
| 139 | mach_msg_trailer_t trailer; |
| 140 | } Request __attribute__((unused)); |
| 141 | #ifdef __MigPackStructs |
| 142 | #pragma pack() |
| 143 | #endif |
| 144 | typedef __Request__clock_set_time_t __Request; |
| 145 | typedef __Reply__clock_set_time_t Reply __attribute__((unused)); |
| 146 | |
| 147 | /* |
| 148 | * typedef struct { |
| 149 | * mach_msg_header_t Head; |
| 150 | * NDR_record_t NDR; |
| 151 | * kern_return_t RetCode; |
| 152 | * } mig_reply_error_t; |
| 153 | */ |
| 154 | |
| 155 | Request *In0P = (Request *) InHeadP; |
| 156 | Reply *OutP = (Reply *) OutHeadP; |
| 157 | #ifdef __MIG_check__Request__clock_set_time_t__defined |
| 158 | kern_return_t check_result; |
| 159 | #endif /* __MIG_check__Request__clock_set_time_t__defined */ |
| 160 | |
| 161 | #if __MigKernelSpecificCode |
| 162 | #else |
| 163 | #endif /* __MigKernelSpecificCode */ |
| 164 | __DeclareRcvRpc(1200, "clock_set_time" ) |
| 165 | __BeforeRcvRpc(1200, "clock_set_time" ) |
| 166 | |
| 167 | #if defined(__MIG_check__Request__clock_set_time_t__defined) |
| 168 | check_result = __MIG_check__Request__clock_set_time_t((__Request *)In0P); |
| 169 | if (check_result != MACH_MSG_SUCCESS) |
| 170 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 171 | #endif /* defined(__MIG_check__Request__clock_set_time_t__defined) */ |
| 172 | |
| 173 | OutP->RetCode = clock_set_time(convert_port_to_clock_ctrl(In0P->Head.msgh_request_port), In0P->new_time); |
| 174 | #if __MigKernelSpecificCode |
| 175 | #endif /* __MigKernelSpecificCode */ |
| 176 | |
| 177 | OutP->NDR = NDR_record; |
| 178 | |
| 179 | |
| 180 | __AfterRcvRpc(1200, "clock_set_time" ) |
| 181 | } |
| 182 | |
| 183 | #if ( __MigTypeCheck ) |
| 184 | #if __MIG_check__Request__clock_priv_subsystem__ |
| 185 | #if !defined(__MIG_check__Request__clock_set_attributes_t__defined) |
| 186 | #define __MIG_check__Request__clock_set_attributes_t__defined |
| 187 | |
| 188 | mig_internal kern_return_t __MIG_check__Request__clock_set_attributes_t(__attribute__((__unused__)) __Request__clock_set_attributes_t *In0P) |
| 189 | { |
| 190 | |
| 191 | typedef __Request__clock_set_attributes_t __Request; |
| 192 | #if __MigTypeCheck |
| 193 | unsigned int msgh_size; |
| 194 | #endif /* __MigTypeCheck */ |
| 195 | |
| 196 | #if __MigTypeCheck |
| 197 | msgh_size = In0P->Head.msgh_size; |
| 198 | if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || |
| 199 | (msgh_size < (mach_msg_size_t)(sizeof(__Request) - 4)) || (msgh_size > (mach_msg_size_t)sizeof(__Request))) |
| 200 | return MIG_BAD_ARGUMENTS; |
| 201 | #endif /* __MigTypeCheck */ |
| 202 | |
| 203 | #if defined(__NDR_convert__int_rep__Request__clock_set_attributes_t__clock_attrCnt__defined) |
| 204 | if (In0P->NDR.int_rep != NDR_record.int_rep) |
| 205 | __NDR_convert__int_rep__Request__clock_set_attributes_t__clock_attrCnt(&In0P->clock_attrCnt, In0P->NDR.int_rep); |
| 206 | #endif /* __NDR_convert__int_rep__Request__clock_set_attributes_t__clock_attrCnt__defined */ |
| 207 | #if __MigTypeCheck |
| 208 | if ( In0P->clock_attrCnt > 1 ) |
| 209 | return MIG_BAD_ARGUMENTS; |
| 210 | if (((msgh_size - (mach_msg_size_t)(sizeof(__Request) - 4)) / 4 < In0P->clock_attrCnt) || |
| 211 | (msgh_size != (mach_msg_size_t)(sizeof(__Request) - 4) + (4 * In0P->clock_attrCnt))) |
| 212 | return MIG_BAD_ARGUMENTS; |
| 213 | #endif /* __MigTypeCheck */ |
| 214 | |
| 215 | return MACH_MSG_SUCCESS; |
| 216 | } |
| 217 | #endif /* !defined(__MIG_check__Request__clock_set_attributes_t__defined) */ |
| 218 | #endif /* __MIG_check__Request__clock_priv_subsystem__ */ |
| 219 | #endif /* ( __MigTypeCheck ) */ |
| 220 | |
| 221 | |
| 222 | /* Routine clock_set_attributes */ |
| 223 | mig_internal novalue _Xclock_set_attributes |
| 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 | clock_flavor_t flavor; |
| 234 | mach_msg_type_number_t clock_attrCnt; |
| 235 | int clock_attr[1]; |
| 236 | mach_msg_trailer_t trailer; |
| 237 | } Request __attribute__((unused)); |
| 238 | #ifdef __MigPackStructs |
| 239 | #pragma pack() |
| 240 | #endif |
| 241 | typedef __Request__clock_set_attributes_t __Request; |
| 242 | typedef __Reply__clock_set_attributes_t Reply __attribute__((unused)); |
| 243 | |
| 244 | /* |
| 245 | * typedef struct { |
| 246 | * mach_msg_header_t Head; |
| 247 | * NDR_record_t NDR; |
| 248 | * kern_return_t RetCode; |
| 249 | * } mig_reply_error_t; |
| 250 | */ |
| 251 | |
| 252 | Request *In0P = (Request *) InHeadP; |
| 253 | Reply *OutP = (Reply *) OutHeadP; |
| 254 | #ifdef __MIG_check__Request__clock_set_attributes_t__defined |
| 255 | kern_return_t check_result; |
| 256 | #endif /* __MIG_check__Request__clock_set_attributes_t__defined */ |
| 257 | |
| 258 | #if __MigKernelSpecificCode |
| 259 | #else |
| 260 | #endif /* __MigKernelSpecificCode */ |
| 261 | __DeclareRcvRpc(1201, "clock_set_attributes" ) |
| 262 | __BeforeRcvRpc(1201, "clock_set_attributes" ) |
| 263 | |
| 264 | #if defined(__MIG_check__Request__clock_set_attributes_t__defined) |
| 265 | check_result = __MIG_check__Request__clock_set_attributes_t((__Request *)In0P); |
| 266 | if (check_result != MACH_MSG_SUCCESS) |
| 267 | { MIG_RETURN_ERROR(OutP, check_result); } |
| 268 | #endif /* defined(__MIG_check__Request__clock_set_attributes_t__defined) */ |
| 269 | |
| 270 | OutP->RetCode = clock_set_attributes(convert_port_to_clock_ctrl(In0P->Head.msgh_request_port), In0P->flavor, In0P->clock_attr, In0P->clock_attrCnt); |
| 271 | #if __MigKernelSpecificCode |
| 272 | #endif /* __MigKernelSpecificCode */ |
| 273 | |
| 274 | OutP->NDR = NDR_record; |
| 275 | |
| 276 | |
| 277 | __AfterRcvRpc(1201, "clock_set_attributes" ) |
| 278 | } |
| 279 | |
| 280 | |
| 281 | |
| 282 | /* Description of this subsystem, for use in direct RPC */ |
| 283 | const struct clock_priv_subsystem clock_priv_subsystem = { |
| 284 | clock_priv_server_routine, |
| 285 | 1200, |
| 286 | 1202, |
| 287 | (mach_msg_size_t)sizeof(union __ReplyUnion__clock_priv_subsystem), |
| 288 | (vm_address_t)0, |
| 289 | { |
| 290 | { (mig_impl_routine_t) 0, |
| 291 | (mig_stub_routine_t) _Xclock_set_time, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__clock_set_time_t)}, |
| 292 | { (mig_impl_routine_t) 0, |
| 293 | (mig_stub_routine_t) _Xclock_set_attributes, 4, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__clock_set_attributes_t)}, |
| 294 | } |
| 295 | }; |
| 296 | |
| 297 | mig_external boolean_t clock_priv_server |
| 298 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 299 | { |
| 300 | /* |
| 301 | * typedef struct { |
| 302 | * mach_msg_header_t Head; |
| 303 | * NDR_record_t NDR; |
| 304 | * kern_return_t RetCode; |
| 305 | * } mig_reply_error_t; |
| 306 | */ |
| 307 | |
| 308 | register mig_routine_t routine; |
| 309 | |
| 310 | OutHeadP->msgh_bits = MACH_MSGH_BITS(MACH_MSGH_BITS_REPLY(InHeadP->msgh_bits), 0); |
| 311 | OutHeadP->msgh_remote_port = InHeadP->msgh_reply_port; |
| 312 | /* Minimal size: routine() will update it if different */ |
| 313 | OutHeadP->msgh_size = (mach_msg_size_t)sizeof(mig_reply_error_t); |
| 314 | OutHeadP->msgh_local_port = MACH_PORT_NULL; |
| 315 | OutHeadP->msgh_id = InHeadP->msgh_id + 100; |
| 316 | OutHeadP->msgh_reserved = 0; |
| 317 | |
| 318 | if ((InHeadP->msgh_id > 1201) || (InHeadP->msgh_id < 1200) || |
| 319 | ((routine = clock_priv_subsystem.routine[InHeadP->msgh_id - 1200].stub_routine) == 0)) { |
| 320 | ((mig_reply_error_t *)OutHeadP)->NDR = NDR_record; |
| 321 | ((mig_reply_error_t *)OutHeadP)->RetCode = MIG_BAD_ID; |
| 322 | return FALSE; |
| 323 | } |
| 324 | (*routine) (InHeadP, OutHeadP); |
| 325 | return TRUE; |
| 326 | } |
| 327 | |
| 328 | mig_external mig_routine_t clock_priv_server_routine |
| 329 | (mach_msg_header_t *InHeadP) |
| 330 | { |
| 331 | register int msgh_id; |
| 332 | |
| 333 | msgh_id = InHeadP->msgh_id - 1200; |
| 334 | |
| 335 | if ((msgh_id > 1) || (msgh_id < 0)) |
| 336 | return 0; |
| 337 | |
| 338 | return clock_priv_subsystem.routine[msgh_id].stub_routine; |
| 339 | } |
| 340 | |