forked from Mirrors/opensbi
lib: sbi: Update sbi_domain_is_assigned_hart() to take a hart index
This removes redundant hartid to hartindex conversions from four call sites and provides a net reduction in code size. 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
fe153c5516
commit
9f86524b58
@@ -323,7 +323,7 @@ static int sse_event_set_hart_id_check(struct sbi_sse_event *e,
|
||||
if (!sse_event_is_global(e))
|
||||
return SBI_EBAD_RANGE;
|
||||
|
||||
if (!sbi_domain_is_assigned_hart(hd, new_hartid))
|
||||
if (!sbi_domain_is_assigned_hart(hd, sbi_hartid_to_hartindex(hartid)))
|
||||
return SBI_EINVAL;
|
||||
|
||||
hstate = sbi_hsm_hart_get_state(hd, hartid);
|
||||
@@ -810,7 +810,8 @@ int sbi_sse_disable(uint32_t event_id)
|
||||
int sbi_sse_inject_from_ecall(uint32_t event_id, unsigned long hartid,
|
||||
struct sbi_ecall_return *out)
|
||||
{
|
||||
if (!sbi_domain_is_assigned_hart(sbi_domain_thishart_ptr(), hartid))
|
||||
if (!sbi_domain_is_assigned_hart(sbi_domain_thishart_ptr(),
|
||||
sbi_hartid_to_hartindex(hartid)))
|
||||
return SBI_EINVAL;
|
||||
|
||||
return sse_inject_event(event_id, hartid);
|
||||
|
Reference in New Issue
Block a user