cmdq_iwc_sec.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #ifndef _CMDQ_IWC_SEC_H_
  2. #define _CMDQ_IWC_SEC_H_
  3. #include "cmdqSecTl_Api.h"
  4. #include "tz_cross/trustzone.h"
  5. #include "tz_cross/ta_mem.h"
  6. #include "trustzone/kree/system.h"
  7. #include "trustzone/kree/mem.h"
  8. /**
  9. * inter-world communication state
  10. * this file should in cmdq_sec.h but cmdq_core.h will use following structure
  11. * so if following context in cmdq_sec.h, then cmdq_core.h will include cmdq_sec.h
  12. * but the question is cmdq_sec.h includes cmdq_core.h already.
  13. * so we extract this context out in a separate file which will not included outside the cmdq folder
  14. */
  15. typedef enum {
  16. IWC_INIT = 0,
  17. IWC_MOBICORE_OPENED = 1,
  18. IWC_WSM_ALLOCATED = 2,
  19. IWC_SES_OPENED = 3,
  20. IWC_SES_MSG_PACKAGED = 4,
  21. IWC_SES_TRANSACTED = 5,
  22. IWC_SES_ON_TRANSACTED = 6,
  23. IWC_END_OF_ENUM = 7,
  24. } CMDQ_IWC_STATE_ENUM;
  25. /**
  26. * CMDQ secure context struct
  27. * note it is not global data, each process has its own CMDQ sec context
  28. */
  29. typedef struct cmdqSecContextStruct {
  30. struct list_head listEntry;
  31. /* basic info */
  32. uint32_t tgid; /* tgid of procexx context */
  33. uint32_t referCount; /* reference count for open cmdq device node */
  34. /* iwc state */
  35. CMDQ_IWC_STATE_ENUM state;
  36. /* iwc information */
  37. void *iwcMessage; /* message buffer */
  38. #if defined(CMDQ_SECURE_PATH_SUPPORT)
  39. KREE_SESSION_HANDLE sessionHandle;
  40. KREE_SESSION_HANDLE memSessionHandle;
  41. #endif
  42. } cmdqSecContextStruct, *cmdqSecContextHandle;
  43. /**
  44. * shared memory between normal and secure world
  45. */
  46. typedef struct cmdqSecSharedMemoryStruct {
  47. void *pVABase; /* virtual address of command buffer */
  48. dma_addr_t MVABase; /* physical address of command buffer */
  49. uint32_t size; /* buffer size */
  50. cmdqSecContextHandle handle; /* for alloc path */
  51. KREE_SHAREDMEM_HANDLE cmdq_share_cookie_handle;
  52. } cmdqSecSharedMemoryStruct, *cmdqSecSharedMemoryHandle;
  53. #endif /* end of _CMDQ_IWC_SEC_H_ */