diff options
| author | 2014-11-17 22:55:50 -0500 | |
|---|---|---|
| committer | 2014-11-17 22:55:50 -0500 | |
| commit | 745b0219c5dae25d65f18ef13fd5dfd9ca23b671 (patch) | |
| tree | b9d4c36dce32830efd873ccacd25864d22f0e655 /src/core/hle/svc.cpp | |
| parent | Merge pull request #192 from bunnei/fs-fix-paths (diff) | |
| parent | core: Mark some hle functions as static (diff) | |
| download | yuzu-745b0219c5dae25d65f18ef13fd5dfd9ca23b671.tar.gz yuzu-745b0219c5dae25d65f18ef13fd5dfd9ca23b671.tar.xz yuzu-745b0219c5dae25d65f18ef13fd5dfd9ca23b671.zip | |
Merge pull request #200 from lioncash/statics
core: Mark some hle functions as static
Diffstat (limited to 'src/core/hle/svc.cpp')
| -rw-r--r-- | src/core/hle/svc.cpp | 52 |
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 |
| 32 | Result ControlMemory(u32* out_addr, u32 operation, u32 addr0, u32 addr1, u32 size, u32 permissions) { | 32 | static 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 |
| 56 | Result MapMemoryBlock(Handle handle, u32 addr, u32 permissions, u32 other_permissions) { | 56 | static 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 |
| 76 | Result ConnectToPort(Handle* out, const char* port_name) { | 76 | static 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 |
| 88 | Result SendSyncRequest(Handle handle) { | 88 | static 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 |
| 104 | Result CloseHandle(Handle handle) { | 104 | static 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 |
| 111 | Result WaitSynchronization1(Handle handle, s64 nano_seconds) { | 111 | static 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 |
| 135 | Result WaitSynchronizationN(s32* out, Handle* handles, s32 handle_count, bool wait_all, | 135 | static 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) |
| 177 | Result CreateAddressArbiter(u32* arbiter) { | 177 | static 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 |
| 185 | Result ArbitrateAddress(Handle arbiter, u32 address, u32 type, u32 value, s64 nanoseconds) { | 185 | static 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 |
| 191 | void OutputDebugString(const char* string) { | 191 | static 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 |
| 196 | Result GetResourceLimit(Handle* resource_limit, Handle process) { | 196 | static 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 |
| 206 | Result GetResourceLimitCurrentValues(s64* values, Handle resource_limit, void* names, | 206 | static 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 |
| 215 | Result CreateThread(u32 priority, u32 entry_point, u32 arg, u32 stack_top, u32 processor_id) { | 215 | static 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 |
| 237 | u32 ExitThread() { | 237 | static 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 |
| 248 | Result GetThreadPriority(s32* priority, Handle handle) { | 248 | static 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 |
| 254 | Result SetThreadPriority(Handle handle, s32 priority) { | 254 | static 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 |
| 259 | Result CreateMutex(Handle* mutex, u32 initial_locked) { | 259 | static 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 |
| 267 | Result ReleaseMutex(Handle handle) { | 267 | static 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 |
| 275 | Result GetThreadId(u32* thread_id, Handle thread) { | 275 | static 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 |
| 281 | Result QueryMemory(void* info, void* out, u32 addr) { | 281 | static 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 |
| 287 | Result CreateEvent(Handle* evt, u32 reset_type) { | 287 | static 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 |
| 295 | Result DuplicateHandle(Handle* out, Handle handle) { | 295 | static 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 |
| 312 | Result SignalEvent(Handle evt) { | 312 | static 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 |
| 319 | Result ClearEvent(Handle evt) { | 319 | static 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 |
| 326 | void SleepThread(s64 nanoseconds) { | 326 | static 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 |
| 331 | s64 GetSystemTick() { | 331 | static s64 GetSystemTick() { |
| 332 | return (s64)Core::g_app_core->GetTicks(); | 332 | return (s64)Core::g_app_core->GetTicks(); |
| 333 | } | 333 | } |
| 334 | 334 | ||