diff options
| author | Mai M <mathew1800@gmail.com> | 2022-01-14 00:41:17 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-14 00:41:17 -0500 |
| commit | 07e477f891c015b76cadb4421feabd78852a715b (patch) | |
| tree | 35dbd81c5bcce0c85132531e9e21fd874b07e297 /src/core/hle/kernel/physical_core.cpp | |
| parent | f1aa7ff893208b4c5c328d1a77c4028ecba94bf4 (diff) | |
| parent | 49a0e4330ee37bdfa503918f841ab9599ccc1c24 (diff) | |
Merge pull request #7698 from bunnei/mem-code-memory-updates
Kernel Memory Updates (Part 2): SetProcessMemoryPermission, update permissions, and other minor changes.
Diffstat (limited to 'src/core/hle/kernel/physical_core.cpp')
| -rw-r--r-- | src/core/hle/kernel/physical_core.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/core/hle/kernel/physical_core.cpp b/src/core/hle/kernel/physical_core.cpp index 7f02d9471..7477668e4 100644 --- a/src/core/hle/kernel/physical_core.cpp +++ b/src/core/hle/kernel/physical_core.cpp @@ -16,17 +16,25 @@ namespace Kernel { PhysicalCore::PhysicalCore(std::size_t core_index_, Core::System& system_, KScheduler& scheduler_, Core::CPUInterrupts& interrupts_) : core_index{core_index_}, system{system_}, scheduler{scheduler_}, - interrupts{interrupts_}, guard{std::make_unique<Common::SpinLock>()} {} + interrupts{interrupts_}, guard{std::make_unique<Common::SpinLock>()} { +#ifdef ARCHITECTURE_x86_64 + // TODO(bunnei): Initialization relies on a core being available. We may later replace this with + // a 32-bit instance of Dynarmic. This should be abstracted out to a CPU manager. + auto& kernel = system.Kernel(); + arm_interface = std::make_unique<Core::ARM_Dynarmic_64>( + system, interrupts, kernel.IsMulticore(), kernel.GetExclusiveMonitor(), core_index); +#else +#error Platform not supported yet. +#endif +} PhysicalCore::~PhysicalCore() = default; void PhysicalCore::Initialize([[maybe_unused]] bool is_64_bit) { #ifdef ARCHITECTURE_x86_64 auto& kernel = system.Kernel(); - if (is_64_bit) { - arm_interface = std::make_unique<Core::ARM_Dynarmic_64>( - system, interrupts, kernel.IsMulticore(), kernel.GetExclusiveMonitor(), core_index); - } else { + if (!is_64_bit) { + // We already initialized a 64-bit core, replace with a 32-bit one. arm_interface = std::make_unique<Core::ARM_Dynarmic_32>( system, interrupts, kernel.IsMulticore(), kernel.GetExclusiveMonitor(), core_index); } |
