xiaoxiang781216 commented on a change in pull request #5782:
URL: https://github.com/apache/incubator-nuttx/pull/5782#discussion_r837555779
##########
File path: arch/risc-v/src/common/supervisor/riscv_sbi.c
##########
@@ -54,5 +64,9 @@ void riscv_sbi_ack_timer(void)
uintptr_t riscv_sbi_mhartid(void)
{
+#ifdef CONFIG_NUTTSBI
+ return riscv_mcall_mhartid();
Review comment:
> The spec. does not provide this either, which I don't really
understand why.
>
Me too. It's very important to get hartid as fast as possible.
> Knowing the current execution hart can be useful, e.g. when acking
external interrrupts. A hart can claim the interrupt, but it must know which
hart it is to do this.
https://github.com/riscv-non-isa/riscv-sbi-doc/issues/25
look like we can save hartid to sscratch CSR.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]