where Go_to_Sleep() is defined as:…
Go_to_Sleep();
…
… the processor should actually return (exit) from the Go_to_Sleep() function before continuing with the execution of anything else (although there isn’t anything following the asm volatile("HLT"); code).void Go_to_Sleep(void)
{
asm volatile("HLT");
}
So, my question is: Would the processor actually need to do this “extra” step or not? I guess that if we use any sort of compiler optimisation, this might be avoided, but if we don’t, I think this extra (probably tiny) overhead exists.
Any ideas will be greatly appreciated.