forked from Mirrors/opensbi
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:

committed by
Anup Patel

parent
9d7a983060
commit
15c4e285db
@@ -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
|
||||
|
Reference in New Issue
Block a user