mirror of
https://github.com/riscv-software-src/opensbi
synced 2025-10-14 04:46:06 +01:00
lib: sbi: sse: fix invalid errors returned for sse_hart_mask/unmask()
When called twice, sse_hart_mask()/sse_hart_unmask() should return SBI_EALREADY_STOPPED/SBI_EALREADY_STARTED. This was currently inverted. Fixes: b919daf49582 ("lib: sbi: Add support to mask/unmask SSE events") Reported-by: Andrew Jones <ajones@ventanamicro.com> Signed-off-by: Clément Léger <cleger@rivosinc.com> Reviewed-by: Samuel Holland <samuel.holland@sifive.com> Reviewed-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
parent
1f64fef919
commit
f354400ebf
@ -882,7 +882,7 @@ int sbi_sse_hart_mask(void)
|
||||
return SBI_EFAIL;
|
||||
|
||||
if (state->masked)
|
||||
return SBI_EALREADY_STARTED;
|
||||
return SBI_EALREADY_STOPPED;
|
||||
|
||||
state->masked = true;
|
||||
|
||||
@ -897,7 +897,7 @@ int sbi_sse_hart_unmask(void)
|
||||
return SBI_EFAIL;
|
||||
|
||||
if (!state->masked)
|
||||
return SBI_EALREADY_STOPPED;
|
||||
return SBI_EALREADY_STARTED;
|
||||
|
||||
state->masked = false;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user