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 | 0872f9ff8963e81a78f60891e83406e2dee82166 (patch) | |
| tree | 35dbd81c5bcce0c85132531e9e21fd874b07e297 /src/core/hle/kernel/physical_core.cpp | |
| parent | a9c52fed601468394f85c2a903c9567f87b9d173 (diff) | |
| parent | d45b65b4d9578c9eed0aca541f76b046f79ffe07 (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 7f02d9471d..7477668e42 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); } |
