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