Skip to content

Commit

Permalink
refine code comments: clarify misleading names and comments for `thre…
Browse files Browse the repository at this point in the history
…ad_rpc_alloc_*_payload` APIs

The `thread_rpc_alloc_*_payload` APIs are consistent with the `thread_shm_type` enumerations, as seen in the `alloc_shm` function. However, the name and comments of `thread_rpc_alloc_payload` might be misleading, suggesting it is a universal API. To maintain backward compatibility, only the code comments have been updated for clarity.
  • Loading branch information
santongding committed Oct 29, 2024
1 parent 8f64525 commit a98e317
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions core/include/kernel/thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,8 @@ bool thread_is_in_normal_mode(void);
bool thread_is_from_abort_mode(void);

/**
* Allocates data for payload buffers.
* Allocates data for payload buffers only shared with user space applications.
* Ensure consistency with the enumeration `THREAD_SHM_TYPE_APPLICATION`.
*
* @size: size in bytes of payload buffer
*
Expand All @@ -260,7 +261,8 @@ struct mobj *thread_rpc_alloc_payload(size_t size);
void thread_rpc_free_payload(struct mobj *mobj);

/**
* Allocate data for payload buffers only shared with the non-secure kernel
* Allocate data for payload buffers only shared with the non-secure kernel.
* Ensure consistency with the enumeration `THREAD_SHM_TYPE_KERNEL_PRIVATE`.
*
* @size: size in bytes of payload buffer
*
Expand Down Expand Up @@ -333,8 +335,8 @@ uint32_t thread_rpc_cmd(uint32_t cmd, size_t num_params,
struct thread_param *params);

/**
* Allocate data for payload buffers.
* Buffer is exported to user mode applications.
* Allocate data for payload buffers shared with both user space applications the non-secure kernel.
* Ensure consistency with the enumeration `THREAD_SHM_TYPE_GLOBAL`.
*
* @size: size in bytes of payload buffer
*
Expand Down

0 comments on commit a98e317

Please sign in to comment.