diff options
| author | 2020-02-29 13:58:50 -0400 | |
|---|---|---|
| committer | 2020-06-27 11:35:56 -0400 | |
| commit | 1b82ccec2220a69711ba75cf51ee98cbcfe6a510 (patch) | |
| tree | 281ad19080ec4e6e14caa50b073acdfac005212b /src/core | |
| parent | X64 Clock: Reduce accuracy to be less or equal to guest accuracy. (diff) | |
| download | yuzu-1b82ccec2220a69711ba75cf51ee98cbcfe6a510.tar.gz yuzu-1b82ccec2220a69711ba75cf51ee98cbcfe6a510.tar.xz yuzu-1b82ccec2220a69711ba75cf51ee98cbcfe6a510.zip | |
Core: Refactor ARM Interface.
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/arm/arm_interface.h | 9 | ||||
| -rw-r--r-- | src/core/arm/dynarmic/arm_dynarmic_32.cpp | 6 | ||||
| -rw-r--r-- | src/core/arm/dynarmic/arm_dynarmic_32.h | 2 | ||||
| -rw-r--r-- | src/core/arm/dynarmic/arm_dynarmic_64.cpp | 13 | ||||
| -rw-r--r-- | src/core/arm/dynarmic/arm_dynarmic_64.h | 2 | ||||
| -rw-r--r-- | src/core/arm/unicorn/arm_unicorn.cpp | 7 | ||||
| -rw-r--r-- | src/core/arm/unicorn/arm_unicorn.h | 5 | ||||
| -rw-r--r-- | src/core/hle/kernel/kernel.cpp | 28 | ||||
| -rw-r--r-- | src/core/hle/kernel/physical_core.cpp | 25 | ||||
| -rw-r--r-- | src/core/hle/kernel/physical_core.h | 14 |
10 files changed, 69 insertions, 42 deletions
diff --git a/src/core/arm/arm_interface.h b/src/core/arm/arm_interface.h index e701ddf21..dc9b2ff7b 100644 --- a/src/core/arm/arm_interface.h +++ b/src/core/arm/arm_interface.h | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | #include <array> | 7 | #include <array> |
| 8 | #include <vector> | 8 | #include <vector> |
| 9 | #include "common/common_types.h" | 9 | #include "common/common_types.h" |
| 10 | #include "core/hardware_properties.h" | ||
| 10 | 11 | ||
| 11 | namespace Common { | 12 | namespace Common { |
| 12 | struct PageTable; | 13 | struct PageTable; |
| @@ -20,11 +21,13 @@ namespace Core { | |||
| 20 | class System; | 21 | class System; |
| 21 | class CPUInterruptHandler; | 22 | class CPUInterruptHandler; |
| 22 | 23 | ||
| 24 | using CPUInterrupts = std::array<CPUInterruptHandler, Core::Hardware::NUM_CPU_CORES>; | ||
| 25 | |||
| 23 | /// Generic ARMv8 CPU interface | 26 | /// Generic ARMv8 CPU interface |
| 24 | class ARM_Interface : NonCopyable { | 27 | class ARM_Interface : NonCopyable { |
| 25 | public: | 28 | public: |
| 26 | explicit ARM_Interface(System& system_, CPUInterruptHandler& interrupt_handler) | 29 | explicit ARM_Interface(System& system_, CPUInterrupts& interrupt_handlers) |
| 27 | : system{system_}, interrupt_handler{interrupt_handler} {} | 30 | : system{system_}, interrupt_handlers{interrupt_handlers} {} |
| 28 | virtual ~ARM_Interface() = default; | 31 | virtual ~ARM_Interface() = default; |
| 29 | 32 | ||
| 30 | struct ThreadContext32 { | 33 | struct ThreadContext32 { |
| @@ -180,7 +183,7 @@ public: | |||
| 180 | protected: | 183 | protected: |
| 181 | /// System context that this ARM interface is running under. | 184 | /// System context that this ARM interface is running under. |
| 182 | System& system; | 185 | System& system; |
| 183 | CPUInterruptHandler& interrupt_handler; | 186 | CPUInterrupts& interrupt_handlers; |
| 184 | }; | 187 | }; |
| 185 | 188 | ||
| 186 | } // namespace Core | 189 | } // namespace Core |
diff --git a/src/core/arm/dynarmic/arm_dynarmic_32.cpp b/src/core/arm/dynarmic/arm_dynarmic_32.cpp index c8a1ce6e7..f36c5f401 100644 --- a/src/core/arm/dynarmic/arm_dynarmic_32.cpp +++ b/src/core/arm/dynarmic/arm_dynarmic_32.cpp | |||
| @@ -76,7 +76,7 @@ public: | |||
| 76 | } | 76 | } |
| 77 | 77 | ||
| 78 | u64 GetTicksRemaining() override { | 78 | u64 GetTicksRemaining() override { |
| 79 | if (!parent.interrupt_handler.IsInterrupted()) { | 79 | if (!parent.interrupt_handlers[parent.core_index].IsInterrupted()) { |
| 80 | return std::max<s64>(ticks, 0); | 80 | return std::max<s64>(ticks, 0); |
| 81 | } | 81 | } |
| 82 | return 0ULL; | 82 | return 0ULL; |
| @@ -111,9 +111,9 @@ void ARM_Dynarmic_32::Step() { | |||
| 111 | jit->Step(); | 111 | jit->Step(); |
| 112 | } | 112 | } |
| 113 | 113 | ||
| 114 | ARM_Dynarmic_32::ARM_Dynarmic_32(System& system, CPUInterruptHandler& interrupt_handler, | 114 | ARM_Dynarmic_32::ARM_Dynarmic_32(System& system, CPUInterrupts& interrupt_handlers, |
| 115 | ExclusiveMonitor& exclusive_monitor, std::size_t core_index) | 115 | ExclusiveMonitor& exclusive_monitor, std::size_t core_index) |
| 116 | : ARM_Interface{system, interrupt_handler}, cb(std::make_unique<DynarmicCallbacks32>(*this)), | 116 | : ARM_Interface{system, interrupt_handlers}, cb(std::make_unique<DynarmicCallbacks32>(*this)), |
| 117 | cp15(std::make_shared<DynarmicCP15>(*this)), core_index{core_index}, | 117 | cp15(std::make_shared<DynarmicCP15>(*this)), core_index{core_index}, |
| 118 | exclusive_monitor{dynamic_cast<DynarmicExclusiveMonitor&>(exclusive_monitor)} {} | 118 | exclusive_monitor{dynamic_cast<DynarmicExclusiveMonitor&>(exclusive_monitor)} {} |
| 119 | 119 | ||
diff --git a/src/core/arm/dynarmic/arm_dynarmic_32.h b/src/core/arm/dynarmic/arm_dynarmic_32.h index 1e7e17e64..2dd9a4df0 100644 --- a/src/core/arm/dynarmic/arm_dynarmic_32.h +++ b/src/core/arm/dynarmic/arm_dynarmic_32.h | |||
| @@ -29,7 +29,7 @@ class System; | |||
| 29 | 29 | ||
| 30 | class ARM_Dynarmic_32 final : public ARM_Interface { | 30 | class ARM_Dynarmic_32 final : public ARM_Interface { |
| 31 | public: | 31 | public: |
| 32 | ARM_Dynarmic_32(System& system, CPUInterruptHandler& interrupt_handler, | 32 | ARM_Dynarmic_32(System& system, CPUInterrupts& interrupt_handlers, |
| 33 | ExclusiveMonitor& exclusive_monitor, std::size_t core_index); | 33 | ExclusiveMonitor& exclusive_monitor, std::size_t core_index); |
| 34 | ~ARM_Dynarmic_32() override; | 34 | ~ARM_Dynarmic_32() override; |
| 35 | 35 | ||
diff --git a/src/core/arm/dynarmic/arm_dynarmic_64.cpp b/src/core/arm/dynarmic/arm_dynarmic_64.cpp index 3f18dede2..8401ba631 100644 --- a/src/core/arm/dynarmic/arm_dynarmic_64.cpp +++ b/src/core/arm/dynarmic/arm_dynarmic_64.cpp | |||
| @@ -128,7 +128,7 @@ public: | |||
| 128 | } | 128 | } |
| 129 | 129 | ||
| 130 | u64 GetTicksRemaining() override { | 130 | u64 GetTicksRemaining() override { |
| 131 | if (!parent.interrupt_handler.IsInterrupted()) { | 131 | if (!parent.interrupt_handlers[parent.core_index].IsInterrupted()) { |
| 132 | return std::max<s64>(ticks, 0); | 132 | return std::max<s64>(ticks, 0); |
| 133 | } | 133 | } |
| 134 | return 0ULL; | 134 | return 0ULL; |
| @@ -199,11 +199,14 @@ void ARM_Dynarmic_64::Step() { | |||
| 199 | cb->InterpreterFallback(jit->GetPC(), 1); | 199 | cb->InterpreterFallback(jit->GetPC(), 1); |
| 200 | } | 200 | } |
| 201 | 201 | ||
| 202 | ARM_Dynarmic_64::ARM_Dynarmic_64(System& system, CPUInterruptHandler& interrupt_handler, | 202 | ARM_Dynarmic_64::ARM_Dynarmic_64(System& system, CPUInterrupts& interrupt_handlers, |
| 203 | ExclusiveMonitor& exclusive_monitor, std::size_t core_index) | 203 | ExclusiveMonitor& exclusive_monitor, std::size_t core_index) |
| 204 | : ARM_Interface{system, interrupt_handler}, cb(std::make_unique<DynarmicCallbacks64>(*this)), | 204 | : ARM_Interface{system, interrupt_handler}, |
| 205 | inner_unicorn{system, interrupt_handler, ARM_Unicorn::Arch::AArch64}, core_index{core_index}, | 205 | cb(std::make_unique<DynarmicCallbacks64>(*this)), inner_unicorn{system, interrupt_handler, |
| 206 | exclusive_monitor{dynamic_cast<DynarmicExclusiveMonitor&>(exclusive_monitor)} {} | 206 | ARM_Unicorn::Arch::AArch64, |
| 207 | core_index}, | ||
| 208 | core_index{core_index}, exclusive_monitor{ | ||
| 209 | dynamic_cast<DynarmicExclusiveMonitor&>(exclusive_monitor)} {} | ||
| 207 | 210 | ||
| 208 | ARM_Dynarmic_64::~ARM_Dynarmic_64() = default; | 211 | ARM_Dynarmic_64::~ARM_Dynarmic_64() = default; |
| 209 | 212 | ||
diff --git a/src/core/arm/dynarmic/arm_dynarmic_64.h b/src/core/arm/dynarmic/arm_dynarmic_64.h index 5560578ad..1c6791d4e 100644 --- a/src/core/arm/dynarmic/arm_dynarmic_64.h +++ b/src/core/arm/dynarmic/arm_dynarmic_64.h | |||
| @@ -28,7 +28,7 @@ class System; | |||
| 28 | 28 | ||
| 29 | class ARM_Dynarmic_64 final : public ARM_Interface { | 29 | class ARM_Dynarmic_64 final : public ARM_Interface { |
| 30 | public: | 30 | public: |
| 31 | ARM_Dynarmic_64(System& system, CPUInterruptHandler& interrupt_handler, | 31 | ARM_Dynarmic_64(System& system, CPUInterrupts& interrupt_handlers, |
| 32 | ExclusiveMonitor& exclusive_monitor, std::size_t core_index); | 32 | ExclusiveMonitor& exclusive_monitor, std::size_t core_index); |
| 33 | ~ARM_Dynarmic_64() override; | 33 | ~ARM_Dynarmic_64() override; |
| 34 | 34 | ||
diff --git a/src/core/arm/unicorn/arm_unicorn.cpp b/src/core/arm/unicorn/arm_unicorn.cpp index 0393fe641..d81d1b5b0 100644 --- a/src/core/arm/unicorn/arm_unicorn.cpp +++ b/src/core/arm/unicorn/arm_unicorn.cpp | |||
| @@ -63,8 +63,9 @@ static bool UnmappedMemoryHook(uc_engine* uc, uc_mem_type type, u64 addr, int si | |||
| 63 | return false; | 63 | return false; |
| 64 | } | 64 | } |
| 65 | 65 | ||
| 66 | ARM_Unicorn::ARM_Unicorn(System& system, CPUInterruptHandler& interrupt_handler, Arch architecture) | 66 | ARM_Unicorn::ARM_Unicorn(System& system, CPUInterruptHandler& interrupt_handler, Arch architecture, |
| 67 | : ARM_Interface{system, interrupt_handler} { | 67 | std::size_t core_index) |
| 68 | : ARM_Interface{system, interrupt_handler}, core_index{core_index} { | ||
| 68 | const auto arch = architecture == Arch::AArch32 ? UC_ARCH_ARM : UC_ARCH_ARM64; | 69 | const auto arch = architecture == Arch::AArch32 ? UC_ARCH_ARM : UC_ARCH_ARM64; |
| 69 | CHECKED(uc_open(arch, UC_MODE_ARM, &uc)); | 70 | CHECKED(uc_open(arch, UC_MODE_ARM, &uc)); |
| 70 | 71 | ||
| @@ -163,7 +164,7 @@ void ARM_Unicorn::Run() { | |||
| 163 | ExecuteInstructions(std::max(4000000U, 0U)); | 164 | ExecuteInstructions(std::max(4000000U, 0U)); |
| 164 | } else { | 165 | } else { |
| 165 | while (true) { | 166 | while (true) { |
| 166 | if (interrupt_handler.IsInterrupted()) { | 167 | if (interrupt_handlers[core_index].IsInterrupted()) { |
| 167 | return; | 168 | return; |
| 168 | } | 169 | } |
| 169 | ExecuteInstructions(10); | 170 | ExecuteInstructions(10); |
diff --git a/src/core/arm/unicorn/arm_unicorn.h b/src/core/arm/unicorn/arm_unicorn.h index 0a4c087cd..e3da368de 100644 --- a/src/core/arm/unicorn/arm_unicorn.h +++ b/src/core/arm/unicorn/arm_unicorn.h | |||
| @@ -11,7 +11,6 @@ | |||
| 11 | 11 | ||
| 12 | namespace Core { | 12 | namespace Core { |
| 13 | 13 | ||
| 14 | class CPUInterruptHandler; | ||
| 15 | class System; | 14 | class System; |
| 16 | 15 | ||
| 17 | class ARM_Unicorn final : public ARM_Interface { | 16 | class ARM_Unicorn final : public ARM_Interface { |
| @@ -21,7 +20,8 @@ public: | |||
| 21 | AArch64, // 64-bit ARM | 20 | AArch64, // 64-bit ARM |
| 22 | }; | 21 | }; |
| 23 | 22 | ||
| 24 | explicit ARM_Unicorn(System& system, CPUInterruptHandler& interrupt_handler, Arch architecture); | 23 | explicit ARM_Unicorn(System& system, CPUInterruptHandler& interrupt_handler, Arch architecture, |
| 24 | std::size_t core_index); | ||
| 25 | ~ARM_Unicorn() override; | 25 | ~ARM_Unicorn() override; |
| 26 | 26 | ||
| 27 | void SetPC(u64 pc) override; | 27 | void SetPC(u64 pc) override; |
| @@ -56,6 +56,7 @@ private: | |||
| 56 | uc_engine* uc{}; | 56 | uc_engine* uc{}; |
| 57 | GDBStub::BreakpointAddress last_bkpt{}; | 57 | GDBStub::BreakpointAddress last_bkpt{}; |
| 58 | bool last_bkpt_hit = false; | 58 | bool last_bkpt_hit = false; |
| 59 | std::size_t core_index; | ||
| 59 | }; | 60 | }; |
| 60 | 61 | ||
| 61 | } // namespace Core | 62 | } // namespace Core |
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp index a19cd7a1f..e33ef5323 100644 --- a/src/core/hle/kernel/kernel.cpp +++ b/src/core/hle/kernel/kernel.cpp | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <array> | ||
| 5 | #include <atomic> | 6 | #include <atomic> |
| 6 | #include <bitset> | 7 | #include <bitset> |
| 7 | #include <functional> | 8 | #include <functional> |
| @@ -16,7 +17,9 @@ | |||
| 16 | #include "common/microprofile.h" | 17 | #include "common/microprofile.h" |
| 17 | #include "common/thread.h" | 18 | #include "common/thread.h" |
| 18 | #include "core/arm/arm_interface.h" | 19 | #include "core/arm/arm_interface.h" |
| 20 | #include "core/arm/cpu_interrupt_handler.h" | ||
| 19 | #include "core/arm/exclusive_monitor.h" | 21 | #include "core/arm/exclusive_monitor.h" |
| 22 | #include "core/arm/unicorn/arm_unicorn.h" | ||
| 20 | #include "core/core.h" | 23 | #include "core/core.h" |
| 21 | #include "core/core_timing.h" | 24 | #include "core/core_timing.h" |
| 22 | #include "core/core_timing_util.h" | 25 | #include "core/core_timing_util.h" |
| @@ -42,6 +45,11 @@ | |||
| 42 | #include "core/hle/result.h" | 45 | #include "core/hle/result.h" |
| 43 | #include "core/memory.h" | 46 | #include "core/memory.h" |
| 44 | 47 | ||
| 48 | #ifdef ARCHITECTURE_x86_64 | ||
| 49 | #include "core/arm/dynarmic/arm_dynarmic_32.h" | ||
| 50 | #include "core/arm/dynarmic/arm_dynarmic_64.h" | ||
| 51 | #endif | ||
| 52 | |||
| 45 | MICROPROFILE_DEFINE(Kernel_SVC, "Kernel", "SVC", MP_RGB(70, 200, 70)); | 53 | MICROPROFILE_DEFINE(Kernel_SVC, "Kernel", "SVC", MP_RGB(70, 200, 70)); |
| 46 | 54 | ||
| 47 | namespace Kernel { | 55 | namespace Kernel { |
| @@ -178,7 +186,20 @@ struct KernelCore::Impl { | |||
| 178 | exclusive_monitor = | 186 | exclusive_monitor = |
| 179 | Core::MakeExclusiveMonitor(system.Memory(), Core::Hardware::NUM_CPU_CORES); | 187 | Core::MakeExclusiveMonitor(system.Memory(), Core::Hardware::NUM_CPU_CORES); |
| 180 | for (std::size_t i = 0; i < Core::Hardware::NUM_CPU_CORES; i++) { | 188 | for (std::size_t i = 0; i < Core::Hardware::NUM_CPU_CORES; i++) { |
| 181 | cores.emplace_back(system, i, *exclusive_monitor); | 189 | #ifdef ARCHITECTURE_x86_64 |
| 190 | arm_interfaces_32[i] = | ||
| 191 | std::make_unique<Core::ARM_Dynarmic_32>(system, interrupts, *exclusive_monitor, i); | ||
| 192 | arm_interfaces_64[i] = | ||
| 193 | std::make_unique<Core::ARM_Dynarmic_64>(system, interrupts, *exclusive_monitor, i); | ||
| 194 | #else | ||
| 195 | arm_interfaces_32[i] = std::make_shared<Core::ARM_Unicorn>( | ||
| 196 | system, interrupts, ARM_Unicorn::Arch::AArch32, i); | ||
| 197 | arm_interfaces_64[i] = std::make_shared<Core::ARM_Unicorn>( | ||
| 198 | system, interrupts, ARM_Unicorn::Arch::AArch64, i); | ||
| 199 | LOG_WARNING(Core, "CPU JIT requested, but Dynarmic not available"); | ||
| 200 | #endif | ||
| 201 | cores.emplace_back(system, i, *exclusive_monitor, interrupts[i], *arm_interfaces_32[i], | ||
| 202 | *arm_interfaces_64[i]); | ||
| 182 | } | 203 | } |
| 183 | } | 204 | } |
| 184 | 205 | ||
| @@ -407,6 +428,11 @@ struct KernelCore::Impl { | |||
| 407 | std::shared_ptr<Kernel::SharedMemory> time_shared_mem; | 428 | std::shared_ptr<Kernel::SharedMemory> time_shared_mem; |
| 408 | 429 | ||
| 409 | std::array<std::shared_ptr<Thread>, Core::Hardware::NUM_CPU_CORES> suspend_threads{}; | 430 | std::array<std::shared_ptr<Thread>, Core::Hardware::NUM_CPU_CORES> suspend_threads{}; |
| 431 | std::array<Core::CPUInterruptHandler, Core::Hardware::NUM_CPU_CORES> interrupts{}; | ||
| 432 | std::array<std::unique_ptr<Core::ARM_Interface>, Core::Hardware::NUM_CPU_CORES> | ||
| 433 | arm_interfaces_32{}; | ||
| 434 | std::array<std::unique_ptr<Core::ARM_Interface>, Core::Hardware::NUM_CPU_CORES> | ||
| 435 | arm_interfaces_64{}; | ||
| 410 | 436 | ||
| 411 | bool is_multicore{}; | 437 | bool is_multicore{}; |
| 412 | std::thread::id single_core_thread_id{}; | 438 | std::thread::id single_core_thread_id{}; |
diff --git a/src/core/hle/kernel/physical_core.cpp b/src/core/hle/kernel/physical_core.cpp index ff14fcb42..9146b331d 100644 --- a/src/core/hle/kernel/physical_core.cpp +++ b/src/core/hle/kernel/physical_core.cpp | |||
| @@ -21,21 +21,12 @@ | |||
| 21 | namespace Kernel { | 21 | namespace Kernel { |
| 22 | 22 | ||
| 23 | PhysicalCore::PhysicalCore(Core::System& system, std::size_t id, | 23 | PhysicalCore::PhysicalCore(Core::System& system, std::size_t id, |
| 24 | Core::ExclusiveMonitor& exclusive_monitor) | 24 | Core::ExclusiveMonitor& exclusive_monitor, |
| 25 | : interrupt_handler{}, core_index{id} { | 25 | Core::CPUInterruptHandler& interrupt_handler, |
| 26 | #ifdef ARCHITECTURE_x86_64 | 26 | Core::ARM_Interface& arm_interface32, |
| 27 | arm_interface_32 = std::make_unique<Core::ARM_Dynarmic_32>(system, interrupt_handler, | 27 | Core::ARM_Interface& arm_interface64) |
| 28 | exclusive_monitor, core_index); | 28 | : interrupt_handler{interrupt_handler}, core_index{id}, arm_interface_32{arm_interface32}, |
| 29 | arm_interface_64 = std::make_unique<Core::ARM_Dynarmic_64>(system, interrupt_handler, | 29 | arm_interface_64{arm_interface64} { |
| 30 | exclusive_monitor, core_index); | ||
| 31 | #else | ||
| 32 | using Core::ARM_Unicorn; | ||
| 33 | arm_interface_32 = | ||
| 34 | std::make_unique<ARM_Unicorn>(system, interrupt_handler, ARM_Unicorn::Arch::AArch32); | ||
| 35 | arm_interface_64 = | ||
| 36 | std::make_unique<ARM_Unicorn>(system, interrupt_handler, ARM_Unicorn::Arch::AArch64); | ||
| 37 | LOG_WARNING(Core, "CPU JIT requested, but Dynarmic not available"); | ||
| 38 | #endif | ||
| 39 | 30 | ||
| 40 | scheduler = std::make_unique<Kernel::Scheduler>(system, core_index); | 31 | scheduler = std::make_unique<Kernel::Scheduler>(system, core_index); |
| 41 | guard = std::make_unique<Common::SpinLock>(); | 32 | guard = std::make_unique<Common::SpinLock>(); |
| @@ -69,9 +60,9 @@ void PhysicalCore::Shutdown() { | |||
| 69 | 60 | ||
| 70 | void PhysicalCore::SetIs64Bit(bool is_64_bit) { | 61 | void PhysicalCore::SetIs64Bit(bool is_64_bit) { |
| 71 | if (is_64_bit) { | 62 | if (is_64_bit) { |
| 72 | arm_interface = arm_interface_64.get(); | 63 | arm_interface = &arm_interface_64; |
| 73 | } else { | 64 | } else { |
| 74 | arm_interface = arm_interface_32.get(); | 65 | arm_interface = &arm_interface_32; |
| 75 | } | 66 | } |
| 76 | } | 67 | } |
| 77 | 68 | ||
diff --git a/src/core/hle/kernel/physical_core.h b/src/core/hle/kernel/physical_core.h index cd2e42fc3..2673d90f2 100644 --- a/src/core/hle/kernel/physical_core.h +++ b/src/core/hle/kernel/physical_core.h | |||
| @@ -10,7 +10,7 @@ | |||
| 10 | #include "core/arm/cpu_interrupt_handler.h" | 10 | #include "core/arm/cpu_interrupt_handler.h" |
| 11 | 11 | ||
| 12 | namespace Common { | 12 | namespace Common { |
| 13 | class SpinLock; | 13 | class SpinLock; |
| 14 | } | 14 | } |
| 15 | 15 | ||
| 16 | namespace Kernel { | 16 | namespace Kernel { |
| @@ -27,7 +27,9 @@ namespace Kernel { | |||
| 27 | 27 | ||
| 28 | class PhysicalCore { | 28 | class PhysicalCore { |
| 29 | public: | 29 | public: |
| 30 | PhysicalCore(Core::System& system, std::size_t id, Core::ExclusiveMonitor& exclusive_monitor); | 30 | PhysicalCore(Core::System& system, std::size_t id, Core::ExclusiveMonitor& exclusive_monitor, |
| 31 | Core::CPUInterruptHandler& interrupt_handler, Core::ARM_Interface& arm_interface32, | ||
| 32 | Core::ARM_Interface& arm_interface64); | ||
| 31 | ~PhysicalCore(); | 33 | ~PhysicalCore(); |
| 32 | 34 | ||
| 33 | PhysicalCore(const PhysicalCore&) = delete; | 35 | PhysicalCore(const PhysicalCore&) = delete; |
| @@ -92,13 +94,13 @@ public: | |||
| 92 | void SetIs64Bit(bool is_64_bit); | 94 | void SetIs64Bit(bool is_64_bit); |
| 93 | 95 | ||
| 94 | private: | 96 | private: |
| 95 | Core::CPUInterruptHandler interrupt_handler; | 97 | Core::CPUInterruptHandler& interrupt_handler; |
| 96 | std::size_t core_index; | 98 | std::size_t core_index; |
| 97 | std::unique_ptr<Core::ARM_Interface> arm_interface_32; | 99 | Core::ARM_Interface& arm_interface_32; |
| 98 | std::unique_ptr<Core::ARM_Interface> arm_interface_64; | 100 | Core::ARM_Interface& arm_interface_64; |
| 99 | std::unique_ptr<Kernel::Scheduler> scheduler; | 101 | std::unique_ptr<Kernel::Scheduler> scheduler; |
| 100 | Core::ARM_Interface* arm_interface{}; | 102 | Core::ARM_Interface* arm_interface{}; |
| 101 | std::unique_ptr<Common::SpinLock> guard; | 103 | std::unique_ptr<Common::SpinLock> guard; |
| 102 | }; | 104 | }; |
| 103 | 105 | ||
| 104 | } // namespace Kernel | 106 | } // namespace Kernel |