Skip to content

Commit

Permalink
include: sbi: Simplify HSM state define names
Browse files Browse the repository at this point in the history
We simplify HSM state define names so that these defines can directly
replace SBI_HART_xyz defines used by SBI HSM implementation.

Signed-off-by: Anup Patel <[email protected]>
Reviewed-by: Atish Patra <[email protected]>
  • Loading branch information
avpatel committed Mar 3, 2021
1 parent ec5274b commit 5487cf0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions include/sbi/sbi_ecall_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@
#define SBI_EXT_HSM_HART_STOP 0x1
#define SBI_EXT_HSM_HART_GET_STATUS 0x2

#define SBI_HSM_HART_STATUS_STARTED 0x0
#define SBI_HSM_HART_STATUS_STOPPED 0x1
#define SBI_HSM_HART_STATUS_START_PENDING 0x2
#define SBI_HSM_HART_STATUS_STOP_PENDING 0x3
#define SBI_HSM_STATE_STARTED 0x0
#define SBI_HSM_STATE_STOPPED 0x1
#define SBI_HSM_STATE_START_PENDING 0x2
#define SBI_HSM_STATE_STOP_PENDING 0x3

/* SBI function IDs for SRST extension */
#define SBI_EXT_SRST_RESET 0x0
Expand Down
8 changes: 4 additions & 4 deletions lib/sbi/sbi_hsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,16 @@ int sbi_hsm_hart_state_to_status(int state)

switch (state) {
case SBI_HART_STOPPED:
ret = SBI_HSM_HART_STATUS_STOPPED;
ret = SBI_HSM_STATE_STOPPED;
break;
case SBI_HART_STOPPING:
ret = SBI_HSM_HART_STATUS_STOP_PENDING;
ret = SBI_HSM_STATE_STOP_PENDING;
break;
case SBI_HART_STARTING:
ret = SBI_HSM_HART_STATUS_START_PENDING;
ret = SBI_HSM_STATE_START_PENDING;
break;
case SBI_HART_STARTED:
ret = SBI_HSM_HART_STATUS_STARTED;
ret = SBI_HSM_STATE_STARTED;
break;
default:
ret = SBI_EINVAL;
Expand Down

0 comments on commit 5487cf0

Please sign in to comment.