summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/fs_user.cpp14
-rw-r--r--src/core/hle/service/gsp_gpu.cpp16
-rw-r--r--src/core/hle/service/hid_user.cpp4
-rw-r--r--src/core/hle/service/srv.cpp6
-rw-r--r--src/core/hle/svc.cpp52
-rw-r--r--src/core/loader/ncch.cpp4
6 files changed, 48 insertions, 48 deletions
diff --git a/src/core/hle/service/fs_user.cpp b/src/core/hle/service/fs_user.cpp
index 8d8f0a201..06d3f5656 100644
--- a/src/core/hle/service/fs_user.cpp
+++ b/src/core/hle/service/fs_user.cpp
@@ -18,7 +18,7 @@ namespace FS_User {
18// puts all the sections of the http://3dbrew.org/wiki/Error_codes to something non-zero, to make 18// puts all the sections of the http://3dbrew.org/wiki/Error_codes to something non-zero, to make
19// sure we don't mislead the application into thinking something worked. 19// sure we don't mislead the application into thinking something worked.
20 20
21void Initialize(Service::Interface* self) { 21static void Initialize(Service::Interface* self) {
22 u32* cmd_buff = Service::GetCommandBuffer(); 22 u32* cmd_buff = Service::GetCommandBuffer();
23 23
24 // TODO(Link Mauve): check the behavior when cmd_buff[1] isn't 32, as per 24 // TODO(Link Mauve): check the behavior when cmd_buff[1] isn't 32, as per
@@ -44,7 +44,7 @@ void Initialize(Service::Interface* self) {
44 * 1 : Result of function, 0 on success, otherwise error code 44 * 1 : Result of function, 0 on success, otherwise error code
45 * 3 : File handle 45 * 3 : File handle
46 */ 46 */
47void OpenFile(Service::Interface* self) { 47static void OpenFile(Service::Interface* self) {
48 u32* cmd_buff = Service::GetCommandBuffer(); 48 u32* cmd_buff = Service::GetCommandBuffer();
49 49
50 // TODO(Link Mauve): cmd_buff[2], aka archive handle lower word, isn't used according to 50 // TODO(Link Mauve): cmd_buff[2], aka archive handle lower word, isn't used according to
@@ -91,7 +91,7 @@ void OpenFile(Service::Interface* self) {
91 * 1 : Result of function, 0 on success, otherwise error code 91 * 1 : Result of function, 0 on success, otherwise error code
92 * 3 : File handle 92 * 3 : File handle
93 */ 93 */
94void OpenFileDirectly(Service::Interface* self) { 94static void OpenFileDirectly(Service::Interface* self) {
95 u32* cmd_buff = Service::GetCommandBuffer(); 95 u32* cmd_buff = Service::GetCommandBuffer();
96 96
97 auto archive_id = static_cast<FileSys::Archive::IdCode>(cmd_buff[2]); 97 auto archive_id = static_cast<FileSys::Archive::IdCode>(cmd_buff[2]);
@@ -148,7 +148,7 @@ void OpenFileDirectly(Service::Interface* self) {
148 * Outputs: 148 * Outputs:
149 * 1 : Result of function, 0 on success, otherwise error code 149 * 1 : Result of function, 0 on success, otherwise error code
150 */ 150 */
151void CreateDirectory(Service::Interface* self) { 151static void CreateDirectory(Service::Interface* self) {
152 u32* cmd_buff = Service::GetCommandBuffer(); 152 u32* cmd_buff = Service::GetCommandBuffer();
153 153
154 // TODO: cmd_buff[2], aka archive handle lower word, isn't used according to 154 // TODO: cmd_buff[2], aka archive handle lower word, isn't used according to
@@ -177,7 +177,7 @@ void CreateDirectory(Service::Interface* self) {
177 DEBUG_LOG(KERNEL, "called"); 177 DEBUG_LOG(KERNEL, "called");
178} 178}
179 179
180void OpenDirectory(Service::Interface* self) { 180static void OpenDirectory(Service::Interface* self) {
181 u32* cmd_buff = Service::GetCommandBuffer(); 181 u32* cmd_buff = Service::GetCommandBuffer();
182 182
183 // TODO(Link Mauve): cmd_buff[2], aka archive handle lower word, isn't used according to 183 // TODO(Link Mauve): cmd_buff[2], aka archive handle lower word, isn't used according to
@@ -227,7 +227,7 @@ void OpenDirectory(Service::Interface* self) {
227 * 2 : Archive handle lower word (unused) 227 * 2 : Archive handle lower word (unused)
228 * 3 : Archive handle upper word (same as file handle) 228 * 3 : Archive handle upper word (same as file handle)
229 */ 229 */
230void OpenArchive(Service::Interface* self) { 230static void OpenArchive(Service::Interface* self) {
231 u32* cmd_buff = Service::GetCommandBuffer(); 231 u32* cmd_buff = Service::GetCommandBuffer();
232 232
233 auto archive_id = static_cast<FileSys::Archive::IdCode>(cmd_buff[1]); 233 auto archive_id = static_cast<FileSys::Archive::IdCode>(cmd_buff[1]);
@@ -264,7 +264,7 @@ void OpenArchive(Service::Interface* self) {
264* 1 : Result of function, 0 on success, otherwise error code 264* 1 : Result of function, 0 on success, otherwise error code
265* 2 : Whether the Sdmc could be detected 265* 2 : Whether the Sdmc could be detected
266*/ 266*/
267void IsSdmcDetected(Service::Interface* self) { 267static void IsSdmcDetected(Service::Interface* self) {
268 u32* cmd_buff = Service::GetCommandBuffer(); 268 u32* cmd_buff = Service::GetCommandBuffer();
269 269
270 cmd_buff[1] = 0; 270 cmd_buff[1] = 0;
diff --git a/src/core/hle/service/gsp_gpu.cpp b/src/core/hle/service/gsp_gpu.cpp
index 6119e6300..66daded94 100644
--- a/src/core/hle/service/gsp_gpu.cpp
+++ b/src/core/hle/service/gsp_gpu.cpp
@@ -52,7 +52,7 @@ static inline InterruptRelayQueue* GetInterruptRelayQueue(u32 thread_id) {
52 sizeof(InterruptRelayQueue) * thread_id); 52 sizeof(InterruptRelayQueue) * thread_id);
53} 53}
54 54
55void WriteHWRegs(u32 base_address, u32 size_in_bytes, const u32* data) { 55static void WriteHWRegs(u32 base_address, u32 size_in_bytes, const u32* data) {
56 // TODO: Return proper error codes 56 // TODO: Return proper error codes
57 if (base_address + size_in_bytes >= 0x420000) { 57 if (base_address + size_in_bytes >= 0x420000) {
58 ERROR_LOG(GPU, "Write address out of range! (address=0x%08x, size=0x%08x)", 58 ERROR_LOG(GPU, "Write address out of range! (address=0x%08x, size=0x%08x)",
@@ -76,7 +76,7 @@ void WriteHWRegs(u32 base_address, u32 size_in_bytes, const u32* data) {
76} 76}
77 77
78/// Write a GSP GPU hardware register 78/// Write a GSP GPU hardware register
79void WriteHWRegs(Service::Interface* self) { 79static void WriteHWRegs(Service::Interface* self) {
80 u32* cmd_buff = Service::GetCommandBuffer(); 80 u32* cmd_buff = Service::GetCommandBuffer();
81 u32 reg_addr = cmd_buff[1]; 81 u32 reg_addr = cmd_buff[1];
82 u32 size = cmd_buff[2]; 82 u32 size = cmd_buff[2];
@@ -87,7 +87,7 @@ void WriteHWRegs(Service::Interface* self) {
87} 87}
88 88
89/// Read a GSP GPU hardware register 89/// Read a GSP GPU hardware register
90void ReadHWRegs(Service::Interface* self) { 90static void ReadHWRegs(Service::Interface* self) {
91 u32* cmd_buff = Service::GetCommandBuffer(); 91 u32* cmd_buff = Service::GetCommandBuffer();
92 u32 reg_addr = cmd_buff[1]; 92 u32 reg_addr = cmd_buff[1];
93 u32 size = cmd_buff[2]; 93 u32 size = cmd_buff[2];
@@ -115,7 +115,7 @@ void ReadHWRegs(Service::Interface* self) {
115 } 115 }
116} 116}
117 117
118void SetBufferSwap(u32 screen_id, const FrameBufferInfo& info) { 118static void SetBufferSwap(u32 screen_id, const FrameBufferInfo& info) {
119 u32 base_address = 0x400000; 119 u32 base_address = 0x400000;
120 if (info.active_fb == 0) { 120 if (info.active_fb == 0) {
121 WriteHWRegs(base_address + 4 * GPU_REG_INDEX(framebuffer_config[screen_id].address_left1), 4, &info.address_left); 121 WriteHWRegs(base_address + 4 * GPU_REG_INDEX(framebuffer_config[screen_id].address_left1), 4, &info.address_left);
@@ -140,7 +140,7 @@ void SetBufferSwap(u32 screen_id, const FrameBufferInfo& info) {
140 * Outputs: 140 * Outputs:
141 * 1: Result code 141 * 1: Result code
142 */ 142 */
143void SetBufferSwap(Service::Interface* self) { 143static void SetBufferSwap(Service::Interface* self) {
144 u32* cmd_buff = Service::GetCommandBuffer(); 144 u32* cmd_buff = Service::GetCommandBuffer();
145 u32 screen_id = cmd_buff[1]; 145 u32 screen_id = cmd_buff[1];
146 FrameBufferInfo* fb_info = (FrameBufferInfo*)&cmd_buff[2]; 146 FrameBufferInfo* fb_info = (FrameBufferInfo*)&cmd_buff[2];
@@ -159,7 +159,7 @@ void SetBufferSwap(Service::Interface* self) {
159 * 2 : Thread index into GSP command buffer 159 * 2 : Thread index into GSP command buffer
160 * 4 : Handle to GSP shared memory 160 * 4 : Handle to GSP shared memory
161 */ 161 */
162void RegisterInterruptRelayQueue(Service::Interface* self) { 162static void RegisterInterruptRelayQueue(Service::Interface* self) {
163 u32* cmd_buff = Service::GetCommandBuffer(); 163 u32* cmd_buff = Service::GetCommandBuffer();
164 u32 flags = cmd_buff[1]; 164 u32 flags = cmd_buff[1];
165 g_interrupt_event = cmd_buff[3]; 165 g_interrupt_event = cmd_buff[3];
@@ -202,7 +202,7 @@ void SignalInterrupt(InterruptId interrupt_id) {
202} 202}
203 203
204/// Executes the next GSP command 204/// Executes the next GSP command
205void ExecuteCommand(const Command& command, u32 thread_id) { 205static void ExecuteCommand(const Command& command, u32 thread_id) {
206 // Utility function to convert register ID to address 206 // Utility function to convert register ID to address
207 auto WriteGPURegister = [](u32 id, u32 data) { 207 auto WriteGPURegister = [](u32 id, u32 data) {
208 GPU::Write<u32>(0x1EF00000 + 4 * id, data); 208 GPU::Write<u32>(0x1EF00000 + 4 * id, data);
@@ -308,7 +308,7 @@ void ExecuteCommand(const Command& command, u32 thread_id) {
308} 308}
309 309
310/// This triggers handling of the GX command written to the command buffer in shared memory. 310/// This triggers handling of the GX command written to the command buffer in shared memory.
311void TriggerCmdReqQueue(Service::Interface* self) { 311static void TriggerCmdReqQueue(Service::Interface* self) {
312 312
313 // Iterate through each thread's command queue... 313 // Iterate through each thread's command queue...
314 for (unsigned thread_id = 0; thread_id < 0x4; ++thread_id) { 314 for (unsigned thread_id = 0; thread_id < 0x4; ++thread_id) {
diff --git a/src/core/hle/service/hid_user.cpp b/src/core/hle/service/hid_user.cpp
index 0eb32ba4a..5f6bf1eff 100644
--- a/src/core/hle/service/hid_user.cpp
+++ b/src/core/hle/service/hid_user.cpp
@@ -47,7 +47,7 @@ static inline PadData* GetPadData() {
47 * 47 *
48 * Indicate the circle pad is pushed completely to the edge in 1 of 8 directions. 48 * Indicate the circle pad is pushed completely to the edge in 1 of 8 directions.
49 */ 49 */
50void UpdateNextCirclePadState() { 50static void UpdateNextCirclePadState() {
51 static const s16 max_value = 0x9C; 51 static const s16 max_value = 0x9C;
52 next_circle_x = next_state.circle_left ? -max_value : 0x0; 52 next_circle_x = next_state.circle_left ? -max_value : 0x0;
53 next_circle_x += next_state.circle_right ? max_value : 0x0; 53 next_circle_x += next_state.circle_right ? max_value : 0x0;
@@ -155,7 +155,7 @@ void PadUpdateComplete() {
155 * 7 : Gyroscope event 155 * 7 : Gyroscope event
156 * 8 : Event signaled by HID_User 156 * 8 : Event signaled by HID_User
157 */ 157 */
158void GetIPCHandles(Service::Interface* self) { 158static void GetIPCHandles(Service::Interface* self) {
159 u32* cmd_buff = Service::GetCommandBuffer(); 159 u32* cmd_buff = Service::GetCommandBuffer();
160 160
161 cmd_buff[1] = 0; // No error 161 cmd_buff[1] = 0; // No error
diff --git a/src/core/hle/service/srv.cpp b/src/core/hle/service/srv.cpp
index 6c02a43d9..420f53f8f 100644
--- a/src/core/hle/service/srv.cpp
+++ b/src/core/hle/service/srv.cpp
@@ -13,7 +13,7 @@ namespace SRV {
13 13
14Handle g_event_handle = 0; 14Handle g_event_handle = 0;
15 15
16void Initialize(Service::Interface* self) { 16static void Initialize(Service::Interface* self) {
17 DEBUG_LOG(OSHLE, "called"); 17 DEBUG_LOG(OSHLE, "called");
18 18
19 u32* cmd_buff = Service::GetCommandBuffer(); 19 u32* cmd_buff = Service::GetCommandBuffer();
@@ -21,7 +21,7 @@ void Initialize(Service::Interface* self) {
21 cmd_buff[1] = 0; // No error 21 cmd_buff[1] = 0; // No error
22} 22}
23 23
24void GetProcSemaphore(Service::Interface* self) { 24static void GetProcSemaphore(Service::Interface* self) {
25 DEBUG_LOG(OSHLE, "called"); 25 DEBUG_LOG(OSHLE, "called");
26 26
27 u32* cmd_buff = Service::GetCommandBuffer(); 27 u32* cmd_buff = Service::GetCommandBuffer();
@@ -34,7 +34,7 @@ void GetProcSemaphore(Service::Interface* self) {
34 cmd_buff[3] = g_event_handle; 34 cmd_buff[3] = g_event_handle;
35} 35}
36 36
37void GetServiceHandle(Service::Interface* self) { 37static void GetServiceHandle(Service::Interface* self) {
38 Result res = 0; 38 Result res = 0;
39 u32* cmd_buff = Service::GetCommandBuffer(); 39 u32* cmd_buff = Service::GetCommandBuffer();
40 40
diff --git a/src/core/hle/svc.cpp b/src/core/hle/svc.cpp
index 1eda36c53..16a1d99b7 100644
--- a/src/core/hle/svc.cpp
+++ b/src/core/hle/svc.cpp
@@ -29,7 +29,7 @@ enum ControlMemoryOperation {
29}; 29};
30 30
31/// Map application or GSP heap memory 31/// Map application or GSP heap memory
32Result ControlMemory(u32* out_addr, u32 operation, u32 addr0, u32 addr1, u32 size, u32 permissions) { 32static Result ControlMemory(u32* out_addr, u32 operation, u32 addr0, u32 addr1, u32 size, u32 permissions) {
33 DEBUG_LOG(SVC,"called operation=0x%08X, addr0=0x%08X, addr1=0x%08X, size=%08X, permissions=0x%08X", 33 DEBUG_LOG(SVC,"called operation=0x%08X, addr0=0x%08X, addr1=0x%08X, size=%08X, permissions=0x%08X",
34 operation, addr0, addr1, size, permissions); 34 operation, addr0, addr1, size, permissions);
35 35
@@ -53,7 +53,7 @@ Result ControlMemory(u32* out_addr, u32 operation, u32 addr0, u32 addr1, u32 siz
53} 53}
54 54
55/// Maps a memory block to specified address 55/// Maps a memory block to specified address
56Result MapMemoryBlock(Handle handle, u32 addr, u32 permissions, u32 other_permissions) { 56static Result MapMemoryBlock(Handle handle, u32 addr, u32 permissions, u32 other_permissions) {
57 DEBUG_LOG(SVC, "called memblock=0x%08X, addr=0x%08X, mypermissions=0x%08X, otherpermission=%d", 57 DEBUG_LOG(SVC, "called memblock=0x%08X, addr=0x%08X, mypermissions=0x%08X, otherpermission=%d",
58 handle, addr, permissions, other_permissions); 58 handle, addr, permissions, other_permissions);
59 59
@@ -73,7 +73,7 @@ Result MapMemoryBlock(Handle handle, u32 addr, u32 permissions, u32 other_permis
73} 73}
74 74
75/// Connect to an OS service given the port name, returns the handle to the port to out 75/// Connect to an OS service given the port name, returns the handle to the port to out
76Result ConnectToPort(Handle* out, const char* port_name) { 76static Result ConnectToPort(Handle* out, const char* port_name) {
77 Service::Interface* service = Service::g_manager->FetchFromPortName(port_name); 77 Service::Interface* service = Service::g_manager->FetchFromPortName(port_name);
78 78
79 DEBUG_LOG(SVC, "called port_name=%s", port_name); 79 DEBUG_LOG(SVC, "called port_name=%s", port_name);
@@ -85,7 +85,7 @@ Result ConnectToPort(Handle* out, const char* port_name) {
85} 85}
86 86
87/// Synchronize to an OS service 87/// Synchronize to an OS service
88Result SendSyncRequest(Handle handle) { 88static Result SendSyncRequest(Handle handle) {
89 Kernel::Object* object = Kernel::g_object_pool.GetFast<Kernel::Object>(handle); 89 Kernel::Object* object = Kernel::g_object_pool.GetFast<Kernel::Object>(handle);
90 90
91 _assert_msg_(KERNEL, (object != nullptr), "called, but kernel object is nullptr!"); 91 _assert_msg_(KERNEL, (object != nullptr), "called, but kernel object is nullptr!");
@@ -101,14 +101,14 @@ Result SendSyncRequest(Handle handle) {
101} 101}
102 102
103/// Close a handle 103/// Close a handle
104Result CloseHandle(Handle handle) { 104static Result CloseHandle(Handle handle) {
105 // ImplementMe 105 // ImplementMe
106 ERROR_LOG(SVC, "(UNIMPLEMENTED) called handle=0x%08X", handle); 106 ERROR_LOG(SVC, "(UNIMPLEMENTED) called handle=0x%08X", handle);
107 return 0; 107 return 0;
108} 108}
109 109
110/// Wait for a handle to synchronize, timeout after the specified nanoseconds 110/// Wait for a handle to synchronize, timeout after the specified nanoseconds
111Result WaitSynchronization1(Handle handle, s64 nano_seconds) { 111static Result WaitSynchronization1(Handle handle, s64 nano_seconds) {
112 // TODO(bunnei): Do something with nano_seconds, currently ignoring this 112 // TODO(bunnei): Do something with nano_seconds, currently ignoring this
113 bool wait = false; 113 bool wait = false;
114 bool wait_infinite = (nano_seconds == -1); // Used to wait until a thread has terminated 114 bool wait_infinite = (nano_seconds == -1); // Used to wait until a thread has terminated
@@ -132,7 +132,7 @@ Result WaitSynchronization1(Handle handle, s64 nano_seconds) {
132} 132}
133 133
134/// Wait for the given handles to synchronize, timeout after the specified nanoseconds 134/// Wait for the given handles to synchronize, timeout after the specified nanoseconds
135Result WaitSynchronizationN(s32* out, Handle* handles, s32 handle_count, bool wait_all, 135static Result WaitSynchronizationN(s32* out, Handle* handles, s32 handle_count, bool wait_all,
136 s64 nano_seconds) { 136 s64 nano_seconds) {
137 // TODO(bunnei): Do something with nano_seconds, currently ignoring this 137 // TODO(bunnei): Do something with nano_seconds, currently ignoring this
138 bool unlock_all = true; 138 bool unlock_all = true;
@@ -174,7 +174,7 @@ Result WaitSynchronizationN(s32* out, Handle* handles, s32 handle_count, bool wa
174} 174}
175 175
176/// Create an address arbiter (to allocate access to shared resources) 176/// Create an address arbiter (to allocate access to shared resources)
177Result CreateAddressArbiter(u32* arbiter) { 177static Result CreateAddressArbiter(u32* arbiter) {
178 DEBUG_LOG(SVC, "called"); 178 DEBUG_LOG(SVC, "called");
179 Handle handle = Kernel::CreateAddressArbiter(); 179 Handle handle = Kernel::CreateAddressArbiter();
180 *arbiter = handle; 180 *arbiter = handle;
@@ -182,18 +182,18 @@ Result CreateAddressArbiter(u32* arbiter) {
182} 182}
183 183
184/// Arbitrate address 184/// Arbitrate address
185Result ArbitrateAddress(Handle arbiter, u32 address, u32 type, u32 value, s64 nanoseconds) { 185static Result ArbitrateAddress(Handle arbiter, u32 address, u32 type, u32 value, s64 nanoseconds) {
186 return Kernel::ArbitrateAddress(arbiter, static_cast<Kernel::ArbitrationType>(type), address, 186 return Kernel::ArbitrateAddress(arbiter, static_cast<Kernel::ArbitrationType>(type), address,
187 value); 187 value);
188} 188}
189 189
190/// Used to output a message on a debug hardware unit - does nothing on a retail unit 190/// Used to output a message on a debug hardware unit - does nothing on a retail unit
191void OutputDebugString(const char* string) { 191static void OutputDebugString(const char* string) {
192 OS_LOG(SVC, "%s", string); 192 OS_LOG(SVC, "%s", string);
193} 193}
194 194
195/// Get resource limit 195/// Get resource limit
196Result GetResourceLimit(Handle* resource_limit, Handle process) { 196static Result GetResourceLimit(Handle* resource_limit, Handle process) {
197 // With regards to proceess values: 197 // With regards to proceess values:
198 // 0xFFFF8001 is a handle alias for the current KProcess, and 0xFFFF8000 is a handle alias for 198 // 0xFFFF8001 is a handle alias for the current KProcess, and 0xFFFF8000 is a handle alias for
199 // the current KThread. 199 // the current KThread.
@@ -203,7 +203,7 @@ Result GetResourceLimit(Handle* resource_limit, Handle process) {
203} 203}
204 204
205/// Get resource limit current values 205/// Get resource limit current values
206Result GetResourceLimitCurrentValues(s64* values, Handle resource_limit, void* names, 206static Result GetResourceLimitCurrentValues(s64* values, Handle resource_limit, void* names,
207 s32 name_count) { 207 s32 name_count) {
208 ERROR_LOG(SVC, "(UNIMPLEMENTED) called resource_limit=%08X, names=%s, name_count=%d", 208 ERROR_LOG(SVC, "(UNIMPLEMENTED) called resource_limit=%08X, names=%s, name_count=%d",
209 resource_limit, names, name_count); 209 resource_limit, names, name_count);
@@ -212,7 +212,7 @@ Result GetResourceLimitCurrentValues(s64* values, Handle resource_limit, void* n
212} 212}
213 213
214/// Creates a new thread 214/// Creates a new thread
215Result CreateThread(u32 priority, u32 entry_point, u32 arg, u32 stack_top, u32 processor_id) { 215static Result CreateThread(u32 priority, u32 entry_point, u32 arg, u32 stack_top, u32 processor_id) {
216 std::string name; 216 std::string name;
217 if (Symbols::HasSymbol(entry_point)) { 217 if (Symbols::HasSymbol(entry_point)) {
218 TSymbol symbol = Symbols::GetSymbol(entry_point); 218 TSymbol symbol = Symbols::GetSymbol(entry_point);
@@ -234,7 +234,7 @@ Result CreateThread(u32 priority, u32 entry_point, u32 arg, u32 stack_top, u32 p
234} 234}
235 235
236/// Called when a thread exits 236/// Called when a thread exits
237u32 ExitThread() { 237static u32 ExitThread() {
238 Handle thread = Kernel::GetCurrentThreadHandle(); 238 Handle thread = Kernel::GetCurrentThreadHandle();
239 239
240 DEBUG_LOG(SVC, "called, pc=0x%08X", Core::g_app_core->GetPC()); // PC = 0x0010545C 240 DEBUG_LOG(SVC, "called, pc=0x%08X", Core::g_app_core->GetPC()); // PC = 0x0010545C
@@ -245,18 +245,18 @@ u32 ExitThread() {
245} 245}
246 246
247/// Gets the priority for the specified thread 247/// Gets the priority for the specified thread
248Result GetThreadPriority(s32* priority, Handle handle) { 248static Result GetThreadPriority(s32* priority, Handle handle) {
249 *priority = Kernel::GetThreadPriority(handle); 249 *priority = Kernel::GetThreadPriority(handle);
250 return 0; 250 return 0;
251} 251}
252 252
253/// Sets the priority for the specified thread 253/// Sets the priority for the specified thread
254Result SetThreadPriority(Handle handle, s32 priority) { 254static Result SetThreadPriority(Handle handle, s32 priority) {
255 return Kernel::SetThreadPriority(handle, priority); 255 return Kernel::SetThreadPriority(handle, priority);
256} 256}
257 257
258/// Create a mutex 258/// Create a mutex
259Result CreateMutex(Handle* mutex, u32 initial_locked) { 259static Result CreateMutex(Handle* mutex, u32 initial_locked) {
260 *mutex = Kernel::CreateMutex((initial_locked != 0)); 260 *mutex = Kernel::CreateMutex((initial_locked != 0));
261 DEBUG_LOG(SVC, "called initial_locked=%s : created handle=0x%08X", 261 DEBUG_LOG(SVC, "called initial_locked=%s : created handle=0x%08X",
262 initial_locked ? "true" : "false", *mutex); 262 initial_locked ? "true" : "false", *mutex);
@@ -264,7 +264,7 @@ Result CreateMutex(Handle* mutex, u32 initial_locked) {
264} 264}
265 265
266/// Release a mutex 266/// Release a mutex
267Result ReleaseMutex(Handle handle) { 267static Result ReleaseMutex(Handle handle) {
268 DEBUG_LOG(SVC, "called handle=0x%08X", handle); 268 DEBUG_LOG(SVC, "called handle=0x%08X", handle);
269 _assert_msg_(KERNEL, (handle != 0), "called, but handle is nullptr!"); 269 _assert_msg_(KERNEL, (handle != 0), "called, but handle is nullptr!");
270 Kernel::ReleaseMutex(handle); 270 Kernel::ReleaseMutex(handle);
@@ -272,19 +272,19 @@ Result ReleaseMutex(Handle handle) {
272} 272}
273 273
274/// Get current thread ID 274/// Get current thread ID
275Result GetThreadId(u32* thread_id, Handle thread) { 275static Result GetThreadId(u32* thread_id, Handle thread) {
276 ERROR_LOG(SVC, "(UNIMPLEMENTED) called thread=0x%08X", thread); 276 ERROR_LOG(SVC, "(UNIMPLEMENTED) called thread=0x%08X", thread);
277 return 0; 277 return 0;
278} 278}
279 279
280/// Query memory 280/// Query memory
281Result QueryMemory(void* info, void* out, u32 addr) { 281static Result QueryMemory(void* info, void* out, u32 addr) {
282 ERROR_LOG(SVC, "(UNIMPLEMENTED) called addr=0x%08X", addr); 282 ERROR_LOG(SVC, "(UNIMPLEMENTED) called addr=0x%08X", addr);
283 return 0; 283 return 0;
284} 284}
285 285
286/// Create an event 286/// Create an event
287Result CreateEvent(Handle* evt, u32 reset_type) { 287static Result CreateEvent(Handle* evt, u32 reset_type) {
288 *evt = Kernel::CreateEvent((ResetType)reset_type); 288 *evt = Kernel::CreateEvent((ResetType)reset_type);
289 DEBUG_LOG(SVC, "called reset_type=0x%08X : created handle=0x%08X", 289 DEBUG_LOG(SVC, "called reset_type=0x%08X : created handle=0x%08X",
290 reset_type, *evt); 290 reset_type, *evt);
@@ -292,7 +292,7 @@ Result CreateEvent(Handle* evt, u32 reset_type) {
292} 292}
293 293
294/// Duplicates a kernel handle 294/// Duplicates a kernel handle
295Result DuplicateHandle(Handle* out, Handle handle) { 295static Result DuplicateHandle(Handle* out, Handle handle) {
296 DEBUG_LOG(SVC, "called handle=0x%08X", handle); 296 DEBUG_LOG(SVC, "called handle=0x%08X", handle);
297 297
298 // Translate kernel handles -> real handles 298 // Translate kernel handles -> real handles
@@ -309,26 +309,26 @@ Result DuplicateHandle(Handle* out, Handle handle) {
309} 309}
310 310
311/// Signals an event 311/// Signals an event
312Result SignalEvent(Handle evt) { 312static Result SignalEvent(Handle evt) {
313 Result res = Kernel::SignalEvent(evt); 313 Result res = Kernel::SignalEvent(evt);
314 DEBUG_LOG(SVC, "called event=0x%08X", evt); 314 DEBUG_LOG(SVC, "called event=0x%08X", evt);
315 return res; 315 return res;
316} 316}
317 317
318/// Clears an event 318/// Clears an event
319Result ClearEvent(Handle evt) { 319static Result ClearEvent(Handle evt) {
320 Result res = Kernel::ClearEvent(evt); 320 Result res = Kernel::ClearEvent(evt);
321 DEBUG_LOG(SVC, "called event=0x%08X", evt); 321 DEBUG_LOG(SVC, "called event=0x%08X", evt);
322 return res; 322 return res;
323} 323}
324 324
325/// Sleep the current thread 325/// Sleep the current thread
326void SleepThread(s64 nanoseconds) { 326static void SleepThread(s64 nanoseconds) {
327 DEBUG_LOG(SVC, "called nanoseconds=%lld", nanoseconds); 327 DEBUG_LOG(SVC, "called nanoseconds=%lld", nanoseconds);
328} 328}
329 329
330/// This returns the total CPU ticks elapsed since the CPU was powered-on 330/// This returns the total CPU ticks elapsed since the CPU was powered-on
331s64 GetSystemTick() { 331static s64 GetSystemTick() {
332 return (s64)Core::g_app_core->GetTicks(); 332 return (s64)Core::g_app_core->GetTicks();
333} 333}
334 334
diff --git a/src/core/loader/ncch.cpp b/src/core/loader/ncch.cpp
index 1e5501e6d..5b6f88604 100644
--- a/src/core/loader/ncch.cpp
+++ b/src/core/loader/ncch.cpp
@@ -24,7 +24,7 @@ static const int kBlockSize = 0x200; ///< Size of ExeFS blocks (in bytes)
24 * @param size Size of compressed buffer 24 * @param size Size of compressed buffer
25 * @return Size of decompressed buffer 25 * @return Size of decompressed buffer
26 */ 26 */
27u32 LZSS_GetDecompressedSize(u8* buffer, u32 size) { 27static u32 LZSS_GetDecompressedSize(u8* buffer, u32 size) {
28 u32 offset_size = *(u32*)(buffer + size - 4); 28 u32 offset_size = *(u32*)(buffer + size - 4);
29 return offset_size + size; 29 return offset_size + size;
30} 30}
@@ -37,7 +37,7 @@ u32 LZSS_GetDecompressedSize(u8* buffer, u32 size) {
37 * @param decompressed_size Size of decompressed buffer 37 * @param decompressed_size Size of decompressed buffer
38 * @return True on success, otherwise false 38 * @return True on success, otherwise false
39 */ 39 */
40bool LZSS_Decompress(u8* compressed, u32 compressed_size, u8* decompressed, u32 decompressed_size) { 40static bool LZSS_Decompress(u8* compressed, u32 compressed_size, u8* decompressed, u32 decompressed_size) {
41 u8* footer = compressed + compressed_size - 8; 41 u8* footer = compressed + compressed_size - 8;
42 u32 buffer_top_and_bottom = *(u32*)footer; 42 u32 buffer_top_and_bottom = *(u32*)footer;
43 u32 out = decompressed_size; 43 u32 out = decompressed_size;