summaryrefslogtreecommitdiff
path: root/lib/sbi/sbi_ecall_hsm.c
diff options
context:
space:
mode:
authorAnup Patel <anup.patel@wdc.com>2021-02-01 13:43:03 +0300
committerAnup Patel <anup@brainfault.org>2021-03-03 07:47:41 +0300
commit8df1f9a0d33f295fc9f9cd5f6b9b723be96ba13b (patch)
tree601583c4879a1cd4e8d0ef0716d375e8bb7eef8a /lib/sbi/sbi_ecall_hsm.c
parent5487cf095daecf72c81e2813dcce13e203398a55 (diff)
downloadopensbi-8df1f9a0d33f295fc9f9cd5f6b9b723be96ba13b.tar.xz
lib: sbi: Use SBI_HSM_STATE_xyz defines instead of SBI_STATE_xyz defines
We replace the use of SBI_STATE_xyz defines with SBI_HSM_STATE_xyz defines because the HSM state defines are complete enough to implement HSM state machine in OpenSBI. As a result of this, we can now remove sbi_hsm_hart_state_to_status() function because it is now redundant and sbi_hsm_hart_get_state() can directly return HSM state or error. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Atish Patra <atish.patra@wdc.com>
Diffstat (limited to 'lib/sbi/sbi_ecall_hsm.c')
-rw-r--r--lib/sbi/sbi_ecall_hsm.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/sbi/sbi_ecall_hsm.c b/lib/sbi/sbi_ecall_hsm.c
index df29d51..79a9f21 100644
--- a/lib/sbi/sbi_ecall_hsm.c
+++ b/lib/sbi/sbi_ecall_hsm.c
@@ -23,7 +23,7 @@ static int sbi_ecall_hsm_handler(unsigned long extid, unsigned long funcid,
struct sbi_trap_info *out_trap)
{
ulong smode;
- int ret = 0, hstate;
+ int ret = 0;
struct sbi_scratch *scratch = sbi_scratch_thishart_ptr();
switch (funcid) {
@@ -37,9 +37,8 @@ static int sbi_ecall_hsm_handler(unsigned long extid, unsigned long funcid,
ret = sbi_hsm_hart_stop(scratch, TRUE);
break;
case SBI_EXT_HSM_HART_GET_STATUS:
- hstate = sbi_hsm_hart_get_state(sbi_domain_thishart_ptr(),
- regs->a0);
- ret = sbi_hsm_hart_state_to_status(hstate);
+ ret = sbi_hsm_hart_get_state(sbi_domain_thishart_ptr(),
+ regs->a0);
break;
default:
ret = SBI_ENOTSUPP;