Lines Matching refs:rx_msg

113 			       struct k_mbox_msg *rx_msg)  in mbox_message_match()  argument
118 (tx_msg->tx_target_thread == rx_msg->tx_target_thread)) && in mbox_message_match()
119 ((rx_msg->rx_source_thread == (k_tid_t)K_ANY) || in mbox_message_match()
120 (rx_msg->rx_source_thread == tx_msg->rx_source_thread))) { in mbox_message_match()
123 rx_msg->rx_source_thread = tx_msg->rx_source_thread; in mbox_message_match()
124 tx_msg->tx_target_thread = rx_msg->tx_target_thread; in mbox_message_match()
127 temp_info = rx_msg->info; in mbox_message_match()
128 rx_msg->info = tx_msg->info; in mbox_message_match()
132 if (rx_msg->size > tx_msg->size) { in mbox_message_match()
133 rx_msg->size = tx_msg->size; in mbox_message_match()
137 rx_msg->tx_data = tx_msg->tx_data; in mbox_message_match()
140 rx_msg->_syncing_thread = tx_msg->_syncing_thread; in mbox_message_match()
155 static void mbox_message_dispose(struct k_mbox_msg *rx_msg) in mbox_message_dispose() argument
161 if (rx_msg->_syncing_thread == NULL) { in mbox_message_dispose()
166 sending_thread = rx_msg->_syncing_thread; in mbox_message_dispose()
167 rx_msg->_syncing_thread = NULL; in mbox_message_dispose()
171 tx_msg->size = rx_msg->size; in mbox_message_dispose()
215 struct k_mbox_msg *rx_msg; in mbox_message_put() local
231 rx_msg = (struct k_mbox_msg *)receiving_thread->base.swap_data; in mbox_message_put()
233 if (mbox_message_match(tx_msg, rx_msg) == 0) { in mbox_message_put()
335 void k_mbox_data_get(struct k_mbox_msg *rx_msg, void *buffer) in k_mbox_data_get() argument
339 rx_msg->size = 0; in k_mbox_data_get()
340 mbox_message_dispose(rx_msg); in k_mbox_data_get()
345 if ((rx_msg->tx_data != NULL) && (rx_msg->size > 0U)) { in k_mbox_data_get()
346 (void)memcpy(buffer, rx_msg->tx_data, rx_msg->size); in k_mbox_data_get()
348 mbox_message_dispose(rx_msg); in k_mbox_data_get()
367 static int mbox_message_data_check(struct k_mbox_msg *rx_msg, void *buffer) in mbox_message_data_check() argument
371 k_mbox_data_get(rx_msg, buffer); in mbox_message_data_check()
372 } else if (rx_msg->size == 0U) { in mbox_message_data_check()
374 mbox_message_dispose(rx_msg); in mbox_message_data_check()
382 int k_mbox_get(struct k_mbox *mbox, struct k_mbox_msg *rx_msg, void *buffer, in k_mbox_get() argument
391 rx_msg->tx_target_thread = arch_current_thread(); in k_mbox_get()
401 if (mbox_message_match(tx_msg, rx_msg) == 0) { in k_mbox_get()
408 result = mbox_message_data_check(rx_msg, buffer); in k_mbox_get()
428 arch_current_thread()->base.swap_data = rx_msg; in k_mbox_get()
433 result = mbox_message_data_check(rx_msg, buffer); in k_mbox_get()