From: Clément Léger <cleger@rivosinc.com>
To: opensbi@lists.infradead.org
Subject: [PATCH 4/6] lib: sbi: sse: Rename STATUS* interrupted flags to SSTATUS*
Date: Mon, 17 Mar 2025 11:54:22 +0100 [thread overview]
Message-ID: <20250317105426.631243-5-cleger@rivosinc.com> (raw)
In-Reply-To: <20250317105426.631243-1-cleger@rivosinc.com>
As raised by Andrew on the kvm-unit-test review, this flags are meant to
hold SSTATUS bits in the specification. Rename them to match that.
Signed-off-by: Cl?ment L?ger <cleger@rivosinc.com>
---
include/sbi/sbi_ecall_interface.h | 4 ++--
lib/sbi/sbi_sse.c | 12 ++++++------
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/include/sbi/sbi_ecall_interface.h b/include/sbi/sbi_ecall_interface.h
index bd694aa8..51e42eed 100644
--- a/include/sbi/sbi_ecall_interface.h
+++ b/include/sbi/sbi_ecall_interface.h
@@ -380,8 +380,8 @@ enum sbi_sse_attr_id {
#define SBI_SSE_ATTR_CONFIG_ONESHOT (1 << 0)
-#define SBI_SSE_ATTR_INTERRUPTED_FLAGS_STATUS_SPP BIT(0)
-#define SBI_SSE_ATTR_INTERRUPTED_FLAGS_STATUS_SPIE BIT(1)
+#define SBI_SSE_ATTR_INTERRUPTED_FLAGS_SSTATUS_SPP BIT(0)
+#define SBI_SSE_ATTR_INTERRUPTED_FLAGS_SSTATUS_SPIE BIT(1)
#define SBI_SSE_ATTR_INTERRUPTED_FLAGS_HSTATUS_SPV BIT(2)
#define SBI_SSE_ATTR_INTERRUPTED_FLAGS_HSTATUS_SPVP BIT(3)
diff --git a/lib/sbi/sbi_sse.c b/lib/sbi/sbi_sse.c
index ac714b8a..fb7ccf05 100644
--- a/lib/sbi/sbi_sse.c
+++ b/lib/sbi/sbi_sse.c
@@ -427,8 +427,8 @@ static int sse_event_set_attr_check(struct sbi_sse_event *e, uint32_t attr_id,
return sse_event_set_hart_id_check(e, val);
case SBI_SSE_ATTR_INTERRUPTED_FLAGS:
- if (val & ~(SBI_SSE_ATTR_INTERRUPTED_FLAGS_STATUS_SPP |
- SBI_SSE_ATTR_INTERRUPTED_FLAGS_STATUS_SPIE |
+ if (val & ~(SBI_SSE_ATTR_INTERRUPTED_FLAGS_SSTATUS_SPP |
+ SBI_SSE_ATTR_INTERRUPTED_FLAGS_SSTATUS_SPIE |
SBI_SSE_ATTR_INTERRUPTED_FLAGS_HSTATUS_SPV |
SBI_SSE_ATTR_INTERRUPTED_FLAGS_HSTATUS_SPVP))
return SBI_EINVAL;
@@ -513,9 +513,9 @@ static unsigned long sse_interrupted_flags(unsigned long mstatus)
unsigned long hstatus, flags = 0;
if (mstatus & (MSTATUS_SPIE))
- flags |= SBI_SSE_ATTR_INTERRUPTED_FLAGS_STATUS_SPIE;
+ flags |= SBI_SSE_ATTR_INTERRUPTED_FLAGS_SSTATUS_SPIE;
if (mstatus & (MSTATUS_SPP))
- flags |= SBI_SSE_ATTR_INTERRUPTED_FLAGS_STATUS_SPP;
+ flags |= SBI_SSE_ATTR_INTERRUPTED_FLAGS_SSTATUS_SPP;
if (misa_extension('H')) {
hstatus = csr_read(CSR_HSTATUS);
@@ -626,11 +626,11 @@ static void sse_event_resume(struct sbi_sse_event *e,
regs->mstatus |= MSTATUS_SIE;
regs->mstatus &= ~MSTATUS_SPIE;
- if (i_ctx->flags & SBI_SSE_ATTR_INTERRUPTED_FLAGS_STATUS_SPIE)
+ if (i_ctx->flags & SBI_SSE_ATTR_INTERRUPTED_FLAGS_SSTATUS_SPIE)
regs->mstatus |= MSTATUS_SPIE;
regs->mstatus &= ~MSTATUS_SPP;
- if (i_ctx->flags & SBI_SSE_ATTR_INTERRUPTED_FLAGS_STATUS_SPP)
+ if (i_ctx->flags & SBI_SSE_ATTR_INTERRUPTED_FLAGS_SSTATUS_SPP)
regs->mstatus |= MSTATUS_SPP;
regs->a7 = i_ctx->a7;
--
2.47.2
next prev parent reply other threads:[~2025-03-17 10:54 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-17 10:54 [PATCH 0/6] lib: sbi: sse: spec update and fixes Clément Léger
2025-03-17 10:54 ` [PATCH 1/6] lib: sbi: sse: Update SSE event ids Clément Léger
2025-03-24 16:15 ` Andrew Jones
2025-03-17 10:54 ` [PATCH 2/6] lib: sbi: sse: Fix format string for event invalid state Clément Léger
2025-03-24 16:39 ` Andrew Jones
2025-03-24 16:41 ` Clément Léger
2025-03-17 10:54 ` [PATCH 3/6] lib: sbi: sse: Return SBI_EDENIED for read only parameters Clément Léger
2025-03-24 17:01 ` Andrew Jones
2025-03-24 17:02 ` Clément Léger
2025-03-17 10:54 ` Clément Léger [this message]
2025-03-24 17:03 ` [PATCH 4/6] lib: sbi: sse: Rename STATUS* interrupted flags to SSTATUS* Andrew Jones
2025-03-17 10:54 ` [PATCH 5/6] lib: sbi: sse: Add support for SSTATUS.SPELP Clément Léger
2025-03-24 17:08 ` Andrew Jones
2025-03-17 10:54 ` [PATCH 6/6] lib: sbi: sse: Add support for SSTATUS.SDT Clément Léger
2025-03-24 17:46 ` Andrew Jones
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=20250317105426.631243-5-cleger@rivosinc.com \
--to=cleger@rivosinc.com \
--cc=opensbi@lists.infradead.org \
/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.