From 4d6a86b03fe6ae0d98838a21613b66d5196150af Mon Sep 17 00:00:00 2001 From: Fernando Sahmkow Date: Sat, 25 Jan 2020 18:55:32 -0400 Subject: Core: Refactor CPU Management. This commit moves ARM Interface and Scheduler handling into the kernel. --- src/core/cpu_core_manager.h | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'src/core/cpu_core_manager.h') diff --git a/src/core/cpu_core_manager.h b/src/core/cpu_core_manager.h index 2cbbf8216..2a7f84d5c 100644 --- a/src/core/cpu_core_manager.h +++ b/src/core/cpu_core_manager.h @@ -12,8 +12,6 @@ namespace Core { class Cpu; -class CpuBarrier; -class ExclusiveMonitor; class System; class CpuCoreManager { @@ -28,7 +26,6 @@ public: CpuCoreManager& operator=(CpuCoreManager&&) = delete; void Initialize(); - void StartThreads(); void Shutdown(); Cpu& GetCore(std::size_t index); @@ -37,25 +34,18 @@ public: Cpu& GetCurrentCore(); const Cpu& GetCurrentCore() const; - ExclusiveMonitor& GetExclusiveMonitor(); - const ExclusiveMonitor& GetExclusiveMonitor() const; + std::size_t GetCurrentCoreIndex() const { + return active_core; + } void RunLoop(bool tight_loop); - void InvalidateAllInstructionCaches(); - private: static constexpr std::size_t NUM_CPU_CORES = 4; - std::unique_ptr exclusive_monitor; - std::unique_ptr barrier; std::array, NUM_CPU_CORES> cores; - std::array, NUM_CPU_CORES - 1> core_threads; std::size_t active_core{}; ///< Active core, only used in single thread mode - /// Map of guest threads to CPU cores - std::map thread_to_cpu; - System& system; }; -- cgit v1.2.3 From e4a1ead897575ee9222b4fc1021aaa9cc58f12c8 Mon Sep 17 00:00:00 2001 From: Fernando Sahmkow Date: Sun, 26 Jan 2020 14:07:22 -0400 Subject: Core: Refactor CpuCoreManager to CpuManager and Cpu to Core Manager. This commit instends on better naming the new purpose of this classes. --- src/core/cpu_core_manager.h | 52 --------------------------------------------- 1 file changed, 52 deletions(-) delete mode 100644 src/core/cpu_core_manager.h (limited to 'src/core/cpu_core_manager.h') diff --git a/src/core/cpu_core_manager.h b/src/core/cpu_core_manager.h deleted file mode 100644 index 2a7f84d5c..000000000 --- a/src/core/cpu_core_manager.h +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2018 yuzu emulator team -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#pragma once - -#include -#include -#include -#include - -namespace Core { - -class Cpu; -class System; - -class CpuCoreManager { -public: - explicit CpuCoreManager(System& system); - CpuCoreManager(const CpuCoreManager&) = delete; - CpuCoreManager(CpuCoreManager&&) = delete; - - ~CpuCoreManager(); - - CpuCoreManager& operator=(const CpuCoreManager&) = delete; - CpuCoreManager& operator=(CpuCoreManager&&) = delete; - - void Initialize(); - void Shutdown(); - - Cpu& GetCore(std::size_t index); - const Cpu& GetCore(std::size_t index) const; - - Cpu& GetCurrentCore(); - const Cpu& GetCurrentCore() const; - - std::size_t GetCurrentCoreIndex() const { - return active_core; - } - - void RunLoop(bool tight_loop); - -private: - static constexpr std::size_t NUM_CPU_CORES = 4; - - std::array, NUM_CPU_CORES> cores; - std::size_t active_core{}; ///< Active core, only used in single thread mode - - System& system; -}; - -} // namespace Core -- cgit v1.2.3