From 72b9c8ff89a963bcec0a7f41fc679ee5246efd01 Mon Sep 17 00:00:00 2001 From: Anup Patel Date: Wed, 5 Jul 2023 12:23:57 +0530 Subject: [PATCH] lib: sbi: Alphabetically sort HART ISA extensions Let us follow alphabetical order for HART ISA extension so that it is simpler to maintain. Signed-off-by: Anup Patel Reviewed-by: Xiang W --- include/sbi/sbi_hart.h | 10 +++++----- lib/sbi/sbi_hart.c | 16 ++++++++-------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/include/sbi/sbi_hart.h b/include/sbi/sbi_hart.h index 938248f3..b97f78cd 100644 --- a/include/sbi/sbi_hart.h +++ b/include/sbi/sbi_hart.h @@ -26,16 +26,16 @@ enum sbi_hart_priv_versions { /** Possible ISA extensions of a hart */ enum sbi_hart_extensions { - /** Hart has Sscofpmt extension */ - SBI_HART_EXT_SSCOFPMF = 0, - /** HART has Zicntr extension (i.e. HW cycle, time & instret CSRs) */ - SBI_HART_EXT_ZICNTR, /** HART has AIA M-mode CSRs */ - SBI_HART_EXT_SMAIA, + SBI_HART_EXT_SMAIA = 0, /** HART has Smstateen CSR **/ SBI_HART_EXT_SMSTATEEN, + /** Hart has Sscofpmt extension */ + SBI_HART_EXT_SSCOFPMF, /** HART has Sstc extension */ SBI_HART_EXT_SSTC, + /** HART has Zicntr extension (i.e. HW cycle, time & instret CSRs) */ + SBI_HART_EXT_ZICNTR, /** HART has Zihpm extension */ SBI_HART_EXT_ZIHPM, diff --git a/lib/sbi/sbi_hart.c b/lib/sbi/sbi_hart.c index ff6f5826..2eacefb1 100644 --- a/lib/sbi/sbi_hart.c +++ b/lib/sbi/sbi_hart.c @@ -438,20 +438,20 @@ static inline char *sbi_hart_extension_id2string(int ext) char *estr = NULL; switch (ext) { - case SBI_HART_EXT_SSCOFPMF: - estr = "sscofpmf"; - break; - case SBI_HART_EXT_ZICNTR: - estr = "zicntr"; - break; case SBI_HART_EXT_SMAIA: estr = "smaia"; break; + case SBI_HART_EXT_SMSTATEEN: + estr = "smstateen"; + break; + case SBI_HART_EXT_SSCOFPMF: + estr = "sscofpmf"; + break; case SBI_HART_EXT_SSTC: estr = "sstc"; break; - case SBI_HART_EXT_SMSTATEEN: - estr = "smstateen"; + case SBI_HART_EXT_ZICNTR: + estr = "zicntr"; break; case SBI_HART_EXT_ZIHPM: estr = "zihpm";