diff --git a/Architecture/aarch64/Entry.cpp b/Architecture/aarch64/Entry.cpp index 2b58a3f..1214c60 100644 --- a/Architecture/aarch64/Entry.cpp +++ b/Architecture/aarch64/Entry.cpp @@ -6,6 +6,5 @@ EXTERNC void arm64Entry(uint64_t dtb_ptr32, uint64_t x1, uint64_t x2, uint64_t x3) { trace("Hello, World!"); - while (1) - CPU::Halt(); + CPU::Halt(true); } diff --git a/Architecture/amd64/cpu/SymmetricMultiprocessing.cpp b/Architecture/amd64/cpu/SymmetricMultiprocessing.cpp index 478cf41..9827bd0 100644 --- a/Architecture/amd64/cpu/SymmetricMultiprocessing.cpp +++ b/Architecture/amd64/cpu/SymmetricMultiprocessing.cpp @@ -46,8 +46,7 @@ extern "C" void StartCPU() CPU::Interrupts(CPU::Enable); KPrint("\e058C19CPU \e8888FF%d \e058C19is online", CoreID); CPUEnabled = true; - while (1) - CPU::Halt(); + CPU::Halt(true); } namespace SMP diff --git a/Core/Memory/PhysicalMemoryManager.cpp b/Core/Memory/PhysicalMemoryManager.cpp index b0c0f02..f3a9b7c 100644 --- a/Core/Memory/PhysicalMemoryManager.cpp +++ b/Core/Memory/PhysicalMemoryManager.cpp @@ -74,8 +74,7 @@ namespace Memory } error("Out of memory! (Free: %ldMB; Used: %ldMB; Reserved: %ldMB)", TO_MB(FreeMemory), TO_MB(UsedMemory), TO_MB(ReservedMemory)); - while (1) - CPU::Halt(); + CPU::Halt(true); return nullptr; } @@ -112,8 +111,7 @@ namespace Memory } error("Out of memory! (Free: %ldMB; Used: %ldMB; Reserved: %ldMB)", TO_MB(FreeMemory), TO_MB(UsedMemory), TO_MB(ReservedMemory)); - while (1) - CPU::Halt(); + CPU::Halt(true); return nullptr; } diff --git a/KThread.cpp b/KThread.cpp index b4e6c24..bd56afc 100644 --- a/KThread.cpp +++ b/KThread.cpp @@ -219,8 +219,7 @@ void KernelMainThread() Display->SetBufferCursor(0, x, y); KPrint("\e22AA11Color test finished."); - while (1) - CPU::Halt(); + CPU::Halt(true); } void KernelShutdownThread(bool Reboot) diff --git a/Kernel.cpp b/Kernel.cpp index dd9e3c4..96bdd7c 100644 --- a/Kernel.cpp +++ b/Kernel.cpp @@ -92,6 +92,5 @@ EXTERNC void Entry(BootInfo *Info) SMP::Initialize(PowerManager->GetMADT()); TaskManager = new Tasking::Task((Tasking::IP)KernelMainThread); KPrint("\e058C19######## \eE85230END \e058C19########"); - while (1) - CPU::Halt(); + CPU::Halt(true); } diff --git a/Tasking/Task.cpp b/Tasking/Task.cpp index c6630f9..ef63e62 100644 --- a/Tasking/Task.cpp +++ b/Tasking/Task.cpp @@ -327,6 +327,7 @@ namespace Tasking #elif defined(__i386__) __attribute__((no_stack_protector)) bool Task::FindNewProcess(void *CPUDataPointer) { + fixme("unimplemented"); } __attribute__((no_stack_protector)) void Task::OnInterruptReceived(void *Frame) @@ -337,6 +338,7 @@ namespace Tasking #elif defined(__aarch64__) __attribute__((no_stack_protector)) bool Task::FindNewProcess(void *CPUDataPointer) { + fixme("unimplemented"); } __attribute__((no_stack_protector)) void Task::OnInterruptReceived(void *Frame) @@ -353,7 +355,8 @@ namespace Tasking CPUData->CurrentThread->ExitCode = Code; debug("parent:%s tid:%d, code:%016p", CPUData->CurrentProcess->Name, CPUData->CurrentThread->ID, Code); trace("Exiting thread %d(%s)...", CPUData->CurrentThread->ID, CPUData->CurrentThread->Name); - CPU::Stop(); + OneShot(CPUData->CurrentThread->Info.Priority); + CPU::Halt(true); } PCB *Task::GetCurrentProcess()