system_update_configurator/bridge/vx_ta/
tee_client_api.rs

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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
// Copyright 2022 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(non_upper_case_globals)]
#![allow(dead_code)]

/* automatically generated by rust-bindgen */

pub const _STDINT_H: u32 = 1;
pub const _FEATURES_H: u32 = 1;
pub const _DEFAULT_SOURCE: u32 = 1;
pub const __USE_ISOC11: u32 = 1;
pub const __USE_ISOC99: u32 = 1;
pub const __USE_ISOC95: u32 = 1;
pub const __USE_POSIX_IMPLICITLY: u32 = 1;
pub const _POSIX_SOURCE: u32 = 1;
pub const _POSIX_C_SOURCE: u32 = 200809;
pub const __USE_POSIX: u32 = 1;
pub const __USE_POSIX2: u32 = 1;
pub const __USE_POSIX199309: u32 = 1;
pub const __USE_POSIX199506: u32 = 1;
pub const __USE_XOPEN2K: u32 = 1;
pub const __USE_XOPEN2K8: u32 = 1;
pub const _ATFILE_SOURCE: u32 = 1;
pub const __USE_MISC: u32 = 1;
pub const __USE_ATFILE: u32 = 1;
pub const __USE_FORTIFY_LEVEL: u32 = 0;
pub const _STDC_PREDEF_H: u32 = 1;
pub const __STDC_IEC_559__: u32 = 1;
pub const __STDC_IEC_559_COMPLEX__: u32 = 1;
pub const __STDC_ISO_10646__: u32 = 201605;
pub const __STDC_NO_THREADS__: u32 = 1;
pub const __GNU_LIBRARY__: u32 = 6;
pub const __GLIBC__: u32 = 2;
pub const __GLIBC_MINOR__: u32 = 24;
pub const _SYS_CDEFS_H: u32 = 1;
pub const __WORDSIZE: u32 = 64;
pub const __WORDSIZE_TIME64_COMPAT32: u32 = 1;
pub const __SYSCALL_WORDSIZE: u32 = 64;
pub const _BITS_WCHAR_H: u32 = 1;
pub const INT8_MIN: i32 = -128;
pub const INT16_MIN: i32 = -32768;
pub const INT32_MIN: i32 = -2147483648;
pub const INT8_MAX: u32 = 127;
pub const INT16_MAX: u32 = 32767;
pub const INT32_MAX: u32 = 2147483647;
pub const UINT8_MAX: u32 = 255;
pub const UINT16_MAX: u32 = 65535;
pub const UINT32_MAX: u32 = 4294967295;
pub const INT_LEAST8_MIN: i32 = -128;
pub const INT_LEAST16_MIN: i32 = -32768;
pub const INT_LEAST32_MIN: i32 = -2147483648;
pub const INT_LEAST8_MAX: u32 = 127;
pub const INT_LEAST16_MAX: u32 = 32767;
pub const INT_LEAST32_MAX: u32 = 2147483647;
pub const UINT_LEAST8_MAX: u32 = 255;
pub const UINT_LEAST16_MAX: u32 = 65535;
pub const UINT_LEAST32_MAX: u32 = 4294967295;
pub const INT_FAST8_MIN: i32 = -128;
pub const INT_FAST16_MIN: i64 = -9223372036854775808;
pub const INT_FAST32_MIN: i64 = -9223372036854775808;
pub const INT_FAST8_MAX: u32 = 127;
pub const INT_FAST16_MAX: u64 = 9223372036854775807;
pub const INT_FAST32_MAX: u64 = 9223372036854775807;
pub const UINT_FAST8_MAX: u32 = 255;
pub const UINT_FAST16_MAX: i32 = -1;
pub const UINT_FAST32_MAX: i32 = -1;
pub const INTPTR_MIN: i64 = -9223372036854775808;
pub const INTPTR_MAX: u64 = 9223372036854775807;
pub const UINTPTR_MAX: i32 = -1;
pub const PTRDIFF_MIN: i64 = -9223372036854775808;
pub const PTRDIFF_MAX: u64 = 9223372036854775807;
pub const SIG_ATOMIC_MIN: i32 = -2147483648;
pub const SIG_ATOMIC_MAX: u32 = 2147483647;
pub const SIZE_MAX: i32 = -1;
pub const WINT_MIN: u32 = 0;
pub const WINT_MAX: u32 = 4294967295;
pub const true_: u32 = 1;
pub const false_: u32 = 0;
pub const __bool_true_false_are_defined: u32 = 1;
pub const ZX_OK: u32 = 0;
pub const ZX_ERR_INTERNAL: i32 = -1;
pub const ZX_ERR_NOT_SUPPORTED: i32 = -2;
pub const ZX_ERR_NO_RESOURCES: i32 = -3;
pub const ZX_ERR_NO_MEMORY: i32 = -4;
pub const ZX_ERR_INTERNAL_INTR_RETRY: i32 = -6;
pub const ZX_ERR_INVALID_ARGS: i32 = -10;
pub const ZX_ERR_BAD_HANDLE: i32 = -11;
pub const ZX_ERR_WRONG_TYPE: i32 = -12;
pub const ZX_ERR_BAD_SYSCALL: i32 = -13;
pub const ZX_ERR_OUT_OF_RANGE: i32 = -14;
pub const ZX_ERR_BUFFER_TOO_SMALL: i32 = -15;
pub const ZX_ERR_BAD_STATE: i32 = -20;
pub const ZX_ERR_TIMED_OUT: i32 = -21;
pub const ZX_ERR_SHOULD_WAIT: i32 = -22;
pub const ZX_ERR_CANCELED: i32 = -23;
pub const ZX_ERR_PEER_CLOSED: i32 = -24;
pub const ZX_ERR_NOT_FOUND: i32 = -25;
pub const ZX_ERR_ALREADY_EXISTS: i32 = -26;
pub const ZX_ERR_ALREADY_BOUND: i32 = -27;
pub const ZX_ERR_UNAVAILABLE: i32 = -28;
pub const ZX_ERR_ACCESS_DENIED: i32 = -30;
pub const ZX_ERR_IO: i32 = -40;
pub const ZX_ERR_IO_REFUSED: i32 = -41;
pub const ZX_ERR_IO_DATA_INTEGRITY: i32 = -42;
pub const ZX_ERR_IO_DATA_LOSS: i32 = -43;
pub const ZX_ERR_IO_NOT_PRESENT: i32 = -44;
pub const ZX_ERR_IO_OVERRUN: i32 = -45;
pub const ZX_ERR_IO_MISSED_DEADLINE: i32 = -46;
pub const ZX_ERR_IO_INVALID: i32 = -47;
pub const ZX_ERR_BAD_PATH: i32 = -50;
pub const ZX_ERR_NOT_DIR: i32 = -51;
pub const ZX_ERR_NOT_FILE: i32 = -52;
pub const ZX_ERR_FILE_BIG: i32 = -53;
pub const ZX_ERR_NO_SPACE: i32 = -54;
pub const ZX_ERR_NOT_EMPTY: i32 = -55;
pub const ZX_ERR_STOP: i32 = -60;
pub const ZX_ERR_NEXT: i32 = -61;
pub const ZX_ERR_ASYNC: i32 = -62;
pub const ZX_ERR_PROTOCOL_NOT_SUPPORTED: i32 = -70;
pub const ZX_ERR_ADDRESS_UNREACHABLE: i32 = -71;
pub const ZX_ERR_ADDRESS_IN_USE: i32 = -72;
pub const ZX_ERR_NOT_CONNECTED: i32 = -73;
pub const ZX_ERR_CONNECTION_REFUSED: i32 = -74;
pub const ZX_ERR_CONNECTION_RESET: i32 = -75;
pub const ZX_ERR_CONNECTION_ABORTED: i32 = -76;
pub const TEEC_NUM_PARAMS_MAX: u32 = 4;
pub const TEEC_SUCCESS: u32 = 0;
pub const TEEC_ERROR_GENERIC: u32 = 4294901760;
pub const TEEC_ERROR_ACCESS_DENIED: u32 = 4294901761;
pub const TEEC_ERROR_CANCEL: u32 = 4294901762;
pub const TEEC_ERROR_ACCESS_CONFLICT: u32 = 4294901763;
pub const TEEC_ERROR_EXCESS_DATA: u32 = 4294901764;
pub const TEEC_ERROR_BAD_FORMAT: u32 = 4294901765;
pub const TEEC_ERROR_BAD_PARAMETERS: u32 = 4294901766;
pub const TEEC_ERROR_BAD_STATE: u32 = 4294901767;
pub const TEEC_ERROR_ITEM_NOT_FOUND: u32 = 4294901768;
pub const TEEC_ERROR_NOT_IMPLEMENTED: u32 = 4294901769;
pub const TEEC_ERROR_NOT_SUPPORTED: u32 = 4294901770;
pub const TEEC_ERROR_NO_DATA: u32 = 4294901771;
pub const TEEC_ERROR_OUT_OF_MEMORY: u32 = 4294901772;
pub const TEEC_ERROR_BUSY: u32 = 4294901773;
pub const TEEC_ERROR_COMMUNICATION: u32 = 4294901774;
pub const TEEC_ERROR_SECURITY: u32 = 4294901775;
pub const TEEC_ERROR_SHORT_BUFFER: u32 = 4294901776;
pub const TEE_ERROR_EXTERNAL_CANCEL: u32 = 4294901777;
pub const TEE_ERROR_OVERFLOW: u32 = 4294914063;
pub const TEE_ERROR_TARGET_DEAD: u32 = 4294914084;
pub const TEEC_ERROR_TARGET_DEAD: u32 = 4294914084;
pub const TEE_ERROR_STORAGE_NO_SPACE: u32 = 4294914113;
pub const TEEC_ORIGIN_API: u32 = 1;
pub const TEEC_ORIGIN_COMMS: u32 = 2;
pub const TEEC_ORIGIN_TEE: u32 = 3;
pub const TEEC_ORIGIN_TRUSTED_APP: u32 = 4;
pub const TEEC_MEM_INPUT: u32 = 1;
pub const TEEC_MEM_OUTPUT: u32 = 2;
pub const TEEC_NONE: u32 = 0;
pub const TEEC_VALUE_INPUT: u32 = 1;
pub const TEEC_VALUE_OUTPUT: u32 = 2;
pub const TEEC_VALUE_INOUT: u32 = 3;
pub const TEEC_MEMREF_TEMP_INPUT: u32 = 5;
pub const TEEC_MEMREF_TEMP_OUTPUT: u32 = 6;
pub const TEEC_MEMREF_TEMP_INOUT: u32 = 7;
pub const TEEC_MEMREF_WHOLE: u32 = 12;
pub const TEEC_MEMREF_PARTIAL_INPUT: u32 = 13;
pub const TEEC_MEMREF_PARTIAL_OUTPUT: u32 = 14;
pub const TEEC_MEMREF_PARTIAL_INOUT: u32 = 15;
pub const TEEC_LOGIN_PUBLIC: u32 = 0;
pub const TEEC_LOGIN_USER: u32 = 1;
pub const TEEC_LOGIN_GROUP: u32 = 2;
pub const TEEC_LOGIN_APPLICATION: u32 = 4;
pub const TEEC_LOGIN_USER_APPLICATION: u32 = 5;
pub const TEEC_LOGIN_GROUP_APPLICATION: u32 = 6;
pub type wchar_t = ::std::os::raw::c_int;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct max_align_t {
    pub __clang_max_align_nonce1: ::std::os::raw::c_longlong,
    pub __bindgen_padding_0: u64,
    pub __clang_max_align_nonce2: f64,
}
pub type int_least8_t = ::std::os::raw::c_schar;
pub type int_least16_t = ::std::os::raw::c_short;
pub type int_least32_t = ::std::os::raw::c_int;
pub type int_least64_t = ::std::os::raw::c_long;
pub type uint_least8_t = ::std::os::raw::c_uchar;
pub type uint_least16_t = ::std::os::raw::c_ushort;
pub type uint_least32_t = ::std::os::raw::c_uint;
pub type uint_least64_t = ::std::os::raw::c_ulong;
pub type int_fast8_t = ::std::os::raw::c_schar;
pub type int_fast16_t = ::std::os::raw::c_long;
pub type int_fast32_t = ::std::os::raw::c_long;
pub type int_fast64_t = ::std::os::raw::c_long;
pub type uint_fast8_t = ::std::os::raw::c_uchar;
pub type uint_fast16_t = ::std::os::raw::c_ulong;
pub type uint_fast32_t = ::std::os::raw::c_ulong;
pub type uint_fast64_t = ::std::os::raw::c_ulong;
pub type intmax_t = ::std::os::raw::c_long;
pub type uintmax_t = ::std::os::raw::c_ulong;
pub type zx_rights_t = u32;
pub type zx_time_t = i64;
pub type zx_duration_t = i64;
pub type zx_ticks_t = u64;
pub const memory_order_memory_order_relaxed: memory_order = 0;
pub const memory_order_memory_order_consume: memory_order = 1;
pub const memory_order_memory_order_acquire: memory_order = 2;
pub const memory_order_memory_order_release: memory_order = 3;
pub const memory_order_memory_order_acq_rel: memory_order = 4;
pub const memory_order_memory_order_seq_cst: memory_order = 5;
pub type memory_order = u32;
extern "C" {
    pub fn atomic_thread_fence(arg1: memory_order);
}
extern "C" {
    pub fn atomic_signal_fence(arg1: memory_order);
}
pub type atomic_bool = u8;
pub type atomic_char = u8;
pub type atomic_schar = u8;
pub type atomic_uchar = u8;
pub type atomic_short = u16;
pub type atomic_ushort = u16;
pub type atomic_int = u32;
pub type atomic_uint = u32;
pub type atomic_long = u64;
pub type atomic_ulong = u64;
pub type atomic_llong = u64;
pub type atomic_ullong = u64;
pub type atomic_char16_t = uint_least16_t;
pub type atomic_char32_t = uint_least32_t;
pub type atomic_wchar_t = wchar_t;
pub type atomic_int_least8_t = int_least8_t;
pub type atomic_uint_least8_t = uint_least8_t;
pub type atomic_int_least16_t = int_least16_t;
pub type atomic_uint_least16_t = uint_least16_t;
pub type atomic_int_least32_t = int_least32_t;
pub type atomic_uint_least32_t = uint_least32_t;
pub type atomic_int_least64_t = int_least64_t;
pub type atomic_uint_least64_t = uint_least64_t;
pub type atomic_int_fast8_t = int_fast8_t;
pub type atomic_uint_fast8_t = uint_fast8_t;
pub type atomic_int_fast16_t = int_fast16_t;
pub type atomic_uint_fast16_t = uint_fast16_t;
pub type atomic_int_fast32_t = int_fast32_t;
pub type atomic_uint_fast32_t = uint_fast32_t;
pub type atomic_int_fast64_t = int_fast64_t;
pub type atomic_uint_fast64_t = uint_fast64_t;
pub type atomic_intptr_t = isize;
pub type atomic_uintptr_t = usize;
pub type atomic_size_t = usize;
pub type atomic_ptrdiff_t = isize;
pub type atomic_intmax_t = intmax_t;
pub type atomic_uintmax_t = uintmax_t;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct atomic_flag {
    pub _Value: atomic_bool,
}
extern "C" {
    pub fn atomic_flag_test_and_set(arg1: *mut atomic_flag) -> bool;
}
extern "C" {
    pub fn atomic_flag_test_and_set_explicit(arg1: *mut atomic_flag, arg2: memory_order) -> bool;
}
extern "C" {
    pub fn atomic_flag_clear(arg1: *mut atomic_flag);
}
extern "C" {
    pub fn atomic_flag_clear_explicit(arg1: *mut atomic_flag, arg2: memory_order);
}
pub type zx_handle_t = u32;
pub type zx_status_t = i32;
pub type zx_clock_t = u32;
pub type zx_signals_t = u32;
pub type zx_koid_t = u64;
pub type zx_txid_t = u32;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct zx_channel_call_args {
    pub wr_bytes: *const ::std::os::raw::c_void,
    pub wr_handles: *const zx_handle_t,
    pub rd_bytes: *mut ::std::os::raw::c_void,
    pub rd_handles: *mut zx_handle_t,
    pub wr_num_bytes: u32,
    pub wr_num_handles: u32,
    pub rd_num_bytes: u32,
    pub rd_num_handles: u32,
}
pub type zx_channel_call_args_t = zx_channel_call_args;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct zx_wait_item {
    pub handle: zx_handle_t,
    pub waitfor: zx_signals_t,
    pub pending: zx_signals_t,
}
pub type zx_wait_item_t = zx_wait_item;
pub type zx_vm_option_t = u32;
pub type zx_vaddr_t = usize;
pub type zx_paddr_t = usize;
pub type zx_gpaddr_t = usize;
pub type zx_off_t = u64;
pub type zx_obj_type_t = u32;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct zx_handle_info {
    pub handle: zx_handle_t,
    pub type_: zx_obj_type_t,
    pub rights: zx_rights_t,
    pub unused: u32,
}
pub type zx_handle_info_t = zx_handle_info;
pub type zx_futex_t = atomic_int;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct teec_context_impl {
    pub tee_channel: zx_handle_t,
    pub uuid_to_channel: *mut ::std::os::raw::c_void,
}
pub type teec_context_impl_t = teec_context_impl;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct teec_session_impl {
    pub session_id: u32,
    pub application_channel: zx_handle_t,
}
pub type teec_session_impl_t = teec_session_impl;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct teec_shared_memory_impl {
    pub vmo: zx_handle_t,
    pub mapped_addr: zx_vaddr_t,
    pub mapped_size: usize,
}
pub type teec_shared_memory_impl_t = teec_shared_memory_impl;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct teec_operation_impl {
    pub reserved: ::std::os::raw::c_char,
}
pub type teec_operation_impl_t = teec_operation_impl;
#[doc = " Data Types *"]
pub type TEEC_Result = u32;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct TEEC_UUID {
    pub timeLow: u32,
    pub timeMid: u16,
    pub timeHiAndVersion: u16,
    pub clockSeqAndNode: [u8; 8usize],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct TEEC_Context {
    pub imp: teec_context_impl_t,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct TEEC_Session {
    pub imp: teec_session_impl_t,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct TEEC_SharedMemory {
    pub buffer: *mut ::std::os::raw::c_void,
    pub size: usize,
    pub flags: u32,
    pub imp: teec_shared_memory_impl_t,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct TEEC_TempMemoryReference {
    pub buffer: *mut ::std::os::raw::c_void,
    pub size: usize,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct TEEC_RegisteredMemoryReference {
    pub parent: *mut TEEC_SharedMemory,
    pub size: usize,
    pub offset: usize,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct TEEC_Value {
    pub a: u32,
    pub b: u32,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union TEEC_Parameter {
    pub tmpref: TEEC_TempMemoryReference,
    pub memref: TEEC_RegisteredMemoryReference,
    pub value: TEEC_Value,
    _bindgen_union_align: [u64; 3usize],
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct TEEC_Operation {
    pub started: u32,
    pub paramTypes: u32,
    pub params: [TEEC_Parameter; 4usize],
    pub imp: teec_operation_impl_t,
}
extern "C" {
    #[doc = " Functions *"]
    pub fn TEEC_InitializeContext(
        name: *const ::std::os::raw::c_char,
        context: *mut TEEC_Context,
    ) -> TEEC_Result;
}
extern "C" {
    pub fn TEEC_FinalizeContext(context: *mut TEEC_Context);
}
extern "C" {
    pub fn TEEC_RegisterSharedMemory(
        context: *mut TEEC_Context,
        sharedMem: *mut TEEC_SharedMemory,
    ) -> TEEC_Result;
}
extern "C" {
    pub fn TEEC_AllocateSharedMemory(
        context: *mut TEEC_Context,
        sharedMem: *mut TEEC_SharedMemory,
    ) -> TEEC_Result;
}
extern "C" {
    pub fn TEEC_ReleaseSharedMemory(sharedMem: *mut TEEC_SharedMemory);
}
extern "C" {
    pub fn TEEC_OpenSession(
        context: *mut TEEC_Context,
        session: *mut TEEC_Session,
        destination: *const TEEC_UUID,
        connectionMethod: u32,
        connectionData: *const ::std::os::raw::c_void,
        operation: *mut TEEC_Operation,
        returnOrigin: *mut u32,
    ) -> TEEC_Result;
}
extern "C" {
    pub fn TEEC_CloseSession(session: *mut TEEC_Session);
}
extern "C" {
    pub fn TEEC_InvokeCommand(
        session: *mut TEEC_Session,
        commandID: u32,
        operation: *mut TEEC_Operation,
        returnOrigin: *mut u32,
    ) -> TEEC_Result;
}
extern "C" {
    pub fn TEEC_RequestCancellation(operation: *mut TEEC_Operation);
}