Exemplo n.º 1
0
TEE_Result TEE_OpenTASession(const TEE_UUID *destination,
			     uint32_t cancellationRequestTimeout,
			     uint32_t paramTypes, TEE_Param params[4],
			     TEE_TASessionHandle *session,
			     uint32_t *returnOrigin)
{
	TEE_Result res;
	struct utee_params up;
	uint32_t s;

	__utee_from_param(&up, paramTypes, params);
	res = utee_open_ta_session(destination, cancellationRequestTimeout,
				   &up, &s, returnOrigin);
	__utee_to_param(params, NULL, &up);
	/*
	 * Specification says that *session must hold TEE_HANDLE_NULL is
	 * TEE_SUCCESS isn't returned. Set it here explicitly in case
	 * the syscall fails before out parameters has been updated.
	 */
	if (res != TEE_SUCCESS)
		s = TEE_HANDLE_NULL;

	*session = (TEE_TASessionHandle)(uintptr_t)s;
	return res;
}
Exemplo n.º 2
0
TEE_Result TEE_OpenTASession(const TEE_UUID *destination,
			     uint32_t cancellationRequestTimeout,
			     uint32_t paramTypes, TEE_Param params[4],
			     TEE_TASessionHandle *session,
			     uint32_t *returnOrigin)
{
	TEE_Result res;

	res = utee_open_ta_session(destination, cancellationRequestTimeout,
				   paramTypes, params, session, returnOrigin);
	/*
	 * Specification says that *session must hold TEE_HANDLE_NULL is
	 * TEE_SUCCESS isn't returned. Set it here explicitly in case
	 * the syscall fails before out parameters has been updated.
	 */
	if (res != TEE_SUCCESS)
		*session = TEE_HANDLE_NULL;

	return res;
}