apache / apache/nuttx

Question about RISCV cpu_start

Open
#11,930 11 comments 1 reaction 0 assignees View on GitHub
Dominant language
C
Stars
4k
Forks
1.7k
Avg merge
1d 17h
Merged PRs (30d)
237

Description

Since RISCV spec allows WFI to be implemented as a NOP, shouldn't asm("WFI"); be in a while loop, as is commonly done?

https://github.com/apache/nuttx/blob/master/arch/risc-v/src/common/riscv_cpustart.c#L78

```
void riscv_cpu_boot(int cpu)
{
....
/* Enable machine software interrupt for IPI to boot */

up_enable_irq(RISCV_IRQ_SOFT);

/* Wait interrupt */

asm("WFI");

#ifdef CONFIG_BUILD_KERNEL
/* Initialize the per CPU areas */
...
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.