pussuw commented on a change in pull request #5782: URL: https://github.com/apache/incubator-nuttx/pull/5782#discussion_r837576874
########## 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: Yes, I mentioned this before and this is exactly what I have done. I created a dedicated "per CPU" storage, which is put into sscratch. Now it contains only mhartid, but it can be made to contain other hart specific information too. This is a bit more generic than just storing the hart id into sscratch. I did this months ago, but I decided to do the call gate to read mhartid instead. But now I'll revert back to using the sscratch interface. For a preview if you want to take a look, this is the old implementation I did long ago: https://github.com/tiiuae/nuttx/pull/32/commits/18a101532d365749b12b86089795f47fe4157128 I have cleaned it up a bit and the new cleaner implementation will be part of the next patches -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org