diff options
| author | bunnei <bunneidev@gmail.com> | 2020-01-30 18:13:59 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-01-30 18:13:59 -0500 |
| commit | 985d0f35e55f0752c6e147d0140b367708499cb4 (patch) | |
| tree | 119249aee3acc2cc2ee6a5d391288b52c126765b /src/core/hle/kernel/physical_core.cpp | |
| parent | 8a7cdfc3ff1956f7895bec1c60cfe1a0abc21b12 (diff) | |
| parent | 2d1984c20c75e03ec79eeb3806b12efa1679b977 (diff) | |
Merge pull request #3353 from FernandoS27/aries
System: Refactor CPU Core management and move ARMInterface and Schedulers to Kernel
Diffstat (limited to 'src/core/hle/kernel/physical_core.cpp')
| -rw-r--r-- | src/core/hle/kernel/physical_core.cpp | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/core/hle/kernel/physical_core.cpp b/src/core/hle/kernel/physical_core.cpp new file mode 100644 index 000000000..896a1a87a --- /dev/null +++ b/src/core/hle/kernel/physical_core.cpp @@ -0,0 +1,52 @@ +// Copyright 2020 yuzu Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#include "common/logging/log.h" +#include "core/arm/arm_interface.h" +#ifdef ARCHITECTURE_x86_64 +#include "core/arm/dynarmic/arm_dynarmic.h" +#endif +#include "core/arm/exclusive_monitor.h" +#include "core/arm/unicorn/arm_unicorn.h" +#include "core/core.h" +#include "core/hle/kernel/kernel.h" +#include "core/hle/kernel/physical_core.h" +#include "core/hle/kernel/scheduler.h" +#include "core/hle/kernel/thread.h" + +namespace Kernel { + +PhysicalCore::PhysicalCore(Core::System& system, KernelCore& kernel, std::size_t id, + Core::ExclusiveMonitor& exclusive_monitor) + : core_index{id}, kernel{kernel} { +#ifdef ARCHITECTURE_x86_64 + arm_interface = std::make_shared<Core::ARM_Dynarmic>(system, exclusive_monitor, core_index); +#else + arm_interface = std::make_shared<Core::ARM_Unicorn>(system); + LOG_WARNING(Core, "CPU JIT requested, but Dynarmic not available"); +#endif + + scheduler = std::make_shared<Kernel::Scheduler>(system, *arm_interface, core_index); +} + +PhysicalCore::~PhysicalCore() = default; + +void PhysicalCore::Run() { + arm_interface->Run(); + arm_interface->ClearExclusiveState(); +} + +void PhysicalCore::Step() { + arm_interface->Step(); +} + +void PhysicalCore::Stop() { + arm_interface->PrepareReschedule(); +} + +void PhysicalCore::Shutdown() { + scheduler->Shutdown(); +} + +} // namespace Kernel |
