| 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__sysdiagnose_notification_subsystem__ 1 |
| 9 | |
| 10 | #include "sysdiagnose_notification.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 sysdiagnose_notification */ |
| 109 | mig_external kern_return_t send_sysdiagnose_notification |
| 110 | ( |
| 111 | mach_port_t sysdiagnose_port, |
| 112 | uint32_t flags |
| 113 | ) |
| 114 | { |
| 115 | |
| 116 | #ifdef __MigPackStructs |
| 117 | #pragma pack(4) |
| 118 | #endif |
| 119 | typedef struct { |
| 120 | mach_msg_header_t Head; |
| 121 | NDR_record_t NDR; |
| 122 | uint32_t flags; |
| 123 | } Request __attribute__((unused)); |
| 124 | #ifdef __MigPackStructs |
| 125 | #pragma pack() |
| 126 | #endif |
| 127 | /* |
| 128 | * typedef struct { |
| 129 | * mach_msg_header_t Head; |
| 130 | * NDR_record_t NDR; |
| 131 | * kern_return_t RetCode; |
| 132 | * } mig_reply_error_t; |
| 133 | */ |
| 134 | |
| 135 | union { |
| 136 | Request In; |
| 137 | } Mess; |
| 138 | |
| 139 | Request *InP = &Mess.In; |
| 140 | |
| 141 | mach_msg_return_t msg_result; |
| 142 | |
| 143 | #ifdef __MIG_check__Reply__sysdiagnose_notification_t__defined |
| 144 | kern_return_t check_result; |
| 145 | #endif /* __MIG_check__Reply__sysdiagnose_notification_t__defined */ |
| 146 | |
| 147 | __DeclareSendSimple(31337, "sysdiagnose_notification" ) |
| 148 | |
| 149 | InP->NDR = NDR_record; |
| 150 | |
| 151 | InP->flags = flags; |
| 152 | |
| 153 | InP->Head.msgh_bits = |
| 154 | MACH_MSGH_BITS(19, 0); |
| 155 | /* msgh_size passed as argument */ |
| 156 | InP->Head.msgh_request_port = sysdiagnose_port; |
| 157 | InP->Head.msgh_reply_port = MACH_PORT_NULL; |
| 158 | InP->Head.msgh_id = 31337; |
| 159 | InP->Head.msgh_reserved = 0; |
| 160 | |
| 161 | __BeforeSendSimple(31337, "sysdiagnose_notification" ) |
| 162 | #if __MigKernelSpecificCode |
| 163 | msg_result = mach_msg_send_from_kernel(&InP->Head, (mach_msg_size_t)sizeof(Request)); |
| 164 | #else |
| 165 | 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); |
| 166 | #endif /* __MigKernelSpecificCode */ |
| 167 | __AfterSendSimple(31337, "sysdiagnose_notification" ) |
| 168 | return msg_result; |
| 169 | } |
| 170 | |