|
29 | 29 | #include <stdlib.h>
|
30 | 30 |
|
31 | 31 |
|
32 |
| - |
33 | 32 | /* ------------------------------------ Definitions ---------------------------------- */
|
34 | 33 |
|
35 | 34 | #define PSA_HANDLE_MGR_HANDLE_INDEX_POS 16
|
36 | 35 | #define PSA_HANDLE_MGR_HANDLE_INDEX_MSK 0xFFFF
|
37 | 36 |
|
38 | 37 |
|
39 |
| - |
40 |
| -/* -------------------------------- Handle Manager Module ---------------------------- */ |
41 |
| - |
42 |
| -/* The Handle Manager Module manages handles. |
43 |
| - * |
44 |
| - * It basically generates and exposes a unique handle identifier [handle] per |
45 |
| - * handle memory [handle_mem] it receives from the user. |
46 |
| - * Then users can use the exposed handle identifier to relate to the "registered" |
47 |
| - * handle memory. |
48 |
| - * |
49 |
| - * Users can: |
50 |
| - * - Ask for a unique handle identifier for a given handle memory [handle_create] |
51 |
| - * - Ask for a pointer to the handle memory corresponding to a |
52 |
| - * handle identifier [handle_get_mem] |
53 |
| - * - Remove a handle from the handle manager module [handle_destroy] |
54 |
| - * |
55 |
| - * Note: |
56 |
| - * Handles generation is done exclusively. |
57 |
| - * Once we got a handle, removing a handle or getting its memory can be |
58 |
| - * done non-exclusive. |
59 |
| - * The assumption is that only one context is dealing with a handle after it was |
60 |
| - * generated. |
61 |
| - */ |
62 |
| - |
63 | 38 | /* ------------------------------------- Functions ----------------------------------- */
|
64 | 39 |
|
65 |
| -/********************************************************************************************************************************** |
66 |
| - * Function : psa_hndl_mgr_handle_create |
67 |
| - * |
68 |
| - * Description: This function generates a unique handle identifier, and "couples" it with the received handle memory. |
69 |
| - * If there is no vacant space for the new handle, the function fails. |
70 |
| - * |
71 |
| - * Note: This function is expected to pass since it is always coupled with memory pool allocation of the same size. |
72 |
| - * In case memory pool allocation fails, this function should not be called. |
73 |
| - * This function will panic on non vacant space use case. |
74 |
| - * |
75 |
| - * Parameters : handle_mgr - [IN] A pointer to the handle manager object |
76 |
| - * handle_mem - [IN] A pointer to a pre-allocated handle memory to get a handle identifier for |
77 |
| - * friend_pid - [IN] The partition id which is allowed to get_mem() and destroy() in addition to the handle owner. |
78 |
| - * Use PSA_HANDLE_MGR_INVALID_FRIEND_OWNER to denote there is no friend partition. |
79 |
| - * |
80 |
| - * Return : The created handle identifier |
81 |
| - *********************************************************************************************************************************/ |
| 40 | + |
82 | 41 | psa_handle_t psa_hndl_mgr_handle_create(psa_handle_manager_t *handle_mgr, void *handle_mem, int32_t friend_pid)
|
83 | 42 | {
|
84 | 43 | // Make sanity checks on arguments
|
@@ -137,16 +96,6 @@ psa_handle_t psa_hndl_mgr_handle_create(psa_handle_manager_t *handle_mgr, void *
|
137 | 96 | }
|
138 | 97 |
|
139 | 98 |
|
140 |
| -/********************************************************************************************************************************** |
141 |
| - * Function : psa_hndl_mgr_handle_destroy |
142 |
| - * |
143 |
| - * Description: This function removes a handle from the handle manager. |
144 |
| - * |
145 |
| - * Parameters : handle_mgr - [IN] A pointer to the handle manager object |
146 |
| - * handle - [IN] The handle to be removed |
147 |
| - * |
148 |
| - * Return : Void |
149 |
| - *********************************************************************************************************************************/ |
150 | 99 | void psa_hndl_mgr_handle_destroy(psa_handle_manager_t *handle_mgr, psa_handle_t handle)
|
151 | 100 | {
|
152 | 101 | // Make sanity checks on arguments
|
@@ -180,17 +129,6 @@ void psa_hndl_mgr_handle_destroy(psa_handle_manager_t *handle_mgr, psa_handle_t
|
180 | 129 | }
|
181 | 130 |
|
182 | 131 |
|
183 |
| -/********************************************************************************************************************************** |
184 |
| - * Function : psa_hndl_mgr_handle_get_mem |
185 |
| - * |
186 |
| - * Description: This function looks for the handle memory corresponding to <handle>. |
187 |
| - * If it is not found in the expected index in the handles pool, the function fails. |
188 |
| - * |
189 |
| - * Parameters : handle_mgr - [IN] A pointer to the handle manager object. |
190 |
| - * handle - [IN] The handle for which we request the corresponding memory handle. |
191 |
| - * |
192 |
| - * Return : A pointer to the memory corresponding to the handle. |
193 |
| - *********************************************************************************************************************************/ |
194 | 132 | void *psa_hndl_mgr_handle_get_mem(psa_handle_manager_t *handle_mgr, psa_handle_t handle)
|
195 | 133 | {
|
196 | 134 | SPM_ASSERT(handle_mgr != NULL);
|
|
0 commit comments