[RFC PATCH 0/1] Added a blocking wait function that waits until a certain condition is true or timeout occurs

Adnan Rahman Chowdhury adnan.chowdhury at sifive.com
Wed Jun 29 06:42:56 PDT 2022


Motivation: Suppose a peripheral needs to be configured to transmit data.
There is an SFR bit which indicates that the peripheral is ready to transmit.
The firmware should check the bit and will only transmit data when the
peripheral is ready. When the firmware starts polling the SFR, the peripheral
could be busy transmitting/receiving other data so the firmware must wait
till that completes. Assuming that there is no other way, the
firmware shouldn't wait indefinitely.

This patch series addresses this problem. There is a new function that
constantly checks whether a certain condition is met and times out after a
certain amount of time.

Adnan Rahman Chowdhury (1):
  lib: sbi_timer: Added a blocking wait function that waits until a
    certain condition is true or timeout occurs

 include/sbi/sbi_timer.h |  3 +++
 lib/sbi/sbi_timer.c     | 18 ++++++++++++++++++
 2 files changed, 21 insertions(+)

-- 
2.30.2




More information about the opensbi mailing list