in optee-utee/src/tee_parameter.rs [185:209]
fn update_value_from_raw(&mut self, raw_param: &raw::TEE_Param) {
match &mut self.content {
ParamContent::ValueInout { a, b } => {
// SAFETY:
// The caller must ensure this param is of value type and properly initialized.
// This is guaranteed by matching against `ParamContent::ValueInout`.
// Accessing `raw_param.value.a` is safe under above assumption.
*a = unsafe { raw_param.value.a };
// SAFETY:
// Accessing `raw_param.value.b` is safe under above assumption.
*b = unsafe { raw_param.value.b };
}
ParamContent::ValueOutput { a, b } => {
// SAFETY:
// The caller must ensure this param is of value type and properly initialized.
// This is guaranteed by matching against `ParamContent::ValueInout`.
// Accessing `raw_param.value.a` is safe under above assumption.
*a = unsafe { raw_param.value.a };
// SAFETY:
// Accessing `raw_param.value.b` is safe under above assumption.
*b = unsafe { raw_param.value.b };
}
_ => {}
}
}