| 1 | /* |
| 2 | * IDENTIFICATION: |
| 3 | * stub generated Tue Apr 9 11:33:40 2019 |
| 4 | * with a MiG generated by bootstrap_cmds-96.20.2.200.4 |
| 5 | * OPTIONS: |
| 6 | * KernelUser |
| 7 | */ |
| 8 | #define __MIG_check__Reply__resource_notify_subsystem__ 1 |
| 9 | |
| 10 | #include "resource_notify.h" |
| 11 | |
| 12 | |
| 13 | #ifndef mig_internal |
| 14 | #define mig_internal static __inline__ |
| 15 | #endif /* mig_internal */ |
| 16 | |
| 17 | #ifndef mig_external |
| 18 | #define mig_external |
| 19 | #endif /* mig_external */ |
| 20 | |
| 21 | #if !defined(__MigTypeCheck) && defined(TypeCheck) |
| 22 | #define __MigTypeCheck TypeCheck /* Legacy setting */ |
| 23 | #endif /* !defined(__MigTypeCheck) */ |
| 24 | |
| 25 | #if !defined(__MigKernelSpecificCode) && defined(_MIG_KERNEL_SPECIFIC_CODE_) |
| 26 | #define __MigKernelSpecificCode _MIG_KERNEL_SPECIFIC_CODE_ /* Legacy setting */ |
| 27 | #endif /* !defined(__MigKernelSpecificCode) */ |
| 28 | |
| 29 | #ifndef LimitCheck |
| 30 | #define LimitCheck 0 |
| 31 | #endif /* LimitCheck */ |
| 32 | |
| 33 | #ifndef min |
| 34 | #define min(a,b) ( ((a) < (b))? (a): (b) ) |
| 35 | #endif /* min */ |
| 36 | |
| 37 | #if !defined(_WALIGN_) |
| 38 | #define _WALIGN_(x) (((x) + 3) & ~3) |
| 39 | #endif /* !defined(_WALIGN_) */ |
| 40 | |
| 41 | #if !defined(_WALIGNSZ_) |
| 42 | #define _WALIGNSZ_(x) _WALIGN_(sizeof(x)) |
| 43 | #endif /* !defined(_WALIGNSZ_) */ |
| 44 | |
| 45 | #ifndef UseStaticTemplates |
| 46 | #define UseStaticTemplates 0 |
| 47 | #endif /* UseStaticTemplates */ |
| 48 | |
| 49 | #ifndef __MachMsgErrorWithTimeout |
| 50 | #define __MachMsgErrorWithTimeout(_R_) { \ |
| 51 | switch (_R_) { \ |
| 52 | case MACH_SEND_INVALID_DATA: \ |
| 53 | case MACH_SEND_INVALID_DEST: \ |
| 54 | case MACH_SEND_INVALID_HEADER: \ |
| 55 | mig_put_reply_port(InP->Head.msgh_reply_port); \ |
| 56 | break; \ |
| 57 | case MACH_SEND_TIMED_OUT: \ |
| 58 | case MACH_RCV_TIMED_OUT: \ |
| 59 | default: \ |
| 60 | mig_dealloc_reply_port(InP->Head.msgh_reply_port); \ |
| 61 | } \ |
| 62 | } |
| 63 | #endif /* __MachMsgErrorWithTimeout */ |
| 64 | |
| 65 | #ifndef __MachMsgErrorWithoutTimeout |
| 66 | #define __MachMsgErrorWithoutTimeout(_R_) { \ |
| 67 | switch (_R_) { \ |
| 68 | case MACH_SEND_INVALID_DATA: \ |
| 69 | case MACH_SEND_INVALID_DEST: \ |
| 70 | case MACH_SEND_INVALID_HEADER: \ |
| 71 | mig_put_reply_port(InP->Head.msgh_reply_port); \ |
| 72 | break; \ |
| 73 | default: \ |
| 74 | mig_dealloc_reply_port(InP->Head.msgh_reply_port); \ |
| 75 | } \ |
| 76 | } |
| 77 | #endif /* __MachMsgErrorWithoutTimeout */ |
| 78 | |
| 79 | #ifndef __DeclareSendRpc |
| 80 | #define __DeclareSendRpc(_NUM_, _NAME_) |
| 81 | #endif /* __DeclareSendRpc */ |
| 82 | |
| 83 | #ifndef __BeforeSendRpc |
| 84 | #define __BeforeSendRpc(_NUM_, _NAME_) |
| 85 | #endif /* __BeforeSendRpc */ |
| 86 | |
| 87 | #ifndef __AfterSendRpc |
| 88 | #define __AfterSendRpc(_NUM_, _NAME_) |
| 89 | #endif /* __AfterSendRpc */ |
| 90 | |
| 91 | #ifndef __DeclareSendSimple |
| 92 | #define __DeclareSendSimple(_NUM_, _NAME_) |
| 93 | #endif /* __DeclareSendSimple */ |
| 94 | |
| 95 | #ifndef __BeforeSendSimple |
| 96 | #define __BeforeSendSimple(_NUM_, _NAME_) |
| 97 | #endif /* __BeforeSendSimple */ |
| 98 | |
| 99 | #ifndef __AfterSendSimple |
| 100 | #define __AfterSendSimple(_NUM_, _NAME_) |
| 101 | #endif /* __AfterSendSimple */ |
| 102 | |
| 103 | #define msgh_request_port msgh_remote_port |
| 104 | #define msgh_reply_port msgh_local_port |
| 105 | |
| 106 | |
| 107 | |
| 108 | /* SimpleRoutine cpu_usage_violation */ |
| 109 | mig_external kern_return_t send_cpu_usage_violation |
| 110 | ( |
| 111 | mach_port_t receiver, |
| 112 | proc_name_t procname, |
| 113 | int pid, |
| 114 | posix_path_t killed_proc_path, |
| 115 | mach_timespec_t timestamp, |
| 116 | int64_t observed_cpu_nsecs, |
| 117 | int64_t observation_nsecs, |
| 118 | int64_t cpu_nsecs_allowed, |
| 119 | int64_t limit_window_nsecs, |
| 120 | resource_notify_flags_t flags |
| 121 | ) |
| 122 | { |
| 123 | |
| 124 | #ifdef __MigPackStructs |
| 125 | #pragma pack(4) |
| 126 | #endif |
| 127 | typedef struct { |
| 128 | mach_msg_header_t Head; |
| 129 | NDR_record_t NDR; |
| 130 | proc_name_t procname; |
| 131 | char procnamePad[3]; |
| 132 | int pid; |
| 133 | posix_path_t killed_proc_path; |
| 134 | mach_timespec_t timestamp; |
| 135 | int64_t observed_cpu_nsecs; |
| 136 | int64_t observation_nsecs; |
| 137 | int64_t cpu_nsecs_allowed; |
| 138 | int64_t limit_window_nsecs; |
| 139 | resource_notify_flags_t flags; |
| 140 | } Request __attribute__((unused)); |
| 141 | #ifdef __MigPackStructs |
| 142 | #pragma pack() |
| 143 | #endif |
| 144 | /* |
| 145 | * typedef struct { |
| 146 | * mach_msg_header_t Head; |
| 147 | * NDR_record_t NDR; |
| 148 | * kern_return_t RetCode; |
| 149 | * } mig_reply_error_t; |
| 150 | */ |
| 151 | |
| 152 | union { |
| 153 | Request In; |
| 154 | } Mess; |
| 155 | |
| 156 | Request *InP = &Mess.In; |
| 157 | |
| 158 | mach_msg_return_t msg_result; |
| 159 | |
| 160 | #ifdef __MIG_check__Reply__cpu_usage_violation_t__defined |
| 161 | kern_return_t check_result; |
| 162 | #endif /* __MIG_check__Reply__cpu_usage_violation_t__defined */ |
| 163 | |
| 164 | __DeclareSendSimple(827800, "cpu_usage_violation" ) |
| 165 | |
| 166 | InP->NDR = NDR_record; |
| 167 | |
| 168 | { typedef struct { char data[33]; } *sp; |
| 169 | * (sp) InP->procname = * (sp) procname; |
| 170 | } |
| 171 | |
| 172 | InP->pid = pid; |
| 173 | |
| 174 | { typedef struct { char data[512]; } *sp; |
| 175 | * (sp) InP->killed_proc_path = * (sp) killed_proc_path; |
| 176 | } |
| 177 | |
| 178 | InP->timestamp = timestamp; |
| 179 | |
| 180 | InP->observed_cpu_nsecs = observed_cpu_nsecs; |
| 181 | |
| 182 | InP->observation_nsecs = observation_nsecs; |
| 183 | |
| 184 | InP->cpu_nsecs_allowed = cpu_nsecs_allowed; |
| 185 | |
| 186 | InP->limit_window_nsecs = limit_window_nsecs; |
| 187 | |
| 188 | InP->flags = flags; |
| 189 | |
| 190 | InP->Head.msgh_bits = |
| 191 | MACH_MSGH_BITS(19, 0); |
| 192 | /* msgh_size passed as argument */ |
| 193 | InP->Head.msgh_request_port = receiver; |
| 194 | InP->Head.msgh_reply_port = MACH_PORT_NULL; |
| 195 | InP->Head.msgh_id = 827800; |
| 196 | InP->Head.msgh_reserved = 0; |
| 197 | |
| 198 | __BeforeSendSimple(827800, "cpu_usage_violation" ) |
| 199 | #if __MigKernelSpecificCode |
| 200 | msg_result = mach_msg_send_from_kernel(&InP->Head, (mach_msg_size_t)sizeof(Request)); |
| 201 | #else |
| 202 | msg_result = mach_msg(&InP->Head, MACH_SEND_MSG|MACH_MSG_OPTION_NONE, (mach_msg_size_t)sizeof(Request), 0, MACH_PORT_NULL, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); |
| 203 | #endif /* __MigKernelSpecificCode */ |
| 204 | __AfterSendSimple(827800, "cpu_usage_violation" ) |
| 205 | return msg_result; |
| 206 | } |
| 207 | |
| 208 | /* SimpleRoutine cpu_wakes_violation */ |
| 209 | mig_external kern_return_t send_cpu_wakes_violation |
| 210 | ( |
| 211 | mach_port_t receiver, |
| 212 | proc_name_t procname, |
| 213 | int pid, |
| 214 | posix_path_t killed_proc_path, |
| 215 | mach_timespec_t timestamp, |
| 216 | int64_t observed_cpu_wakes, |
| 217 | int64_t observation_nsecs, |
| 218 | int64_t cpu_wakes_allowed, |
| 219 | int64_t limit_window_nsecs, |
| 220 | resource_notify_flags_t flags |
| 221 | ) |
| 222 | { |
| 223 | |
| 224 | #ifdef __MigPackStructs |
| 225 | #pragma pack(4) |
| 226 | #endif |
| 227 | typedef struct { |
| 228 | mach_msg_header_t Head; |
| 229 | NDR_record_t NDR; |
| 230 | proc_name_t procname; |
| 231 | char procnamePad[3]; |
| 232 | int pid; |
| 233 | posix_path_t killed_proc_path; |
| 234 | mach_timespec_t timestamp; |
| 235 | int64_t observed_cpu_wakes; |
| 236 | int64_t observation_nsecs; |
| 237 | int64_t cpu_wakes_allowed; |
| 238 | int64_t limit_window_nsecs; |
| 239 | resource_notify_flags_t flags; |
| 240 | } Request __attribute__((unused)); |
| 241 | #ifdef __MigPackStructs |
| 242 | #pragma pack() |
| 243 | #endif |
| 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 | union { |
| 253 | Request In; |
| 254 | } Mess; |
| 255 | |
| 256 | Request *InP = &Mess.In; |
| 257 | |
| 258 | mach_msg_return_t msg_result; |
| 259 | |
| 260 | #ifdef __MIG_check__Reply__cpu_wakes_violation_t__defined |
| 261 | kern_return_t check_result; |
| 262 | #endif /* __MIG_check__Reply__cpu_wakes_violation_t__defined */ |
| 263 | |
| 264 | __DeclareSendSimple(827801, "cpu_wakes_violation" ) |
| 265 | |
| 266 | InP->NDR = NDR_record; |
| 267 | |
| 268 | { typedef struct { char data[33]; } *sp; |
| 269 | * (sp) InP->procname = * (sp) procname; |
| 270 | } |
| 271 | |
| 272 | InP->pid = pid; |
| 273 | |
| 274 | { typedef struct { char data[512]; } *sp; |
| 275 | * (sp) InP->killed_proc_path = * (sp) killed_proc_path; |
| 276 | } |
| 277 | |
| 278 | InP->timestamp = timestamp; |
| 279 | |
| 280 | InP->observed_cpu_wakes = observed_cpu_wakes; |
| 281 | |
| 282 | InP->observation_nsecs = observation_nsecs; |
| 283 | |
| 284 | InP->cpu_wakes_allowed = cpu_wakes_allowed; |
| 285 | |
| 286 | InP->limit_window_nsecs = limit_window_nsecs; |
| 287 | |
| 288 | InP->flags = flags; |
| 289 | |
| 290 | InP->Head.msgh_bits = |
| 291 | MACH_MSGH_BITS(19, 0); |
| 292 | /* msgh_size passed as argument */ |
| 293 | InP->Head.msgh_request_port = receiver; |
| 294 | InP->Head.msgh_reply_port = MACH_PORT_NULL; |
| 295 | InP->Head.msgh_id = 827801; |
| 296 | InP->Head.msgh_reserved = 0; |
| 297 | |
| 298 | __BeforeSendSimple(827801, "cpu_wakes_violation" ) |
| 299 | #if __MigKernelSpecificCode |
| 300 | msg_result = mach_msg_send_from_kernel(&InP->Head, (mach_msg_size_t)sizeof(Request)); |
| 301 | #else |
| 302 | msg_result = mach_msg(&InP->Head, MACH_SEND_MSG|MACH_MSG_OPTION_NONE, (mach_msg_size_t)sizeof(Request), 0, MACH_PORT_NULL, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); |
| 303 | #endif /* __MigKernelSpecificCode */ |
| 304 | __AfterSendSimple(827801, "cpu_wakes_violation" ) |
| 305 | return msg_result; |
| 306 | } |
| 307 | |
| 308 | /* SimpleRoutine disk_writes_violation */ |
| 309 | mig_external kern_return_t send_disk_writes_violation |
| 310 | ( |
| 311 | mach_port_t receiver, |
| 312 | proc_name_t procname, |
| 313 | int pid, |
| 314 | posix_path_t killed_proc_path, |
| 315 | mach_timespec_t timestamp, |
| 316 | int64_t observed_bytes_dirtied, |
| 317 | int64_t observation_nsecs, |
| 318 | int64_t bytes_dirtied_allowed, |
| 319 | int64_t limit_window_nsecs, |
| 320 | resource_notify_flags_t flags |
| 321 | ) |
| 322 | { |
| 323 | |
| 324 | #ifdef __MigPackStructs |
| 325 | #pragma pack(4) |
| 326 | #endif |
| 327 | typedef struct { |
| 328 | mach_msg_header_t Head; |
| 329 | NDR_record_t NDR; |
| 330 | proc_name_t procname; |
| 331 | char procnamePad[3]; |
| 332 | int pid; |
| 333 | posix_path_t killed_proc_path; |
| 334 | mach_timespec_t timestamp; |
| 335 | int64_t observed_bytes_dirtied; |
| 336 | int64_t observation_nsecs; |
| 337 | int64_t bytes_dirtied_allowed; |
| 338 | int64_t limit_window_nsecs; |
| 339 | resource_notify_flags_t flags; |
| 340 | } Request __attribute__((unused)); |
| 341 | #ifdef __MigPackStructs |
| 342 | #pragma pack() |
| 343 | #endif |
| 344 | /* |
| 345 | * typedef struct { |
| 346 | * mach_msg_header_t Head; |
| 347 | * NDR_record_t NDR; |
| 348 | * kern_return_t RetCode; |
| 349 | * } mig_reply_error_t; |
| 350 | */ |
| 351 | |
| 352 | union { |
| 353 | Request In; |
| 354 | } Mess; |
| 355 | |
| 356 | Request *InP = &Mess.In; |
| 357 | |
| 358 | mach_msg_return_t msg_result; |
| 359 | |
| 360 | #ifdef __MIG_check__Reply__disk_writes_violation_t__defined |
| 361 | kern_return_t check_result; |
| 362 | #endif /* __MIG_check__Reply__disk_writes_violation_t__defined */ |
| 363 | |
| 364 | __DeclareSendSimple(827802, "disk_writes_violation" ) |
| 365 | |
| 366 | InP->NDR = NDR_record; |
| 367 | |
| 368 | { typedef struct { char data[33]; } *sp; |
| 369 | * (sp) InP->procname = * (sp) procname; |
| 370 | } |
| 371 | |
| 372 | InP->pid = pid; |
| 373 | |
| 374 | { typedef struct { char data[512]; } *sp; |
| 375 | * (sp) InP->killed_proc_path = * (sp) killed_proc_path; |
| 376 | } |
| 377 | |
| 378 | InP->timestamp = timestamp; |
| 379 | |
| 380 | InP->observed_bytes_dirtied = observed_bytes_dirtied; |
| 381 | |
| 382 | InP->observation_nsecs = observation_nsecs; |
| 383 | |
| 384 | InP->bytes_dirtied_allowed = bytes_dirtied_allowed; |
| 385 | |
| 386 | InP->limit_window_nsecs = limit_window_nsecs; |
| 387 | |
| 388 | InP->flags = flags; |
| 389 | |
| 390 | InP->Head.msgh_bits = |
| 391 | MACH_MSGH_BITS(19, 0); |
| 392 | /* msgh_size passed as argument */ |
| 393 | InP->Head.msgh_request_port = receiver; |
| 394 | InP->Head.msgh_reply_port = MACH_PORT_NULL; |
| 395 | InP->Head.msgh_id = 827802; |
| 396 | InP->Head.msgh_reserved = 0; |
| 397 | |
| 398 | __BeforeSendSimple(827802, "disk_writes_violation" ) |
| 399 | #if __MigKernelSpecificCode |
| 400 | msg_result = mach_msg_send_from_kernel(&InP->Head, (mach_msg_size_t)sizeof(Request)); |
| 401 | #else |
| 402 | msg_result = mach_msg(&InP->Head, MACH_SEND_MSG|MACH_MSG_OPTION_NONE, (mach_msg_size_t)sizeof(Request), 0, MACH_PORT_NULL, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); |
| 403 | #endif /* __MigKernelSpecificCode */ |
| 404 | __AfterSendSimple(827802, "disk_writes_violation" ) |
| 405 | return msg_result; |
| 406 | } |
| 407 | |