Browse Source
Core: Refactor CpuCoreManager to CpuManager and Cpu to Core Manager.
Core: Refactor CpuCoreManager to CpuManager and Cpu to Core Manager.
This commit instends on better naming the new purpose of this classes.nce_cpp
15 changed files with 115 additions and 128 deletions
-
8src/core/CMakeLists.txt
-
2src/core/arm/dynarmic/arm_dynarmic.cpp
-
44src/core/core.cpp
-
10src/core/core.h
-
14src/core/core_manager.cpp
-
6src/core/core_manager.h
-
52src/core/cpu_core_manager.h
-
45src/core/cpu_manager.cpp
-
52src/core/cpu_manager.h
-
2src/core/gdbstub/gdbstub.cpp
-
1src/core/hle/kernel/address_arbiter.cpp
-
1src/core/hle/kernel/scheduler.cpp
-
2src/core/hle/kernel/svc.cpp
-
3src/core/hle/kernel/thread.cpp
-
1src/core/hle/kernel/wait_object.cpp
@ -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 <array> |
|||
#include <map> |
|||
#include <memory> |
|||
#include <thread> |
|||
|
|||
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<std::unique_ptr<Cpu>, NUM_CPU_CORES> cores; |
|||
std::size_t active_core{}; ///< Active core, only used in single thread mode |
|||
|
|||
System& system; |
|||
}; |
|||
|
|||
} // namespace Core |
|||
@ -0,0 +1,52 @@ |
|||
// Copyright 2018 yuzu emulator team |
|||
// Licensed under GPLv2 or any later version |
|||
// Refer to the license.txt file included. |
|||
|
|||
#pragma once |
|||
|
|||
#include <array> |
|||
#include <map> |
|||
#include <memory> |
|||
#include <thread> |
|||
|
|||
namespace Core { |
|||
|
|||
class CoreManager; |
|||
class System; |
|||
|
|||
class CpuManager { |
|||
public: |
|||
explicit CpuManager(System& system); |
|||
CpuManager(const CpuManager&) = delete; |
|||
CpuManager(CpuManager&&) = delete; |
|||
|
|||
~CpuManager(); |
|||
|
|||
CpuManager& operator=(const CpuManager&) = delete; |
|||
CpuManager& operator=(CpuManager&&) = delete; |
|||
|
|||
void Initialize(); |
|||
void Shutdown(); |
|||
|
|||
CoreManager& GetCoreManager(std::size_t index); |
|||
const CoreManager& GetCoreManager(std::size_t index) const; |
|||
|
|||
CoreManager& GetCurrentCoreManager(); |
|||
const CoreManager& GetCurrentCoreManager() const; |
|||
|
|||
std::size_t GetActiveCoreIndex() const { |
|||
return active_core; |
|||
} |
|||
|
|||
void RunLoop(bool tight_loop); |
|||
|
|||
private: |
|||
static constexpr std::size_t NUM_CPU_CORES = 4; |
|||
|
|||
std::array<std::unique_ptr<CoreManager>, NUM_CPU_CORES> core_managers; |
|||
std::size_t active_core{}; ///< Active core, only used in single thread mode |
|||
|
|||
System& system; |
|||
}; |
|||
|
|||
} // namespace Core |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue