1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
|
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# pylint: disable=F0401
import interface_dsl
def MakeInterface():
mojo = interface_dsl.Interface()
f = mojo.Func('MojoCreateSharedBuffer', 'MojoResult')
p = f.Param('options')
p.InExtensibleStruct('MojoCreateSharedBufferOptions').Optional()
f.Param('num_bytes').In('uint64_t')
f.Param('shared_buffer_handle').Out('MojoHandle')
f = mojo.Func('MojoDuplicateBufferHandle', 'MojoResult')
f.Param('buffer_handle').In('MojoHandle')
p = f.Param('options')
p.InExtensibleStruct('MojoDuplicateBufferHandleOptions').Optional()
f.Param('new_buffer_handle').Out('MojoHandle')
f = mojo.Func('MojoMapBuffer', 'MojoResult')
f.Param('buffer_handle').In('MojoHandle')
f.Param('offset').In('uint64_t')
f.Param('num_bytes').In('uint64_t')
f.Param('buffer').Out('void*')
f.Param('flags').In('MojoMapBufferFlags')
f = mojo.Func('MojoUnmapBuffer', 'MojoResult')
f.Param('buffer').In('void*')
f = mojo.Func('MojoCreateDataPipe', 'MojoResult')
p = f.Param('options')
p.InExtensibleStruct('MojoCreateDataPipeOptions').Optional()
f.Param('data_pipe_producer_handle').Out('MojoHandle')
f.Param('data_pipe_consumer_handle').Out('MojoHandle')
f = mojo.Func('MojoWriteData', 'MojoResult')
f.Param('data_pipe_producer_handle').In('MojoHandle')
f.Param('elements').InArray('void', 'num_bytes')
f.Param('num_bytes').InOut('uint32_t')
f.Param('flags').In('MojoWriteDataFlags')
f = mojo.Func('MojoBeginWriteData', 'MojoResult')
f.Param('data_pipe_producer_handle').In('MojoHandle')
f.Param('buffer').Out('void*')
f.Param('buffer_num_bytes').InOut('uint32_t')
f.Param('flags').In('MojoWriteDataFlags')
f = mojo.Func('MojoEndWriteData', 'MojoResult')
f.Param('data_pipe_producer_handle').In('MojoHandle')
f.Param('num_bytes_written').In('uint32_t')
f = mojo.Func('MojoReadData', 'MojoResult')
f.Param('data_pipe_consumer_handle').In('MojoHandle')
f.Param('elements').OutArray('void', 'num_bytes')
f.Param('num_bytes').InOut('uint32_t')
f.Param('flags').In('MojoReadDataFlags')
f = mojo.Func('MojoBeginReadData', 'MojoResult')
f.Param('data_pipe_consumer_handle').In('MojoHandle')
f.Param('buffer').Out('const void*')
f.Param('buffer_num_bytes').InOut('uint32_t')
f.Param('flags').In('MojoReadDataFlags')
f = mojo.Func('MojoEndReadData', 'MojoResult')
f.Param('data_pipe_consumer_handle').In('MojoHandle')
f.Param('num_bytes_read').In('uint32_t')
f = mojo.Func('MojoGetTimeTicksNow', 'MojoTimeTicks')
f = mojo.Func('MojoClose', 'MojoResult')
f.Param('handle').In('MojoHandle')
f = mojo.Func('MojoWait', 'MojoResult')
f.Param('handle').In('MojoHandle')
f.Param('signals').In('MojoHandleSignals')
f.Param('deadline').In('MojoDeadline')
f.Param('signals_state').OutFixedStruct('MojoHandleSignalsState').Optional()
f = mojo.Func('MojoWaitMany', 'MojoResult')
f.Param('handles').InArray('MojoHandle', 'num_handles')
f.Param('signals').InArray('MojoHandleSignals', 'num_handles')
f.Param('num_handles').In('uint32_t')
f.Param('deadline').In('MojoDeadline')
f.Param('result_index').Out('uint32_t').Optional()
p = f.Param('signals_states')
p.OutFixedStructArray('MojoHandleSignalsState', 'num_handles').Optional()
f = mojo.Func('MojoCreateMessagePipe', 'MojoResult')
p = f.Param('options')
p.InExtensibleStruct('MojoCreateMessagePipeOptions').Optional()
f.Param('message_pipe_handle0').Out('MojoHandle')
f.Param('message_pipe_handle1').Out('MojoHandle')
f = mojo.Func('MojoWriteMessage', 'MojoResult')
f.Param('message_pipe_handle').In('MojoHandle')
f.Param('bytes').InArray('void', 'num_bytes').Optional()
f.Param('num_bytes').In('uint32_t')
f.Param('handles').InArray('MojoHandle', 'num_handles').Optional()
f.Param('num_handles').In('uint32_t')
f.Param('flags').In('MojoWriteMessageFlags')
f = mojo.Func('MojoReadMessage', 'MojoResult')
f.Param('message_pipe_handle').In('MojoHandle')
f.Param('bytes').OutArray('void', 'num_bytes').Optional()
f.Param('num_bytes').InOut('uint32_t').Optional()
f.Param('handles').OutArray('MojoHandle', 'num_handles').Optional()
f.Param('num_handles').InOut('uint32_t').Optional()
f.Param('flags').In('MojoReadMessageFlags')
# This function is not provided by the Mojo system APIs, but instead allows
# trusted code to provide a handle for use by untrusted code. See the
# implementation in mojo_syscall.cc.tmpl.
f = mojo.Func('_MojoGetInitialHandle', 'MojoResult')
f.Param('handle').Out('MojoHandle')
mojo.Finalize()
return mojo
|