I am trying to use WFE on Linux user space. I have the following code,
while(1)
{
if (condition==TRUE)
break;
__asm__ __volatile__ ("wfe" : : : "memory");
...
}
It seems the core never gets into sleep state after the WFE instruction is executed. If I replace wfe with wfi, the core can enter into sleep state frequently, so the interrupts may not be the sources to wake up WFE. I disabled the timer event stream in the kernel. The only think I am not sure is the event generated by clearing global monitor. I guess it cannot be masked/disabled. Is there anything else need to be taken care so that the core can enter the sleep state?