teei_common.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. #ifndef __TEEI_COMMON_H_
  2. #define __TEEI_COMMON_H_
  3. #define TEEI_MAX_REQ_PARAMS 12
  4. #define TEEI_MAX_RES_PARAMS 8
  5. #define TEEI_1K_SIZE 1024
  6. /**
  7. * @brief Command status
  8. */
  9. enum teei_cmd_status {
  10. TEEI_STATUS_INCOMPLETE = 0,
  11. TEEI_STATUS_COMPLETE,
  12. TEEI_STATUS_MAX = 0x7FFFFFFF
  13. };
  14. /**
  15. * @brief Parameters type
  16. */
  17. enum teeic_param_type {
  18. TEEIC_PARAM_IN = 0,
  19. TEEIC_PARAM_OUT
  20. };
  21. /**
  22. * @brief Shared memory for Notification
  23. */
  24. struct teeic_notify_data {
  25. int dev_file_id;
  26. int service_id;
  27. int client_pid;
  28. int session_id;
  29. int enc_id;
  30. };
  31. enum teeic_param_value {
  32. TEEIC_PARAM_A = 0,
  33. TEEIC_PARAM_B
  34. };
  35. enum teeic_param_pos {
  36. TEEIC_PARAM_1ST = 0,
  37. TEEIC_PARAM_2ND,
  38. TEEIC_PARAM_3TD,
  39. TEEIC_PARAM_4TH
  40. };
  41. /**
  42. * @brief Metadata used for encoding/decoding
  43. */
  44. struct teei_encode_meta {
  45. int type;
  46. int len; /* data length */
  47. unsigned long usr_addr; /* data address in user space */
  48. int ret_len; /* return sizeof data */
  49. int value_flag; /* value of a or b */
  50. int param_pos; /* param order */
  51. int param_pos_type; /* param type */
  52. };
  53. /**
  54. * @brief SMC command structure
  55. */
  56. struct teei_smc_cmd {
  57. unsigned int teei_cmd_type;
  58. unsigned int id;
  59. unsigned int context;
  60. unsigned int enc_id;
  61. unsigned int src_id;
  62. unsigned int src_context;
  63. unsigned int req_buf_len;
  64. unsigned int resp_buf_len;
  65. unsigned int ret_resp_buf_len;
  66. unsigned int info_buf_len;
  67. unsigned int cmd_status;
  68. unsigned int req_buf_phys;
  69. unsigned int resp_buf_phys;
  70. unsigned int meta_data_phys;
  71. unsigned int info_buf_phys;
  72. unsigned int dev_file_id;
  73. unsigned int error_code;
  74. struct semaphore *teei_sema;
  75. };
  76. #endif /* __TEEI_COMMON_H_ */