From bf40e07f6f24a9c3ed08cfeb730d4e62ba3e215b Mon Sep 17 00:00:00 2001 From: Xiang W Date: Fri, 14 Apr 2023 09:32:47 +0800 Subject: lib: sbi: Optimize sbi_tlb queue waiting When tlb_fifo is full, it will wait and affect the ipi update to other harts. This patch is optimized. Signed-off-by: Xiang W Reviewed-by: Anup Patel Tested-by: Anup Patel --- include/sbi/sbi_ipi.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include') diff --git a/include/sbi/sbi_ipi.h b/include/sbi/sbi_ipi.h index f384e748..c64f422c 100644 --- a/include/sbi/sbi_ipi.h +++ b/include/sbi/sbi_ipi.h @@ -30,6 +30,12 @@ struct sbi_ipi_device { void (*ipi_clear)(u32 target_hart); }; +enum sbi_ipi_update_type { + SBI_IPI_UPDATE_SUCCESS, + SBI_IPI_UPDATE_BREAK, + SBI_IPI_UPDATE_RETRY, +}; + struct sbi_scratch; /** IPI event operations or callbacks */ @@ -41,6 +47,10 @@ struct sbi_ipi_event_ops { * Update callback to save/enqueue data for remote HART * Note: This is an optional callback and it is called just before * triggering IPI to remote HART. + * @return < 0, error or failure + * @return SBI_IPI_UPDATE_SUCCESS, success + * @return SBI_IPI_UPDATE_BREAK, break IPI, done on local hart + * @return SBI_IPI_UPDATE_RETRY, need retry */ int (* update)(struct sbi_scratch *scratch, struct sbi_scratch *remote_scratch, -- cgit v1.3.1