All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heinrich Schuchardt <xypron.glpk@gmx.de>
To: Rick Chen <rick@andestech.com>, Leo Yu-Chi Liang <ycliang@andestech.com>
Cc: "Alexander Graf" <agraf@csgraf.de>,
	"Bin Meng" <bmeng.cn@gmail.com>,
	"Green Wan" <green.wan@sifive.com>,
	"Sean Anderson" <seanga2@gmail.com>,
	"Marek Behún" <marek.behun@nic.cz>,
	"Chee Hong Ang" <chee.hong.ang@intel.com>,
	"Simon Glass" <sjg@chromium.org>,
	"Ley Foon Tan" <ley.foon.tan@intel.com>,
	"Priyanka Jain" <priyanka.jain@nxp.com>,
	"Sebastian Reichel" <sebastian.reichel@collabora.com>,
	"Siew Chin Lim" <elly.siew.chin.lim@intel.com>,
	"Dimitri John Ledkov" <dimitri.ledkov@canonical.com>,
	u-boot@lists.denx.de, "Heinrich Schuchardt" <xypron.glpk@gmx.de>
Subject: [PATCH v3 2/3] cmd/sbi: use constants instead of numerical values
Date: Sun,  5 Sep 2021 10:37:25 +0200	[thread overview]
Message-ID: <20210905083726.6031-3-xypron.glpk@gmx.de> (raw)
In-Reply-To: <20210905083726.6031-1-xypron.glpk@gmx.de>

Use constants for extension IDs.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
---
v3:
	no change
---
 cmd/riscv/sbi.c | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/cmd/riscv/sbi.c b/cmd/riscv/sbi.c
index 90c0811e14..65a2c93290 100644
--- a/cmd/riscv/sbi.c
+++ b/cmd/riscv/sbi.c
@@ -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,
--
2.30.2


  parent reply	other threads:[~2021-09-05  8:39 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-05  8:37 [PATCH v3 0/3] riscv: enable SBI system reset Heinrich Schuchardt
2021-09-05  8:37 ` [PATCH v3 1/3] riscv: add missing SBI extension definitions Heinrich Schuchardt
2021-09-05 12:00   ` Bin Meng
2021-09-05  8:37 ` Heinrich Schuchardt [this message]
2021-09-05 12:01   ` [PATCH v3 2/3] cmd/sbi: use constants instead of numerical values Bin Meng
2021-09-05  8:37 ` [PATCH v3 3/3] sysreset: provide SBI based sysreset driver Heinrich Schuchardt
2021-09-05 11:59   ` Bin Meng
2021-09-05 16:49     ` Heinrich Schuchardt
2021-09-05 17:00       ` Bin Meng
2021-09-05 17:21         ` Heinrich Schuchardt
2021-09-06  1:47           ` Bin Meng
2021-09-06  4:45             ` Heinrich Schuchardt
2021-09-06  5:22               ` Bin Meng
2021-09-06  5:58                 ` Heinrich Schuchardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210905083726.6031-3-xypron.glpk@gmx.de \
    --to=xypron.glpk@gmx.de \
    --cc=agraf@csgraf.de \
    --cc=bmeng.cn@gmail.com \
    --cc=chee.hong.ang@intel.com \
    --cc=dimitri.ledkov@canonical.com \
    --cc=elly.siew.chin.lim@intel.com \
    --cc=green.wan@sifive.com \
    --cc=ley.foon.tan@intel.com \
    --cc=marek.behun@nic.cz \
    --cc=priyanka.jain@nxp.com \
    --cc=rick@andestech.com \
    --cc=seanga2@gmail.com \
    --cc=sebastian.reichel@collabora.com \
    --cc=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    --cc=ycliang@andestech.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.