Grammatical and capitalization changes

pull/8873/head
Mel W 2018-12-04 13:03:21 +02:00 committed by GitHub
parent 549d24f213
commit 56e3dd9a7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 30 additions and 30 deletions

View File

@ -27,21 +27,21 @@
/* -------------------------------- Handle Manager Module ---------------------------- */ /* -------------------------------- Handle Manager Module ---------------------------- */
/* /*
* The Handle Manager module generates and exposes a unique handle * The Handle Manager module generates and exposes a unique
* identifier (handle) per handle memory (handle_mem) it receives from the user. * identifier (handle) per handle memory (handle_mem) it receives.
* Then users can use the exposed handle identifier to relate to the "registered" * You can use the exposed handle identifier to relate to the "registered"
* handle memory. * handle memory.
* *
* Users can: * You can:
* - Ask for a unique handle identifier for a given handle memory [handle_create] * - Ask for a unique handle identifier for a given handle memory [`handle_create`].
* - Ask for a pointer to the handle memory corresponding to a * - Ask for a pointer to the handle memory corresponding to a
* handle identifier [handle_get_mem] * handle identifier [`handle_get_mem`].
* - Remove a handle from the handle manager module [handle_destroy] * - Remove a handle from the handle manager module [`handle_destroy`].
* *
* Note: * Note:
* Handle generation is done exclusively. * Handle generation is done exclusively.
* Once you have a handle, you can remove or get its memory non-exclusively. * Once you have a handle, you can remove or get its memory non-exclusively.
* The assumption is that only one context is dealing with a handle after it was * The assumption is that only one context is dealing with a handle after it is
* generated. * generated.
*/ */
@ -59,9 +59,9 @@ extern "C" {
#define PSA_HANDLE_MGR_INVALID_FRIEND_OWNER 0 // Denoting invalid friend or invalid owner #define PSA_HANDLE_MGR_INVALID_FRIEND_OWNER 0 // Denoting invalid friend or invalid owner
// Handles manager pool indexes must be in range 0 - 0x7FFF. // Handle manager pool indexes must be in range 0 - 0x7FFF.
// The reason for this limitation is that the index is stored in the upper 16 bits of a handle, // This is because the index is stored in the upper 16 bits of a handle,
// and the most significant bit must be zero to keep handles non negative. // and the most significant bit must be zero to keep handles non-negative.
#define PSA_HANDLE_MGR_MAX_HANDLES_NUM 0x8000 #define PSA_HANDLE_MGR_MAX_HANDLES_NUM 0x8000
@ -70,19 +70,19 @@ extern "C" {
typedef struct psa_handle_item_t { typedef struct psa_handle_item_t {
psa_handle_t handle; /* The user exposed handle [unique identifier] */ psa_handle_t handle; /* The user-exposed handle [unique identifier]. */
int32_t handle_owner; /* The partition id of the handle creator - allowed to get_mem() / destroy() */ int32_t handle_owner; /* The partition ID of the handle creator. Allowed to get_mem() / destroy(). */
int32_t handle_friend; /* The partition id of a "friend" partition - allowed to get_mem() */ int32_t handle_friend; /* The partition ID of a "friend" partition. Allowed to get_mem(). */
void *handle_mem; /* Points to memory allocated by the user */ void *handle_mem; /* Points to memory allocated by the use.r */
} psa_handle_item_t; } psa_handle_item_t;
typedef struct psa_handle_manager_t { typedef struct psa_handle_manager_t {
uint32_t handle_generator; /* A counter supplying handle numbers */ uint32_t handle_generator; /* A counter supplying handle numbers. */
uint32_t pool_size; /* The maximum number of handles that pool can contain */ uint32_t pool_size; /* The maximum number of handles that pool can contain. */
psa_handle_item_t *handles_pool; /* Holding couples of handles and their memory "blocks" */ psa_handle_item_t *handles_pool; /* Holds couples of handles and their memory "blocks". */
} psa_handle_manager_t; } psa_handle_manager_t;
@ -109,40 +109,40 @@ handles_pool
/* /*
* @brief create unique handle identifier * @brief Create unique handle identifier
* *
* This function generates a unique handle identifier, and **couples** it with the received handle memory. * This function generates a unique handle identifier, and **couples** it with the received handle memory.
* If there is no vacant space for the new handle, the function fails. * If there is no vacant space for the new handle, the function fails.
* *
* @note This function is expected to pass since it is always coupled with memory pool allocation of the same size. * @note This function is expected to pass since it is always coupled with memory pool allocation of the same size.
* In case memory pool allocation fails, this function should not be called. * In case memory pool allocation fails, this function should not be called.
* This function will panic on non vacant space use case. * This function will panic in the case of non-vacant space use.
* *
* @param[in] handle_mgr A pointer to the handle manager object. * @param[in] handle_mgr A pointer to the handle manager object.
* @param[in] handle_mem A pointer to a pre-allocated handle memory to get a handle identifier for * @param[in] handle_mem A pointer to a pre-allocated handle memory for which to get a handle identifier.
* @param[in] friend_pid The partition ID which is allowed to `get_mem()` and `destroy()` in addition to the handle owner. * @param[in] friend_pid The partition ID allowed to `get_mem()` and `destroy()` in addition to the handle owner.
* Use PSA_HANDLE_MGR_INVALID_FRIEND_OWNER to denote there is no friend partition. * Use `PSA_HANDLE_MGR_INVALID_FRIEND_OWNER` to denote that there is no friend partition.
* @return The created handle identifier * @return The created handle identifier
*/ */
psa_handle_t psa_hndl_mgr_handle_create(psa_handle_manager_t *handle_mgr, void *handle_mem, int32_t friend_pid); psa_handle_t psa_hndl_mgr_handle_create(psa_handle_manager_t *handle_mgr, void *handle_mem, int32_t friend_pid);
/* /*
* @brief remove a handle from the handle manager. * @brief Remove a handle from the handle manager.
* *
* @param handle_mgr A pointer to the handle manager object * @param handle_mgr A pointer to the handle manager object.
* @param handle The handle to be removed * @param handle The handle to be removed.
*/ */
void psa_hndl_mgr_handle_destroy(psa_handle_manager_t *handle_mgr, psa_handle_t handle); void psa_hndl_mgr_handle_destroy(psa_handle_manager_t *handle_mgr, psa_handle_t handle);
/* /*
* @brief dereference handle * @brief De-reference handle
* *
* This function retrieves the pointer associated with the input <handle>. * This function retrieves the pointer associated with the input <handle>.
* *
* @note This function will panic in case caller not allowed to dereference the memory * @note This function will panic if caller is not allowed to de-reference the memory,
* or handler does not correspond to a valid existing handle * or handler does not correspond to a valid existing handle.
* *
* @param handle_mgr A pointer to the handle manager object. * @param handle_mgr A pointer to the handle manager object.
* @param handle The handle for which you request the corresponding memory handle. * @param handle The handle for which you request the corresponding memory handle.