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 // This file contains the definitions of the system functions, which are | 5 // This file contains the definitions of the system functions, which are |
6 // declared in various header files in mojo/public/c/system. | 6 // declared in various header files in mojo/public/c/system. |
7 | 7 |
8 #include "mojo/edk/embedder/embedder_internal.h" | 8 #include "mojo/edk/embedder/embedder_internal.h" |
9 #include "mojo/edk/system/core.h" | 9 #include "mojo/edk/system/core.h" |
10 #include "mojo/public/c/system/buffer.h" | 10 #include "mojo/public/c/system/buffer.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 } | 24 } |
25 | 25 |
26 MojoResult MojoClose(MojoHandle handle) { | 26 MojoResult MojoClose(MojoHandle handle) { |
27 return g_core->Close(handle); | 27 return g_core->Close(handle); |
28 } | 28 } |
29 | 29 |
30 MojoResult MojoGetRights(MojoHandle handle, MojoHandleRights* rights) { | 30 MojoResult MojoGetRights(MojoHandle handle, MojoHandleRights* rights) { |
31 return g_core->GetRights(handle, MakeUserPointer(rights)); | 31 return g_core->GetRights(handle, MakeUserPointer(rights)); |
32 } | 32 } |
33 | 33 |
| 34 MojoResult MojoDuplicateHandleWithReducedRights( |
| 35 MojoHandle handle, |
| 36 MojoHandleRights rights_to_remove, |
| 37 MojoHandle* new_handle) { |
| 38 return g_core->DuplicateHandleWithReducedRights(handle, rights_to_remove, |
| 39 MakeUserPointer(new_handle)); |
| 40 } |
| 41 |
| 42 MojoResult MojoDuplicateHandle(MojoHandle handle, MojoHandle* new_handle) { |
| 43 return g_core->DuplicateHandleWithReducedRights( |
| 44 handle, MOJO_HANDLE_RIGHT_NONE, MakeUserPointer(new_handle)); |
| 45 } |
| 46 |
34 MojoResult MojoWait(MojoHandle handle, | 47 MojoResult MojoWait(MojoHandle handle, |
35 MojoHandleSignals signals, | 48 MojoHandleSignals signals, |
36 MojoDeadline deadline, | 49 MojoDeadline deadline, |
37 MojoHandleSignalsState* signals_state) { | 50 MojoHandleSignalsState* signals_state) { |
38 return g_core->Wait(handle, signals, deadline, | 51 return g_core->Wait(handle, signals, deadline, |
39 MakeUserPointer(signals_state)); | 52 MakeUserPointer(signals_state)); |
40 } | 53 } |
41 | 54 |
42 MojoResult MojoWaitMany(const MojoHandle* handles, | 55 MojoResult MojoWaitMany(const MojoHandle* handles, |
43 const MojoHandleSignals* signals, | 56 const MojoHandleSignals* signals, |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 MojoMapBufferFlags flags) { | 205 MojoMapBufferFlags flags) { |
193 return g_core->MapBuffer(buffer_handle, offset, num_bytes, | 206 return g_core->MapBuffer(buffer_handle, offset, num_bytes, |
194 MakeUserPointer(buffer), flags); | 207 MakeUserPointer(buffer), flags); |
195 } | 208 } |
196 | 209 |
197 MojoResult MojoUnmapBuffer(void* buffer) { | 210 MojoResult MojoUnmapBuffer(void* buffer) { |
198 return g_core->UnmapBuffer(MakeUserPointer(buffer)); | 211 return g_core->UnmapBuffer(MakeUserPointer(buffer)); |
199 } | 212 } |
200 | 213 |
201 } // extern "C" | 214 } // extern "C" |
OLD | NEW |