Skip to content

Commit

Permalink
lib: sbi: Fix error codes returned by HSM start() and stop() functions
Browse files Browse the repository at this point in the history
The sbi_hsm_hart_start() and sbi_hsm_hart_stop() functions should
only return error codes as defined by the SBI specification.

Signed-off-by: Anup Patel <[email protected]>
Reviewed-by: Atish Patra <[email protected]>
  • Loading branch information
avpatel committed Mar 3, 2021
1 parent 638c948 commit ca864a9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/sbi/sbi_hsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ int sbi_hsm_hart_start(struct sbi_scratch *scratch,
return SBI_EINVAL;
if (dom && !sbi_domain_check_addr(dom, saddr, smode,
SBI_DOMAIN_EXECUTE))
return SBI_EINVAL;
return SBI_EINVALID_ADDR;

rscratch = sbi_hartid_to_scratch(hartid);
if (!rscratch)
Expand Down Expand Up @@ -251,7 +251,7 @@ int sbi_hsm_hart_stop(struct sbi_scratch *scratch, bool exitnow)
if (oldstate != SBI_HSM_STATE_STARTED) {
sbi_printf("%s: ERR: The hart is in invalid state [%u]\n",
__func__, oldstate);
return SBI_EDENIED;
return SBI_EFAIL;
}

if (exitnow)
Expand Down

0 comments on commit ca864a9

Please sign in to comment.