1#![cfg_attr(not(feature = "std"), no_std)]
19#![cfg_attr(doc, doc = concat!(
20 env!("CARGO_PKG_DESCRIPTION"),
21 "\n",
22 "## Feature flags\n",
23 document_features::document_features!(),
24))]
25
26#[macro_use]
28extern crate alloc;
29
30#[cfg(not(feature = "std"))]
31use libc_alloc::LibcAlloc;
32
33#[cfg(not(feature = "std"))]
34#[global_allocator]
35static ALLOCATOR: LibcAlloc = LibcAlloc;
36
37#[cfg(all(not(feature = "std"), not(feature = "no_panic_handler")))]
38#[panic_handler]
39fn panic(_info: &core::panic::PanicInfo) -> ! {
40 unsafe {
41 optee_utee_sys::TEE_Panic(0);
42 }
43 loop {}
44}
45
46#[cfg(all(not(feature = "std"), feature = "unwind_stubs"))]
50mod unwind_stubs {
51 #[unsafe(no_mangle)]
52 extern "C" fn _Unwind_Resume() -> ! {
53 loop {}
54 }
55
56 #[unsafe(no_mangle)]
57 extern "C" fn rust_eh_personality() {}
58}
59
60pub use arithmetical::*;
61pub use crypto_op::*;
62pub use error::{Error, ErrorKind, Result};
63pub(crate) use error::{tee_check, tee_check_with_origin};
64pub use extension::*;
65pub use identity::{Identity, LoginType};
66pub use object::*;
67pub use optee_utee_macros::{
68 ta_close_session, ta_create, ta_destroy, ta_invoke_command, ta_open_session,
69};
70pub use parameter::{
71 FromRawParameter, FromRawParameters, ParamType, ParameterAny, ParametersAny, ParametersNone,
72 RawParamType, RawParamTypes, RawParams, deprecated,
73 memref::{
74 ParameterMemref, ParameterMemrefInout, ParameterMemrefInput, ParameterMemrefOutput,
75 ParameterMemrefRead, ParameterMemrefWrite,
76 },
77 none::ParameterNone,
78 value::{
79 ParameterValueInout, ParameterValueInput, ParameterValueOutput, ParameterValueRead,
80 ParameterValueWrite,
81 },
82};
83pub use ta_session::{TaSession, TaSessionBuilder};
84pub use tee_parameter::{ParamIndex, TeeParams};
85pub use time::*;
86pub use uuid::*;
87
88pub mod trace;
89#[macro_use]
90mod macros;
91pub mod arithmetical;
92pub mod crypto_op;
93mod error;
94pub mod extension;
95pub mod identity;
96pub mod net;
97pub mod object;
98mod parameter;
99pub mod property;
100mod ta_session;
101mod tee_parameter;
102pub mod time;
103pub mod uuid;
104
105pub use optee_utee_sys as raw;
108
109pub mod prelude {
110 pub use crate::{
111 FromRawParameter, FromRawParameters, ParameterAny, ParameterMemref, ParameterMemrefInout,
112 ParameterMemrefInput, ParameterMemrefOutput, ParameterMemrefRead, ParameterMemrefWrite,
113 ParameterNone, ParameterValueInout, ParameterValueInput, ParameterValueOutput,
114 ParameterValueRead, ParameterValueWrite, ParametersAny, ParametersNone, ta_close_session,
115 ta_create, ta_destroy, ta_invoke_command, ta_open_session, trace_print, trace_println,
116 };
117}