Skip to content

Commit

Permalink
rtio: add helper function rtio_sqe_prep_callback_no_cqe
Browse files Browse the repository at this point in the history
Add a helper function that constructs a callback operation that doesn't
generate a completion queue event.

Signed-off-by: Jordan Yates <[email protected]>
  • Loading branch information
JordanYates authored and aescolar committed Aug 30, 2024
1 parent 674cf30 commit 559f58b
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions include/zephyr/rtio/rtio.h
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,25 @@ static inline void rtio_sqe_prep_callback(struct rtio_sqe *sqe,
sqe->userdata = userdata;
}

/**
* @brief Prepare a callback op submission that does not create a CQE
*
* Similar to @ref rtio_sqe_prep_callback, but the @ref RTIO_SQE_NO_RESPONSE
* flag is set on the SQE to prevent the generation of a CQE upon completion.
*
* This can be useful when the callback is the last operation in a sequence
* whose job is to clean up all the previous CQE's. Without @ref RTIO_SQE_NO_RESPONSE
* the completion itself will result in a CQE that cannot be consumed in the callback.
*/
static inline void rtio_sqe_prep_callback_no_cqe(struct rtio_sqe *sqe,
rtio_callback_t callback,
void *arg0,
void *userdata)
{
rtio_sqe_prep_callback(sqe, callback, arg0, userdata);
sqe->flags |= RTIO_SQE_NO_RESPONSE;
}

/**
* @brief Prepare a transceive op submission
*/
Expand Down

0 comments on commit 559f58b

Please sign in to comment.