From 73df144e5d1efd74dc5f81ae69802c58ee75a9a9 Mon Sep 17 00:00:00 2001 From: Remco van Homelen Date: Sun, 8 Nov 2020 19:19:15 +0100 Subject: [PATCH] Optimalization - Better for speed, not for power usage --- kernel/src/kernel.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/kernel/src/kernel.cpp b/kernel/src/kernel.cpp index adf31a5..db4939c 100644 --- a/kernel/src/kernel.cpp +++ b/kernel/src/kernel.cpp @@ -49,9 +49,9 @@ void IdleThread() prevTicks = System::pit->Ticks(); } - //Handle power state requests from userspace - //Processes can not do this themself because the first mb of memory is not mapped for them - //And that should not be the case due to security issues :) + // Handle power state requests from userspace + // Processes can not do this themself because the first mb of memory is not mapped for them + // And that should not be the case due to security issues :) if(powerRequestState == Reboot) { Power::Reboot(); } @@ -59,8 +59,8 @@ void IdleThread() Power::Poweroff(); } - //Wait for interrupt to perform next operation - asm volatile("hlt"); + // Move onto other threads since there is nothing else to do here + System::scheduler->ForceSwitch(); } }