Skip to content

Commit

Permalink
unified: Eliminate k_mem_pool_t typedef
Browse files Browse the repository at this point in the history
Replaces it with a pointer as there is no need for an opaque memory
pool type.

Jira: ZEP-916
Change-Id: I5493eed25c9c34e1b850dc3b20699864edb22d28
Signed-off-by: Peter Mitsis <[email protected]>
  • Loading branch information
wrsPeterMitsis authored and benwrs committed Oct 3, 2016
1 parent 0ca7cea commit 0cb65c3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions include/kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ struct k_mem_pool;
struct k_timer;

typedef struct tcs *k_tid_t;
typedef struct k_mem_pool *k_mem_pool_t;

/* threads/scheduler/execution contexts */

Expand Down Expand Up @@ -841,7 +840,7 @@ static inline int k_msgq_num_used_get(struct k_msgq *q)
}

struct k_mem_block {
k_mem_pool_t pool_id;
struct k_mem_pool *pool_id;
void *addr_in_pool;
void *data;
uint32_t req_size;
Expand Down Expand Up @@ -902,7 +901,8 @@ extern void k_mbox_async_put(struct k_mbox *mbox, struct k_mbox_msg *msg,
extern int k_mbox_get(struct k_mbox *mbox, struct k_mbox_msg *msg,
void *buffer, int32_t timeout);
extern void k_mbox_data_get(struct k_mbox_msg *msg, void *buffer);
extern int k_mbox_data_block_get(struct k_mbox_msg *msg, k_mem_pool_t pool,
extern int k_mbox_data_block_get(struct k_mbox_msg *msg,
struct k_mem_pool *pool,
struct k_mem_block *block, int32_t timeout);

/* pipes */
Expand Down
2 changes: 1 addition & 1 deletion kernel/unified/mailbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ void k_mbox_data_get(struct k_mbox_msg *rx_msg, void *buffer)
*
* @return 0 if successful, -ENOMEM if failed immediately, -EAGAIN if timed out
*/
int k_mbox_data_block_get(struct k_mbox_msg *rx_msg, k_mem_pool_t pool,
int k_mbox_data_block_get(struct k_mbox_msg *rx_msg, struct k_mem_pool *pool,
struct k_mem_block *block, int32_t timeout)
{
int result;
Expand Down
4 changes: 2 additions & 2 deletions kernel/unified/mem_pool.c
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ static void block_waiters_check(struct k_mem_pool *pool)
*
* @return N/A
*/
void k_mem_pool_defrag(k_mem_pool_t pool)
void k_mem_pool_defrag(struct k_mem_pool *pool)
{
k_sched_lock();

Expand All @@ -489,7 +489,7 @@ void k_mem_pool_defrag(k_mem_pool_t pool)
*
* @return N/A
*/
int k_mem_pool_alloc(k_mem_pool_t pool, struct k_mem_block *block,
int k_mem_pool_alloc(struct k_mem_pool *pool, struct k_mem_block *block,
int size, int32_t timeout)
{
char *found_block;
Expand Down

0 comments on commit 0cb65c3

Please sign in to comment.