Skip to content

Commit c660d36

Browse files
Oren Cohenadbridge
authored andcommitted
Melinda's remarks
1 parent 0ba9623 commit c660d36

File tree

3 files changed

+23
-24
lines changed

3 files changed

+23
-24
lines changed

components/TARGET_PSA/spm/COMPONENT_SPE/handles_manager.h

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,9 @@
2626

2727
/* -------------------------------- Handle Manager Module ---------------------------- */
2828

29-
/* The Handle Manager Module manages handles.
30-
*
31-
* It basically generates and exposes a unique handle identifier [handle] per
32-
* handle memory [handle_mem] it receives from the user.
29+
/*
30+
* It generates and exposes a unique handle identifier (handle) per
31+
* handle memory (handle_mem) it receives from the user.
3332
* Then users can use the exposed handle identifier to relate to the "registered"
3433
* handle memory.
3534
*
@@ -40,8 +39,8 @@
4039
* - Remove a handle from the handle manager module [handle_destroy]
4140
*
4241
* Note:
43-
* Handles generation is done exclusively.
44-
* Once we got a handle, removing a handle or getting its memory can be
42+
* Handle generation is done exclusively.
43+
* Once you got a handle, removing a handle or getting its memory can be
4544
* done non-exclusive.
4645
* The assumption is that only one context is dealing with a handle after it was
4746
* generated.
@@ -113,16 +112,16 @@ handles_pool
113112
/*
114113
* @brief create unique handle identifier
115114
*
116-
* This function generates a unique handle identifier, and "couples" it with the received handle memory.
115+
* This function generates a unique handle identifier, and **couples** it with the received handle memory.
117116
* If there is no vacant space for the new handle, the function fails.
118117
*
119118
* @note This function is expected to pass since it is always coupled with memory pool allocation of the same size.
120119
* In case memory pool allocation fails, this function should not be called.
121120
* This function will panic on non vacant space use case.
122121
*
123-
* @param[in] handle_mgr A pointer to the handle manager object
122+
* @param[in] handle_mgr A pointer to the handle manager object.
124123
* @param[in] handle_mem A pointer to a pre-allocated handle memory to get a handle identifier for
125-
* @param[in] friend_pid The partition id which is allowed to get_mem() and destroy() in addition to the handle owner.
124+
* @param[in] friend_pid The partition id which is allowed to `get_mem()` and `destroy()` in addition to the handle owner.
126125
* Use PSA_HANDLE_MGR_INVALID_FRIEND_OWNER to denote there is no friend partition.
127126
* @return The created handle identifier
128127
*/
@@ -147,7 +146,7 @@ void psa_hndl_mgr_handle_destroy(psa_handle_manager_t *handle_mgr, psa_handle_t
147146
* or handler does not correspond to a valid existing handle
148147
*
149148
* @param handle_mgr A pointer to the handle manager object.
150-
* @param handle The handle for which we request the corresponding memory handle.
149+
* @param handle The handle for which you request the corresponding memory handle.
151150
* @return void* A pointer to the memory corresponding to the handle.
152151
*/
153152
void *psa_hndl_mgr_handle_get_mem(psa_handle_manager_t *handle_mgr, psa_handle_t handle);

components/TARGET_PSA/spm/COMPONENT_SPE/spm_internal.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,11 @@ typedef struct spm_ipc_channel {
110110
struct spm_partition *src_partition; /* Pointer to the Partition which connects to the Root of Trust Service.*/
111111
spm_rot_service_t *dst_rot_service; /* Pointer to the connected Root of Trust Service.*/
112112
void *rhandle; /* Reverse handle to be used for this channel.*/
113-
void *msg_ptr; /* message data sent from user */
114-
struct spm_ipc_channel *next; /* Next channel in the chain */
113+
void *msg_ptr; /* Message data sent from user. */
114+
struct spm_ipc_channel *next; /* Next channel in the chain.*/
115115
uint8_t msg_type; /* The message type.*/
116116
uint8_t state; /* The current processing state of the channel.*/
117-
uint8_t is_dropped;
117+
uint8_t is_dropped; /* Indicates whether the channel has been dropped by the partition.*/
118118
} spm_ipc_channel_t;
119119

120120
/*
@@ -127,7 +127,7 @@ typedef struct spm_active_msg {
127127
} spm_active_msg_t;
128128

129129
/*
130-
* Structure containing resources and attributes of a Secure Partition.
130+
* Structure containing resources and attributes of a secure partition.
131131
*/
132132
typedef struct spm_partition {
133133
const int32_t partition_id; /* The Partition ID.*/
@@ -136,7 +136,7 @@ typedef struct spm_partition {
136136
const uint32_t flags_interrupts; /* Mask of all the IRQs & doorbell which the partition supports.*/
137137
spm_rot_service_t *rot_services; /* Array of the Partition's Root of Trust Services.*/
138138
const uint32_t rot_services_count; /* Number of the Partition's Root of Trust Services.*/
139-
const uint32_t *extern_sids; /* Array of Root of Trust Service IDs which the partition can connect to.*/
139+
const uint32_t *extern_sids; /* Array of Root of Trust Service IDs that the partition can connect to.*/
140140
const uint32_t extern_sids_count; /* Number of Root of Trust Services which the partition can connect to.*/
141141
osMutexId_t mutex; /* Mutex for all rot_service's queues operations. */
142142
spm_signal_to_irq_mapper_t irq_mapper; /* a function which maps signal to irq number*/
@@ -171,19 +171,19 @@ const mem_region_t *get_mem_regions(int32_t partition_id, uint32_t *region_count
171171
// Platform dependent APIs
172172

173173
/*
174-
* Validates a memory block is accessable from a specific partition
174+
* Validates that a memory block accessible from a specific partition
175175
*
176-
* @param[in] ptr pointer to the beggining of the memory block.
177-
* @param[in] size size of the memory block in bytes.
178-
* @param[in] accessing_partition which partition is trying to access the memory.
179-
* @return true if the entire memory block is accessable from given partition.
176+
* @param[in] ptr - Pointer to the beggining of the memory block.
177+
* @param[in] size - Size of the memory block in bytes.
178+
* @param[in] accessing_partition - Which partition is trying to access the memory.
179+
* @return `true` if the entire memory block is accessable from given partition.
180180
*/
181181
bool is_buffer_accessible(const void *ptr, size_t size, spm_partition_t *accessing_partition);
182182

183183
/**
184184
* Alerts NSPE that a proccess (connect or call) has ended.
185185
*
186-
* @param[in] completion_sem_id semaphore id in NSPE.
186+
* @param[in] completion_sem_id - semaphore id in NSPE.
187187
*/
188188
void nspe_done(osSemaphoreId_t completion_sem_id);
189189

components/TARGET_PSA/spm/COMPONENT_SPE/spm_server.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ extern "C" {
3535
#endif
3636

3737
/** @addtogroup RoT-Service-API
38-
* The C interface for a Root of Trust Service in a partition.
38+
* The C interface for a root of trust (RoT) Service in a partition.
3939
* @{
4040
*/
4141

@@ -75,8 +75,8 @@ int32_t psa_identity(psa_handle_t msg_handle);
7575
/**
7676
* Get the message that corresponds to a given signal.
7777
*
78-
* @param[in] signum an asserted signal returned from psa_wait().
79-
* @param[out] msg pointer to a psa_msg structure.
78+
* @param[in] signum An asserted signal returned from psa_wait().
79+
* @param[out] msg Pointer to a psa_msg structure.
8080
*/
8181
void psa_get(psa_signal_t signum, psa_msg_t *msg);
8282

0 commit comments

Comments
 (0)