mpxy_opteed_send_message()- If message ID is
OPTEED_MSG_COMMUNICATE(0x1) (Called fromudomain): - If
tdomain’s shared memory is NOT valid, returnSBI_EINVAL. - Otherwise:
- Direction:
udomain-> OpenSBI - Copy the source data from
udomaintotdomain’s shared memory. - Call
sbi_ecall_tee_domain_enter()to switch totdomain. - Direction:
udomain->tdomain. - The entry point to be switched to is defined by the function type:
- Function type is defined by the first
unsigned longinudomain’s shared memory:((ulong *)shmem_base)[0]. - If function type is:
ABI_ENTRY_TYPE_FAST(i.e.ARM_SMCCC_FAST_CALL) - Entry point ⇒
entry_vector_table->fast_abi_entry entry_vector_table⇒thread_vector_tableis defined in OP-TEE. Therefore,entry_vector_table->fast_abi_entry⇒vector_fast_abi_entry()- Otherwise:
- Entry point ⇒
entry_vector_table->yield_abi_entry entry_vector_table⇒thread_vector_tableis defined in OP-TEE. Therefore,entry_vector_table->yield_abi_entry⇒vector_std_abi_entry()- If message ID is
OPTEED_MSG_COMPLETE(0x2) (Called fromtdomain): - If
udomain’s shared memory is NOT valid: - Direction:
tdomain-> OpenSBI. - If
((ulong *)msgbuf)[0](fromtdomain’s shared memory, i.e.$a0) isTEEABI_OPTEED_RETURN_CALL_DONE(0xbe000000): - Register OP-TEE entry table:
- Set
entry_vector_tableto((ulong *)msgbuf)[1](i.e.$a1), i.e.thread_vector_tabledefined in OP-TEE. - Otherwise, copy the source data from
tdomaintoudomain’s shared memory. - Direction:
tdomain->udomain. - Only
$a1~$a4(fromtdomain’s shared memory) are copied toudomain’s shared memory,$a0is skipped. - Call
sbi_ecall_tee_domain_exit()to exit from the currenttdomain. - The domain to switch to:
- Switch to the previous domain
- Switch to the use-define next domain.
- Fallback to the root domain.
- P.S. Domain switching only involves domain contexts save and restore. The mode is switched by
mretin the trap handler.
mpxy_opteed_send_message()c
Loading...