diff --git a/Core/Memory/PhysicalMemoryManager.cpp b/Core/Memory/PhysicalMemoryManager.cpp index acfbc160..8e12ff8f 100644 --- a/Core/Memory/PhysicalMemoryManager.cpp +++ b/Core/Memory/PhysicalMemoryManager.cpp @@ -74,8 +74,8 @@ namespace Memory } error("Out of memory! (Free: %ldMB; Used: %ldMB; Reserved: %ldMB)", TO_MB(FreeMemory), TO_MB(UsedMemory), TO_MB(ReservedMemory)); - CPU::Halt(true); - return nullptr; + CPU::Stop(); + __builtin_unreachable(); } void *Physical::RequestPages(size_t Count) diff --git a/Execute/Elf/BaseLoad.cpp b/Execute/Elf/BaseLoad.cpp index 0575390c..6f9d7e74 100644 --- a/Execute/Elf/BaseLoad.cpp +++ b/Execute/Elf/BaseLoad.cpp @@ -47,8 +47,7 @@ namespace Execute TaskManager->Sleep(100); goto RetryIPCWrite; } - while (1) - ; + CPU::Halt(true); } PCB *InterpreterTargetProcess; diff --git a/GUI/GraphicalUserInterface.cpp b/GUI/GraphicalUserInterface.cpp index 3b5f65eb..c2825ba4 100644 --- a/GUI/GraphicalUserInterface.cpp +++ b/GUI/GraphicalUserInterface.cpp @@ -182,7 +182,7 @@ namespace GraphicalUserInterface else { if (unlikely(Idle > 1000)) - CPU::Halt(); + CPU::Pause(); else Idle++; } diff --git a/Kernel.cpp b/Kernel.cpp index aad314b5..d121ccad 100644 --- a/Kernel.cpp +++ b/Kernel.cpp @@ -280,7 +280,7 @@ EXTERNC __no_instrument_function void Main(BootInfo *Info) if (dev->node->Flags != NodeFlags::DIRECTORY) { KPrint("\eE85230/system/dev is not a directory! Halting..."); - CPU::Halt(true); + CPU::Stop(); } vfs->Close(dev); DevFS = dev->node; @@ -294,7 +294,7 @@ EXTERNC __no_instrument_function void Main(BootInfo *Info) if (mnt->node->Flags != NodeFlags::DIRECTORY) { KPrint("\eE85230/system/mnt is not a directory! Halting..."); - CPU::Halt(true); + CPU::Stop(); } vfs->Close(mnt); MntFS = mnt->node; @@ -308,7 +308,7 @@ EXTERNC __no_instrument_function void Main(BootInfo *Info) if (proc->node->Flags != NodeFlags::DIRECTORY) { KPrint("\eE85230/system/proc is not a directory! Halting..."); - CPU::Halt(true); + CPU::Stop(); } vfs->Close(proc); ProcFS = proc->node; diff --git a/Tasking/InterProcessCommunication.cpp b/Tasking/InterProcessCommunication.cpp index 02f99273..27c9749b 100644 --- a/Tasking/InterProcessCommunication.cpp +++ b/Tasking/InterProcessCommunication.cpp @@ -170,7 +170,7 @@ namespace InterProcessCommunication warn("Interrupts are disabled. This may cause a kernel hang."); debug("Waiting for IPC %d (now %s)", ID, Hnd->Listening ? "listening" : "ready"); while (Hnd->Listening) - CPU::Halt(); + CPU::Pause(); debug("IPC %d is ready", ID); return IPCSuccess; }