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 memory_entry */
10
11#define __MIG_check__Request__memory_entry_subsystem__ 1
12
13#include "memory_entry_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
98mig_internal novalue _Xmach_memory_entry_purgable_control
99 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
100
101mig_internal novalue _Xmach_memory_entry_access_tracking
102 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
103
104
105#if ( __MigTypeCheck )
106#if __MIG_check__Request__memory_entry_subsystem__
107#if !defined(__MIG_check__Request__mach_memory_entry_purgable_control_t__defined)
108#define __MIG_check__Request__mach_memory_entry_purgable_control_t__defined
109
110mig_internal kern_return_t __MIG_check__Request__mach_memory_entry_purgable_control_t(__attribute__((__unused__)) __Request__mach_memory_entry_purgable_control_t *In0P)
111{
112
113 typedef __Request__mach_memory_entry_purgable_control_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__mach_memory_entry_purgable_control_t__defined) */
123#endif /* __MIG_check__Request__memory_entry_subsystem__ */
124#endif /* ( __MigTypeCheck ) */
125
126
127/* Routine mach_memory_entry_purgable_control */
128mig_internal novalue _Xmach_memory_entry_purgable_control
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 vm_purgable_t control;
139 int state;
140 mach_msg_trailer_t trailer;
141 } Request __attribute__((unused));
142#ifdef __MigPackStructs
143#pragma pack()
144#endif
145 typedef __Request__mach_memory_entry_purgable_control_t __Request;
146 typedef __Reply__mach_memory_entry_purgable_control_t Reply __attribute__((unused));
147
148 /*
149 * typedef struct {
150 * mach_msg_header_t Head;
151 * NDR_record_t NDR;
152 * kern_return_t RetCode;
153 * } mig_reply_error_t;
154 */
155
156 Request *In0P = (Request *) InHeadP;
157 Reply *OutP = (Reply *) OutHeadP;
158#ifdef __MIG_check__Request__mach_memory_entry_purgable_control_t__defined
159 kern_return_t check_result;
160#endif /* __MIG_check__Request__mach_memory_entry_purgable_control_t__defined */
161
162#if __MigKernelSpecificCode
163#else
164#endif /* __MigKernelSpecificCode */
165 __DeclareRcvRpc(4900, "mach_memory_entry_purgable_control")
166 __BeforeRcvRpc(4900, "mach_memory_entry_purgable_control")
167
168#if defined(__MIG_check__Request__mach_memory_entry_purgable_control_t__defined)
169 check_result = __MIG_check__Request__mach_memory_entry_purgable_control_t((__Request *)In0P);
170 if (check_result != MACH_MSG_SUCCESS)
171 { MIG_RETURN_ERROR(OutP, check_result); }
172#endif /* defined(__MIG_check__Request__mach_memory_entry_purgable_control_t__defined) */
173
174 OutP->RetCode = mach_memory_entry_purgable_control(null_conversion(In0P->Head.msgh_request_port), In0P->control, &In0P->state);
175 if (OutP->RetCode != KERN_SUCCESS) {
176 MIG_RETURN_ERROR(OutP, OutP->RetCode);
177 }
178#if __MigKernelSpecificCode
179#endif /* __MigKernelSpecificCode */
180
181 OutP->NDR = NDR_record;
182
183
184 OutP->state = In0P->state;
185
186 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
187 __AfterRcvRpc(4900, "mach_memory_entry_purgable_control")
188}
189
190#if ( __MigTypeCheck )
191#if __MIG_check__Request__memory_entry_subsystem__
192#if !defined(__MIG_check__Request__mach_memory_entry_access_tracking_t__defined)
193#define __MIG_check__Request__mach_memory_entry_access_tracking_t__defined
194
195mig_internal kern_return_t __MIG_check__Request__mach_memory_entry_access_tracking_t(__attribute__((__unused__)) __Request__mach_memory_entry_access_tracking_t *In0P)
196{
197
198 typedef __Request__mach_memory_entry_access_tracking_t __Request;
199#if __MigTypeCheck
200 if ((In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
201 (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
202 return MIG_BAD_ARGUMENTS;
203#endif /* __MigTypeCheck */
204
205 return MACH_MSG_SUCCESS;
206}
207#endif /* !defined(__MIG_check__Request__mach_memory_entry_access_tracking_t__defined) */
208#endif /* __MIG_check__Request__memory_entry_subsystem__ */
209#endif /* ( __MigTypeCheck ) */
210
211
212/* Routine mach_memory_entry_access_tracking */
213mig_internal novalue _Xmach_memory_entry_access_tracking
214 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
215{
216
217#ifdef __MigPackStructs
218#pragma pack(4)
219#endif
220 typedef struct {
221 mach_msg_header_t Head;
222 NDR_record_t NDR;
223 int access_tracking;
224 mach_msg_trailer_t trailer;
225 } Request __attribute__((unused));
226#ifdef __MigPackStructs
227#pragma pack()
228#endif
229 typedef __Request__mach_memory_entry_access_tracking_t __Request;
230 typedef __Reply__mach_memory_entry_access_tracking_t Reply __attribute__((unused));
231
232 /*
233 * typedef struct {
234 * mach_msg_header_t Head;
235 * NDR_record_t NDR;
236 * kern_return_t RetCode;
237 * } mig_reply_error_t;
238 */
239
240 Request *In0P = (Request *) InHeadP;
241 Reply *OutP = (Reply *) OutHeadP;
242#ifdef __MIG_check__Request__mach_memory_entry_access_tracking_t__defined
243 kern_return_t check_result;
244#endif /* __MIG_check__Request__mach_memory_entry_access_tracking_t__defined */
245
246#if __MigKernelSpecificCode
247#else
248#endif /* __MigKernelSpecificCode */
249 __DeclareRcvRpc(4901, "mach_memory_entry_access_tracking")
250 __BeforeRcvRpc(4901, "mach_memory_entry_access_tracking")
251
252#if defined(__MIG_check__Request__mach_memory_entry_access_tracking_t__defined)
253 check_result = __MIG_check__Request__mach_memory_entry_access_tracking_t((__Request *)In0P);
254 if (check_result != MACH_MSG_SUCCESS)
255 { MIG_RETURN_ERROR(OutP, check_result); }
256#endif /* defined(__MIG_check__Request__mach_memory_entry_access_tracking_t__defined) */
257
258 OutP->RetCode = mach_memory_entry_access_tracking(null_conversion(In0P->Head.msgh_request_port), &In0P->access_tracking, &OutP->access_tracking_reads, &OutP->access_tracking_writes);
259 if (OutP->RetCode != KERN_SUCCESS) {
260 MIG_RETURN_ERROR(OutP, OutP->RetCode);
261 }
262#if __MigKernelSpecificCode
263#endif /* __MigKernelSpecificCode */
264
265 OutP->NDR = NDR_record;
266
267
268 OutP->access_tracking = In0P->access_tracking;
269
270 OutP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
271 __AfterRcvRpc(4901, "mach_memory_entry_access_tracking")
272}
273
274
275
276/* Description of this subsystem, for use in direct RPC */
277const struct memory_entry_subsystem memory_entry_subsystem = {
278 memory_entry_server_routine,
279 4900,
280 4902,
281 (mach_msg_size_t)sizeof(union __ReplyUnion__memory_entry_subsystem),
282 (vm_address_t)0,
283 {
284 { (mig_impl_routine_t) 0,
285 (mig_stub_routine_t) _Xmach_memory_entry_purgable_control, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__mach_memory_entry_purgable_control_t)},
286 { (mig_impl_routine_t) 0,
287 (mig_stub_routine_t) _Xmach_memory_entry_access_tracking, 4, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__mach_memory_entry_access_tracking_t)},
288 }
289};
290
291mig_external boolean_t memory_entry_server
292 (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
293{
294 /*
295 * typedef struct {
296 * mach_msg_header_t Head;
297 * NDR_record_t NDR;
298 * kern_return_t RetCode;
299 * } mig_reply_error_t;
300 */
301
302 register mig_routine_t routine;
303
304 OutHeadP->msgh_bits = MACH_MSGH_BITS(MACH_MSGH_BITS_REPLY(InHeadP->msgh_bits), 0);
305 OutHeadP->msgh_remote_port = InHeadP->msgh_reply_port;
306 /* Minimal size: routine() will update it if different */
307 OutHeadP->msgh_size = (mach_msg_size_t)sizeof(mig_reply_error_t);
308 OutHeadP->msgh_local_port = MACH_PORT_NULL;
309 OutHeadP->msgh_id = InHeadP->msgh_id + 100;
310 OutHeadP->msgh_reserved = 0;
311
312 if ((InHeadP->msgh_id > 4901) || (InHeadP->msgh_id < 4900) ||
313 ((routine = memory_entry_subsystem.routine[InHeadP->msgh_id - 4900].stub_routine) == 0)) {
314 ((mig_reply_error_t *)OutHeadP)->NDR = NDR_record;
315 ((mig_reply_error_t *)OutHeadP)->RetCode = MIG_BAD_ID;
316 return FALSE;
317 }
318 (*routine) (InHeadP, OutHeadP);
319 return TRUE;
320}
321
322mig_external mig_routine_t memory_entry_server_routine
323 (mach_msg_header_t *InHeadP)
324{
325 register int msgh_id;
326
327 msgh_id = InHeadP->msgh_id - 4900;
328
329 if ((msgh_id > 1) || (msgh_id < 0))
330 return 0;
331
332 return memory_entry_subsystem.routine[msgh_id].stub_routine;
333}
334