summaryrefslogtreecommitdiff
path: root/include/sbi/sbi_scratch.h
diff options
context:
space:
mode:
authorAtish Patra <atish.patra@wdc.com>2019-04-02 03:07:54 +0300
committerAnup Patel <anup@brainfault.org>2019-04-03 07:27:42 +0300
commitf700216cb55fe690b0eec61bb618b11a0630040e (patch)
treef004ccbba3ae179ac4e4c47555d36a5a8d9dc301 /include/sbi/sbi_scratch.h
parent1eba298b0d1be5c1d9d7d4c07a8a18e9613bcb44 (diff)
downloadopensbi-f700216cb55fe690b0eec61bb618b11a0630040e.tar.xz
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>
Diffstat (limited to 'include/sbi/sbi_scratch.h')
-rw-r--r--include/sbi/sbi_scratch.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/include/sbi/sbi_scratch.h b/include/sbi/sbi_scratch.h
index 800ffcf..a41549c 100644
--- a/include/sbi/sbi_scratch.h
+++ b/include/sbi/sbi_scratch.h
@@ -37,7 +37,9 @@
/** Offset of ipi_type in sbi_ipi_data */
#define SBI_IPI_DATA_IPI_TYPE_OFFSET (15 * __SIZEOF_POINTER__)
-#define SBI_SCRATCH_TLB_INFO_OFFSET (16 * __SIZEOF_POINTER__)
+#define SBI_SCRATCH_TLB_QUEUE_HEAD_OFFSET (16 * __SIZEOF_POINTER__)
+#define SBI_SCRATCH_TLB_QUEUE_MEM_OFFSET (SBI_SCRATCH_TLB_QUEUE_HEAD_OFFSET + SBI_TLB_INFO_SIZE)
+
/** Maximum size of sbi_scratch and sbi_ipi_data */
#define SBI_SCRATCH_SIZE (64 * __SIZEOF_POINTER__)
@@ -88,9 +90,13 @@ enum sbi_scratch_options {
#define sbi_ipi_data_ptr(scratch) \
((struct sbi_ipi_data *)(void*)scratch + SBI_IPI_DATA_IPI_TYPE_OFFSET)
-/** Get pointer to tlb flush info from sbi_scratch */
-#define sbi_tlb_info_ptr(scratch) \
-((struct sbi_tlb_info *)(void*)scratch + SBI_SCRATCH_TLB_INFO_OFFSET)
+/** Get pointer to tlb flush info fifo header from sbi_scratch */
+#define sbi_tlb_fifo_head_ptr(scratch) \
+((struct sbi_fifo *)(void*)scratch + SBI_SCRATCH_TLB_QUEUE_HEAD_OFFSET)
+
+/** Get pointer to tlb flush info fifo queue address from sbi_scratch */
+#define sbi_tlb_fifo_mem_ptr(scratch) \
+(void *)((void*)scratch + SBI_SCRATCH_TLB_QUEUE_MEM_OFFSET)
#endif