diff options
| author | 2020-02-11 19:56:24 -0400 | |
|---|---|---|
| committer | 2020-02-11 20:19:11 -0400 | |
| commit | 1e6f8aba04b7be0f90b97aed2527558c755935d6 (patch) | |
| tree | dea6dc5efd324eb6bc8667a114e20c6e91a28195 /src | |
| parent | Kernel: Refactor synchronization to better match RE (diff) | |
| download | yuzu-1e6f8aba04b7be0f90b97aed2527558c755935d6.tar.gz yuzu-1e6f8aba04b7be0f90b97aed2527558c755935d6.tar.xz yuzu-1e6f8aba04b7be0f90b97aed2527558c755935d6.zip | |
Core: Set all hardware emulation constants in a single file.
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/arm/dynarmic/arm_dynarmic.cpp | 3 | ||||
| -rw-r--r-- | src/core/core_timing.cpp | 3 | ||||
| -rw-r--r-- | src/core/core_timing_util.cpp | 18 | ||||
| -rw-r--r-- | src/core/core_timing_util.h | 12 | ||||
| -rw-r--r-- | src/core/cpu_manager.h | 5 | ||||
| -rw-r--r-- | src/core/hardware_properties.h | 28 | ||||
| -rw-r--r-- | src/core/hle/kernel/scheduler.cpp | 12 | ||||
| -rw-r--r-- | src/core/hle/kernel/scheduler.h | 13 | ||||
| -rw-r--r-- | src/core/hle/kernel/thread.cpp | 15 | ||||
| -rw-r--r-- | src/core/hle/service/hid/hid.cpp | 7 | ||||
| -rw-r--r-- | src/core/hle/service/nvflinger/nvflinger.cpp | 7 | ||||
| -rw-r--r-- | src/core/hle/service/time/standard_steady_clock_core.cpp | 3 | ||||
| -rw-r--r-- | src/core/hle/service/time/tick_based_steady_clock_core.cpp | 3 | ||||
| -rw-r--r-- | src/core/hle/service/time/time.cpp | 3 | ||||
| -rw-r--r-- | src/core/hle/service/time/time_sharedmemory.cpp | 3 | ||||
| -rw-r--r-- | src/core/memory/cheat_engine.cpp | 3 | ||||
| -rw-r--r-- | src/core/tools/freezer.cpp | 3 |
17 files changed, 88 insertions, 53 deletions
diff --git a/src/core/arm/dynarmic/arm_dynarmic.cpp b/src/core/arm/dynarmic/arm_dynarmic.cpp index 791640a3a..29eaf74e5 100644 --- a/src/core/arm/dynarmic/arm_dynarmic.cpp +++ b/src/core/arm/dynarmic/arm_dynarmic.cpp | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | #include "core/core_timing.h" | 14 | #include "core/core_timing.h" |
| 15 | #include "core/core_timing_util.h" | 15 | #include "core/core_timing_util.h" |
| 16 | #include "core/gdbstub/gdbstub.h" | 16 | #include "core/gdbstub/gdbstub.h" |
| 17 | #include "core/hardware_properties.h" | ||
| 17 | #include "core/hle/kernel/process.h" | 18 | #include "core/hle/kernel/process.h" |
| 18 | #include "core/hle/kernel/scheduler.h" | 19 | #include "core/hle/kernel/scheduler.h" |
| 19 | #include "core/hle/kernel/svc.h" | 20 | #include "core/hle/kernel/svc.h" |
| @@ -153,7 +154,7 @@ std::unique_ptr<Dynarmic::A64::Jit> ARM_Dynarmic::MakeJit(Common::PageTable& pag | |||
| 153 | config.tpidr_el0 = &cb->tpidr_el0; | 154 | config.tpidr_el0 = &cb->tpidr_el0; |
| 154 | config.dczid_el0 = 4; | 155 | config.dczid_el0 = 4; |
| 155 | config.ctr_el0 = 0x8444c004; | 156 | config.ctr_el0 = 0x8444c004; |
| 156 | config.cntfrq_el0 = Timing::CNTFREQ; | 157 | config.cntfrq_el0 = Hardware::CNTFREQ; |
| 157 | 158 | ||
| 158 | // Unpredictable instructions | 159 | // Unpredictable instructions |
| 159 | config.define_unpredictable_behaviour = true; | 160 | config.define_unpredictable_behaviour = true; |
diff --git a/src/core/core_timing.cpp b/src/core/core_timing.cpp index aa09fa453..46d4178c4 100644 --- a/src/core/core_timing.cpp +++ b/src/core/core_timing.cpp | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | #include "common/assert.h" | 12 | #include "common/assert.h" |
| 13 | #include "common/thread.h" | 13 | #include "common/thread.h" |
| 14 | #include "core/core_timing_util.h" | 14 | #include "core/core_timing_util.h" |
| 15 | #include "core/hardware_properties.h" | ||
| 15 | 16 | ||
| 16 | namespace Core::Timing { | 17 | namespace Core::Timing { |
| 17 | 18 | ||
| @@ -215,7 +216,7 @@ void CoreTiming::Idle() { | |||
| 215 | } | 216 | } |
| 216 | 217 | ||
| 217 | std::chrono::microseconds CoreTiming::GetGlobalTimeUs() const { | 218 | std::chrono::microseconds CoreTiming::GetGlobalTimeUs() const { |
| 218 | return std::chrono::microseconds{GetTicks() * 1000000 / BASE_CLOCK_RATE}; | 219 | return std::chrono::microseconds{GetTicks() * 1000000 / Hardware::BASE_CLOCK_RATE}; |
| 219 | } | 220 | } |
| 220 | 221 | ||
| 221 | s64 CoreTiming::GetDowncount() const { | 222 | s64 CoreTiming::GetDowncount() const { |
diff --git a/src/core/core_timing_util.cpp b/src/core/core_timing_util.cpp index a10472a95..de50d3b14 100644 --- a/src/core/core_timing_util.cpp +++ b/src/core/core_timing_util.cpp | |||
| @@ -11,7 +11,7 @@ | |||
| 11 | 11 | ||
| 12 | namespace Core::Timing { | 12 | namespace Core::Timing { |
| 13 | 13 | ||
| 14 | constexpr u64 MAX_VALUE_TO_MULTIPLY = std::numeric_limits<s64>::max() / BASE_CLOCK_RATE; | 14 | constexpr u64 MAX_VALUE_TO_MULTIPLY = std::numeric_limits<s64>::max() / Hardware::BASE_CLOCK_RATE; |
| 15 | 15 | ||
| 16 | s64 msToCycles(std::chrono::milliseconds ms) { | 16 | s64 msToCycles(std::chrono::milliseconds ms) { |
| 17 | if (static_cast<u64>(ms.count() / 1000) > MAX_VALUE_TO_MULTIPLY) { | 17 | if (static_cast<u64>(ms.count() / 1000) > MAX_VALUE_TO_MULTIPLY) { |
| @@ -20,9 +20,9 @@ s64 msToCycles(std::chrono::milliseconds ms) { | |||
| 20 | } | 20 | } |
| 21 | if (static_cast<u64>(ms.count()) > MAX_VALUE_TO_MULTIPLY) { | 21 | if (static_cast<u64>(ms.count()) > MAX_VALUE_TO_MULTIPLY) { |
| 22 | LOG_DEBUG(Core_Timing, "Time very big, do rounding"); | 22 | LOG_DEBUG(Core_Timing, "Time very big, do rounding"); |
| 23 | return BASE_CLOCK_RATE * (ms.count() / 1000); | 23 | return Hardware::BASE_CLOCK_RATE * (ms.count() / 1000); |
| 24 | } | 24 | } |
| 25 | return (BASE_CLOCK_RATE * ms.count()) / 1000; | 25 | return (Hardware::BASE_CLOCK_RATE * ms.count()) / 1000; |
| 26 | } | 26 | } |
| 27 | 27 | ||
| 28 | s64 usToCycles(std::chrono::microseconds us) { | 28 | s64 usToCycles(std::chrono::microseconds us) { |
| @@ -32,9 +32,9 @@ s64 usToCycles(std::chrono::microseconds us) { | |||
| 32 | } | 32 | } |
| 33 | if (static_cast<u64>(us.count()) > MAX_VALUE_TO_MULTIPLY) { | 33 | if (static_cast<u64>(us.count()) > MAX_VALUE_TO_MULTIPLY) { |
| 34 | LOG_DEBUG(Core_Timing, "Time very big, do rounding"); | 34 | LOG_DEBUG(Core_Timing, "Time very big, do rounding"); |
| 35 | return BASE_CLOCK_RATE * (us.count() / 1000000); | 35 | return Hardware::BASE_CLOCK_RATE * (us.count() / 1000000); |
| 36 | } | 36 | } |
| 37 | return (BASE_CLOCK_RATE * us.count()) / 1000000; | 37 | return (Hardware::BASE_CLOCK_RATE * us.count()) / 1000000; |
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | s64 nsToCycles(std::chrono::nanoseconds ns) { | 40 | s64 nsToCycles(std::chrono::nanoseconds ns) { |
| @@ -44,14 +44,14 @@ s64 nsToCycles(std::chrono::nanoseconds ns) { | |||
| 44 | } | 44 | } |
| 45 | if (static_cast<u64>(ns.count()) > MAX_VALUE_TO_MULTIPLY) { | 45 | if (static_cast<u64>(ns.count()) > MAX_VALUE_TO_MULTIPLY) { |
| 46 | LOG_DEBUG(Core_Timing, "Time very big, do rounding"); | 46 | LOG_DEBUG(Core_Timing, "Time very big, do rounding"); |
| 47 | return BASE_CLOCK_RATE * (ns.count() / 1000000000); | 47 | return Hardware::BASE_CLOCK_RATE * (ns.count() / 1000000000); |
| 48 | } | 48 | } |
| 49 | return (BASE_CLOCK_RATE * ns.count()) / 1000000000; | 49 | return (Hardware::BASE_CLOCK_RATE * ns.count()) / 1000000000; |
| 50 | } | 50 | } |
| 51 | 51 | ||
| 52 | u64 CpuCyclesToClockCycles(u64 ticks) { | 52 | u64 CpuCyclesToClockCycles(u64 ticks) { |
| 53 | const u128 temporal = Common::Multiply64Into128(ticks, CNTFREQ); | 53 | const u128 temporal = Common::Multiply64Into128(ticks, Hardware::CNTFREQ); |
| 54 | return Common::Divide128On32(temporal, static_cast<u32>(BASE_CLOCK_RATE)).first; | 54 | return Common::Divide128On32(temporal, static_cast<u32>(Hardware::BASE_CLOCK_RATE)).first; |
| 55 | } | 55 | } |
| 56 | 56 | ||
| 57 | } // namespace Core::Timing | 57 | } // namespace Core::Timing |
diff --git a/src/core/core_timing_util.h b/src/core/core_timing_util.h index cdd84d70f..addc72b19 100644 --- a/src/core/core_timing_util.h +++ b/src/core/core_timing_util.h | |||
| @@ -6,28 +6,24 @@ | |||
| 6 | 6 | ||
| 7 | #include <chrono> | 7 | #include <chrono> |
| 8 | #include "common/common_types.h" | 8 | #include "common/common_types.h" |
| 9 | #include "core/hardware_properties.h" | ||
| 9 | 10 | ||
| 10 | namespace Core::Timing { | 11 | namespace Core::Timing { |
| 11 | 12 | ||
| 12 | // The below clock rate is based on Switch's clockspeed being widely known as 1.020GHz | ||
| 13 | // The exact value used is of course unverified. | ||
| 14 | constexpr u64 BASE_CLOCK_RATE = 1019215872; // Switch clock speed is 1020MHz un/docked | ||
| 15 | constexpr u64 CNTFREQ = 19200000; // Value from fusee. | ||
| 16 | |||
| 17 | s64 msToCycles(std::chrono::milliseconds ms); | 13 | s64 msToCycles(std::chrono::milliseconds ms); |
| 18 | s64 usToCycles(std::chrono::microseconds us); | 14 | s64 usToCycles(std::chrono::microseconds us); |
| 19 | s64 nsToCycles(std::chrono::nanoseconds ns); | 15 | s64 nsToCycles(std::chrono::nanoseconds ns); |
| 20 | 16 | ||
| 21 | inline std::chrono::milliseconds CyclesToMs(s64 cycles) { | 17 | inline std::chrono::milliseconds CyclesToMs(s64 cycles) { |
| 22 | return std::chrono::milliseconds(cycles * 1000 / BASE_CLOCK_RATE); | 18 | return std::chrono::milliseconds(cycles * 1000 / Hardware::BASE_CLOCK_RATE); |
| 23 | } | 19 | } |
| 24 | 20 | ||
| 25 | inline std::chrono::nanoseconds CyclesToNs(s64 cycles) { | 21 | inline std::chrono::nanoseconds CyclesToNs(s64 cycles) { |
| 26 | return std::chrono::nanoseconds(cycles * 1000000000 / BASE_CLOCK_RATE); | 22 | return std::chrono::nanoseconds(cycles * 1000000000 / Hardware::BASE_CLOCK_RATE); |
| 27 | } | 23 | } |
| 28 | 24 | ||
| 29 | inline std::chrono::microseconds CyclesToUs(s64 cycles) { | 25 | inline std::chrono::microseconds CyclesToUs(s64 cycles) { |
| 30 | return std::chrono::microseconds(cycles * 1000000 / BASE_CLOCK_RATE); | 26 | return std::chrono::microseconds(cycles * 1000000 / Hardware::BASE_CLOCK_RATE); |
| 31 | } | 27 | } |
| 32 | 28 | ||
| 33 | u64 CpuCyclesToClockCycles(u64 ticks); | 29 | u64 CpuCyclesToClockCycles(u64 ticks); |
diff --git a/src/core/cpu_manager.h b/src/core/cpu_manager.h index feb619e1b..97554d1bb 100644 --- a/src/core/cpu_manager.h +++ b/src/core/cpu_manager.h | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | 6 | ||
| 7 | #include <array> | 7 | #include <array> |
| 8 | #include <memory> | 8 | #include <memory> |
| 9 | #include "core/hardware_properties.h" | ||
| 9 | 10 | ||
| 10 | namespace Core { | 11 | namespace Core { |
| 11 | 12 | ||
| @@ -39,9 +40,7 @@ public: | |||
| 39 | void RunLoop(bool tight_loop); | 40 | void RunLoop(bool tight_loop); |
| 40 | 41 | ||
| 41 | private: | 42 | private: |
| 42 | static constexpr std::size_t NUM_CPU_CORES = 4; | 43 | std::array<std::unique_ptr<CoreManager>, Hardware::NUM_CPU_CORES> core_managers; |
| 43 | |||
| 44 | std::array<std::unique_ptr<CoreManager>, NUM_CPU_CORES> core_managers; | ||
| 45 | std::size_t active_core{}; ///< Active core, only used in single thread mode | 44 | std::size_t active_core{}; ///< Active core, only used in single thread mode |
| 46 | 45 | ||
| 47 | System& system; | 46 | System& system; |
diff --git a/src/core/hardware_properties.h b/src/core/hardware_properties.h new file mode 100644 index 000000000..62cdf9ef0 --- /dev/null +++ b/src/core/hardware_properties.h | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | // Copyright 2020 yuzu Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include "common/common_types.h" | ||
| 8 | |||
| 9 | namespace Core { | ||
| 10 | |||
| 11 | union EmuThreadHandle { | ||
| 12 | u64 raw; | ||
| 13 | struct { | ||
| 14 | u32 host_handle; | ||
| 15 | u32 guest_handle; | ||
| 16 | }; | ||
| 17 | }; | ||
| 18 | |||
| 19 | namespace Hardware { | ||
| 20 | |||
| 21 | // The below clock rate is based on Switch's clockspeed being widely known as 1.020GHz | ||
| 22 | // The exact value used is of course unverified. | ||
| 23 | constexpr u64 BASE_CLOCK_RATE = 1019215872; // Switch cpu frequency is 1020MHz un/docked | ||
| 24 | constexpr u64 CNTFREQ = 19200000; // Switch's hardware clock speed | ||
| 25 | constexpr u32 NUM_CPU_CORES = 4; // Number of CPU Cores | ||
| 26 | } // namespace Hardware | ||
| 27 | |||
| 28 | } // namespace Core | ||
diff --git a/src/core/hle/kernel/scheduler.cpp b/src/core/hle/kernel/scheduler.cpp index eb196a690..b5ffa5418 100644 --- a/src/core/hle/kernel/scheduler.cpp +++ b/src/core/hle/kernel/scheduler.cpp | |||
| @@ -124,8 +124,8 @@ bool GlobalScheduler::YieldThreadAndBalanceLoad(Thread* yielding_thread) { | |||
| 124 | "Thread yielding without being in front"); | 124 | "Thread yielding without being in front"); |
| 125 | scheduled_queue[core_id].yield(priority); | 125 | scheduled_queue[core_id].yield(priority); |
| 126 | 126 | ||
| 127 | std::array<Thread*, NUM_CPU_CORES> current_threads; | 127 | std::array<Thread*, Core::Hardware::NUM_CPU_CORES> current_threads; |
| 128 | for (u32 i = 0; i < NUM_CPU_CORES; i++) { | 128 | for (u32 i = 0; i < Core::Hardware::NUM_CPU_CORES; i++) { |
| 129 | current_threads[i] = scheduled_queue[i].empty() ? nullptr : scheduled_queue[i].front(); | 129 | current_threads[i] = scheduled_queue[i].empty() ? nullptr : scheduled_queue[i].front(); |
| 130 | } | 130 | } |
| 131 | 131 | ||
| @@ -177,8 +177,8 @@ bool GlobalScheduler::YieldThreadAndWaitForLoadBalancing(Thread* yielding_thread | |||
| 177 | // function... | 177 | // function... |
| 178 | if (scheduled_queue[core_id].empty()) { | 178 | if (scheduled_queue[core_id].empty()) { |
| 179 | // Here, "current_threads" is calculated after the ""yield"", unlike yield -1 | 179 | // Here, "current_threads" is calculated after the ""yield"", unlike yield -1 |
| 180 | std::array<Thread*, NUM_CPU_CORES> current_threads; | 180 | std::array<Thread*, Core::Hardware::NUM_CPU_CORES> current_threads; |
| 181 | for (u32 i = 0; i < NUM_CPU_CORES; i++) { | 181 | for (u32 i = 0; i < Core::Hardware::NUM_CPU_CORES; i++) { |
| 182 | current_threads[i] = scheduled_queue[i].empty() ? nullptr : scheduled_queue[i].front(); | 182 | current_threads[i] = scheduled_queue[i].empty() ? nullptr : scheduled_queue[i].front(); |
| 183 | } | 183 | } |
| 184 | for (auto& thread : suggested_queue[core_id]) { | 184 | for (auto& thread : suggested_queue[core_id]) { |
| @@ -208,7 +208,7 @@ bool GlobalScheduler::YieldThreadAndWaitForLoadBalancing(Thread* yielding_thread | |||
| 208 | } | 208 | } |
| 209 | 209 | ||
| 210 | void GlobalScheduler::PreemptThreads() { | 210 | void GlobalScheduler::PreemptThreads() { |
| 211 | for (std::size_t core_id = 0; core_id < NUM_CPU_CORES; core_id++) { | 211 | for (std::size_t core_id = 0; core_id < Core::Hardware::NUM_CPU_CORES; core_id++) { |
| 212 | const u32 priority = preemption_priorities[core_id]; | 212 | const u32 priority = preemption_priorities[core_id]; |
| 213 | 213 | ||
| 214 | if (scheduled_queue[core_id].size(priority) > 0) { | 214 | if (scheduled_queue[core_id].size(priority) > 0) { |
| @@ -349,7 +349,7 @@ bool GlobalScheduler::AskForReselectionOrMarkRedundant(Thread* current_thread, | |||
| 349 | } | 349 | } |
| 350 | 350 | ||
| 351 | void GlobalScheduler::Shutdown() { | 351 | void GlobalScheduler::Shutdown() { |
| 352 | for (std::size_t core = 0; core < NUM_CPU_CORES; core++) { | 352 | for (std::size_t core = 0; core < Core::Hardware::NUM_CPU_CORES; core++) { |
| 353 | scheduled_queue[core].clear(); | 353 | scheduled_queue[core].clear(); |
| 354 | suggested_queue[core].clear(); | 354 | suggested_queue[core].clear(); |
| 355 | } | 355 | } |
diff --git a/src/core/hle/kernel/scheduler.h b/src/core/hle/kernel/scheduler.h index 14b77960a..96db049cb 100644 --- a/src/core/hle/kernel/scheduler.h +++ b/src/core/hle/kernel/scheduler.h | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | 10 | ||
| 11 | #include "common/common_types.h" | 11 | #include "common/common_types.h" |
| 12 | #include "common/multi_level_queue.h" | 12 | #include "common/multi_level_queue.h" |
| 13 | #include "core/hardware_properties.h" | ||
| 13 | #include "core/hle/kernel/thread.h" | 14 | #include "core/hle/kernel/thread.h" |
| 14 | 15 | ||
| 15 | namespace Core { | 16 | namespace Core { |
| @@ -23,8 +24,6 @@ class Process; | |||
| 23 | 24 | ||
| 24 | class GlobalScheduler final { | 25 | class GlobalScheduler final { |
| 25 | public: | 26 | public: |
| 26 | static constexpr u32 NUM_CPU_CORES = 4; | ||
| 27 | |||
| 28 | explicit GlobalScheduler(Core::System& system); | 27 | explicit GlobalScheduler(Core::System& system); |
| 29 | ~GlobalScheduler(); | 28 | ~GlobalScheduler(); |
| 30 | 29 | ||
| @@ -125,7 +124,7 @@ public: | |||
| 125 | void PreemptThreads(); | 124 | void PreemptThreads(); |
| 126 | 125 | ||
| 127 | u32 CpuCoresCount() const { | 126 | u32 CpuCoresCount() const { |
| 128 | return NUM_CPU_CORES; | 127 | return Core::Hardware::NUM_CPU_CORES; |
| 129 | } | 128 | } |
| 130 | 129 | ||
| 131 | void SetReselectionPending() { | 130 | void SetReselectionPending() { |
| @@ -149,13 +148,15 @@ private: | |||
| 149 | bool AskForReselectionOrMarkRedundant(Thread* current_thread, const Thread* winner); | 148 | bool AskForReselectionOrMarkRedundant(Thread* current_thread, const Thread* winner); |
| 150 | 149 | ||
| 151 | static constexpr u32 min_regular_priority = 2; | 150 | static constexpr u32 min_regular_priority = 2; |
| 152 | std::array<Common::MultiLevelQueue<Thread*, THREADPRIO_COUNT>, NUM_CPU_CORES> scheduled_queue; | 151 | std::array<Common::MultiLevelQueue<Thread*, THREADPRIO_COUNT>, Core::Hardware::NUM_CPU_CORES> |
| 153 | std::array<Common::MultiLevelQueue<Thread*, THREADPRIO_COUNT>, NUM_CPU_CORES> suggested_queue; | 152 | scheduled_queue; |
| 153 | std::array<Common::MultiLevelQueue<Thread*, THREADPRIO_COUNT>, Core::Hardware::NUM_CPU_CORES> | ||
| 154 | suggested_queue; | ||
| 154 | std::atomic<bool> is_reselection_pending{false}; | 155 | std::atomic<bool> is_reselection_pending{false}; |
| 155 | 156 | ||
| 156 | // The priority levels at which the global scheduler preempts threads every 10 ms. They are | 157 | // The priority levels at which the global scheduler preempts threads every 10 ms. They are |
| 157 | // ordered from Core 0 to Core 3. | 158 | // ordered from Core 0 to Core 3. |
| 158 | std::array<u32, NUM_CPU_CORES> preemption_priorities = {59, 59, 59, 62}; | 159 | std::array<u32, Core::Hardware::NUM_CPU_CORES> preemption_priorities = {59, 59, 59, 62}; |
| 159 | 160 | ||
| 160 | /// Lists all thread ids that aren't deleted/etc. | 161 | /// Lists all thread ids that aren't deleted/etc. |
| 161 | std::vector<std::shared_ptr<Thread>> thread_list; | 162 | std::vector<std::shared_ptr<Thread>> thread_list; |
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index ee9ea7d67..43b30dd3d 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | #include "core/core.h" | 15 | #include "core/core.h" |
| 16 | #include "core/core_timing.h" | 16 | #include "core/core_timing.h" |
| 17 | #include "core/core_timing_util.h" | 17 | #include "core/core_timing_util.h" |
| 18 | #include "core/hardware_properties.h" | ||
| 18 | #include "core/hle/kernel/errors.h" | 19 | #include "core/hle/kernel/errors.h" |
| 19 | #include "core/hle/kernel/handle_table.h" | 20 | #include "core/hle/kernel/handle_table.h" |
| 20 | #include "core/hle/kernel/kernel.h" | 21 | #include "core/hle/kernel/kernel.h" |
| @@ -431,7 +432,7 @@ ResultCode Thread::SetCoreAndAffinityMask(s32 new_core, u64 new_affinity_mask) { | |||
| 431 | const s32 old_core = processor_id; | 432 | const s32 old_core = processor_id; |
| 432 | if (processor_id >= 0 && ((affinity_mask >> processor_id) & 1) == 0) { | 433 | if (processor_id >= 0 && ((affinity_mask >> processor_id) & 1) == 0) { |
| 433 | if (static_cast<s32>(ideal_core) < 0) { | 434 | if (static_cast<s32>(ideal_core) < 0) { |
| 434 | processor_id = HighestSetCore(affinity_mask, GlobalScheduler::NUM_CPU_CORES); | 435 | processor_id = HighestSetCore(affinity_mask, Core::Hardware::NUM_CPU_CORES); |
| 435 | } else { | 436 | } else { |
| 436 | processor_id = ideal_core; | 437 | processor_id = ideal_core; |
| 437 | } | 438 | } |
| @@ -455,7 +456,7 @@ void Thread::AdjustSchedulingOnStatus(u32 old_flags) { | |||
| 455 | scheduler.Unschedule(current_priority, static_cast<u32>(processor_id), this); | 456 | scheduler.Unschedule(current_priority, static_cast<u32>(processor_id), this); |
| 456 | } | 457 | } |
| 457 | 458 | ||
| 458 | for (u32 core = 0; core < GlobalScheduler::NUM_CPU_CORES; core++) { | 459 | for (u32 core = 0; core < Core::Hardware::NUM_CPU_CORES; core++) { |
| 459 | if (core != static_cast<u32>(processor_id) && ((affinity_mask >> core) & 1) != 0) { | 460 | if (core != static_cast<u32>(processor_id) && ((affinity_mask >> core) & 1) != 0) { |
| 460 | scheduler.Unsuggest(current_priority, core, this); | 461 | scheduler.Unsuggest(current_priority, core, this); |
| 461 | } | 462 | } |
| @@ -466,7 +467,7 @@ void Thread::AdjustSchedulingOnStatus(u32 old_flags) { | |||
| 466 | scheduler.Schedule(current_priority, static_cast<u32>(processor_id), this); | 467 | scheduler.Schedule(current_priority, static_cast<u32>(processor_id), this); |
| 467 | } | 468 | } |
| 468 | 469 | ||
| 469 | for (u32 core = 0; core < GlobalScheduler::NUM_CPU_CORES; core++) { | 470 | for (u32 core = 0; core < Core::Hardware::NUM_CPU_CORES; core++) { |
| 470 | if (core != static_cast<u32>(processor_id) && ((affinity_mask >> core) & 1) != 0) { | 471 | if (core != static_cast<u32>(processor_id) && ((affinity_mask >> core) & 1) != 0) { |
| 471 | scheduler.Suggest(current_priority, core, this); | 472 | scheduler.Suggest(current_priority, core, this); |
| 472 | } | 473 | } |
| @@ -485,7 +486,7 @@ void Thread::AdjustSchedulingOnPriority(u32 old_priority) { | |||
| 485 | scheduler.Unschedule(old_priority, static_cast<u32>(processor_id), this); | 486 | scheduler.Unschedule(old_priority, static_cast<u32>(processor_id), this); |
| 486 | } | 487 | } |
| 487 | 488 | ||
| 488 | for (u32 core = 0; core < GlobalScheduler::NUM_CPU_CORES; core++) { | 489 | for (u32 core = 0; core < Core::Hardware::NUM_CPU_CORES; core++) { |
| 489 | if (core != static_cast<u32>(processor_id) && ((affinity_mask >> core) & 1) != 0) { | 490 | if (core != static_cast<u32>(processor_id) && ((affinity_mask >> core) & 1) != 0) { |
| 490 | scheduler.Unsuggest(old_priority, core, this); | 491 | scheduler.Unsuggest(old_priority, core, this); |
| 491 | } | 492 | } |
| @@ -502,7 +503,7 @@ void Thread::AdjustSchedulingOnPriority(u32 old_priority) { | |||
| 502 | } | 503 | } |
| 503 | } | 504 | } |
| 504 | 505 | ||
| 505 | for (u32 core = 0; core < GlobalScheduler::NUM_CPU_CORES; core++) { | 506 | for (u32 core = 0; core < Core::Hardware::NUM_CPU_CORES; core++) { |
| 506 | if (core != static_cast<u32>(processor_id) && ((affinity_mask >> core) & 1) != 0) { | 507 | if (core != static_cast<u32>(processor_id) && ((affinity_mask >> core) & 1) != 0) { |
| 507 | scheduler.Suggest(current_priority, core, this); | 508 | scheduler.Suggest(current_priority, core, this); |
| 508 | } | 509 | } |
| @@ -518,7 +519,7 @@ void Thread::AdjustSchedulingOnAffinity(u64 old_affinity_mask, s32 old_core) { | |||
| 518 | return; | 519 | return; |
| 519 | } | 520 | } |
| 520 | 521 | ||
| 521 | for (u32 core = 0; core < GlobalScheduler::NUM_CPU_CORES; core++) { | 522 | for (u32 core = 0; core < Core::Hardware::NUM_CPU_CORES; core++) { |
| 522 | if (((old_affinity_mask >> core) & 1) != 0) { | 523 | if (((old_affinity_mask >> core) & 1) != 0) { |
| 523 | if (core == static_cast<u32>(old_core)) { | 524 | if (core == static_cast<u32>(old_core)) { |
| 524 | scheduler.Unschedule(current_priority, core, this); | 525 | scheduler.Unschedule(current_priority, core, this); |
| @@ -528,7 +529,7 @@ void Thread::AdjustSchedulingOnAffinity(u64 old_affinity_mask, s32 old_core) { | |||
| 528 | } | 529 | } |
| 529 | } | 530 | } |
| 530 | 531 | ||
| 531 | for (u32 core = 0; core < GlobalScheduler::NUM_CPU_CORES; core++) { | 532 | for (u32 core = 0; core < Core::Hardware::NUM_CPU_CORES; core++) { |
| 532 | if (((affinity_mask >> core) & 1) != 0) { | 533 | if (((affinity_mask >> core) & 1) != 0) { |
| 533 | if (core == static_cast<u32>(processor_id)) { | 534 | if (core == static_cast<u32>(processor_id)) { |
| 534 | scheduler.Schedule(current_priority, core, this); | 535 | scheduler.Schedule(current_priority, core, this); |
diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp index 89bf8b815..e6b56a9f9 100644 --- a/src/core/hle/service/hid/hid.cpp +++ b/src/core/hle/service/hid/hid.cpp | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | #include "core/core_timing_util.h" | 10 | #include "core/core_timing_util.h" |
| 11 | #include "core/frontend/emu_window.h" | 11 | #include "core/frontend/emu_window.h" |
| 12 | #include "core/frontend/input.h" | 12 | #include "core/frontend/input.h" |
| 13 | #include "core/hardware_properties.h" | ||
| 13 | #include "core/hle/ipc_helpers.h" | 14 | #include "core/hle/ipc_helpers.h" |
| 14 | #include "core/hle/kernel/client_port.h" | 15 | #include "core/hle/kernel/client_port.h" |
| 15 | #include "core/hle/kernel/client_session.h" | 16 | #include "core/hle/kernel/client_session.h" |
| @@ -37,11 +38,11 @@ namespace Service::HID { | |||
| 37 | 38 | ||
| 38 | // Updating period for each HID device. | 39 | // Updating period for each HID device. |
| 39 | // TODO(ogniK): Find actual polling rate of hid | 40 | // TODO(ogniK): Find actual polling rate of hid |
| 40 | constexpr s64 pad_update_ticks = static_cast<s64>(Core::Timing::BASE_CLOCK_RATE / 66); | 41 | constexpr s64 pad_update_ticks = static_cast<s64>(Core::Hardware::BASE_CLOCK_RATE / 66); |
| 41 | [[maybe_unused]] constexpr s64 accelerometer_update_ticks = | 42 | [[maybe_unused]] constexpr s64 accelerometer_update_ticks = |
| 42 | static_cast<s64>(Core::Timing::BASE_CLOCK_RATE / 100); | 43 | static_cast<s64>(Core::Hardware::BASE_CLOCK_RATE / 100); |
| 43 | [[maybe_unused]] constexpr s64 gyroscope_update_ticks = | 44 | [[maybe_unused]] constexpr s64 gyroscope_update_ticks = |
| 44 | static_cast<s64>(Core::Timing::BASE_CLOCK_RATE / 100); | 45 | static_cast<s64>(Core::Hardware::BASE_CLOCK_RATE / 100); |
| 45 | constexpr std::size_t SHARED_MEMORY_SIZE = 0x40000; | 46 | constexpr std::size_t SHARED_MEMORY_SIZE = 0x40000; |
| 46 | 47 | ||
| 47 | IAppletResource::IAppletResource(Core::System& system) | 48 | IAppletResource::IAppletResource(Core::System& system) |
diff --git a/src/core/hle/service/nvflinger/nvflinger.cpp b/src/core/hle/service/nvflinger/nvflinger.cpp index 62752e419..134152210 100644 --- a/src/core/hle/service/nvflinger/nvflinger.cpp +++ b/src/core/hle/service/nvflinger/nvflinger.cpp | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | #include "core/core.h" | 12 | #include "core/core.h" |
| 13 | #include "core/core_timing.h" | 13 | #include "core/core_timing.h" |
| 14 | #include "core/core_timing_util.h" | 14 | #include "core/core_timing_util.h" |
| 15 | #include "core/hardware_properties.h" | ||
| 15 | #include "core/hle/kernel/kernel.h" | 16 | #include "core/hle/kernel/kernel.h" |
| 16 | #include "core/hle/kernel/readable_event.h" | 17 | #include "core/hle/kernel/readable_event.h" |
| 17 | #include "core/hle/service/nvdrv/devices/nvdisp_disp0.h" | 18 | #include "core/hle/service/nvdrv/devices/nvdisp_disp0.h" |
| @@ -26,8 +27,8 @@ | |||
| 26 | 27 | ||
| 27 | namespace Service::NVFlinger { | 28 | namespace Service::NVFlinger { |
| 28 | 29 | ||
| 29 | constexpr s64 frame_ticks = static_cast<s64>(Core::Timing::BASE_CLOCK_RATE / 60); | 30 | constexpr s64 frame_ticks = static_cast<s64>(Core::Hardware::BASE_CLOCK_RATE / 60); |
| 30 | constexpr s64 frame_ticks_30fps = static_cast<s64>(Core::Timing::BASE_CLOCK_RATE / 30); | 31 | constexpr s64 frame_ticks_30fps = static_cast<s64>(Core::Hardware::BASE_CLOCK_RATE / 30); |
| 31 | 32 | ||
| 32 | NVFlinger::NVFlinger(Core::System& system) : system(system) { | 33 | NVFlinger::NVFlinger(Core::System& system) : system(system) { |
| 33 | displays.emplace_back(0, "Default", system); | 34 | displays.emplace_back(0, "Default", system); |
| @@ -222,7 +223,7 @@ void NVFlinger::Compose() { | |||
| 222 | 223 | ||
| 223 | s64 NVFlinger::GetNextTicks() const { | 224 | s64 NVFlinger::GetNextTicks() const { |
| 224 | constexpr s64 max_hertz = 120LL; | 225 | constexpr s64 max_hertz = 120LL; |
| 225 | return (Core::Timing::BASE_CLOCK_RATE * (1LL << swap_interval)) / max_hertz; | 226 | return (Core::Hardware::BASE_CLOCK_RATE * (1LL << swap_interval)) / max_hertz; |
| 226 | } | 227 | } |
| 227 | 228 | ||
| 228 | } // namespace Service::NVFlinger | 229 | } // namespace Service::NVFlinger |
diff --git a/src/core/hle/service/time/standard_steady_clock_core.cpp b/src/core/hle/service/time/standard_steady_clock_core.cpp index ca1a783fc..1575f0b49 100644 --- a/src/core/hle/service/time/standard_steady_clock_core.cpp +++ b/src/core/hle/service/time/standard_steady_clock_core.cpp | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | #include "core/core.h" | 5 | #include "core/core.h" |
| 6 | #include "core/core_timing.h" | 6 | #include "core/core_timing.h" |
| 7 | #include "core/core_timing_util.h" | 7 | #include "core/core_timing_util.h" |
| 8 | #include "core/hardware_properties.h" | ||
| 8 | #include "core/hle/service/time/standard_steady_clock_core.h" | 9 | #include "core/hle/service/time/standard_steady_clock_core.h" |
| 9 | 10 | ||
| 10 | namespace Service::Time::Clock { | 11 | namespace Service::Time::Clock { |
| @@ -12,7 +13,7 @@ namespace Service::Time::Clock { | |||
| 12 | TimeSpanType StandardSteadyClockCore::GetCurrentRawTimePoint(Core::System& system) { | 13 | TimeSpanType StandardSteadyClockCore::GetCurrentRawTimePoint(Core::System& system) { |
| 13 | const TimeSpanType ticks_time_span{TimeSpanType::FromTicks( | 14 | const TimeSpanType ticks_time_span{TimeSpanType::FromTicks( |
| 14 | Core::Timing::CpuCyclesToClockCycles(system.CoreTiming().GetTicks()), | 15 | Core::Timing::CpuCyclesToClockCycles(system.CoreTiming().GetTicks()), |
| 15 | Core::Timing::CNTFREQ)}; | 16 | Core::Hardware::CNTFREQ)}; |
| 16 | TimeSpanType raw_time_point{setup_value.nanoseconds + ticks_time_span.nanoseconds}; | 17 | TimeSpanType raw_time_point{setup_value.nanoseconds + ticks_time_span.nanoseconds}; |
| 17 | 18 | ||
| 18 | if (raw_time_point.nanoseconds < cached_raw_time_point.nanoseconds) { | 19 | if (raw_time_point.nanoseconds < cached_raw_time_point.nanoseconds) { |
diff --git a/src/core/hle/service/time/tick_based_steady_clock_core.cpp b/src/core/hle/service/time/tick_based_steady_clock_core.cpp index c77b98189..44d5bc651 100644 --- a/src/core/hle/service/time/tick_based_steady_clock_core.cpp +++ b/src/core/hle/service/time/tick_based_steady_clock_core.cpp | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | #include "core/core.h" | 5 | #include "core/core.h" |
| 6 | #include "core/core_timing.h" | 6 | #include "core/core_timing.h" |
| 7 | #include "core/core_timing_util.h" | 7 | #include "core/core_timing_util.h" |
| 8 | #include "core/hardware_properties.h" | ||
| 8 | #include "core/hle/service/time/tick_based_steady_clock_core.h" | 9 | #include "core/hle/service/time/tick_based_steady_clock_core.h" |
| 9 | 10 | ||
| 10 | namespace Service::Time::Clock { | 11 | namespace Service::Time::Clock { |
| @@ -12,7 +13,7 @@ namespace Service::Time::Clock { | |||
| 12 | SteadyClockTimePoint TickBasedSteadyClockCore::GetTimePoint(Core::System& system) { | 13 | SteadyClockTimePoint TickBasedSteadyClockCore::GetTimePoint(Core::System& system) { |
| 13 | const TimeSpanType ticks_time_span{TimeSpanType::FromTicks( | 14 | const TimeSpanType ticks_time_span{TimeSpanType::FromTicks( |
| 14 | Core::Timing::CpuCyclesToClockCycles(system.CoreTiming().GetTicks()), | 15 | Core::Timing::CpuCyclesToClockCycles(system.CoreTiming().GetTicks()), |
| 15 | Core::Timing::CNTFREQ)}; | 16 | Core::Hardware::CNTFREQ)}; |
| 16 | 17 | ||
| 17 | return {ticks_time_span.ToSeconds(), GetClockSourceId()}; | 18 | return {ticks_time_span.ToSeconds(), GetClockSourceId()}; |
| 18 | } | 19 | } |
diff --git a/src/core/hle/service/time/time.cpp b/src/core/hle/service/time/time.cpp index 8ef4efcef..749b7be70 100644 --- a/src/core/hle/service/time/time.cpp +++ b/src/core/hle/service/time/time.cpp | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | #include "core/core.h" | 6 | #include "core/core.h" |
| 7 | #include "core/core_timing.h" | 7 | #include "core/core_timing.h" |
| 8 | #include "core/core_timing_util.h" | 8 | #include "core/core_timing_util.h" |
| 9 | #include "core/hardware_properties.h" | ||
| 9 | #include "core/hle/ipc_helpers.h" | 10 | #include "core/hle/ipc_helpers.h" |
| 10 | #include "core/hle/kernel/client_port.h" | 11 | #include "core/hle/kernel/client_port.h" |
| 11 | #include "core/hle/kernel/client_session.h" | 12 | #include "core/hle/kernel/client_session.h" |
| @@ -233,7 +234,7 @@ void Module::Interface::CalculateMonotonicSystemClockBaseTimePoint(Kernel::HLERe | |||
| 233 | if (current_time_point.clock_source_id == context.steady_time_point.clock_source_id) { | 234 | if (current_time_point.clock_source_id == context.steady_time_point.clock_source_id) { |
| 234 | const auto ticks{Clock::TimeSpanType::FromTicks( | 235 | const auto ticks{Clock::TimeSpanType::FromTicks( |
| 235 | Core::Timing::CpuCyclesToClockCycles(system.CoreTiming().GetTicks()), | 236 | Core::Timing::CpuCyclesToClockCycles(system.CoreTiming().GetTicks()), |
| 236 | Core::Timing::CNTFREQ)}; | 237 | Core::Hardware::CNTFREQ)}; |
| 237 | const s64 base_time_point{context.offset + current_time_point.time_point - | 238 | const s64 base_time_point{context.offset + current_time_point.time_point - |
| 238 | ticks.ToSeconds()}; | 239 | ticks.ToSeconds()}; |
| 239 | IPC::ResponseBuilder rb{ctx, (sizeof(s64) / 4) + 2}; | 240 | IPC::ResponseBuilder rb{ctx, (sizeof(s64) / 4) + 2}; |
diff --git a/src/core/hle/service/time/time_sharedmemory.cpp b/src/core/hle/service/time/time_sharedmemory.cpp index 9b03191bf..fdaef233f 100644 --- a/src/core/hle/service/time/time_sharedmemory.cpp +++ b/src/core/hle/service/time/time_sharedmemory.cpp | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | #include "core/core.h" | 5 | #include "core/core.h" |
| 6 | #include "core/core_timing.h" | 6 | #include "core/core_timing.h" |
| 7 | #include "core/core_timing_util.h" | 7 | #include "core/core_timing_util.h" |
| 8 | #include "core/hardware_properties.h" | ||
| 8 | #include "core/hle/service/time/clock_types.h" | 9 | #include "core/hle/service/time/clock_types.h" |
| 9 | #include "core/hle/service/time/steady_clock_core.h" | 10 | #include "core/hle/service/time/steady_clock_core.h" |
| 10 | #include "core/hle/service/time/time_sharedmemory.h" | 11 | #include "core/hle/service/time/time_sharedmemory.h" |
| @@ -31,7 +32,7 @@ void SharedMemory::SetupStandardSteadyClock(Core::System& system, | |||
| 31 | Clock::TimeSpanType current_time_point) { | 32 | Clock::TimeSpanType current_time_point) { |
| 32 | const Clock::TimeSpanType ticks_time_span{Clock::TimeSpanType::FromTicks( | 33 | const Clock::TimeSpanType ticks_time_span{Clock::TimeSpanType::FromTicks( |
| 33 | Core::Timing::CpuCyclesToClockCycles(system.CoreTiming().GetTicks()), | 34 | Core::Timing::CpuCyclesToClockCycles(system.CoreTiming().GetTicks()), |
| 34 | Core::Timing::CNTFREQ)}; | 35 | Core::Hardware::CNTFREQ)}; |
| 35 | const Clock::SteadyClockContext context{ | 36 | const Clock::SteadyClockContext context{ |
| 36 | static_cast<u64>(current_time_point.nanoseconds - ticks_time_span.nanoseconds), | 37 | static_cast<u64>(current_time_point.nanoseconds - ticks_time_span.nanoseconds), |
| 37 | clock_source_id}; | 38 | clock_source_id}; |
diff --git a/src/core/memory/cheat_engine.cpp b/src/core/memory/cheat_engine.cpp index d1e6bed93..4472500d2 100644 --- a/src/core/memory/cheat_engine.cpp +++ b/src/core/memory/cheat_engine.cpp | |||
| @@ -9,6 +9,7 @@ | |||
| 9 | #include "core/core.h" | 9 | #include "core/core.h" |
| 10 | #include "core/core_timing.h" | 10 | #include "core/core_timing.h" |
| 11 | #include "core/core_timing_util.h" | 11 | #include "core/core_timing_util.h" |
| 12 | #include "core/hardware_properties.h" | ||
| 12 | #include "core/hle/kernel/process.h" | 13 | #include "core/hle/kernel/process.h" |
| 13 | #include "core/hle/service/hid/controllers/npad.h" | 14 | #include "core/hle/service/hid/controllers/npad.h" |
| 14 | #include "core/hle/service/hid/hid.h" | 15 | #include "core/hle/service/hid/hid.h" |
| @@ -17,7 +18,7 @@ | |||
| 17 | 18 | ||
| 18 | namespace Memory { | 19 | namespace Memory { |
| 19 | 20 | ||
| 20 | constexpr s64 CHEAT_ENGINE_TICKS = static_cast<s64>(Core::Timing::BASE_CLOCK_RATE / 12); | 21 | constexpr s64 CHEAT_ENGINE_TICKS = static_cast<s64>(Core::Hardware::BASE_CLOCK_RATE / 12); |
| 21 | constexpr u32 KEYPAD_BITMASK = 0x3FFFFFF; | 22 | constexpr u32 KEYPAD_BITMASK = 0x3FFFFFF; |
| 22 | 23 | ||
| 23 | StandardVmCallbacks::StandardVmCallbacks(Core::System& system, const CheatProcessMetadata& metadata) | 24 | StandardVmCallbacks::StandardVmCallbacks(Core::System& system, const CheatProcessMetadata& metadata) |
diff --git a/src/core/tools/freezer.cpp b/src/core/tools/freezer.cpp index 55e0dbc49..1e060f009 100644 --- a/src/core/tools/freezer.cpp +++ b/src/core/tools/freezer.cpp | |||
| @@ -7,13 +7,14 @@ | |||
| 7 | #include "core/core.h" | 7 | #include "core/core.h" |
| 8 | #include "core/core_timing.h" | 8 | #include "core/core_timing.h" |
| 9 | #include "core/core_timing_util.h" | 9 | #include "core/core_timing_util.h" |
| 10 | #include "core/hardware_properties.h" | ||
| 10 | #include "core/memory.h" | 11 | #include "core/memory.h" |
| 11 | #include "core/tools/freezer.h" | 12 | #include "core/tools/freezer.h" |
| 12 | 13 | ||
| 13 | namespace Tools { | 14 | namespace Tools { |
| 14 | namespace { | 15 | namespace { |
| 15 | 16 | ||
| 16 | constexpr s64 MEMORY_FREEZER_TICKS = static_cast<s64>(Core::Timing::BASE_CLOCK_RATE / 60); | 17 | constexpr s64 MEMORY_FREEZER_TICKS = static_cast<s64>(Core::Hardware::BASE_CLOCK_RATE / 60); |
| 17 | 18 | ||
| 18 | u64 MemoryReadWidth(Memory::Memory& memory, u32 width, VAddr addr) { | 19 | u64 MemoryReadWidth(Memory::Memory& memory, u32 width, VAddr addr) { |
| 19 | switch (width) { | 20 | switch (width) { |