Ouss4 commented on code in PR #5985:
URL: https://github.com/apache/incubator-nuttx/pull/5985#discussion_r847216610
##########
arch/risc-v/src/common/riscv_percpu.c:
##########
@@ -86,13 +123,27 @@ void riscv_percpu_init(void)
void riscv_percpu_add_hart(uintptr_t hartid)
{
- /* Hart IDs go from 0...4 */
+ riscv_percpu_t *percpu;
+ irqstate_t flags;
+
+ /* Make sure we are initialized */
+
+ riscv_percpu_init();
- DEBUGASSERT(hartid < HART_CNT);
+ /* Get free entry for this hart, this must not fail */
+
+ flags = spin_lock_irqsave(NULL);
Review Comment:
Do we need the global lock here (and in `riscv_percpu_init`)?
If these are called only during initialization then there won't be much to
gain from a local lock, but I wanted to put this here in case you wanted to
consider it.
--
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]