summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei2018-08-27 18:17:12 -0400
committerGravatar GitHub2018-08-27 18:17:12 -0400
commit62edc01525fa2c81c71c1d8a8bb4fd82e5f73445 (patch)
tree7e7420277d62814e03761c37a53f253edb38fab7 /src
parentMerge pull request #1187 from lioncash/shadow (diff)
parentcore: Namespace all code in the arm subdirectory under the Core namespace (diff)
downloadyuzu-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.h4
-rw-r--r--src/core/arm/dynarmic/arm_dynarmic.cpp4
-rw-r--r--src/core/arm/dynarmic/arm_dynarmic.h4
-rw-r--r--src/core/arm/exclusive_monitor.cpp4
-rw-r--r--src/core/arm/exclusive_monitor.h4
-rw-r--r--src/core/arm/unicorn/arm_unicorn.cpp8
-rw-r--r--src/core/arm/unicorn/arm_unicorn.h4
-rw-r--r--src/core/core.h4
-rw-r--r--src/core/core_cpu.h4
-rw-r--r--src/core/hle/kernel/scheduler.cpp2
-rw-r--r--src/core/hle/kernel/scheduler.h6
-rw-r--r--src/core/hle/kernel/thread.cpp4
-rw-r--r--src/core/hle/kernel/thread.h2
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
11namespace Core {
12
11/// Generic ARM11 CPU interface 13/// Generic ARM11 CPU interface
12class ARM_Interface : NonCopyable { 14class ARM_Interface : NonCopyable {
13public: 15public:
@@ -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
17namespace Core {
18
17using Vector = Dynarmic::A64::Vector; 19using Vector = Dynarmic::A64::Vector;
18 20
19class ARM_Dynarmic_Callbacks : public Dynarmic::A64::UserCallbacks { 21class 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
15namespace Core {
16
15class ARM_Dynarmic_Callbacks; 17class ARM_Dynarmic_Callbacks;
16class DynarmicExclusiveMonitor; 18class 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
7namespace Core {
8
7ExclusiveMonitor::~ExclusiveMonitor() = default; 9ExclusiveMonitor::~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
9namespace Core {
10
9class ExclusiveMonitor { 11class ExclusiveMonitor {
10public: 12public:
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
14namespace 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
214void ARM_Unicorn::SaveContext(ARM_Interface::ThreadContext& ctx) { 216void 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
241void ARM_Unicorn::LoadContext(const ARM_Interface::ThreadContext& ctx) { 243void 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
12namespace Core {
13
12class ARM_Unicorn final : public ARM_Interface { 14class ARM_Unicorn final : public ARM_Interface {
13public: 15public:
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
26class ARM_Interface;
27
28namespace Core::Frontend { 26namespace Core::Frontend {
29class EmuWindow; 27class EmuWindow;
30} 28}
@@ -39,6 +37,8 @@ class RendererBase;
39 37
40namespace Core { 38namespace Core {
41 39
40class ARM_Interface;
41
42class System { 42class System {
43public: 43public:
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
15class ARM_Interface;
16
17namespace Kernel { 15namespace Kernel {
18class Scheduler; 16class Scheduler;
19} 17}
20 18
21namespace Core { 19namespace Core {
22 20
21class ARM_Interface;
22
23constexpr unsigned NUM_CPU_CORES{4}; 23constexpr unsigned NUM_CPU_CORES{4};
24 24
25class CpuBarrier { 25class 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
18std::mutex Scheduler::scheduler_mutex; 18std::mutex Scheduler::scheduler_mutex;
19 19
20Scheduler::Scheduler(ARM_Interface* cpu_core) : cpu_core(cpu_core) {} 20Scheduler::Scheduler(Core::ARM_Interface* cpu_core) : cpu_core(cpu_core) {}
21 21
22Scheduler::~Scheduler() { 22Scheduler::~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
14namespace Core {
14class ARM_Interface; 15class ARM_Interface;
16}
15 17
16namespace Kernel { 18namespace Kernel {
17 19
18class Scheduler final { 20class Scheduler final {
19public: 21public:
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 */
286static void ResetThreadContext(ARM_Interface::ThreadContext& context, VAddr stack_top, 286static 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