Expand description
Legacy raw-pointer-based parameter API (deprecated).
The types in this module use raw *mut TEE_Param pointers and require
manual unsafe casts at every call site. New code should use the typed
wrappers instead:
| Legacy type | Replacement |
|---|---|
Parameters | Use FromRawParameters with a 4-tuple of typed wrappers (e.g. (ParameterNone, ParameterMemrefInput, ParameterValueOutput, ParameterMemrefOutput)) |
Parameter | Use the concrete types: ParameterValueInput, ParameterValueOutput, ParameterMemrefInput, etc. |
ParamValue | Use the concrete types: ParameterValueInput, ParameterValueOutput, ParameterValueInout, and the traits: ParameterValueRead and ParameterValueWrite |
ParamMemref | Use the concrete types: ParameterMemrefInput, ParameterMemrefOutput, ParameterMemrefInout, and the traits: ParameterMemrefRead and ParameterMemrefWrite |
§Example migration
Old (deprecated) code:
ⓘ
fn invoke_command(cmd_id: u32, params: &mut Parameters) -> Result<()> {
let mut p0 = unsafe { params.0.as_memref()? };
// extra codes here...
let data = p0.buffer();
data.copy_from_slice(&output);
p0.set_updated_size(output.len());
}New code:
ⓘ
use optee_utee::prelude::*;
fn invoke_command(cmd_id: u32, params: &mut (ParameterMemrefInout, ...)) -> Result<()> {
let p0 = &mut params.0;
// extra codes here...
p0.write_at(0, output)
}Structs§
- Param
Memref - Lightweight accessor for a memory-reference TEE parameter.
- Param
Types - Deprecated
- Param
Value - Deprecated
- Parameter
- Deprecated
- Parameters
- Deprecated