lib: sbi: Use current_hartindex() where possible

This avoids calls to the expensive sbi_hartid_to_hartindex() function
and also makes the firmware smaller.

Signed-off-by: Samuel Holland <samuel.holland@sifive.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
Samuel Holland
2024-08-30 08:49:07 -07:00
committed by Anup Patel
parent 9d7a983060
commit 15c4e285db
5 changed files with 9 additions and 10 deletions

View File

@@ -52,10 +52,9 @@ struct sbi_context {
(__d)->hartindex_to_context_table[__hartindex]
/** Macro to obtain the current hart's context pointer */
#define sbi_domain_context_thishart_ptr() \
sbi_hartindex_to_domain_context( \
sbi_hartid_to_hartindex(current_hartid()), \
sbi_domain_thishart_ptr())
#define sbi_domain_context_thishart_ptr() \
sbi_hartindex_to_domain_context(current_hartindex(), \
sbi_domain_thishart_ptr())
/**
* Enter a specific domain context synchronously