/* Does Standard SMC to OP-TEE in secure world. */
STATIC UINT32 OpteeCallWithArg(IN UINT64 PhysicalArg)
/* Does Standard SMC to OP-TEE in secure world. */
STATIC UINT32 OpteeCallWithArg(IN UINT64 PhysicalArg)
{
  ARM_SMC_ARGS  ArmSmcArgs;
  ZeroMem (&ArmSmcArgs, sizeof (ARM_SMC_ARGS));
  ArmSmcArgs.Arg0 = OPTEE_SMC_CALL_WITH_ARG;
  ArmSmcArgs.Arg1 = (UINT32)(PhysicalArg >> 32);
  ArmSmcArgs.Arg2 = (UINT32)PhysicalArg;
  while (TRUE) {
    ArmCallSmc (&ArmSmcArgs);
    if (IsOpteeSmcReturnRpc (ArmSmcArgs.Arg0)) {
      switch (ArmSmcArgs.Arg0) {
        case OPTEE_SMC_RETURN_RPC_FOREIGN_INTERRUPT:
          break;
        default:
          break;
      }
      ArmSmcArgs.Arg0 = OPTEE_SMC_RETURN_FROM_RPC;
    } else {
      break;
    }
  }
  return ArmSmcArgs.Arg0;
}