Skip to main content

rust_utee/
utee_types.rs

1// Licensed to the Apache Software Foundation (ASF) under one
2// or more contributor license agreements.  See the NOTICE file
3// distributed with this work for additional information
4// regarding copyright ownership.  The ASF licenses this file
5// to you under the Apache License, Version 2.0 (the
6// "License"); you may not use this file except in compliance
7// with the License.  You may obtain a copy of the License at
8//
9//   http://www.apache.org/licenses/LICENSE-2.0
10//
11// Unless required by applicable law or agreed to in writing,
12// software distributed under the License is distributed on an
13// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14// KIND, either express or implied.  See the License for the
15// specific language governing permissions and limitations
16// under the License.
17
18use super::tee_api_defines::*;
19
20#[repr(C)]
21pub enum utee_time_category {
22    UTEE_TIME_CAT_SYSTEM,
23    UTEE_TIME_CAT_TA_PERSISTENT,
24    UTEE_TIME_CAT_REE,
25}
26
27#[repr(C)]
28pub enum utee_entry_func {
29    UTEE_ENTRY_FUNC_OPEN_SESSION,
30    UTEE_ENTRY_FUNC_CLOSE_SESSION,
31    UTEE_ENTRY_FUNC_INVOKE_COMMAND,
32}
33
34#[allow(non_camel_case_types)]
35#[repr(C)]
36pub enum utee_cache_operation {
37    TEE_CACHECLEAN,
38    TEE_CACHEFLUSH,
39    TEE_CACHEINVALIDATE,
40}
41
42#[repr(C)]
43pub struct utee_params {
44    pub types: u64,
45    pub vals: [u64; TEE_NUM_PARAMS as usize * 2],
46}
47
48#[repr(C)]
49#[derive(Copy, Clone, Default)]
50pub struct utee_attribute {
51    pub a: u64,
52    pub b: u64,
53    pub attribute_id: u32,
54}
55
56#[repr(C)]
57#[derive(Copy, Clone, Default)]
58pub struct utee_object_info {
59    pub obj_type: u32,
60    pub obj_size: u32,
61    pub max_obj_size: u32,
62    pub obj_usage: u32,
63    pub data_size: u32,
64    pub data_pos: u32,
65    pub handle_flags: u32,
66}