]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
cmd/sbi: use constants instead of numerical values
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Sun, 12 Sep 2021 19:11:45 +0000 (21:11 +0200)
committerLeo Yu-Chi Liang <ycliang@andestech.com>
Thu, 7 Oct 2021 08:08:23 +0000 (16:08 +0800)
Use constants for extension IDs.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
cmd/riscv/sbi.c

index 90c0811e14c60565ddd2be0cee449039f817271f..65a2c9329051759fef351afe1cd0620fc1f12a2c 100644 (file)
@@ -29,21 +29,21 @@ static struct sbi_imp implementations[] = {
 };
 
 static struct sbi_ext extensions[] = {
-       { 0x00000000, "sbi_set_timer" },
-       { 0x00000001, "sbi_console_putchar" },
-       { 0x00000002, "sbi_console_getchar" },
-       { 0x00000003, "sbi_clear_ipi" },
-       { 0x00000004, "sbi_send_ipi" },
-       { 0x00000005, "sbi_remote_fence_i" },
-       { 0x00000006, "sbi_remote_sfence_vma" },
-       { 0x00000007, "sbi_remote_sfence_vma_asid" },
-       { 0x00000008, "sbi_shutdown" },
-       { 0x00000010, "SBI Base Functionality" },
-       { 0x54494D45, "Timer Extension" },
-       { 0x00735049, "IPI Extension" },
-       { 0x52464E43, "RFENCE Extension" },
-       { 0x0048534D, "Hart State Management Extension" },
-       { 0x53525354, "System Reset Extension" },
+       { SBI_EXT_0_1_SET_TIMER,              "sbi_set_timer" },
+       { SBI_EXT_0_1_CONSOLE_PUTCHAR,        "sbi_console_putchar" },
+       { SBI_EXT_0_1_CONSOLE_GETCHAR,        "sbi_console_getchar" },
+       { SBI_EXT_0_1_CLEAR_IPI,              "sbi_clear_ipi" },
+       { SBI_EXT_0_1_SEND_IPI,               "sbi_send_ipi" },
+       { SBI_EXT_0_1_REMOTE_FENCE_I,         "sbi_remote_fence_i" },
+       { SBI_EXT_0_1_REMOTE_SFENCE_VMA,      "sbi_remote_sfence_vma" },
+       { SBI_EXT_0_1_REMOTE_SFENCE_VMA_ASID, "sbi_remote_sfence_vma_asid" },
+       { SBI_EXT_0_1_SHUTDOWN,               "sbi_shutdown" },
+       { SBI_EXT_BASE,                       "SBI Base Functionality" },
+       { SBI_EXT_TIME,                       "Timer Extension" },
+       { SBI_EXT_IPI,                        "IPI Extension" },
+       { SBI_EXT_RFENCE,                     "RFENCE Extension" },
+       { SBI_EXT_HSM,                        "Hart State Management Extension" },
+       { SBI_EXT_SRST,                       "System Reset Extension" },
 };
 
 static int do_sbi(struct cmd_tbl *cmdtp, int flag, int argc,