summaryrefslogtreecommitdiff
path: root/src/core/hle/svc.cpp
diff options
context:
space:
mode:
authorGravatar Lioncash2014-11-16 22:58:39 -0500
committerGravatar Lioncash2014-11-17 22:41:49 -0500
commit72846c418e59771cd63cb21067f0c3e4e58b16f0 (patch)
treeb9d4c36dce32830efd873ccacd25864d22f0e655 /src/core/hle/svc.cpp
parentMerge pull request #192 from bunnei/fs-fix-paths (diff)
downloadyuzu-72846c418e59771cd63cb21067f0c3e4e58b16f0.tar.gz
yuzu-72846c418e59771cd63cb21067f0c3e4e58b16f0.tar.xz
yuzu-72846c418e59771cd63cb21067f0c3e4e58b16f0.zip
core: Mark some hle functions as static
These functions are not referred to by their linkage name outside of the translation unit, so they can be marked as static.
Diffstat (limited to 'src/core/hle/svc.cpp')
-rw-r--r--src/core/hle/svc.cpp52
1 files changed, 26 insertions, 26 deletions
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