lib: Use a fifo to keep track of sfence related IPIs.

Currently, there is no provision for tracking multiple IPIs sent
to a single hart at the same time by different harts.

Use a fifo manage the outstanding requests. While dequeueing, read all
the entries once, because we have only 1 bit to track the type of IPI.
Once the queue is full, busy wait until the there is space available in
queue. This is not the most elegant approach. It should be changed in
favor of a wakeup event once available in opensbi.

Signed-off-by: Atish Patra <atish.patra@wdc.com>
This commit is contained in:
Atish Patra
2019-04-01 17:07:54 -07:00
committed by Anup Patel
parent 1eba298b0d
commit f700216cb5
5 changed files with 47 additions and 19 deletions

View File

@@ -42,6 +42,7 @@ int sbi_fifo_enqueue(struct sbi_fifo *fifo, void *data)
{
if (!fifo || !data)
return -1;
spin_lock(&fifo->qlock);
if (sbi_fifo_is_full(fifo)) {
spin_unlock(&fifo->qlock);