|
67 | 67 | #define OPTEE_MSG_ATTR_META BIT(8)
|
68 | 68 |
|
69 | 69 | /*
|
70 |
| - * The temporary shared memory object is not physically contigous and this |
71 |
| - * temp memref is followed by another fragment until the last temp memref |
72 |
| - * that doesn't have this bit set. |
| 70 | + * Pointer to a list of pages used to register user-defined SHM buffer. |
| 71 | + * Used with OPTEE_MSG_ATTR_TYPE_TMEM_*. |
| 72 | + * buf_ptr should point to the beginning of the buffer. Buffer will contain |
| 73 | + * list of page addresses. OP-TEE core can reconstruct contiguous buffer from |
| 74 | + * that page addresses list. Page addresses are stored as 64 bit values. |
| 75 | + * Last entry on a page should point to the next page of buffer. |
| 76 | + * Every entry in buffer should point to a 4k page beginning (12 least |
| 77 | + * significant bits must be equal to zero). |
| 78 | + * |
| 79 | + * 12 least significant bints of optee_msg_param.u.tmem.buf_ptr should hold page |
| 80 | + * offset of the user buffer. |
| 81 | + * |
| 82 | + * So, entries should be placed like members of this structure: |
| 83 | + * |
| 84 | + * struct page_data { |
| 85 | + * uint64_t pages_array[OPTEE_MSG_NONCONTIG_PAGE_SIZE/sizeof(uint64_t) - 1]; |
| 86 | + * uint64_t next_page_data; |
| 87 | + * }; |
| 88 | + * |
| 89 | + * Structure is designed to exactly fit into the page size |
| 90 | + * OPTEE_MSG_NONCONTIG_PAGE_SIZE which is a standard 4KB page. |
| 91 | + * |
| 92 | + * The size of 4KB is chosen because this is the smallest page size for ARM |
| 93 | + * architectures. If REE uses larger pages, it should divide them to 4KB ones. |
73 | 94 | */
|
74 |
| -#define OPTEE_MSG_ATTR_FRAGMENT BIT(9) |
| 95 | +#define OPTEE_MSG_ATTR_NONCONTIG BIT(9) |
75 | 96 |
|
76 | 97 | /*
|
77 | 98 | * Memory attributes for caching passed with temp memrefs. The actual value
|
|
94 | 115 | #define OPTEE_MSG_LOGIN_APPLICATION_USER 0x00000005
|
95 | 116 | #define OPTEE_MSG_LOGIN_APPLICATION_GROUP 0x00000006
|
96 | 117 |
|
| 118 | +/* |
| 119 | + * Page size used in non-contiguous buffer entries |
| 120 | + */ |
| 121 | +#define OPTEE_MSG_NONCONTIG_PAGE_SIZE 4096 |
| 122 | + |
97 | 123 | /**
|
98 | 124 | * struct optee_msg_param_tmem - temporary memory reference parameter
|
99 | 125 | * @buf_ptr: Address of the buffer
|
@@ -145,8 +171,8 @@ struct optee_msg_param_value {
|
145 | 171 | *
|
146 | 172 | * @attr & OPTEE_MSG_ATTR_TYPE_MASK indicates if tmem, rmem or value is used in
|
147 | 173 | * the union. OPTEE_MSG_ATTR_TYPE_VALUE_* indicates value,
|
148 |
| - * OPTEE_MSG_ATTR_TYPE_TMEM_* indicates tmem and |
149 |
| - * OPTEE_MSG_ATTR_TYPE_RMEM_* indicates rmem. |
| 174 | + * OPTEE_MSG_ATTR_TYPE_TMEM_* indicates @tmem and |
| 175 | + * OPTEE_MSG_ATTR_TYPE_RMEM_* indicates @rmem, |
150 | 176 | * OPTEE_MSG_ATTR_TYPE_NONE indicates that none of the members are used.
|
151 | 177 | */
|
152 | 178 | struct optee_msg_param {
|
|
0 commit comments