This commit is contained in:
Alex
2023-02-27 22:20:02 +02:00
parent 392ebc9be2
commit 65dfa325e9
5 changed files with 221 additions and 145 deletions

View File

@ -130,20 +130,17 @@ namespace CPU
/**
* @brief Stop the CPU (infinite loop)
*/
SafeFunction static inline void Stop()
SafeFunction __noreturn __naked __used inline void Stop()
{
while (1)
{
#if defined(__amd64__) || defined(__i386__)
asmv("CPUStopLoop:\n"
"cli\n"
"hlt\n"
"jmp CPUStopLoop");
asmv("CPUStopLoop:\n"
"cli\n"
"hlt\n"
"jmp CPUStopLoop");
#elif defined(__aarch64__)
asmv("msr daifset, #2");
asmv("wfe");
asmv("msr daifset, #2");
asmv("wfe");
#endif
}
}
/**