diff --git a/optee-teec/Cargo.toml b/optee-teec/Cargo.toml index 7b10587a..13e9aae7 100644 --- a/optee-teec/Cargo.toml +++ b/optee-teec/Cargo.toml @@ -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 } diff --git a/optee-teec/src/lib.rs b/optee-teec/src/lib.rs index 5220ce15..501b1578 100644 --- a/optee-teec/src/lib.rs +++ b/optee-teec/src/lib.rs @@ -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; diff --git a/optee-teec/src/parameter.rs b/optee-teec/src/parameter.rs index 18bdd498..963fc84f 100644 --- a/optee-teec/src/parameter.rs +++ b/optee-teec/src/parameter.rs @@ -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 }