system.h 1.3 KB

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