lib: sbi: sse: Fix a6 and a7 register content upon injection

The specification states that a6 contains the current hart id and
a7 contains the entry argument. This was inverted in the current
implementation.

Reported-by: Andrew Jones <andrew.jones@linux.dev>
Signed-off-by: Clément Léger <cleger@rivosinc.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
Clément Léger
2024-11-25 11:53:00 +01:00
committed by Anup Patel
parent 851e301098
commit b47fcd01b3

View File

@@ -509,8 +509,8 @@ static void sse_event_inject(struct sbi_sse_event *e,
csr_write(CSR_SEPC, regs->mepc);
/* Setup entry context */
regs->a6 = e->attrs.entry.arg;
regs->a7 = current_hartid();
regs->a6 = current_hartid();
regs->a7 = e->attrs.entry.arg;
regs->mepc = e->attrs.entry.pc;
/* Return to S-mode with virtualization disabled */