forked from Mirrors/opensbi
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:

committed by
Anup Patel

parent
851e301098
commit
b47fcd01b3
@@ -509,8 +509,8 @@ static void sse_event_inject(struct sbi_sse_event *e,
|
|||||||
csr_write(CSR_SEPC, regs->mepc);
|
csr_write(CSR_SEPC, regs->mepc);
|
||||||
|
|
||||||
/* Setup entry context */
|
/* Setup entry context */
|
||||||
regs->a6 = e->attrs.entry.arg;
|
regs->a6 = current_hartid();
|
||||||
regs->a7 = current_hartid();
|
regs->a7 = e->attrs.entry.arg;
|
||||||
regs->mepc = e->attrs.entry.pc;
|
regs->mepc = e->attrs.entry.pc;
|
||||||
|
|
||||||
/* Return to S-mode with virtualization disabled */
|
/* Return to S-mode with virtualization disabled */
|
||||||
|
Reference in New Issue
Block a user