From 0624c880bd5af45ae9095465e079fa55458515f6 Mon Sep 17 00:00:00 2001 From: Liam Date: Sun, 26 Jun 2022 18:52:16 -0400 Subject: kernel: use KScheduler from mesosphere --- src/core/cpu_manager.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/core/cpu_manager.h') diff --git a/src/core/cpu_manager.h b/src/core/cpu_manager.h index 76dc58ee1..8143424af 100644 --- a/src/core/cpu_manager.h +++ b/src/core/cpu_manager.h @@ -5,6 +5,7 @@ #include #include +#include #include #include #include @@ -47,10 +48,14 @@ public: gpu_barrier->Sync(); } + void WaitForAndHandleInterrupt(); void Initialize(); void Shutdown(); - std::function GetGuestThreadStartFunc() { + std::function GetGuestActivateFunc() { + return [this] { GuestActivateFunction(); }; + } + std::function GetGuestThreadFunc() { return [this] { GuestThreadFunction(); }; } std::function GetIdleThreadStartFunc() { @@ -67,21 +72,22 @@ public: } private: + void GuestActivateFunction(); void GuestThreadFunction(); - void GuestRewindFunction(); void IdleThreadFunction(); void ShutdownThreadFunction(); + void MultiCoreGuestActivate(); void MultiCoreRunGuestThread(); void MultiCoreRunGuestLoop(); - void MultiCoreRunIdleThread(); + void SingleCoreGuestActivate(); void SingleCoreRunGuestThread(); void SingleCoreRunGuestLoop(); - void SingleCoreRunIdleThread(); static void ThreadStart(std::stop_token stop_token, CpuManager& cpu_manager, std::size_t core); + void HandleInterrupt(); void ShutdownThread(); void RunThread(std::size_t core); -- cgit v1.2.3 From 21945ae127480c8332c1110ceada2df4a42a5848 Mon Sep 17 00:00:00 2001 From: Liam Date: Tue, 5 Jul 2022 23:27:25 -0400 Subject: kernel: fix issues with single core mode --- src/core/cpu_manager.h | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/core/cpu_manager.h') diff --git a/src/core/cpu_manager.h b/src/core/cpu_manager.h index 8143424af..835505b92 100644 --- a/src/core/cpu_manager.h +++ b/src/core/cpu_manager.h @@ -48,12 +48,11 @@ public: gpu_barrier->Sync(); } - void WaitForAndHandleInterrupt(); void Initialize(); void Shutdown(); std::function GetGuestActivateFunc() { - return [this] { GuestActivateFunction(); }; + return [this] { GuestActivate(); }; } std::function GetGuestThreadFunc() { return [this] { GuestThreadFunction(); }; @@ -72,21 +71,19 @@ public: } private: - void GuestActivateFunction(); void GuestThreadFunction(); void IdleThreadFunction(); void ShutdownThreadFunction(); - void MultiCoreGuestActivate(); void MultiCoreRunGuestThread(); - void MultiCoreRunGuestLoop(); + void MultiCoreRunIdleThread(); - void SingleCoreGuestActivate(); void SingleCoreRunGuestThread(); - void SingleCoreRunGuestLoop(); + void SingleCoreRunIdleThread(); static void ThreadStart(std::stop_token stop_token, CpuManager& cpu_manager, std::size_t core); + void GuestActivate(); void HandleInterrupt(); void ShutdownThread(); void RunThread(std::size_t core); -- cgit v1.2.3 From da07e13e0798a4ebd423595830f04e2234a03942 Mon Sep 17 00:00:00 2001 From: Liam Date: Thu, 7 Jul 2022 12:34:46 -0400 Subject: kernel: fix single-core preemption points --- src/core/cpu_manager.h | 1 - 1 file changed, 1 deletion(-) (limited to 'src/core/cpu_manager.h') diff --git a/src/core/cpu_manager.h b/src/core/cpu_manager.h index 835505b92..95ea3ef39 100644 --- a/src/core/cpu_manager.h +++ b/src/core/cpu_manager.h @@ -5,7 +5,6 @@ #include #include -#include #include #include #include -- cgit v1.2.3