diff options
| author | 2018-08-27 18:17:12 -0400 | |
|---|---|---|
| committer | 2018-08-27 18:17:12 -0400 | |
| commit | 62edc01525fa2c81c71c1d8a8bb4fd82e5f73445 (patch) | |
| tree | 7e7420277d62814e03761c37a53f253edb38fab7 /src | |
| parent | Merge pull request #1187 from lioncash/shadow (diff) | |
| parent | core: Namespace all code in the arm subdirectory under the Core namespace (diff) | |
| download | yuzu-62edc01525fa2c81c71c1d8a8bb4fd82e5f73445.tar.gz yuzu-62edc01525fa2c81c71c1d8a8bb4fd82e5f73445.tar.xz yuzu-62edc01525fa2c81c71c1d8a8bb4fd82e5f73445.zip | |
Merge pull request #1175 from lioncash/ns
core: Namespace all code in the arm subdirectory under the Core namespace
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/arm/arm_interface.h | 4 | ||||
| -rw-r--r-- | src/core/arm/dynarmic/arm_dynarmic.cpp | 4 | ||||
| -rw-r--r-- | src/core/arm/dynarmic/arm_dynarmic.h | 4 | ||||
| -rw-r--r-- | src/core/arm/exclusive_monitor.cpp | 4 | ||||
| -rw-r--r-- | src/core/arm/exclusive_monitor.h | 4 | ||||
| -rw-r--r-- | src/core/arm/unicorn/arm_unicorn.cpp | 8 | ||||
| -rw-r--r-- | src/core/arm/unicorn/arm_unicorn.h | 4 | ||||
| -rw-r--r-- | src/core/core.h | 4 | ||||
| -rw-r--r-- | src/core/core_cpu.h | 4 | ||||
| -rw-r--r-- | src/core/hle/kernel/scheduler.cpp | 2 | ||||
| -rw-r--r-- | src/core/hle/kernel/scheduler.h | 6 | ||||
| -rw-r--r-- | src/core/hle/kernel/thread.cpp | 4 | ||||
| -rw-r--r-- | src/core/hle/kernel/thread.h | 2 |
13 files changed, 42 insertions, 12 deletions
diff --git a/src/core/arm/arm_interface.h b/src/core/arm/arm_interface.h index b0d7ced7f..c368745b1 100644 --- a/src/core/arm/arm_interface.h +++ b/src/core/arm/arm_interface.h | |||
| @@ -8,6 +8,8 @@ | |||
| 8 | #include "common/common_types.h" | 8 | #include "common/common_types.h" |
| 9 | #include "core/hle/kernel/vm_manager.h" | 9 | #include "core/hle/kernel/vm_manager.h" |
| 10 | 10 | ||
| 11 | namespace Core { | ||
| 12 | |||
| 11 | /// Generic ARM11 CPU interface | 13 | /// Generic ARM11 CPU interface |
| 12 | class ARM_Interface : NonCopyable { | 14 | class ARM_Interface : NonCopyable { |
| 13 | public: | 15 | public: |
| @@ -122,3 +124,5 @@ public: | |||
| 122 | /// Prepare core for thread reschedule (if needed to correctly handle state) | 124 | /// Prepare core for thread reschedule (if needed to correctly handle state) |
| 123 | virtual void PrepareReschedule() = 0; | 125 | virtual void PrepareReschedule() = 0; |
| 124 | }; | 126 | }; |
| 127 | |||
| 128 | } // namespace Core | ||
diff --git a/src/core/arm/dynarmic/arm_dynarmic.cpp b/src/core/arm/dynarmic/arm_dynarmic.cpp index 2c817d7d1..f96e08212 100644 --- a/src/core/arm/dynarmic/arm_dynarmic.cpp +++ b/src/core/arm/dynarmic/arm_dynarmic.cpp | |||
| @@ -14,6 +14,8 @@ | |||
| 14 | #include "core/hle/kernel/svc.h" | 14 | #include "core/hle/kernel/svc.h" |
| 15 | #include "core/memory.h" | 15 | #include "core/memory.h" |
| 16 | 16 | ||
| 17 | namespace Core { | ||
| 18 | |||
| 17 | using Vector = Dynarmic::A64::Vector; | 19 | using Vector = Dynarmic::A64::Vector; |
| 18 | 20 | ||
| 19 | class ARM_Dynarmic_Callbacks : public Dynarmic::A64::UserCallbacks { | 21 | class ARM_Dynarmic_Callbacks : public Dynarmic::A64::UserCallbacks { |
| @@ -300,3 +302,5 @@ bool DynarmicExclusiveMonitor::ExclusiveWrite128(size_t core_index, VAddr vaddr, | |||
| 300 | Memory::Write64(vaddr, value[1]); | 302 | Memory::Write64(vaddr, value[1]); |
| 301 | }); | 303 | }); |
| 302 | } | 304 | } |
| 305 | |||
| 306 | } // namespace Core | ||
diff --git a/src/core/arm/dynarmic/arm_dynarmic.h b/src/core/arm/dynarmic/arm_dynarmic.h index 14c072601..3bdfd8cd9 100644 --- a/src/core/arm/dynarmic/arm_dynarmic.h +++ b/src/core/arm/dynarmic/arm_dynarmic.h | |||
| @@ -12,6 +12,8 @@ | |||
| 12 | #include "core/arm/exclusive_monitor.h" | 12 | #include "core/arm/exclusive_monitor.h" |
| 13 | #include "core/arm/unicorn/arm_unicorn.h" | 13 | #include "core/arm/unicorn/arm_unicorn.h" |
| 14 | 14 | ||
| 15 | namespace Core { | ||
| 16 | |||
| 15 | class ARM_Dynarmic_Callbacks; | 17 | class ARM_Dynarmic_Callbacks; |
| 16 | class DynarmicExclusiveMonitor; | 18 | class DynarmicExclusiveMonitor; |
| 17 | 19 | ||
| @@ -81,3 +83,5 @@ private: | |||
| 81 | friend class ARM_Dynarmic; | 83 | friend class ARM_Dynarmic; |
| 82 | Dynarmic::A64::ExclusiveMonitor monitor; | 84 | Dynarmic::A64::ExclusiveMonitor monitor; |
| 83 | }; | 85 | }; |
| 86 | |||
| 87 | } // namespace Core | ||
diff --git a/src/core/arm/exclusive_monitor.cpp b/src/core/arm/exclusive_monitor.cpp index cb8c81d80..abd59ff4b 100644 --- a/src/core/arm/exclusive_monitor.cpp +++ b/src/core/arm/exclusive_monitor.cpp | |||
| @@ -4,4 +4,8 @@ | |||
| 4 | 4 | ||
| 5 | #include "core/arm/exclusive_monitor.h" | 5 | #include "core/arm/exclusive_monitor.h" |
| 6 | 6 | ||
| 7 | namespace Core { | ||
| 8 | |||
| 7 | ExclusiveMonitor::~ExclusiveMonitor() = default; | 9 | ExclusiveMonitor::~ExclusiveMonitor() = default; |
| 10 | |||
| 11 | } // namespace Core | ||
diff --git a/src/core/arm/exclusive_monitor.h b/src/core/arm/exclusive_monitor.h index 13671ed7a..6f9b51573 100644 --- a/src/core/arm/exclusive_monitor.h +++ b/src/core/arm/exclusive_monitor.h | |||
| @@ -6,6 +6,8 @@ | |||
| 6 | 6 | ||
| 7 | #include "common/common_types.h" | 7 | #include "common/common_types.h" |
| 8 | 8 | ||
| 9 | namespace Core { | ||
| 10 | |||
| 9 | class ExclusiveMonitor { | 11 | class ExclusiveMonitor { |
| 10 | public: | 12 | public: |
| 11 | virtual ~ExclusiveMonitor(); | 13 | virtual ~ExclusiveMonitor(); |
| @@ -19,3 +21,5 @@ public: | |||
| 19 | virtual bool ExclusiveWrite64(size_t core_index, VAddr vaddr, u64 value) = 0; | 21 | virtual bool ExclusiveWrite64(size_t core_index, VAddr vaddr, u64 value) = 0; |
| 20 | virtual bool ExclusiveWrite128(size_t core_index, VAddr vaddr, u128 value) = 0; | 22 | virtual bool ExclusiveWrite128(size_t core_index, VAddr vaddr, u128 value) = 0; |
| 21 | }; | 23 | }; |
| 24 | |||
| 25 | } // namespace Core | ||
diff --git a/src/core/arm/unicorn/arm_unicorn.cpp b/src/core/arm/unicorn/arm_unicorn.cpp index 6bc349460..307f12198 100644 --- a/src/core/arm/unicorn/arm_unicorn.cpp +++ b/src/core/arm/unicorn/arm_unicorn.cpp | |||
| @@ -11,6 +11,8 @@ | |||
| 11 | #include "core/core_timing.h" | 11 | #include "core/core_timing.h" |
| 12 | #include "core/hle/kernel/svc.h" | 12 | #include "core/hle/kernel/svc.h" |
| 13 | 13 | ||
| 14 | namespace Core { | ||
| 15 | |||
| 14 | // Load Unicorn DLL once on Windows using RAII | 16 | // Load Unicorn DLL once on Windows using RAII |
| 15 | #ifdef _MSC_VER | 17 | #ifdef _MSC_VER |
| 16 | #include <unicorn_dynload.h> | 18 | #include <unicorn_dynload.h> |
| @@ -211,7 +213,7 @@ void ARM_Unicorn::ExecuteInstructions(int num_instructions) { | |||
| 211 | } | 213 | } |
| 212 | } | 214 | } |
| 213 | 215 | ||
| 214 | void ARM_Unicorn::SaveContext(ARM_Interface::ThreadContext& ctx) { | 216 | void ARM_Unicorn::SaveContext(ThreadContext& ctx) { |
| 215 | int uregs[32]; | 217 | int uregs[32]; |
| 216 | void* tregs[32]; | 218 | void* tregs[32]; |
| 217 | 219 | ||
| @@ -238,7 +240,7 @@ void ARM_Unicorn::SaveContext(ARM_Interface::ThreadContext& ctx) { | |||
| 238 | CHECKED(uc_reg_read_batch(uc, uregs, tregs, 32)); | 240 | CHECKED(uc_reg_read_batch(uc, uregs, tregs, 32)); |
| 239 | } | 241 | } |
| 240 | 242 | ||
| 241 | void ARM_Unicorn::LoadContext(const ARM_Interface::ThreadContext& ctx) { | 243 | void ARM_Unicorn::LoadContext(const ThreadContext& ctx) { |
| 242 | int uregs[32]; | 244 | int uregs[32]; |
| 243 | void* tregs[32]; | 245 | void* tregs[32]; |
| 244 | 246 | ||
| @@ -277,3 +279,5 @@ void ARM_Unicorn::RecordBreak(GDBStub::BreakpointAddress bkpt) { | |||
| 277 | last_bkpt = bkpt; | 279 | last_bkpt = bkpt; |
| 278 | last_bkpt_hit = true; | 280 | last_bkpt_hit = true; |
| 279 | } | 281 | } |
| 282 | |||
| 283 | } // namespace Core | ||
diff --git a/src/core/arm/unicorn/arm_unicorn.h b/src/core/arm/unicorn/arm_unicorn.h index af7943352..bd6b2f723 100644 --- a/src/core/arm/unicorn/arm_unicorn.h +++ b/src/core/arm/unicorn/arm_unicorn.h | |||
| @@ -9,6 +9,8 @@ | |||
| 9 | #include "core/arm/arm_interface.h" | 9 | #include "core/arm/arm_interface.h" |
| 10 | #include "core/gdbstub/gdbstub.h" | 10 | #include "core/gdbstub/gdbstub.h" |
| 11 | 11 | ||
| 12 | namespace Core { | ||
| 13 | |||
| 12 | class ARM_Unicorn final : public ARM_Interface { | 14 | class ARM_Unicorn final : public ARM_Interface { |
| 13 | public: | 15 | public: |
| 14 | ARM_Unicorn(); | 16 | ARM_Unicorn(); |
| @@ -46,3 +48,5 @@ private: | |||
| 46 | GDBStub::BreakpointAddress last_bkpt{}; | 48 | GDBStub::BreakpointAddress last_bkpt{}; |
| 47 | bool last_bkpt_hit; | 49 | bool last_bkpt_hit; |
| 48 | }; | 50 | }; |
| 51 | |||
| 52 | } // namespace Core | ||
diff --git a/src/core/core.h b/src/core/core.h index 0fab76b7f..321104585 100644 --- a/src/core/core.h +++ b/src/core/core.h | |||
| @@ -23,8 +23,6 @@ | |||
| 23 | #include "video_core/debug_utils/debug_utils.h" | 23 | #include "video_core/debug_utils/debug_utils.h" |
| 24 | #include "video_core/gpu.h" | 24 | #include "video_core/gpu.h" |
| 25 | 25 | ||
| 26 | class ARM_Interface; | ||
| 27 | |||
| 28 | namespace Core::Frontend { | 26 | namespace Core::Frontend { |
| 29 | class EmuWindow; | 27 | class EmuWindow; |
| 30 | } | 28 | } |
| @@ -39,6 +37,8 @@ class RendererBase; | |||
| 39 | 37 | ||
| 40 | namespace Core { | 38 | namespace Core { |
| 41 | 39 | ||
| 40 | class ARM_Interface; | ||
| 41 | |||
| 42 | class System { | 42 | class System { |
| 43 | public: | 43 | public: |
| 44 | System(const System&) = delete; | 44 | System(const System&) = delete; |
diff --git a/src/core/core_cpu.h b/src/core/core_cpu.h index 56cdae194..40ed34b47 100644 --- a/src/core/core_cpu.h +++ b/src/core/core_cpu.h | |||
| @@ -12,14 +12,14 @@ | |||
| 12 | #include "common/common_types.h" | 12 | #include "common/common_types.h" |
| 13 | #include "core/arm/exclusive_monitor.h" | 13 | #include "core/arm/exclusive_monitor.h" |
| 14 | 14 | ||
| 15 | class ARM_Interface; | ||
| 16 | |||
| 17 | namespace Kernel { | 15 | namespace Kernel { |
| 18 | class Scheduler; | 16 | class Scheduler; |
| 19 | } | 17 | } |
| 20 | 18 | ||
| 21 | namespace Core { | 19 | namespace Core { |
| 22 | 20 | ||
| 21 | class ARM_Interface; | ||
| 22 | |||
| 23 | constexpr unsigned NUM_CPU_CORES{4}; | 23 | constexpr unsigned NUM_CPU_CORES{4}; |
| 24 | 24 | ||
| 25 | class CpuBarrier { | 25 | class CpuBarrier { |
diff --git a/src/core/hle/kernel/scheduler.cpp b/src/core/hle/kernel/scheduler.cpp index e770b9103..69c812f16 100644 --- a/src/core/hle/kernel/scheduler.cpp +++ b/src/core/hle/kernel/scheduler.cpp | |||
| @@ -17,7 +17,7 @@ namespace Kernel { | |||
| 17 | 17 | ||
| 18 | std::mutex Scheduler::scheduler_mutex; | 18 | std::mutex Scheduler::scheduler_mutex; |
| 19 | 19 | ||
| 20 | Scheduler::Scheduler(ARM_Interface* cpu_core) : cpu_core(cpu_core) {} | 20 | Scheduler::Scheduler(Core::ARM_Interface* cpu_core) : cpu_core(cpu_core) {} |
| 21 | 21 | ||
| 22 | Scheduler::~Scheduler() { | 22 | Scheduler::~Scheduler() { |
| 23 | for (auto& thread : thread_list) { | 23 | for (auto& thread : thread_list) { |
diff --git a/src/core/hle/kernel/scheduler.h b/src/core/hle/kernel/scheduler.h index 6a61ef64e..744990c9b 100644 --- a/src/core/hle/kernel/scheduler.h +++ b/src/core/hle/kernel/scheduler.h | |||
| @@ -11,13 +11,15 @@ | |||
| 11 | #include "core/hle/kernel/object.h" | 11 | #include "core/hle/kernel/object.h" |
| 12 | #include "core/hle/kernel/thread.h" | 12 | #include "core/hle/kernel/thread.h" |
| 13 | 13 | ||
| 14 | namespace Core { | ||
| 14 | class ARM_Interface; | 15 | class ARM_Interface; |
| 16 | } | ||
| 15 | 17 | ||
| 16 | namespace Kernel { | 18 | namespace Kernel { |
| 17 | 19 | ||
| 18 | class Scheduler final { | 20 | class Scheduler final { |
| 19 | public: | 21 | public: |
| 20 | explicit Scheduler(ARM_Interface* cpu_core); | 22 | explicit Scheduler(Core::ARM_Interface* cpu_core); |
| 21 | ~Scheduler(); | 23 | ~Scheduler(); |
| 22 | 24 | ||
| 23 | /// Returns whether there are any threads that are ready to run. | 25 | /// Returns whether there are any threads that are ready to run. |
| @@ -70,7 +72,7 @@ private: | |||
| 70 | 72 | ||
| 71 | SharedPtr<Thread> current_thread = nullptr; | 73 | SharedPtr<Thread> current_thread = nullptr; |
| 72 | 74 | ||
| 73 | ARM_Interface* cpu_core; | 75 | Core::ARM_Interface* cpu_core; |
| 74 | 76 | ||
| 75 | static std::mutex scheduler_mutex; | 77 | static std::mutex scheduler_mutex; |
| 76 | }; | 78 | }; |
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index cf4f94822..4ffd8d5cc 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp | |||
| @@ -283,9 +283,9 @@ static std::tuple<std::size_t, std::size_t, bool> GetFreeThreadLocalSlot( | |||
| 283 | * @param entry_point Address of entry point for execution | 283 | * @param entry_point Address of entry point for execution |
| 284 | * @param arg User argument for thread | 284 | * @param arg User argument for thread |
| 285 | */ | 285 | */ |
| 286 | static void ResetThreadContext(ARM_Interface::ThreadContext& context, VAddr stack_top, | 286 | static void ResetThreadContext(Core::ARM_Interface::ThreadContext& context, VAddr stack_top, |
| 287 | VAddr entry_point, u64 arg) { | 287 | VAddr entry_point, u64 arg) { |
| 288 | memset(&context, 0, sizeof(ARM_Interface::ThreadContext)); | 288 | memset(&context, 0, sizeof(Core::ARM_Interface::ThreadContext)); |
| 289 | 289 | ||
| 290 | context.cpu_registers[0] = arg; | 290 | context.cpu_registers[0] = arg; |
| 291 | context.pc = entry_point; | 291 | context.pc = entry_point; |
diff --git a/src/core/hle/kernel/thread.h b/src/core/hle/kernel/thread.h index adc804248..06edc296d 100644 --- a/src/core/hle/kernel/thread.h +++ b/src/core/hle/kernel/thread.h | |||
| @@ -204,7 +204,7 @@ public: | |||
| 204 | return status == ThreadStatus::WaitSynchAll; | 204 | return status == ThreadStatus::WaitSynchAll; |
| 205 | } | 205 | } |
| 206 | 206 | ||
| 207 | ARM_Interface::ThreadContext context; | 207 | Core::ARM_Interface::ThreadContext context; |
| 208 | 208 | ||
| 209 | u32 thread_id; | 209 | u32 thread_id; |
| 210 | 210 | ||