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.h | |
| 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.h')
| -rw-r--r-- | src/core/hle/kernel/physical_core.h | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/src/core/hle/kernel/physical_core.h b/src/core/hle/kernel/physical_core.h new file mode 100644 index 000000000..fbef0801f --- /dev/null +++ b/src/core/hle/kernel/physical_core.h @@ -0,0 +1,74 @@ +// Copyright 2020 yuzu Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#pragma once + +#include <cstddef> +#include <memory> + +namespace Kernel { +class Scheduler; +} // namespace Kernel + +namespace Core { +class ARM_Interface; +class ExclusiveMonitor; +class System; +} // namespace Core + +namespace Kernel { + +class PhysicalCore { +public: + PhysicalCore(Core::System& system, KernelCore& kernel, std::size_t id, + Core::ExclusiveMonitor& exclusive_monitor); + + ~PhysicalCore(); + + /// Execute current jit state + void Run(); + /// Execute a single instruction in current jit. + void Step(); + /// Stop JIT execution/exit + void Stop(); + + // Shutdown this physical core. + void Shutdown(); + + Core::ARM_Interface& ArmInterface() { + return *arm_interface; + } + + const Core::ARM_Interface& ArmInterface() const { + return *arm_interface; + } + + bool IsMainCore() const { + return core_index == 0; + } + + bool IsSystemCore() const { + return core_index == 3; + } + + std::size_t CoreIndex() const { + return core_index; + } + + Kernel::Scheduler& Scheduler() { + return *scheduler; + } + + const Kernel::Scheduler& Scheduler() const { + return *scheduler; + } + +private: + std::size_t core_index; + KernelCore& kernel; + std::shared_ptr<Core::ARM_Interface> arm_interface; + std::shared_ptr<Kernel::Scheduler> scheduler; +}; + +} // namespace Kernel |
