OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // WARNING this file was generated by generate_nacl_bindings.py | 5 // WARNING this file was generated by generate_nacl_bindings.py |
6 // Do not edit by hand. | 6 // Do not edit by hand. |
7 | 7 |
8 #include "nacl_bindings/mojo_syscall.h" | 8 #include "nacl_bindings/mojo_syscall.h" |
9 | 9 |
10 #include <stdio.h> | 10 #include <stdio.h> |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 &new_buffer_handle_value); | 115 &new_buffer_handle_value); |
116 | 116 |
117 { | 117 { |
118 ScopedCopyLock copy_lock(nap); | 118 ScopedCopyLock copy_lock(nap); |
119 *new_buffer_handle_ptr = new_buffer_handle_value; | 119 *new_buffer_handle_ptr = new_buffer_handle_value; |
120 *result_ptr = result_value; | 120 *result_ptr = result_value; |
121 } | 121 } |
122 | 122 |
123 return 0; | 123 return 0; |
124 } | 124 } |
125 case 2: { | 125 case 2: |
126 if (num_params != 7) { | 126 fprintf(stderr, "MojoMapBuffer not implemented\n"); |
127 return -1; | 127 return -1; |
128 } | 128 case 3: |
129 MojoHandle buffer_handle_value; | 129 fprintf(stderr, "MojoUnmapBuffer not implemented\n"); |
130 uint64_t offset_value; | 130 return -1; |
131 uint64_t num_bytes_value; | |
132 void* volatile* buffer_ptr; | |
133 void* buffer_value; | |
134 MojoMapBufferFlags flags_value; | |
135 MojoResult volatile* result_ptr; | |
136 MojoResult result_value; | |
137 { | |
138 ScopedCopyLock copy_lock(nap); | |
139 if (!ConvertScalarInput(nap, params[1], &buffer_handle_value)) { | |
140 return -1; | |
141 } | |
142 if (!ConvertScalarInput(nap, params[2], &offset_value)) { | |
143 return -1; | |
144 } | |
145 if (!ConvertScalarInput(nap, params[3], &num_bytes_value)) { | |
146 return -1; | |
147 } | |
148 if (!ConvertScalarInOut(nap, params[4], false, &buffer_value, | |
149 &buffer_ptr)) { | |
150 return -1; | |
151 } | |
152 if (!ConvertScalarInput(nap, params[5], &flags_value)) { | |
153 return -1; | |
154 } | |
155 if (!ConvertScalarOutput(nap, params[6], false, &result_ptr)) { | |
156 return -1; | |
157 } | |
158 } | |
159 | |
160 result_value = MojoMapBuffer(buffer_handle_value, offset_value, | |
161 num_bytes_value, &buffer_value, flags_value); | |
162 | |
163 { | |
164 ScopedCopyLock copy_lock(nap); | |
165 *buffer_ptr = buffer_value; | |
166 *result_ptr = result_value; | |
167 } | |
168 | |
169 return 0; | |
170 } | |
171 case 3: { | |
172 if (num_params != 3) { | |
173 return -1; | |
174 } | |
175 void* buffer_value; | |
176 MojoResult volatile* result_ptr; | |
177 MojoResult result_value; | |
178 { | |
179 ScopedCopyLock copy_lock(nap); | |
180 if (!ConvertScalarInput(nap, params[1], &buffer_value)) { | |
181 return -1; | |
182 } | |
183 if (!ConvertScalarOutput(nap, params[2], false, &result_ptr)) { | |
184 return -1; | |
185 } | |
186 } | |
187 | |
188 result_value = MojoUnmapBuffer(buffer_value); | |
189 | |
190 { | |
191 ScopedCopyLock copy_lock(nap); | |
192 *result_ptr = result_value; | |
193 } | |
194 | |
195 return 0; | |
196 } | |
197 case 4: { | 131 case 4: { |
198 if (num_params != 5) { | 132 if (num_params != 5) { |
199 return -1; | 133 return -1; |
200 } | 134 } |
201 const struct MojoCreateDataPipeOptions* options; | 135 const struct MojoCreateDataPipeOptions* options; |
202 MojoHandle volatile* data_pipe_producer_handle_ptr; | 136 MojoHandle volatile* data_pipe_producer_handle_ptr; |
203 MojoHandle data_pipe_producer_handle_value; | 137 MojoHandle data_pipe_producer_handle_value; |
204 MojoHandle volatile* data_pipe_consumer_handle_ptr; | 138 MojoHandle volatile* data_pipe_consumer_handle_ptr; |
205 MojoHandle data_pipe_consumer_handle_value; | 139 MojoHandle data_pipe_consumer_handle_value; |
206 MojoResult volatile* result_ptr; | 140 MojoResult volatile* result_ptr; |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 &num_bytes_value, flags_value); | 209 &num_bytes_value, flags_value); |
276 | 210 |
277 { | 211 { |
278 ScopedCopyLock copy_lock(nap); | 212 ScopedCopyLock copy_lock(nap); |
279 *num_bytes_ptr = num_bytes_value; | 213 *num_bytes_ptr = num_bytes_value; |
280 *result_ptr = result_value; | 214 *result_ptr = result_value; |
281 } | 215 } |
282 | 216 |
283 return 0; | 217 return 0; |
284 } | 218 } |
285 case 6: { | 219 case 6: |
286 if (num_params != 6) { | 220 fprintf(stderr, "MojoBeginWriteData not implemented\n"); |
287 return -1; | 221 return -1; |
288 } | |
289 MojoHandle data_pipe_producer_handle_value; | |
290 void* volatile* buffer_ptr; | |
291 void* buffer_value; | |
292 uint32_t volatile* buffer_num_bytes_ptr; | |
293 uint32_t buffer_num_bytes_value; | |
294 MojoWriteDataFlags flags_value; | |
295 MojoResult volatile* result_ptr; | |
296 MojoResult result_value; | |
297 { | |
298 ScopedCopyLock copy_lock(nap); | |
299 if (!ConvertScalarInput(nap, params[1], | |
300 &data_pipe_producer_handle_value)) { | |
301 return -1; | |
302 } | |
303 if (!ConvertScalarInOut(nap, params[2], false, &buffer_value, | |
304 &buffer_ptr)) { | |
305 return -1; | |
306 } | |
307 if (!ConvertScalarInOut(nap, params[3], false, &buffer_num_bytes_value, | |
308 &buffer_num_bytes_ptr)) { | |
309 return -1; | |
310 } | |
311 if (!ConvertScalarInput(nap, params[4], &flags_value)) { | |
312 return -1; | |
313 } | |
314 if (!ConvertScalarOutput(nap, params[5], false, &result_ptr)) { | |
315 return -1; | |
316 } | |
317 } | |
318 | |
319 result_value = | |
320 MojoBeginWriteData(data_pipe_producer_handle_value, &buffer_value, | |
321 &buffer_num_bytes_value, flags_value); | |
322 | |
323 { | |
324 ScopedCopyLock copy_lock(nap); | |
325 *buffer_ptr = buffer_value; | |
326 *buffer_num_bytes_ptr = buffer_num_bytes_value; | |
327 *result_ptr = result_value; | |
328 } | |
329 | |
330 return 0; | |
331 } | |
332 case 7: { | 222 case 7: { |
333 if (num_params != 4) { | 223 if (num_params != 4) { |
334 return -1; | 224 return -1; |
335 } | 225 } |
336 MojoHandle data_pipe_producer_handle_value; | 226 MojoHandle data_pipe_producer_handle_value; |
337 uint32_t num_bytes_written_value; | 227 uint32_t num_bytes_written_value; |
338 MojoResult volatile* result_ptr; | 228 MojoResult volatile* result_ptr; |
339 MojoResult result_value; | 229 MojoResult result_value; |
340 { | 230 { |
341 ScopedCopyLock copy_lock(nap); | 231 ScopedCopyLock copy_lock(nap); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 &num_bytes_value, flags_value); | 288 &num_bytes_value, flags_value); |
399 | 289 |
400 { | 290 { |
401 ScopedCopyLock copy_lock(nap); | 291 ScopedCopyLock copy_lock(nap); |
402 *num_bytes_ptr = num_bytes_value; | 292 *num_bytes_ptr = num_bytes_value; |
403 *result_ptr = result_value; | 293 *result_ptr = result_value; |
404 } | 294 } |
405 | 295 |
406 return 0; | 296 return 0; |
407 } | 297 } |
408 case 9: { | 298 case 9: |
409 if (num_params != 6) { | 299 fprintf(stderr, "MojoBeginReadData not implemented\n"); |
410 return -1; | 300 return -1; |
411 } | |
412 MojoHandle data_pipe_consumer_handle_value; | |
413 const void* volatile* buffer_ptr; | |
414 const void* buffer_value; | |
415 uint32_t volatile* buffer_num_bytes_ptr; | |
416 uint32_t buffer_num_bytes_value; | |
417 MojoReadDataFlags flags_value; | |
418 MojoResult volatile* result_ptr; | |
419 MojoResult result_value; | |
420 { | |
421 ScopedCopyLock copy_lock(nap); | |
422 if (!ConvertScalarInput(nap, params[1], | |
423 &data_pipe_consumer_handle_value)) { | |
424 return -1; | |
425 } | |
426 if (!ConvertScalarInOut(nap, params[2], false, &buffer_value, | |
427 &buffer_ptr)) { | |
428 return -1; | |
429 } | |
430 if (!ConvertScalarInOut(nap, params[3], false, &buffer_num_bytes_value, | |
431 &buffer_num_bytes_ptr)) { | |
432 return -1; | |
433 } | |
434 if (!ConvertScalarInput(nap, params[4], &flags_value)) { | |
435 return -1; | |
436 } | |
437 if (!ConvertScalarOutput(nap, params[5], false, &result_ptr)) { | |
438 return -1; | |
439 } | |
440 } | |
441 | |
442 result_value = | |
443 MojoBeginReadData(data_pipe_consumer_handle_value, &buffer_value, | |
444 &buffer_num_bytes_value, flags_value); | |
445 | |
446 { | |
447 ScopedCopyLock copy_lock(nap); | |
448 *buffer_ptr = buffer_value; | |
449 *buffer_num_bytes_ptr = buffer_num_bytes_value; | |
450 *result_ptr = result_value; | |
451 } | |
452 | |
453 return 0; | |
454 } | |
455 case 10: { | 301 case 10: { |
456 if (num_params != 4) { | 302 if (num_params != 4) { |
457 return -1; | 303 return -1; |
458 } | 304 } |
459 MojoHandle data_pipe_consumer_handle_value; | 305 MojoHandle data_pipe_consumer_handle_value; |
460 uint32_t num_bytes_read_value; | 306 uint32_t num_bytes_read_value; |
461 MojoResult volatile* result_ptr; | 307 MojoResult volatile* result_ptr; |
462 MojoResult result_value; | 308 MojoResult result_value; |
463 { | 309 { |
464 ScopedCopyLock copy_lock(nap); | 310 ScopedCopyLock copy_lock(nap); |
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
870 } | 716 } |
871 | 717 |
872 void InjectMojo(struct NaClApp* nap, MojoHandle handle) { | 718 void InjectMojo(struct NaClApp* nap, MojoHandle handle) { |
873 NaClAppSetDesc(nap, NACL_MOJO_DESC, MakeMojoDesc(nap)); | 719 NaClAppSetDesc(nap, NACL_MOJO_DESC, MakeMojoDesc(nap)); |
874 g_mojo_handle = handle; | 720 g_mojo_handle = handle; |
875 } | 721 } |
876 | 722 |
877 void InjectDisabledMojo(struct NaClApp* nap) { | 723 void InjectDisabledMojo(struct NaClApp* nap) { |
878 NaClAppSetDesc(nap, NACL_MOJO_DESC, MakeDisabledMojoDesc(nap)); | 724 NaClAppSetDesc(nap, NACL_MOJO_DESC, MakeDisabledMojoDesc(nap)); |
879 } | 725 } |
OLD | NEW |