My Project
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
otz_tee_client_api.h
Go to the documentation of this file.
1 /*
2  * OpenVirtualization:
3  * For additional details and support contact developer@sierraware.com.
4  * Additional documentation can be found at www.openvirtualization.org
5  *
6  * Copyright (C) 2010-2014 SierraWare
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21  *
22  */
23 /*
24  * Header file for global platform TEE client API
25  */
26 
27 #ifndef __OTZ_TEE_CLIENT_API_H_
28 #define __OTZ_TEE_CLIENT_API_H_
29 
30 #define MAX_SESSIONS_PER_DEVICE 16
31 #define MAX_OPERATIONS_PER_SESSION 16
32 #define MAX_MEMBLOCKS_PER_SESSION 16
33 #define MAX_MEMBLOCKS_PER_OPERATION 4
34 
35 
36 #define TEEC_PARAM_TYPES( param0Type, param1Type, param2Type, param3Type) \
37  (param3Type << 12 | param2Type << 8 | param1Type << 4 | param0Type)
38 
39 #define TEEC_VALUE_UNDEF 0xffffffff
40 #include <sw_list.h>
41 #include <otz_tee_api.h>
42 
43 
44 
62 };
63 
64 
85 };
86 
99 };
100 
107  TEEC_NONE = 0x1,
134 
139 
144 
149 };
150 
158 typedef struct TEEC_Session TEEC_Session;
162 typedef struct TEEC_Context TEEC_Context;
178 typedef struct TEEC_Value TEEC_Value;
179 
181 
188 {
199  int s_errno;
200 };
201 
202 
209 {
220  int s_errno;
221 };
222 
223 
232 {
234  void* buffer;
235 
237  size_t size;
238 
248 
258  struct list head_ref;
260  int s_errno;
261 };
262 
263 
274 {
279  size_t a;
280  size_t b;
281 };
282 
283 
289 {
293  void *buffer;
306  size_t size;
307 };
308 
319 {
329 
346  size_t size;
347 
354  size_t offset;
355 };
356 
363 typedef union
364 {
371 
379 
387 
397 {
404 
426 
433 };
434 
435 
450 };
451 
452 
490  const char* name,
491  TEEC_Context* context);
492 
493 
494 
522  TEEC_Context* context);
523 
590  TEEC_Context* context,
591  TEEC_SharedMemory* sharedMem);
592 
593 
667  TEEC_Context* context,
668  TEEC_SharedMemory* sharedMem);
669 
670 
702  TEEC_SharedMemory* sharedMem);
703 
704 
797  TEEC_Context* context,
798  TEEC_Session* session,
799  const TEEC_UUID* destination,
800  uint32_t connectionMethod,
801  const void* connectionData,
802  TEEC_Operation* operation,
803  uint32_t* returnOrigin);
804 
805 
831 void TEEC_CloseSession (
832  TEEC_Session* session);
833 
834 
950  TEEC_Session* session,
951  uint32_t commandID,
952  TEEC_Operation* operation,
953  uint32_t* returnOrigin);
954 
955 
1006  TEEC_Operation* operation);
1007 
1020 char* TEEC_GetError(int error, int returnOrigin);
1021 
1022 #endif
1023 
int s_errno
Definition: otz_tee_client_api.h:220
void TEEC_FinalizeContext(TEEC_Context *context)
Finalizes an initialized TEE context.
Definition: otz_tee_api.c:173
int s_errno
Definition: otz_tee_client_api.h:260
Registered memory reference.
Definition: otz_tee_client_api.h:318
TEEC_SharedMemory * parent
Definition: otz_tee_client_api.h:328
Definition: otz_tee_client_api.h:56
Definition: otz_tee_client_api.h:107
int service_id
Definition: otz_tee_client_api.h:195
Definition: otz_tee_client_api.h:133
Definition: otz_tee_client_api.h:445
TEEC_Value value
Definition: otz_tee_client_api.h:385
otz_shared_mem_flags
Shared memory flag constants.
Definition: otz_api.h:151
TEEC_TempMemoryReference tmpref
Definition: otz_tee_client_api.h:370
The TEEC_Context structure is used to contain control information related to the TEE.
Definition: otz_tee_client_api.h:208
uint32_t shared_mem_cnt
Definition: otz_tee_client_api.h:216
unsigned int uint32_t
Definition: otz_api.h:35
size_t b
Definition: otz_tee_client_api.h:280
TEEC_Result TEEC_RegisterSharedMemory(TEEC_Context *context, TEEC_SharedMemory *sharedMem)
Register a allocated shared memory block.
Definition: otz_tee_api.c:264
Definition: otz_tee_client_api.h:72
Definition: otz_tee_client_api.h:443
uint32_t flags
Definition: otz_tee_client_api.h:247
void TEEC_RequestCancellation(TEEC_Operation *operation)
Request cancellation of pending open session or command invocation.
Definition: otz_tee_api.c:1032
Definition: otz_tee_client_api.h:138
int session_count
Definition: otz_tee_client_api.h:214
size_t a
Definition: otz_tee_client_api.h:279
Definition: otz_tee_client_api.h:127
TEEC_Result TEEC_InvokeCommand(TEEC_Session *session, uint32_t commandID, TEEC_Operation *operation, uint32_t *returnOrigin)
Invokes a command within the session.
Definition: otz_tee_api.c:495
TEE_Result TEEC_Result
Definition: otz_tee_api.h:88
The TEEC_Session structure is used to contain control information related to a session between a clie...
Definition: otz_tee_client_api.h:187
int operation_cnt
Definition: otz_tee_client_api.h:191
size_t size
Definition: otz_tee_client_api.h:346
void * buffer
Definition: otz_tee_client_api.h:234
Definition: otz_tee_client_api.h:78
Definition: otz_tee_client_api.h:119
Definition: otz_tee_client_api.h:53
Definition: otz_tee_client_api.h:109
void * buffer
Definition: otz_tee_client_api.h:293
TEEC_param_type
Param type constants.
Definition: otz_tee_client_api.h:105
Definition: otz_tee_client_api.h:84
TEEC_Context * device
Definition: otz_tee_client_api.h:197
struct list shared_mem_list
Definition: otz_tee_client_api.h:218
size_t size
Definition: otz_tee_client_api.h:306
uint32_t allocated
Definition: otz_tee_client_api.h:256
TEEC_Result TEEC_AllocateSharedMemory(TEEC_Context *context, TEEC_SharedMemory *sharedMem)
Allocate a shared memory block.
Definition: otz_tee_api.c:210
uint32_t TEEC_UUID
Definition: otz_tee_client_api.h:180
Definition: otz_tee_client_api.h:81
size_t offset
Definition: otz_tee_client_api.h:354
Definition: otz_tee_client_api.h:148
int operation_count
Definition: otz_tee_client_api.h:254
uint32_t fd
Definition: otz_tee_client_api.h:212
The TEEC_SharedMemory structure is used to contain control information related to a block of shared m...
Definition: otz_tee_client_api.h:231
char * TEEC_GetError(int error, int returnOrigin)
Returns error string.
Definition: otz_tee_api.c:102
Definition: otz_tee_client_api.h:449
Definition: otz_tee_client_api.h:115
TEEC_login_flags
Login flag constants.
Definition: otz_tee_client_api.h:70
Definition: otz_tee_client_api.h:58
size_t size
Definition: otz_tee_client_api.h:237
TEEC_Result TEEC_InitializeContext(const char *name, TEEC_Context *context)
Initialize Context.
Definition: otz_tee_api.c:123
The TEEC_Operation structure is used to contain control information related to an operation that is t...
Definition: otz_tee_client_api.h:396
Temporary shared memory reference.
Definition: otz_tee_client_api.h:288
Definition: otz_tee_client_api.h:95
Parameter of a TEEC_Operation.
Definition: otz_tee_client_api.h:363
void TEEC_CloseSession(TEEC_Session *session)
Close a opened session between client and trusted application.
Definition: otz_tee_api.c:451
Definition: otz_tee_client_api.h:111
Definition: otz_tee_client_api.h:61
TEEC_Context * context
Definition: otz_tee_client_api.h:252
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)
Opens a new session between client and trusted application.
Definition: otz_tee_api.c:354
Definition: sw_list.h:56
struct list head_ref
Definition: otz_tee_client_api.h:258
int session_id
Definition: otz_tee_client_api.h:193
uint32_t started
Definition: otz_tee_client_api.h:403
TEEC_return_code_origin
Return code origin.
Definition: otz_tee_client_api.h:50
Definition: otz_tee_client_api.h:98
Definition: otz_tee_client_api.h:123
Definition: otz_tee_client_api.h:447
void TEEC_ReleaseSharedMemory(TEEC_SharedMemory *sharedMem)
Release a shared memory block.
Definition: otz_tee_api.c:301
Definition: otz_tee_client_api.h:74
Small raw data value type.
Definition: otz_tee_client_api.h:273
int s_errno
Definition: otz_tee_client_api.h:199
uint32_t paramTypes
Definition: otz_tee_client_api.h:425
Definition: otz_tee_client_api.h:76
TEEC_RegisteredMemoryReference memref
Definition: otz_tee_client_api.h:378
TEEC_Parameter params[4]
Definition: otz_tee_client_api.h:432
TEEC_shared_mem_flags
Shared memory flag constants.
Definition: otz_tee_client_api.h:92
Definition: otz_tee_client_api.h:143