"Wait for Interrupt instruction (WFI) provides a hint to the implementation that the current hart can be stalled until an interrupt ... so a legal implementation is to simply implement WFI as a NOP" 🤔

Source: github.com/riscv/riscv-isa-man

Follow

@exa I have some code that assumes WFI will loop forever. I suppose that's incorrect 🤔

@lupyuen if by "loop forever" you mean "the hart isn't going to execute past the WFI instruction", then yeah that code might be wrong

@lupyuen anyway I guess fixing this with 1 extra instruction that loops forever over the WFI is quite valid. I assume your interrupt handler will be able to jump over that, right?

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.