import PULS_20160108
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / include / trustzone / kree / system.h
1 /*
2 * Header files for basic KREE functions.
3 */
4
5 #ifndef __KREE_H__
6 #define __KREE_H__
7
8 #ifdef CONFIG_MTK_IN_HOUSE_TEE_SUPPORT
9
10 #include "trustzone/tz_cross/trustzone.h"
11
12 /// KREE session handle type.
13 typedef void* KREE_SESSION_HANDLE;
14
15 typedef uint32_t KREE_SHAREDMEM_HANDLE;
16
17
18 /* Session Management */
19 /**
20 * Create a new TEE sesssion
21 *
22 * @param ta_uuid UUID of the TA to connect to.
23 * @param pHandle Handle for the new session. Return KREE_SESSION_HANDLE_FAIL if fail.
24 * @return return code
25 */
26 TZ_RESULT KREE_CreateSession(const char *ta_uuid, KREE_SESSION_HANDLE *pHandle);
27
28 /**
29 * Close TEE session
30 *
31 * @param handle Handle for session to close.
32 * @return return code
33 */
34 TZ_RESULT KREE_CloseSession(KREE_SESSION_HANDLE handle);
35
36
37 /**
38 * Make a TEE service call
39 *
40 * @param handle Session handle to make the call
41 * @param command The command to call.
42 * @param paramTypes Types for the parameters, use TZ_ParamTypes() to consturct.
43 * @param param The parameters to pass to TEE. Maximum 4 params.
44 * @return Return value from TEE service.
45 */
46 TZ_RESULT KREE_TeeServiceCall(KREE_SESSION_HANDLE handle, uint32_t command,
47 uint32_t paramTypes, MTEEC_PARAM param[4]);
48
49 #endif /* CONFIG_MTK_IN_HOUSE_TEE_SUPPORT */
50 #endif /* __KREE_H__ */