xiaoxiang781216 commented on a change in pull request #5758:
URL: https://github.com/apache/incubator-nuttx/pull/5758#discussion_r828127043
##########
File path: arch/risc-v/src/common/riscv_internal.h
##########
@@ -253,6 +253,19 @@ void riscv_cpu_boot(int cpu);
int riscv_pause_handler(int irq, void *c, void *arg);
#endif
+/****************************************************************************
+ * Name: riscv_mhartid
+ *
+ * Description:
+ * Context aware way to query hart id
+ *
+ * Returned Value:
+ * Hart id
+ *
+ ****************************************************************************/
+
+uint64_t riscv_mhartid(void);
Review comment:
why not change riscv_mhartid to macro like this:
```
#ifndef CONFIG_ARCH_USE_S_MODE
# define riscv_mhartid() READ_CSR(mhartid)
#endif
```
So, we can catch the wrong usage at the compiler time.
--
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]