Skip to content

Commit b675f5d

Browse files
Mel Wadbridge
authored andcommitted
Grammatical and capitalization changes
1 parent 2b9c41d commit b675f5d

File tree

1 file changed

+30
-30
lines changed

1 file changed

+30
-30
lines changed

components/TARGET_PSA/spm/COMPONENT_SPE/handles_manager.h

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,21 @@
2727
/* -------------------------------- Handle Manager Module ---------------------------- */
2828

2929
/*
30-
* The Handle Manager module generates and exposes a unique handle
31-
* identifier (handle) per handle memory (handle_mem) it receives from the user.
32-
* Then users can use the exposed handle identifier to relate to the "registered"
30+
* The Handle Manager module generates and exposes a unique
31+
* identifier (handle) per handle memory (handle_mem) it receives.
32+
* You can use the exposed handle identifier to relate to the "registered"
3333
* handle memory.
3434
*
35-
* Users can:
36-
* - Ask for a unique handle identifier for a given handle memory [handle_create]
35+
* You can:
36+
* - Ask for a unique handle identifier for a given handle memory [`handle_create`].
3737
* - Ask for a pointer to the handle memory corresponding to a
38-
* handle identifier [handle_get_mem]
39-
* - Remove a handle from the handle manager module [handle_destroy]
38+
* handle identifier [`handle_get_mem`].
39+
* - Remove a handle from the handle manager module [`handle_destroy`].
4040
*
4141
* Note:
4242
* Handle generation is done exclusively.
4343
* Once you have a handle, you can remove or get its memory non-exclusively.
44-
* The assumption is that only one context is dealing with a handle after it was
44+
* The assumption is that only one context is dealing with a handle after it is
4545
* generated.
4646
*/
4747

@@ -59,9 +59,9 @@ extern "C" {
5959

6060
#define PSA_HANDLE_MGR_INVALID_FRIEND_OWNER 0 // Denoting invalid friend or invalid owner
6161

62-
// Handles manager pool indexes must be in range 0 - 0x7FFF.
63-
// The reason for this limitation is that the index is stored in the upper 16 bits of a handle,
64-
// and the most significant bit must be zero to keep handles non negative.
62+
// Handle manager pool indexes must be in range 0 - 0x7FFF.
63+
// This is because the index is stored in the upper 16 bits of a handle,
64+
// and the most significant bit must be zero to keep handles non-negative.
6565
#define PSA_HANDLE_MGR_MAX_HANDLES_NUM 0x8000
6666

6767

@@ -70,19 +70,19 @@ extern "C" {
7070

7171
typedef struct psa_handle_item_t {
7272

73-
psa_handle_t handle; /* The user exposed handle [unique identifier] */
74-
int32_t handle_owner; /* The partition id of the handle creator - allowed to get_mem() / destroy() */
75-
int32_t handle_friend; /* The partition id of a "friend" partition - allowed to get_mem() */
76-
void *handle_mem; /* Points to memory allocated by the user */
73+
psa_handle_t handle; /* The user-exposed handle [unique identifier]. */
74+
int32_t handle_owner; /* The partition ID of the handle creator. Allowed to get_mem() / destroy(). */
75+
int32_t handle_friend; /* The partition ID of a "friend" partition. Allowed to get_mem(). */
76+
void *handle_mem; /* Points to memory allocated by the use.r */
7777

7878
} psa_handle_item_t;
7979

8080

8181
typedef struct psa_handle_manager_t {
8282

83-
uint32_t handle_generator; /* A counter supplying handle numbers */
84-
uint32_t pool_size; /* The maximum number of handles that pool can contain */
85-
psa_handle_item_t *handles_pool; /* Holding couples of handles and their memory "blocks" */
83+
uint32_t handle_generator; /* A counter supplying handle numbers. */
84+
uint32_t pool_size; /* The maximum number of handles that pool can contain. */
85+
psa_handle_item_t *handles_pool; /* Holds couples of handles and their memory "blocks". */
8686

8787
} psa_handle_manager_t;
8888

@@ -109,40 +109,40 @@ handles_pool
109109

110110

111111
/*
112-
* @brief create unique handle identifier
112+
* @brief Create unique handle identifier
113113
*
114114
* This function generates a unique handle identifier, and **couples** it with the received handle memory.
115115
* If there is no vacant space for the new handle, the function fails.
116116
*
117117
* @note This function is expected to pass since it is always coupled with memory pool allocation of the same size.
118118
* In case memory pool allocation fails, this function should not be called.
119-
* This function will panic on non vacant space use case.
119+
* This function will panic in the case of non-vacant space use.
120120
*
121121
* @param[in] handle_mgr A pointer to the handle manager object.
122-
* @param[in] handle_mem A pointer to a pre-allocated handle memory to get a handle identifier for
123-
* @param[in] friend_pid The partition ID which is allowed to `get_mem()` and `destroy()` in addition to the handle owner.
124-
* Use PSA_HANDLE_MGR_INVALID_FRIEND_OWNER to denote there is no friend partition.
125-
* @return The created handle identifier
122+
* @param[in] handle_mem A pointer to a pre-allocated handle memory for which to get a handle identifier.
123+
* @param[in] friend_pid The partition ID allowed to `get_mem()` and `destroy()` in addition to the handle owner.
124+
* Use `PSA_HANDLE_MGR_INVALID_FRIEND_OWNER` to denote that there is no friend partition.
125+
* @return The created handle identifier
126126
*/
127127
psa_handle_t psa_hndl_mgr_handle_create(psa_handle_manager_t *handle_mgr, void *handle_mem, int32_t friend_pid);
128128

129129

130130
/*
131-
* @brief remove a handle from the handle manager.
131+
* @brief Remove a handle from the handle manager.
132132
*
133-
* @param handle_mgr A pointer to the handle manager object
134-
* @param handle The handle to be removed
133+
* @param handle_mgr A pointer to the handle manager object.
134+
* @param handle The handle to be removed.
135135
*/
136136
void psa_hndl_mgr_handle_destroy(psa_handle_manager_t *handle_mgr, psa_handle_t handle);
137137

138138

139139
/*
140-
* @brief dereference handle
140+
* @brief De-reference handle
141141
*
142142
* This function retrieves the pointer associated with the input <handle>.
143143
*
144-
* @note This function will panic in case caller not allowed to dereference the memory
145-
* or handler does not correspond to a valid existing handle
144+
* @note This function will panic if caller is not allowed to de-reference the memory,
145+
* or handler does not correspond to a valid existing handle.
146146
*
147147
* @param handle_mgr A pointer to the handle manager object.
148148
* @param handle The handle for which you request the corresponding memory handle.

0 commit comments

Comments
 (0)