Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion optee-teec/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ edition = "2018"

[dependencies]
optee-teec-sys = { version = "0.8.0", path = "optee-teec-sys" }
optee-teec-macros = { version = "0.8.0", path = "macros" }
uuid = "0.7"
hex = "0.3"
num_enum = { version = "0.7.3", default-features = false }
Expand Down
1 change: 0 additions & 1 deletion optee-teec/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ pub use self::operation::Operation;
pub use self::parameter::{Param, ParamNone, ParamTmpRef, ParamType, ParamTypes, ParamValue};
pub use self::session::{ConnectionMethods, Session};
pub use self::uuid::Uuid;
pub use optee_teec_macros::{plugin_init, plugin_invoke};
// Re-export optee_teec_sys so developers don't have to add it to their cargo
// dependencies.
pub use optee_teec_sys as raw;
Expand Down
20 changes: 20 additions & 0 deletions optee-teec/src/parameter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,26 @@ impl<'a> ParamTmpRef<'a> {
}
}

/// Creates a temporary input/output memory reference.
///
/// `buffer` is a region of memory which needs to be temporarily
/// registered for the duration of the `Operation` and can be both
/// read and written by the Trusted Application (TA).
///
/// This is useful when you need to pass data to a TA that will
/// modify it and return the modified data in the same buffer.
pub fn new_inout(buffer: &'a mut [u8]) -> Self {
let raw = raw::TEEC_TempMemoryReference {
buffer: buffer.as_ptr() as _,
size: buffer.len(),
};
Self {
raw,
param_type: ParamType::MemrefTempInout,
_marker: marker::PhantomData,
}
}

pub fn updated_size(&self) -> usize {
self.raw.size
}
Expand Down
Loading