summaryrefslogtreecommitdiff
path: root/src/core/hle
diff options
context:
space:
mode:
authorGravatar bunnei2016-12-22 00:00:01 -0500
committerGravatar bunnei2016-12-22 00:27:46 -0500
commite26fbfd1d72c026d0f25c09595e7123459b1734f (patch)
tree5d99608b33c991b59c25cd2014be8bacb136c29b /src/core/hle
parentAddress clang-format issues. (diff)
downloadyuzu-e26fbfd1d72c026d0f25c09595e7123459b1734f.tar.gz
yuzu-e26fbfd1d72c026d0f25c09595e7123459b1734f.tar.xz
yuzu-e26fbfd1d72c026d0f25c09595e7123459b1734f.zip
core: Replace "AppCore" nomenclature with just "CPU".
Diffstat (limited to 'src/core/hle')
-rw-r--r--src/core/hle/function_wrappers.h60
-rw-r--r--src/core/hle/kernel/thread.cpp6
-rw-r--r--src/core/hle/service/ldr_ro/ldr_ro.cpp8
-rw-r--r--src/core/hle/svc.cpp13
4 files changed, 43 insertions, 44 deletions
diff --git a/src/core/hle/function_wrappers.h b/src/core/hle/function_wrappers.h
index cafc7fe62..7875971ce 100644
--- a/src/core/hle/function_wrappers.h
+++ b/src/core/hle/function_wrappers.h
@@ -14,7 +14,7 @@
14 14
15namespace HLE { 15namespace HLE {
16 16
17#define PARAM(n) Core::AppCore().GetReg(n) 17#define PARAM(n) Core::CPU().GetReg(n)
18 18
19/// An invalid result code that is meant to be overwritten when a thread resumes from waiting 19/// An invalid result code that is meant to be overwritten when a thread resumes from waiting
20static const ResultCode RESULT_INVALID(0xDEADC0DE); 20static const ResultCode RESULT_INVALID(0xDEADC0DE);
@@ -24,7 +24,7 @@ static const ResultCode RESULT_INVALID(0xDEADC0DE);
24 * @param res Result to return 24 * @param res Result to return
25 */ 25 */
26static inline void FuncReturn(u32 res) { 26static inline void FuncReturn(u32 res) {
27 Core::AppCore().SetReg(0, res); 27 Core::CPU().SetReg(0, res);
28} 28}
29 29
30/** 30/**
@@ -33,8 +33,8 @@ static inline void FuncReturn(u32 res) {
33 * @todo Verify that this function is correct 33 * @todo Verify that this function is correct
34 */ 34 */
35static inline void FuncReturn64(u64 res) { 35static inline void FuncReturn64(u64 res) {
36 Core::AppCore().SetReg(0, (u32)(res & 0xFFFFFFFF)); 36 Core::CPU().SetReg(0, (u32)(res & 0xFFFFFFFF));
37 Core::AppCore().SetReg(1, (u32)((res >> 32) & 0xFFFFFFFF)); 37 Core::CPU().SetReg(1, (u32)((res >> 32) & 0xFFFFFFFF));
38} 38}
39 39
40//////////////////////////////////////////////////////////////////////////////////////////////////// 40////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -49,7 +49,7 @@ template <ResultCode func(u32*, u32, u32, u32, u32, u32)>
49void Wrap() { 49void Wrap() {
50 u32 param_1 = 0; 50 u32 param_1 = 0;
51 u32 retval = func(&param_1, PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4)).raw; 51 u32 retval = func(&param_1, PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4)).raw;
52 Core::AppCore().SetReg(1, param_1); 52 Core::CPU().SetReg(1, param_1);
53 FuncReturn(retval); 53 FuncReturn(retval);
54} 54}
55 55
@@ -57,7 +57,7 @@ template <ResultCode func(u32*, s32, u32, u32, u32, s32)>
57void Wrap() { 57void Wrap() {
58 u32 param_1 = 0; 58 u32 param_1 = 0;
59 u32 retval = func(&param_1, PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4)).raw; 59 u32 retval = func(&param_1, PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4)).raw;
60 Core::AppCore().SetReg(1, param_1); 60 Core::CPU().SetReg(1, param_1);
61 FuncReturn(retval); 61 FuncReturn(retval);
62} 62}
63 63
@@ -69,7 +69,7 @@ void Wrap() {
69 .raw; 69 .raw;
70 70
71 if (retval != RESULT_INVALID.raw) { 71 if (retval != RESULT_INVALID.raw) {
72 Core::AppCore().SetReg(1, (u32)param_1); 72 Core::CPU().SetReg(1, (u32)param_1);
73 FuncReturn(retval); 73 FuncReturn(retval);
74 } 74 }
75} 75}
@@ -84,7 +84,7 @@ template <ResultCode func(u32*)>
84void Wrap() { 84void Wrap() {
85 u32 param_1 = 0; 85 u32 param_1 = 0;
86 u32 retval = func(&param_1).raw; 86 u32 retval = func(&param_1).raw;
87 Core::AppCore().SetReg(1, param_1); 87 Core::CPU().SetReg(1, param_1);
88 FuncReturn(retval); 88 FuncReturn(retval);
89} 89}
90 90
@@ -102,11 +102,11 @@ void Wrap() {
102 MemoryInfo memory_info = {}; 102 MemoryInfo memory_info = {};
103 PageInfo page_info = {}; 103 PageInfo page_info = {};
104 u32 retval = func(&memory_info, &page_info, PARAM(2)).raw; 104 u32 retval = func(&memory_info, &page_info, PARAM(2)).raw;
105 Core::AppCore().SetReg(1, memory_info.base_address); 105 Core::CPU().SetReg(1, memory_info.base_address);
106 Core::AppCore().SetReg(2, memory_info.size); 106 Core::CPU().SetReg(2, memory_info.size);
107 Core::AppCore().SetReg(3, memory_info.permission); 107 Core::CPU().SetReg(3, memory_info.permission);
108 Core::AppCore().SetReg(4, memory_info.state); 108 Core::CPU().SetReg(4, memory_info.state);
109 Core::AppCore().SetReg(5, page_info.flags); 109 Core::CPU().SetReg(5, page_info.flags);
110 FuncReturn(retval); 110 FuncReturn(retval);
111} 111}
112 112
@@ -115,11 +115,11 @@ void Wrap() {
115 MemoryInfo memory_info = {}; 115 MemoryInfo memory_info = {};
116 PageInfo page_info = {}; 116 PageInfo page_info = {};
117 u32 retval = func(&memory_info, &page_info, PARAM(2), PARAM(3)).raw; 117 u32 retval = func(&memory_info, &page_info, PARAM(2), PARAM(3)).raw;
118 Core::AppCore().SetReg(1, memory_info.base_address); 118 Core::CPU().SetReg(1, memory_info.base_address);
119 Core::AppCore().SetReg(2, memory_info.size); 119 Core::CPU().SetReg(2, memory_info.size);
120 Core::AppCore().SetReg(3, memory_info.permission); 120 Core::CPU().SetReg(3, memory_info.permission);
121 Core::AppCore().SetReg(4, memory_info.state); 121 Core::CPU().SetReg(4, memory_info.state);
122 Core::AppCore().SetReg(5, page_info.flags); 122 Core::CPU().SetReg(5, page_info.flags);
123 FuncReturn(retval); 123 FuncReturn(retval);
124} 124}
125 125
@@ -127,7 +127,7 @@ template <ResultCode func(s32*, u32)>
127void Wrap() { 127void Wrap() {
128 s32 param_1 = 0; 128 s32 param_1 = 0;
129 u32 retval = func(&param_1, PARAM(1)).raw; 129 u32 retval = func(&param_1, PARAM(1)).raw;
130 Core::AppCore().SetReg(1, param_1); 130 Core::CPU().SetReg(1, param_1);
131 FuncReturn(retval); 131 FuncReturn(retval);
132} 132}
133 133
@@ -140,7 +140,7 @@ template <ResultCode func(u32*, u32)>
140void Wrap() { 140void Wrap() {
141 u32 param_1 = 0; 141 u32 param_1 = 0;
142 u32 retval = func(&param_1, PARAM(1)).raw; 142 u32 retval = func(&param_1, PARAM(1)).raw;
143 Core::AppCore().SetReg(1, param_1); 143 Core::CPU().SetReg(1, param_1);
144 FuncReturn(retval); 144 FuncReturn(retval);
145} 145}
146 146
@@ -160,7 +160,7 @@ template <ResultCode func(u32*, const char*)>
160void Wrap() { 160void Wrap() {
161 u32 param_1 = 0; 161 u32 param_1 = 0;
162 u32 retval = func(&param_1, (char*)Memory::GetPointer(PARAM(1))).raw; 162 u32 retval = func(&param_1, (char*)Memory::GetPointer(PARAM(1))).raw;
163 Core::AppCore().SetReg(1, param_1); 163 Core::CPU().SetReg(1, param_1);
164 FuncReturn(retval); 164 FuncReturn(retval);
165} 165}
166 166
@@ -168,7 +168,7 @@ template <ResultCode func(u32*, s32, s32)>
168void Wrap() { 168void Wrap() {
169 u32 param_1 = 0; 169 u32 param_1 = 0;
170 u32 retval = func(&param_1, PARAM(1), PARAM(2)).raw; 170 u32 retval = func(&param_1, PARAM(1), PARAM(2)).raw;
171 Core::AppCore().SetReg(1, param_1); 171 Core::CPU().SetReg(1, param_1);
172 FuncReturn(retval); 172 FuncReturn(retval);
173} 173}
174 174
@@ -176,7 +176,7 @@ template <ResultCode func(s32*, u32, s32)>
176void Wrap() { 176void Wrap() {
177 s32 param_1 = 0; 177 s32 param_1 = 0;
178 u32 retval = func(&param_1, PARAM(1), PARAM(2)).raw; 178 u32 retval = func(&param_1, PARAM(1), PARAM(2)).raw;
179 Core::AppCore().SetReg(1, param_1); 179 Core::CPU().SetReg(1, param_1);
180 FuncReturn(retval); 180 FuncReturn(retval);
181} 181}
182 182
@@ -184,8 +184,8 @@ template <ResultCode func(s64*, u32, s32)>
184void Wrap() { 184void Wrap() {
185 s64 param_1 = 0; 185 s64 param_1 = 0;
186 u32 retval = func(&param_1, PARAM(1), PARAM(2)).raw; 186 u32 retval = func(&param_1, PARAM(1), PARAM(2)).raw;
187 Core::AppCore().SetReg(1, (u32)param_1); 187 Core::CPU().SetReg(1, (u32)param_1);
188 Core::AppCore().SetReg(2, (u32)(param_1 >> 32)); 188 Core::CPU().SetReg(2, (u32)(param_1 >> 32));
189 FuncReturn(retval); 189 FuncReturn(retval);
190} 190}
191 191
@@ -194,7 +194,7 @@ void Wrap() {
194 u32 param_1 = 0; 194 u32 param_1 = 0;
195 // The last parameter is passed in R0 instead of R4 195 // The last parameter is passed in R0 instead of R4
196 u32 retval = func(&param_1, PARAM(1), PARAM(2), PARAM(3), PARAM(0)).raw; 196 u32 retval = func(&param_1, PARAM(1), PARAM(2), PARAM(3), PARAM(0)).raw;
197 Core::AppCore().SetReg(1, param_1); 197 Core::CPU().SetReg(1, param_1);
198 FuncReturn(retval); 198 FuncReturn(retval);
199} 199}
200 200
@@ -209,8 +209,8 @@ template <ResultCode func(s64*, Kernel::Handle, u32)>
209void Wrap() { 209void Wrap() {
210 s64 param_1 = 0; 210 s64 param_1 = 0;
211 u32 retval = func(&param_1, PARAM(1), PARAM(2)).raw; 211 u32 retval = func(&param_1, PARAM(1), PARAM(2)).raw;
212 Core::AppCore().SetReg(1, (u32)param_1); 212 Core::CPU().SetReg(1, (u32)param_1);
213 Core::AppCore().SetReg(2, (u32)(param_1 >> 32)); 213 Core::CPU().SetReg(2, (u32)(param_1 >> 32));
214 FuncReturn(retval); 214 FuncReturn(retval);
215} 215}
216 216
@@ -227,8 +227,8 @@ void Wrap() {
227 reinterpret_cast<const char*>(Memory::GetPointer(PARAM(2))), PARAM(3)) 227 reinterpret_cast<const char*>(Memory::GetPointer(PARAM(2))), PARAM(3))
228 .raw; 228 .raw;
229 // The first out parameter is moved into R2 and the second is moved into R1. 229 // The first out parameter is moved into R2 and the second is moved into R1.
230 Core::AppCore().SetReg(1, param_2); 230 Core::CPU().SetReg(1, param_2);
231 Core::AppCore().SetReg(2, param_1); 231 Core::CPU().SetReg(2, param_1);
232 FuncReturn(retval); 232 FuncReturn(retval);
233} 233}
234 234
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp
index c964b35d4..60b7bea70 100644
--- a/src/core/hle/kernel/thread.cpp
+++ b/src/core/hle/kernel/thread.cpp
@@ -187,7 +187,7 @@ static void SwitchContext(Thread* new_thread) {
187 // Save context for previous thread 187 // Save context for previous thread
188 if (previous_thread) { 188 if (previous_thread) {
189 previous_thread->last_running_ticks = CoreTiming::GetTicks(); 189 previous_thread->last_running_ticks = CoreTiming::GetTicks();
190 Core::AppCore().SaveContext(previous_thread->context); 190 Core::CPU().SaveContext(previous_thread->context);
191 191
192 if (previous_thread->status == THREADSTATUS_RUNNING) { 192 if (previous_thread->status == THREADSTATUS_RUNNING) {
193 // This is only the case when a reschedule is triggered without the current thread 193 // This is only the case when a reschedule is triggered without the current thread
@@ -213,8 +213,8 @@ static void SwitchContext(Thread* new_thread) {
213 // Restores thread to its nominal priority if it has been temporarily changed 213 // Restores thread to its nominal priority if it has been temporarily changed
214 new_thread->current_priority = new_thread->nominal_priority; 214 new_thread->current_priority = new_thread->nominal_priority;
215 215
216 Core::AppCore().LoadContext(new_thread->context); 216 Core::CPU().LoadContext(new_thread->context);
217 Core::AppCore().SetCP15Register(CP15_THREAD_URO, new_thread->GetTLSAddress()); 217 Core::CPU().SetCP15Register(CP15_THREAD_URO, new_thread->GetTLSAddress());
218 } else { 218 } else {
219 current_thread = nullptr; 219 current_thread = nullptr;
220 } 220 }
diff --git a/src/core/hle/service/ldr_ro/ldr_ro.cpp b/src/core/hle/service/ldr_ro/ldr_ro.cpp
index 614f16d44..8d00a7577 100644
--- a/src/core/hle/service/ldr_ro/ldr_ro.cpp
+++ b/src/core/hle/service/ldr_ro/ldr_ro.cpp
@@ -457,7 +457,7 @@ static void LoadCRO(Interface* self, bool link_on_load_bug_fix) {
457 } 457 }
458 } 458 }
459 459
460 Core::AppCore().ClearInstructionCache(); 460 Core::CPU().ClearInstructionCache();
461 461
462 LOG_INFO(Service_LDR, "CRO \"%s\" loaded at 0x%08X, fixed_end=0x%08X", cro.ModuleName().data(), 462 LOG_INFO(Service_LDR, "CRO \"%s\" loaded at 0x%08X, fixed_end=0x%08X", cro.ModuleName().data(),
463 cro_address, cro_address + fix_size); 463 cro_address, cro_address + fix_size);
@@ -562,7 +562,7 @@ static void UnloadCRO(Interface* self) {
562 memory_synchronizer.RemoveMemoryBlock(cro_address, cro_buffer_ptr); 562 memory_synchronizer.RemoveMemoryBlock(cro_address, cro_buffer_ptr);
563 } 563 }
564 564
565 Core::AppCore().ClearInstructionCache(); 565 Core::CPU().ClearInstructionCache();
566 566
567 cmd_buff[1] = result.raw; 567 cmd_buff[1] = result.raw;
568} 568}
@@ -624,7 +624,7 @@ static void LinkCRO(Interface* self) {
624 } 624 }
625 625
626 memory_synchronizer.SynchronizeOriginalMemory(); 626 memory_synchronizer.SynchronizeOriginalMemory();
627 Core::AppCore().ClearInstructionCache(); 627 Core::CPU().ClearInstructionCache();
628 628
629 cmd_buff[1] = result.raw; 629 cmd_buff[1] = result.raw;
630} 630}
@@ -686,7 +686,7 @@ static void UnlinkCRO(Interface* self) {
686 } 686 }
687 687
688 memory_synchronizer.SynchronizeOriginalMemory(); 688 memory_synchronizer.SynchronizeOriginalMemory();
689 Core::AppCore().ClearInstructionCache(); 689 Core::CPU().ClearInstructionCache();
690 690
691 cmd_buff[1] = result.raw; 691 cmd_buff[1] = result.raw;
692} 692}
diff --git a/src/core/hle/svc.cpp b/src/core/hle/svc.cpp
index 1f89ccfd5..2ca270de3 100644
--- a/src/core/hle/svc.cpp
+++ b/src/core/hle/svc.cpp
@@ -583,7 +583,7 @@ static ResultCode CreateThread(Kernel::Handle* out_handle, s32 priority, u32 ent
583 583
584/// Called when a thread exits 584/// Called when a thread exits
585static void ExitThread() { 585static void ExitThread() {
586 LOG_TRACE(Kernel_SVC, "called, pc=0x%08X", Core::AppCore().GetPC()); 586 LOG_TRACE(Kernel_SVC, "called, pc=0x%08X", Core::CPU().GetPC());
587 587
588 Kernel::ExitCurrentThread(); 588 Kernel::ExitCurrentThread();
589} 589}
@@ -613,7 +613,7 @@ static ResultCode CreateMutex(Kernel::Handle* out_handle, u32 initial_locked) {
613 using Kernel::Mutex; 613 using Kernel::Mutex;
614 614
615 SharedPtr<Mutex> mutex = Mutex::Create(initial_locked != 0); 615 SharedPtr<Mutex> mutex = Mutex::Create(initial_locked != 0);
616 mutex->name = Common::StringFromFormat("mutex-%08x", Core::AppCore().GetReg(14)); 616 mutex->name = Common::StringFromFormat("mutex-%08x", Core::CPU().GetReg(14));
617 CASCADE_RESULT(*out_handle, Kernel::g_handle_table.Create(std::move(mutex))); 617 CASCADE_RESULT(*out_handle, Kernel::g_handle_table.Create(std::move(mutex)));
618 618
619 LOG_TRACE(Kernel_SVC, "called initial_locked=%s : created handle=0x%08X", 619 LOG_TRACE(Kernel_SVC, "called initial_locked=%s : created handle=0x%08X",
@@ -684,7 +684,7 @@ static ResultCode CreateSemaphore(Kernel::Handle* out_handle, s32 initial_count,
684 using Kernel::Semaphore; 684 using Kernel::Semaphore;
685 685
686 CASCADE_RESULT(SharedPtr<Semaphore> semaphore, Semaphore::Create(initial_count, max_count)); 686 CASCADE_RESULT(SharedPtr<Semaphore> semaphore, Semaphore::Create(initial_count, max_count));
687 semaphore->name = Common::StringFromFormat("semaphore-%08x", Core::AppCore().GetReg(14)); 687 semaphore->name = Common::StringFromFormat("semaphore-%08x", Core::CPU().GetReg(14));
688 CASCADE_RESULT(*out_handle, Kernel::g_handle_table.Create(std::move(semaphore))); 688 CASCADE_RESULT(*out_handle, Kernel::g_handle_table.Create(std::move(semaphore)));
689 689
690 LOG_TRACE(Kernel_SVC, "called initial_count=%d, max_count=%d, created handle=0x%08X", 690 LOG_TRACE(Kernel_SVC, "called initial_count=%d, max_count=%d, created handle=0x%08X",
@@ -741,7 +741,7 @@ static ResultCode CreateEvent(Kernel::Handle* out_handle, u32 reset_type) {
741 using Kernel::Event; 741 using Kernel::Event;
742 742
743 SharedPtr<Event> evt = Event::Create(static_cast<Kernel::ResetType>(reset_type)); 743 SharedPtr<Event> evt = Event::Create(static_cast<Kernel::ResetType>(reset_type));
744 evt->name = Common::StringFromFormat("event-%08x", Core::AppCore().GetReg(14)); 744 evt->name = Common::StringFromFormat("event-%08x", Core::CPU().GetReg(14));
745 CASCADE_RESULT(*out_handle, Kernel::g_handle_table.Create(std::move(evt))); 745 CASCADE_RESULT(*out_handle, Kernel::g_handle_table.Create(std::move(evt)));
746 746
747 LOG_TRACE(Kernel_SVC, "called reset_type=0x%08X : created handle=0x%08X", reset_type, 747 LOG_TRACE(Kernel_SVC, "called reset_type=0x%08X : created handle=0x%08X", reset_type,
@@ -788,7 +788,7 @@ static ResultCode CreateTimer(Kernel::Handle* out_handle, u32 reset_type) {
788 using Kernel::Timer; 788 using Kernel::Timer;
789 789
790 SharedPtr<Timer> timer = Timer::Create(static_cast<Kernel::ResetType>(reset_type)); 790 SharedPtr<Timer> timer = Timer::Create(static_cast<Kernel::ResetType>(reset_type));
791 timer->name = Common::StringFromFormat("timer-%08x", Core::AppCore().GetReg(14)); 791 timer->name = Common::StringFromFormat("timer-%08x", Core::CPU().GetReg(14));
792 CASCADE_RESULT(*out_handle, Kernel::g_handle_table.Create(std::move(timer))); 792 CASCADE_RESULT(*out_handle, Kernel::g_handle_table.Create(std::move(timer)));
793 793
794 LOG_TRACE(Kernel_SVC, "called reset_type=0x%08X : created handle=0x%08X", reset_type, 794 LOG_TRACE(Kernel_SVC, "called reset_type=0x%08X : created handle=0x%08X", reset_type,
@@ -855,8 +855,7 @@ static void SleepThread(s64 nanoseconds) {
855static s64 GetSystemTick() { 855static s64 GetSystemTick() {
856 s64 result = CoreTiming::GetTicks(); 856 s64 result = CoreTiming::GetTicks();
857 // Advance time to defeat dumb games (like Cubic Ninja) that busy-wait for the frame to end. 857 // Advance time to defeat dumb games (like Cubic Ninja) that busy-wait for the frame to end.
858 Core::AppCore().AddTicks( 858 Core::CPU().AddTicks(150); // Measured time between two calls on a 9.2 o3DS with Ninjhax 1.1b
859 150); // Measured time between two calls on a 9.2 o3DS with Ninjhax 1.1b
860 return result; 859 return result;
861} 860}
862 861