From b47fcd01b3ba0e3ea89f5454456eded04afb93ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20L=C3=A9ger?= Date: Mon, 25 Nov 2024 11:53:00 +0100 Subject: [PATCH] lib: sbi: sse: Fix a6 and a7 register content upon injection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Clément Léger Reviewed-by: Anup Patel --- lib/sbi/sbi_sse.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/sbi/sbi_sse.c b/lib/sbi/sbi_sse.c index bf5620e8..c9f9a9dd 100644 --- a/lib/sbi/sbi_sse.c +++ b/lib/sbi/sbi_sse.c @@ -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 */