src/devices/tee/drivers/optee/optee-message.cc
// Converts a big endian UUID from a MessageParam value to a host endian TEEC_UUID.
// The fields of a UUID are stored in big endian in a MessageParam by the TEE and is thus why the
// parameter value cannot be directly reinterpreted as a UUID.
Converts a big endian UUID from a MessageParam value to a host endian TEEC_UUID.
The fields of a UUID are stored in big endian in a MessageParam by the TEE and is thus why the
parameter value cannot be directly reinterpreted as a UUID.
Converts a big endian UUID from a MessageParam value to a host endian TEEC_UUID . The fields of a UUID are stored in big endian in a MessageParam by the TEE and is thus why the parameter value cannot be directly reinterpreted as a UUID .
void ConvertMessageParamToUuid(const MessageParam::Value& src, TEEC_UUID* dst) {
  dst->timeLow = betoh32(src.uuid_big_endian.timeLow);
  dst->timeMid = betoh16(src.uuid_big_endian.timeMid);
  dst->timeHiAndVersion = betoh16(src.uuid_big_endian.timeHiAndVersion);
  memcpy(dst->clockSeqAndNode, src.uuid_big_endian.clockSeqAndNode,
         sizeof(src.uuid_big_endian.clockSeqAndNode));
}
void ConvertMessageParamToUuid ( const MessageParam :: Value & src , TEEC_UUID * dst ) { dst -> timeLow = betoh32 ( src . uuid_big_endian . timeLow ) ; dst -> timeMid = betoh16 ( src . uuid_big_endian . timeMid ) ; dst -> timeHiAndVersion = betoh16 ( src . uuid_big_endian . timeHiAndVersion ) ; memcpy ( dst -> clockSeqAndNode , src . uuid_big_endian . clockSeqAndNode , sizeof ( src . uuid_big_endian . clockSeqAndNode ) ) ; }
Converts a big endian UUID from a MessageParam value to a host endian TEEC_UUID.
Converts a big endian UUID from a MessageParam value to a host endian TEEC_UUID .
// Convert TEEC_UUID fields from big endian to host endian // Because clockSeqAndNode is uint8_t, no need to convert endianness - just memcpy