TA-REF
tee_client_api.h File Reference
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include <limits.h>
#include "tee-common.h"
+ Include dependency graph for tee_client_api.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  TEEC_Context
 
struct  TEEC_UUID
 
struct  TEEC_SharedMemory
 
struct  TEEC_TempMemoryReference
 
struct  TEEC_RegisteredMemoryReference
 
struct  TEEC_Value
 
union  TEEC_Parameter
 
struct  TEEC_Session
 
struct  TEEC_Operation
 

Typedefs

typedef uint32_t TEEC_Result
 

Functions

TEEC_Result TEEC_InitializeContext (const char *name, TEEC_Context *context)
 
void TEEC_FinalizeContext (TEEC_Context *context)
 
TEEC_Result TEEC_OpenSession (TEEC_Context *context, TEEC_Session *session, const TEEC_UUID *destination, uint32_t connectionMethod, const void *connectionData, TEEC_Operation *operation, uint32_t *returnOrigin)
 
void TEEC_CloseSession (TEEC_Session *session)
 
TEEC_Result TEEC_InvokeCommand (TEEC_Session *session, uint32_t commandID, TEEC_Operation *operation, uint32_t *returnOrigin)
 
TEEC_Result TEEC_RegisterSharedMemory (TEEC_Context *context, TEEC_SharedMemory *sharedMem)
 
TEEC_Result TEEC_AllocateSharedMemory (TEEC_Context *context, TEEC_SharedMemory *sharedMem)
 
void TEEC_ReleaseSharedMemory (TEEC_SharedMemory *sharedMemory)
 
void TEEC_RequestCancellation (TEEC_Operation *operation)
 

Typedef Documentation

◆ TEEC_Result

typedef uint32_t TEEC_Result

Function Documentation

◆ TEEC_AllocateSharedMemory()

TEEC_Result TEEC_AllocateSharedMemory ( TEEC_Context context,
TEEC_SharedMemory sharedMem 
)

TEEC_AllocateSharedMemory() - Allocate shared memory for TEE.

Parameters
contextThe initialized TEE context structure in which scope to open the session.
sharedMemPointer to the allocated shared memory.
Returns
TEEC_SUCCESS The registration was successful.
TEEC_ERROR_OUT_OF_MEMORY Memory exhaustion.
TEEC_Result Something failed.

◆ TEEC_CloseSession()

void TEEC_CloseSession ( TEEC_Session session)

TEEC_CloseSession() - Closes the session which has been opened with the specific trusted application.

Parameters
sessionThe opened session to close.

◆ TEEC_FinalizeContext()

void TEEC_FinalizeContext ( TEEC_Context context)

TEEC_FinalizeContext() - Destroys a context holding connection information on the specific TEE.

This function destroys an initialized TEE context, closing the connection between the client application and the TEE. This function must only be called when all sessions related to this TEE context have been closed and all shared memory blocks have been released.

Parameters
contextThe context to be destroyed.

TEEC_FinalizeContext() - Destroys a context holding connection information on the specific TEE.

This function finalizes an initialized TEE context, closing the connection between the client application and the TEE. This function must only be called when all sessions related to this TEE context have been closed and all shared memory blocks have been released.

Parameters
contextThe context to be finalized.

◆ TEEC_InitializeContext()

TEEC_Result TEEC_InitializeContext ( const char *  name,
TEEC_Context context 
)

TEEC_InitializeContext() - Initializes a context holding connection information on the specific TEE, designated by the name string.

Parameters
nameA zero-terminated string identifying the TEE to connect to. If name is set to NULL, the default TEE is connected to. NULL is the only supported value in this version of the API implementation.
contextThe context structure which is to be initialized.
Returns
TEEC_SUCCESS The initialization was successful.
TEEC_Result Something failed.

◆ TEEC_InvokeCommand()

TEEC_Result TEEC_InvokeCommand ( TEEC_Session session,
uint32_t  commandID,
TEEC_Operation operation,
uint32_t *  returnOrigin 
)

TEEC_InvokeCommand() - Executes a command in the specified trusted application.

Parameters
sessionA handle to an open connection to the trusted application.
commandIDIdentifier of the command in the trusted application to invoke.
operationAn operation structure to use in the invoke command. May be set to NULL to signify no operation structure needed.
returnOriginA parameter which will hold the error origin if this function returns any value other than TEEC_SUCCESS.
Returns
TEEC_SUCCESS OpenSession successfully opened a new session.
TEEC_Result Something failed.

◆ TEEC_OpenSession()

TEEC_Result TEEC_OpenSession ( TEEC_Context context,
TEEC_Session session,
const TEEC_UUID destination,
uint32_t  connectionMethod,
const void *  connectionData,
TEEC_Operation operation,
uint32_t *  returnOrigin 
)

TEEC_OpenSession() - Opens a new session with the specified trusted application.

Parameters
contextThe initialized TEE context structure in which scope to open the session.
sessionThe session to initialize.
destinationA structure identifying the trusted application with which to open a session.
connectionMethodThe connection method to use.
connectionDataAny data necessary to connect with the chosen connection method. Not supported, should be set to NULL.
operationAn operation structure to use in the session. May be set to NULL to signify no operation structure needed.
returnOriginA parameter which will hold the error origin if this function returns any value other than TEEC_SUCCESS.
Returns
TEEC_SUCCESS OpenSession successfully opened a new session.
TEEC_Result Something failed.

◆ TEEC_RegisterSharedMemory()

TEEC_Result TEEC_RegisterSharedMemory ( TEEC_Context context,
TEEC_SharedMemory sharedMem 
)

TEEC_RegisterSharedMemory() - Register a block of existing memory as a shared block within the scope of the specified context.

Parameters
contextThe initialized TEE context structure in which scope to open the session.
sharedMempointer to the shared memory structure to register.
Returns
TEEC_SUCCESS The registration was successful.
TEEC_ERROR_OUT_OF_MEMORY Memory exhaustion.
TEEC_Result Something failed.

◆ TEEC_ReleaseSharedMemory()

void TEEC_ReleaseSharedMemory ( TEEC_SharedMemory sharedMemory)

TEEC_ReleaseSharedMemory() - Free or deregister the shared memory.

Parameters
sharedMemPointer to the shared memory to be freed.

◆ TEEC_RequestCancellation()

void TEEC_RequestCancellation ( TEEC_Operation operation)

TEEC_RequestCancellation() - Request the cancellation of a pending open session or command invocation.

Parameters
operationPointer to an operation previously passed to open session or invoke.