| 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 <stdlib.h> | 8 #include <stdlib.h> |
| 9 | 9 |
| 10 #include "mojo/public/c/system/buffer.h" | 10 #include "mojo/public/c/system/buffer.h" |
| 11 #include "mojo/public/c/system/data_pipe.h" | 11 #include "mojo/public/c/system/data_pipe.h" |
| 12 #include "mojo/public/c/system/handle.h" | 12 #include "mojo/public/c/system/handle.h" |
| 13 #include "mojo/public/c/system/message_pipe.h" | 13 #include "mojo/public/c/system/message_pipe.h" |
| 14 #include "mojo/public/c/system/result.h" | 14 #include "mojo/public/c/system/result.h" |
| 15 #include "mojo/public/c/system/time.h" | 15 #include "mojo/public/c/system/time.h" |
| 16 #include "mojo/public/c/system/wait.h" | 16 #include "mojo/public/c/system/wait.h" |
| 17 #include "mojo/public/c/system/wait_set.h" |
| 17 #include "mojo/public/platform/nacl/mojo_irt.h" | 18 #include "mojo/public/platform/nacl/mojo_irt.h" |
| 18 #include "native_client/src/untrusted/irt/irt.h" | 19 #include "native_client/src/untrusted/irt/irt.h" |
| 19 | 20 |
| 20 bool g_irt_mojo_valid = false; | 21 bool g_irt_mojo_valid = false; |
| 21 struct nacl_irt_mojo g_irt_mojo; | 22 struct nacl_irt_mojo g_irt_mojo; |
| 22 | 23 |
| 23 struct nacl_irt_mojo* get_irt_mojo() { | 24 struct nacl_irt_mojo* get_irt_mojo() { |
| 24 if (!g_irt_mojo_valid) { | 25 if (!g_irt_mojo_valid) { |
| 25 size_t rc = nacl_interface_query(NACL_IRT_MOJO_v0_1, &g_irt_mojo, | 26 size_t rc = nacl_interface_query(NACL_IRT_MOJO_v0_1, &g_irt_mojo, |
| 26 sizeof(g_irt_mojo)); | 27 sizeof(g_irt_mojo)); |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 flags); | 306 flags); |
| 306 } | 307 } |
| 307 | 308 |
| 308 MojoResult MojoUnmapBuffer(void* buffer) { | 309 MojoResult MojoUnmapBuffer(void* buffer) { |
| 309 struct nacl_irt_mojo* irt_mojo = get_irt_mojo(); | 310 struct nacl_irt_mojo* irt_mojo = get_irt_mojo(); |
| 310 if (!irt_mojo) | 311 if (!irt_mojo) |
| 311 abort(); | 312 abort(); |
| 312 return irt_mojo->MojoUnmapBuffer(buffer); | 313 return irt_mojo->MojoUnmapBuffer(buffer); |
| 313 } | 314 } |
| 314 | 315 |
| 316 MojoResult MojoCreateWaitSet(const struct MojoCreateWaitSetOptions* options, |
| 317 MojoHandle* handle) { |
| 318 struct nacl_irt_mojo* irt_mojo = get_irt_mojo(); |
| 319 if (!irt_mojo) |
| 320 abort(); |
| 321 return irt_mojo->MojoCreateWaitSet(options, handle); |
| 322 } |
| 323 |
| 324 MojoResult MojoWaitSetAdd(MojoHandle wait_set_handle, |
| 325 MojoHandle handle, |
| 326 MojoHandleSignals signals, |
| 327 uint64_t cookie, |
| 328 const struct MojoWaitSetAddOptions* options) { |
| 329 struct nacl_irt_mojo* irt_mojo = get_irt_mojo(); |
| 330 if (!irt_mojo) |
| 331 abort(); |
| 332 return irt_mojo->MojoWaitSetAdd(wait_set_handle, handle, signals, cookie, |
| 333 options); |
| 334 } |
| 335 |
| 336 MojoResult MojoWaitSetRemove(MojoHandle wait_set_handle, uint64_t cookie) { |
| 337 struct nacl_irt_mojo* irt_mojo = get_irt_mojo(); |
| 338 if (!irt_mojo) |
| 339 abort(); |
| 340 return irt_mojo->MojoWaitSetRemove(wait_set_handle, cookie); |
| 341 } |
| 342 |
| 343 MojoResult MojoWaitSetWait(MojoHandle wait_set_handle, |
| 344 MojoDeadline deadline, |
| 345 uint32_t* num_results, |
| 346 struct MojoWaitSetResult* results, |
| 347 uint32_t* max_results) { |
| 348 struct nacl_irt_mojo* irt_mojo = get_irt_mojo(); |
| 349 if (!irt_mojo) |
| 350 abort(); |
| 351 return irt_mojo->MojoWaitSetWait(wait_set_handle, deadline, num_results, |
| 352 results, max_results); |
| 353 } |
| OLD | NEW |