diff options
| author | 2018-07-02 10:13:26 -0600 | |
|---|---|---|
| committer | 2018-07-02 21:45:47 -0400 | |
| commit | 638956aa81de255bf4bbd4e69a717eabf4ceadb9 (patch) | |
| tree | 5783dda790575e047fa757d8c56e11f3fffe7646 /src/core/hle/kernel/svc.cpp | |
| parent | Merge pull request #608 from Subv/depth (diff) | |
| download | yuzu-638956aa81de255bf4bbd4e69a717eabf4ceadb9.tar.gz yuzu-638956aa81de255bf4bbd4e69a717eabf4ceadb9.tar.xz yuzu-638956aa81de255bf4bbd4e69a717eabf4ceadb9.zip | |
Rename logging macro back to LOG_*
Diffstat (limited to 'src/core/hle/kernel/svc.cpp')
| -rw-r--r-- | src/core/hle/kernel/svc.cpp | 94 |
1 files changed, 47 insertions, 47 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index 1a36e0d02..843fffd7e 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp | |||
| @@ -32,7 +32,7 @@ namespace Kernel { | |||
| 32 | 32 | ||
| 33 | /// Set the process heap to a given Size. It can both extend and shrink the heap. | 33 | /// Set the process heap to a given Size. It can both extend and shrink the heap. |
| 34 | static ResultCode SetHeapSize(VAddr* heap_addr, u64 heap_size) { | 34 | static ResultCode SetHeapSize(VAddr* heap_addr, u64 heap_size) { |
| 35 | NGLOG_TRACE(Kernel_SVC, "called, heap_size=0x{:X}", heap_size); | 35 | LOG_TRACE(Kernel_SVC, "called, heap_size=0x{:X}", heap_size); |
| 36 | auto& process = *Core::CurrentProcess(); | 36 | auto& process = *Core::CurrentProcess(); |
| 37 | CASCADE_RESULT(*heap_addr, | 37 | CASCADE_RESULT(*heap_addr, |
| 38 | process.HeapAllocate(Memory::HEAP_VADDR, heap_size, VMAPermission::ReadWrite)); | 38 | process.HeapAllocate(Memory::HEAP_VADDR, heap_size, VMAPermission::ReadWrite)); |
| @@ -40,20 +40,20 @@ static ResultCode SetHeapSize(VAddr* heap_addr, u64 heap_size) { | |||
| 40 | } | 40 | } |
| 41 | 41 | ||
| 42 | static ResultCode SetMemoryAttribute(VAddr addr, u64 size, u32 state0, u32 state1) { | 42 | static ResultCode SetMemoryAttribute(VAddr addr, u64 size, u32 state0, u32 state1) { |
| 43 | NGLOG_WARNING(Kernel_SVC, "(STUBBED) called, addr=0x{:X}", addr); | 43 | LOG_WARNING(Kernel_SVC, "(STUBBED) called, addr=0x{:X}", addr); |
| 44 | return RESULT_SUCCESS; | 44 | return RESULT_SUCCESS; |
| 45 | } | 45 | } |
| 46 | 46 | ||
| 47 | /// Maps a memory range into a different range. | 47 | /// Maps a memory range into a different range. |
| 48 | static ResultCode MapMemory(VAddr dst_addr, VAddr src_addr, u64 size) { | 48 | static ResultCode MapMemory(VAddr dst_addr, VAddr src_addr, u64 size) { |
| 49 | NGLOG_TRACE(Kernel_SVC, "called, dst_addr=0x{:X}, src_addr=0x{:X}, size=0x{:X}", dst_addr, | 49 | LOG_TRACE(Kernel_SVC, "called, dst_addr=0x{:X}, src_addr=0x{:X}, size=0x{:X}", dst_addr, |
| 50 | src_addr, size); | 50 | src_addr, size); |
| 51 | return Core::CurrentProcess()->MirrorMemory(dst_addr, src_addr, size); | 51 | return Core::CurrentProcess()->MirrorMemory(dst_addr, src_addr, size); |
| 52 | } | 52 | } |
| 53 | 53 | ||
| 54 | /// Unmaps a region that was previously mapped with svcMapMemory | 54 | /// Unmaps a region that was previously mapped with svcMapMemory |
| 55 | static ResultCode UnmapMemory(VAddr dst_addr, VAddr src_addr, u64 size) { | 55 | static ResultCode UnmapMemory(VAddr dst_addr, VAddr src_addr, u64 size) { |
| 56 | NGLOG_TRACE(Kernel_SVC, "called, dst_addr=0x{:X}, src_addr=0x{:X}, size=0x{:X}", dst_addr, | 56 | LOG_TRACE(Kernel_SVC, "called, dst_addr=0x{:X}, src_addr=0x{:X}, size=0x{:X}", dst_addr, |
| 57 | src_addr, size); | 57 | src_addr, size); |
| 58 | return Core::CurrentProcess()->UnmapMemory(dst_addr, src_addr, size); | 58 | return Core::CurrentProcess()->UnmapMemory(dst_addr, src_addr, size); |
| 59 | } | 59 | } |
| @@ -69,11 +69,11 @@ static ResultCode ConnectToNamedPort(Handle* out_handle, VAddr port_name_address | |||
| 69 | if (port_name.size() > PortNameMaxLength) | 69 | if (port_name.size() > PortNameMaxLength) |
| 70 | return ERR_PORT_NAME_TOO_LONG; | 70 | return ERR_PORT_NAME_TOO_LONG; |
| 71 | 71 | ||
| 72 | NGLOG_TRACE(Kernel_SVC, "called port_name={}", port_name); | 72 | LOG_TRACE(Kernel_SVC, "called port_name={}", port_name); |
| 73 | 73 | ||
| 74 | auto it = Service::g_kernel_named_ports.find(port_name); | 74 | auto it = Service::g_kernel_named_ports.find(port_name); |
| 75 | if (it == Service::g_kernel_named_ports.end()) { | 75 | if (it == Service::g_kernel_named_ports.end()) { |
| 76 | NGLOG_WARNING(Kernel_SVC, "tried to connect to unknown port: {}", port_name); | 76 | LOG_WARNING(Kernel_SVC, "tried to connect to unknown port: {}", port_name); |
| 77 | return ERR_NOT_FOUND; | 77 | return ERR_NOT_FOUND; |
| 78 | } | 78 | } |
| 79 | 79 | ||
| @@ -91,11 +91,11 @@ static ResultCode ConnectToNamedPort(Handle* out_handle, VAddr port_name_address | |||
| 91 | static ResultCode SendSyncRequest(Handle handle) { | 91 | static ResultCode SendSyncRequest(Handle handle) { |
| 92 | SharedPtr<ClientSession> session = g_handle_table.Get<ClientSession>(handle); | 92 | SharedPtr<ClientSession> session = g_handle_table.Get<ClientSession>(handle); |
| 93 | if (!session) { | 93 | if (!session) { |
| 94 | NGLOG_ERROR(Kernel_SVC, "called with invalid handle=0x{:08X}", handle); | 94 | LOG_ERROR(Kernel_SVC, "called with invalid handle=0x{:08X}", handle); |
| 95 | return ERR_INVALID_HANDLE; | 95 | return ERR_INVALID_HANDLE; |
| 96 | } | 96 | } |
| 97 | 97 | ||
| 98 | NGLOG_TRACE(Kernel_SVC, "called handle=0x{:08X}({})", handle, session->GetName()); | 98 | LOG_TRACE(Kernel_SVC, "called handle=0x{:08X}({})", handle, session->GetName()); |
| 99 | 99 | ||
| 100 | Core::System::GetInstance().PrepareReschedule(); | 100 | Core::System::GetInstance().PrepareReschedule(); |
| 101 | 101 | ||
| @@ -106,7 +106,7 @@ static ResultCode SendSyncRequest(Handle handle) { | |||
| 106 | 106 | ||
| 107 | /// Get the ID for the specified thread. | 107 | /// Get the ID for the specified thread. |
| 108 | static ResultCode GetThreadId(u32* thread_id, Handle thread_handle) { | 108 | static ResultCode GetThreadId(u32* thread_id, Handle thread_handle) { |
| 109 | NGLOG_TRACE(Kernel_SVC, "called thread=0x{:08X}", thread_handle); | 109 | LOG_TRACE(Kernel_SVC, "called thread=0x{:08X}", thread_handle); |
| 110 | 110 | ||
| 111 | const SharedPtr<Thread> thread = g_handle_table.Get<Thread>(thread_handle); | 111 | const SharedPtr<Thread> thread = g_handle_table.Get<Thread>(thread_handle); |
| 112 | if (!thread) { | 112 | if (!thread) { |
| @@ -119,7 +119,7 @@ static ResultCode GetThreadId(u32* thread_id, Handle thread_handle) { | |||
| 119 | 119 | ||
| 120 | /// Get the ID of the specified process | 120 | /// Get the ID of the specified process |
| 121 | static ResultCode GetProcessId(u32* process_id, Handle process_handle) { | 121 | static ResultCode GetProcessId(u32* process_id, Handle process_handle) { |
| 122 | NGLOG_TRACE(Kernel_SVC, "called process=0x{:08X}", process_handle); | 122 | LOG_TRACE(Kernel_SVC, "called process=0x{:08X}", process_handle); |
| 123 | 123 | ||
| 124 | const SharedPtr<Process> process = g_handle_table.Get<Process>(process_handle); | 124 | const SharedPtr<Process> process = g_handle_table.Get<Process>(process_handle); |
| 125 | if (!process) { | 125 | if (!process) { |
| @@ -149,7 +149,7 @@ static bool DefaultThreadWakeupCallback(ThreadWakeupReason reason, SharedPtr<Thr | |||
| 149 | /// Wait for the given handles to synchronize, timeout after the specified nanoseconds | 149 | /// Wait for the given handles to synchronize, timeout after the specified nanoseconds |
| 150 | static ResultCode WaitSynchronization(Handle* index, VAddr handles_address, u64 handle_count, | 150 | static ResultCode WaitSynchronization(Handle* index, VAddr handles_address, u64 handle_count, |
| 151 | s64 nano_seconds) { | 151 | s64 nano_seconds) { |
| 152 | NGLOG_TRACE(Kernel_SVC, "called handles_address=0x{:X}, handle_count={}, nano_seconds={}", | 152 | LOG_TRACE(Kernel_SVC, "called handles_address=0x{:X}, handle_count={}, nano_seconds={}", |
| 153 | handles_address, handle_count, nano_seconds); | 153 | handles_address, handle_count, nano_seconds); |
| 154 | 154 | ||
| 155 | if (!Memory::IsValidVirtualAddress(handles_address)) | 155 | if (!Memory::IsValidVirtualAddress(handles_address)) |
| @@ -210,7 +210,7 @@ static ResultCode WaitSynchronization(Handle* index, VAddr handles_address, u64 | |||
| 210 | 210 | ||
| 211 | /// Resumes a thread waiting on WaitSynchronization | 211 | /// Resumes a thread waiting on WaitSynchronization |
| 212 | static ResultCode CancelSynchronization(Handle thread_handle) { | 212 | static ResultCode CancelSynchronization(Handle thread_handle) { |
| 213 | NGLOG_TRACE(Kernel_SVC, "called thread=0x{:X}", thread_handle); | 213 | LOG_TRACE(Kernel_SVC, "called thread=0x{:X}", thread_handle); |
| 214 | 214 | ||
| 215 | const SharedPtr<Thread> thread = g_handle_table.Get<Thread>(thread_handle); | 215 | const SharedPtr<Thread> thread = g_handle_table.Get<Thread>(thread_handle); |
| 216 | if (!thread) { | 216 | if (!thread) { |
| @@ -227,7 +227,7 @@ static ResultCode CancelSynchronization(Handle thread_handle) { | |||
| 227 | /// Attempts to locks a mutex, creating it if it does not already exist | 227 | /// Attempts to locks a mutex, creating it if it does not already exist |
| 228 | static ResultCode ArbitrateLock(Handle holding_thread_handle, VAddr mutex_addr, | 228 | static ResultCode ArbitrateLock(Handle holding_thread_handle, VAddr mutex_addr, |
| 229 | Handle requesting_thread_handle) { | 229 | Handle requesting_thread_handle) { |
| 230 | NGLOG_TRACE(Kernel_SVC, | 230 | LOG_TRACE(Kernel_SVC, |
| 231 | "called holding_thread_handle=0x{:08X}, mutex_addr=0x{:X}, " | 231 | "called holding_thread_handle=0x{:08X}, mutex_addr=0x{:X}, " |
| 232 | "requesting_current_thread_handle=0x{:08X}", | 232 | "requesting_current_thread_handle=0x{:08X}", |
| 233 | holding_thread_handle, mutex_addr, requesting_thread_handle); | 233 | holding_thread_handle, mutex_addr, requesting_thread_handle); |
| @@ -237,14 +237,14 @@ static ResultCode ArbitrateLock(Handle holding_thread_handle, VAddr mutex_addr, | |||
| 237 | 237 | ||
| 238 | /// Unlock a mutex | 238 | /// Unlock a mutex |
| 239 | static ResultCode ArbitrateUnlock(VAddr mutex_addr) { | 239 | static ResultCode ArbitrateUnlock(VAddr mutex_addr) { |
| 240 | NGLOG_TRACE(Kernel_SVC, "called mutex_addr=0x{:X}", mutex_addr); | 240 | LOG_TRACE(Kernel_SVC, "called mutex_addr=0x{:X}", mutex_addr); |
| 241 | 241 | ||
| 242 | return Mutex::Release(mutex_addr); | 242 | return Mutex::Release(mutex_addr); |
| 243 | } | 243 | } |
| 244 | 244 | ||
| 245 | /// Break program execution | 245 | /// Break program execution |
| 246 | static void Break(u64 unk_0, u64 unk_1, u64 unk_2) { | 246 | static void Break(u64 unk_0, u64 unk_1, u64 unk_2) { |
| 247 | NGLOG_CRITICAL(Debug_Emulated, "Emulated program broke execution!"); | 247 | LOG_CRITICAL(Debug_Emulated, "Emulated program broke execution!"); |
| 248 | ASSERT(false); | 248 | ASSERT(false); |
| 249 | } | 249 | } |
| 250 | 250 | ||
| @@ -252,12 +252,12 @@ static void Break(u64 unk_0, u64 unk_1, u64 unk_2) { | |||
| 252 | static void OutputDebugString(VAddr address, s32 len) { | 252 | static void OutputDebugString(VAddr address, s32 len) { |
| 253 | std::string str(len, '\0'); | 253 | std::string str(len, '\0'); |
| 254 | Memory::ReadBlock(address, str.data(), str.size()); | 254 | Memory::ReadBlock(address, str.data(), str.size()); |
| 255 | NGLOG_DEBUG(Debug_Emulated, "{}", str); | 255 | LOG_DEBUG(Debug_Emulated, "{}", str); |
| 256 | } | 256 | } |
| 257 | 257 | ||
| 258 | /// Gets system/memory information for the current process | 258 | /// Gets system/memory information for the current process |
| 259 | static ResultCode GetInfo(u64* result, u64 info_id, u64 handle, u64 info_sub_id) { | 259 | static ResultCode GetInfo(u64* result, u64 info_id, u64 handle, u64 info_sub_id) { |
| 260 | NGLOG_TRACE(Kernel_SVC, "called info_id=0x{:X}, info_sub_id=0x{:X}, handle=0x{:08X}", info_id, | 260 | LOG_TRACE(Kernel_SVC, "called info_id=0x{:X}, info_sub_id=0x{:X}, handle=0x{:08X}", info_id, |
| 261 | info_sub_id, handle); | 261 | info_sub_id, handle); |
| 262 | 262 | ||
| 263 | auto& vm_manager = Core::CurrentProcess()->vm_manager; | 263 | auto& vm_manager = Core::CurrentProcess()->vm_manager; |
| @@ -309,16 +309,16 @@ static ResultCode GetInfo(u64* result, u64 info_id, u64 handle, u64 info_sub_id) | |||
| 309 | *result = Core::CurrentProcess()->is_virtual_address_memory_enabled; | 309 | *result = Core::CurrentProcess()->is_virtual_address_memory_enabled; |
| 310 | break; | 310 | break; |
| 311 | case GetInfoType::TitleId: | 311 | case GetInfoType::TitleId: |
| 312 | NGLOG_WARNING(Kernel_SVC, "(STUBBED) Attempted to query titleid, returned 0"); | 312 | LOG_WARNING(Kernel_SVC, "(STUBBED) Attempted to query titleid, returned 0"); |
| 313 | *result = 0; | 313 | *result = 0; |
| 314 | break; | 314 | break; |
| 315 | case GetInfoType::PrivilegedProcessId: | 315 | case GetInfoType::PrivilegedProcessId: |
| 316 | NGLOG_WARNING(Kernel_SVC, | 316 | LOG_WARNING(Kernel_SVC, |
| 317 | "(STUBBED) Attempted to query privileged process id bounds, returned 0"); | 317 | "(STUBBED) Attempted to query privileged process id bounds, returned 0"); |
| 318 | *result = 0; | 318 | *result = 0; |
| 319 | break; | 319 | break; |
| 320 | case GetInfoType::UserExceptionContextAddr: | 320 | case GetInfoType::UserExceptionContextAddr: |
| 321 | NGLOG_WARNING(Kernel_SVC, | 321 | LOG_WARNING(Kernel_SVC, |
| 322 | "(STUBBED) Attempted to query user exception context address, returned 0"); | 322 | "(STUBBED) Attempted to query user exception context address, returned 0"); |
| 323 | *result = 0; | 323 | *result = 0; |
| 324 | break; | 324 | break; |
| @@ -331,14 +331,14 @@ static ResultCode GetInfo(u64* result, u64 info_id, u64 handle, u64 info_sub_id) | |||
| 331 | 331 | ||
| 332 | /// Sets the thread activity | 332 | /// Sets the thread activity |
| 333 | static ResultCode SetThreadActivity(Handle handle, u32 unknown) { | 333 | static ResultCode SetThreadActivity(Handle handle, u32 unknown) { |
| 334 | NGLOG_WARNING(Kernel_SVC, "(STUBBED) called, handle=0x{:08X}, unknown=0x{:08X}", handle, | 334 | LOG_WARNING(Kernel_SVC, "(STUBBED) called, handle=0x{:08X}, unknown=0x{:08X}", handle, |
| 335 | unknown); | 335 | unknown); |
| 336 | return RESULT_SUCCESS; | 336 | return RESULT_SUCCESS; |
| 337 | } | 337 | } |
| 338 | 338 | ||
| 339 | /// Gets the thread context | 339 | /// Gets the thread context |
| 340 | static ResultCode GetThreadContext(Handle handle, VAddr addr) { | 340 | static ResultCode GetThreadContext(Handle handle, VAddr addr) { |
| 341 | NGLOG_WARNING(Kernel_SVC, "(STUBBED) called, handle=0x{:08X}, addr=0x{:X}", handle, addr); | 341 | LOG_WARNING(Kernel_SVC, "(STUBBED) called, handle=0x{:08X}, addr=0x{:X}", handle, addr); |
| 342 | return RESULT_SUCCESS; | 342 | return RESULT_SUCCESS; |
| 343 | } | 343 | } |
| 344 | 344 | ||
| @@ -377,13 +377,13 @@ static ResultCode SetThreadPriority(Handle handle, u32 priority) { | |||
| 377 | 377 | ||
| 378 | /// Get which CPU core is executing the current thread | 378 | /// Get which CPU core is executing the current thread |
| 379 | static u32 GetCurrentProcessorNumber() { | 379 | static u32 GetCurrentProcessorNumber() { |
| 380 | NGLOG_TRACE(Kernel_SVC, "called"); | 380 | LOG_TRACE(Kernel_SVC, "called"); |
| 381 | return GetCurrentThread()->processor_id; | 381 | return GetCurrentThread()->processor_id; |
| 382 | } | 382 | } |
| 383 | 383 | ||
| 384 | static ResultCode MapSharedMemory(Handle shared_memory_handle, VAddr addr, u64 size, | 384 | static ResultCode MapSharedMemory(Handle shared_memory_handle, VAddr addr, u64 size, |
| 385 | u32 permissions) { | 385 | u32 permissions) { |
| 386 | NGLOG_TRACE( | 386 | LOG_TRACE( |
| 387 | Kernel_SVC, | 387 | Kernel_SVC, |
| 388 | "called, shared_memory_handle=0x{:X}, addr=0x{:X}, size=0x{:X}, permissions=0x{:08X}", | 388 | "called, shared_memory_handle=0x{:X}, addr=0x{:X}, size=0x{:X}, permissions=0x{:08X}", |
| 389 | shared_memory_handle, addr, size, permissions); | 389 | shared_memory_handle, addr, size, permissions); |
| @@ -406,14 +406,14 @@ static ResultCode MapSharedMemory(Handle shared_memory_handle, VAddr addr, u64 s | |||
| 406 | return shared_memory->Map(Core::CurrentProcess().get(), addr, permissions_type, | 406 | return shared_memory->Map(Core::CurrentProcess().get(), addr, permissions_type, |
| 407 | MemoryPermission::DontCare); | 407 | MemoryPermission::DontCare); |
| 408 | default: | 408 | default: |
| 409 | NGLOG_ERROR(Kernel_SVC, "unknown permissions=0x{:08X}", permissions); | 409 | LOG_ERROR(Kernel_SVC, "unknown permissions=0x{:08X}", permissions); |
| 410 | } | 410 | } |
| 411 | 411 | ||
| 412 | return RESULT_SUCCESS; | 412 | return RESULT_SUCCESS; |
| 413 | } | 413 | } |
| 414 | 414 | ||
| 415 | static ResultCode UnmapSharedMemory(Handle shared_memory_handle, VAddr addr, u64 size) { | 415 | static ResultCode UnmapSharedMemory(Handle shared_memory_handle, VAddr addr, u64 size) { |
| 416 | NGLOG_WARNING(Kernel_SVC, "called, shared_memory_handle=0x{:08X}, addr=0x{:X}, size=0x{:X}", | 416 | LOG_WARNING(Kernel_SVC, "called, shared_memory_handle=0x{:08X}, addr=0x{:X}, size=0x{:X}", |
| 417 | shared_memory_handle, addr, size); | 417 | shared_memory_handle, addr, size); |
| 418 | 418 | ||
| 419 | SharedPtr<SharedMemory> shared_memory = g_handle_table.Get<SharedMemory>(shared_memory_handle); | 419 | SharedPtr<SharedMemory> shared_memory = g_handle_table.Get<SharedMemory>(shared_memory_handle); |
| @@ -442,19 +442,19 @@ static ResultCode QueryProcessMemory(MemoryInfo* memory_info, PageInfo* /*page_i | |||
| 442 | memory_info->type = static_cast<u32>(vma->second.meminfo_state); | 442 | memory_info->type = static_cast<u32>(vma->second.meminfo_state); |
| 443 | } | 443 | } |
| 444 | 444 | ||
| 445 | NGLOG_TRACE(Kernel_SVC, "called process=0x{:08X} addr={:X}", process_handle, addr); | 445 | LOG_TRACE(Kernel_SVC, "called process=0x{:08X} addr={:X}", process_handle, addr); |
| 446 | return RESULT_SUCCESS; | 446 | return RESULT_SUCCESS; |
| 447 | } | 447 | } |
| 448 | 448 | ||
| 449 | /// Query memory | 449 | /// Query memory |
| 450 | static ResultCode QueryMemory(MemoryInfo* memory_info, PageInfo* page_info, VAddr addr) { | 450 | static ResultCode QueryMemory(MemoryInfo* memory_info, PageInfo* page_info, VAddr addr) { |
| 451 | NGLOG_TRACE(Kernel_SVC, "called, addr={:X}", addr); | 451 | LOG_TRACE(Kernel_SVC, "called, addr={:X}", addr); |
| 452 | return QueryProcessMemory(memory_info, page_info, CurrentProcess, addr); | 452 | return QueryProcessMemory(memory_info, page_info, CurrentProcess, addr); |
| 453 | } | 453 | } |
| 454 | 454 | ||
| 455 | /// Exits the current process | 455 | /// Exits the current process |
| 456 | static void ExitProcess() { | 456 | static void ExitProcess() { |
| 457 | NGLOG_INFO(Kernel_SVC, "Process {} exiting", Core::CurrentProcess()->process_id); | 457 | LOG_INFO(Kernel_SVC, "Process {} exiting", Core::CurrentProcess()->process_id); |
| 458 | 458 | ||
| 459 | ASSERT_MSG(Core::CurrentProcess()->status == ProcessStatus::Running, | 459 | ASSERT_MSG(Core::CurrentProcess()->status == ProcessStatus::Running, |
| 460 | "Process has already exited"); | 460 | "Process has already exited"); |
| @@ -530,7 +530,7 @@ static ResultCode CreateThread(Handle* out_handle, VAddr entry_point, u64 arg, V | |||
| 530 | Core::System::GetInstance().PrepareReschedule(); | 530 | Core::System::GetInstance().PrepareReschedule(); |
| 531 | Core::System::GetInstance().CpuCore(thread->processor_id).PrepareReschedule(); | 531 | Core::System::GetInstance().CpuCore(thread->processor_id).PrepareReschedule(); |
| 532 | 532 | ||
| 533 | NGLOG_TRACE(Kernel_SVC, | 533 | LOG_TRACE(Kernel_SVC, |
| 534 | "called entrypoint=0x{:08X} ({}), arg=0x{:08X}, stacktop=0x{:08X}, " | 534 | "called entrypoint=0x{:08X} ({}), arg=0x{:08X}, stacktop=0x{:08X}, " |
| 535 | "threadpriority=0x{:08X}, processorid=0x{:08X} : created handle=0x{:08X}", | 535 | "threadpriority=0x{:08X}, processorid=0x{:08X} : created handle=0x{:08X}", |
| 536 | entry_point, name, arg, stack_top, priority, processor_id, *out_handle); | 536 | entry_point, name, arg, stack_top, priority, processor_id, *out_handle); |
| @@ -540,7 +540,7 @@ static ResultCode CreateThread(Handle* out_handle, VAddr entry_point, u64 arg, V | |||
| 540 | 540 | ||
| 541 | /// Starts the thread for the provided handle | 541 | /// Starts the thread for the provided handle |
| 542 | static ResultCode StartThread(Handle thread_handle) { | 542 | static ResultCode StartThread(Handle thread_handle) { |
| 543 | NGLOG_TRACE(Kernel_SVC, "called thread=0x{:08X}", thread_handle); | 543 | LOG_TRACE(Kernel_SVC, "called thread=0x{:08X}", thread_handle); |
| 544 | 544 | ||
| 545 | const SharedPtr<Thread> thread = g_handle_table.Get<Thread>(thread_handle); | 545 | const SharedPtr<Thread> thread = g_handle_table.Get<Thread>(thread_handle); |
| 546 | if (!thread) { | 546 | if (!thread) { |
| @@ -557,7 +557,7 @@ static ResultCode StartThread(Handle thread_handle) { | |||
| 557 | 557 | ||
| 558 | /// Called when a thread exits | 558 | /// Called when a thread exits |
| 559 | static void ExitThread() { | 559 | static void ExitThread() { |
| 560 | NGLOG_TRACE(Kernel_SVC, "called, pc=0x{:08X}", Core::CurrentArmInterface().GetPC()); | 560 | LOG_TRACE(Kernel_SVC, "called, pc=0x{:08X}", Core::CurrentArmInterface().GetPC()); |
| 561 | 561 | ||
| 562 | ExitCurrentThread(); | 562 | ExitCurrentThread(); |
| 563 | Core::System::GetInstance().PrepareReschedule(); | 563 | Core::System::GetInstance().PrepareReschedule(); |
| @@ -565,7 +565,7 @@ static void ExitThread() { | |||
| 565 | 565 | ||
| 566 | /// Sleep the current thread | 566 | /// Sleep the current thread |
| 567 | static void SleepThread(s64 nanoseconds) { | 567 | static void SleepThread(s64 nanoseconds) { |
| 568 | NGLOG_TRACE(Kernel_SVC, "called nanoseconds={}", nanoseconds); | 568 | LOG_TRACE(Kernel_SVC, "called nanoseconds={}", nanoseconds); |
| 569 | 569 | ||
| 570 | // Don't attempt to yield execution if there are no available threads to run, | 570 | // Don't attempt to yield execution if there are no available threads to run, |
| 571 | // this way we avoid a useless reschedule to the idle thread. | 571 | // this way we avoid a useless reschedule to the idle thread. |
| @@ -584,7 +584,7 @@ static void SleepThread(s64 nanoseconds) { | |||
| 584 | /// Wait process wide key atomic | 584 | /// Wait process wide key atomic |
| 585 | static ResultCode WaitProcessWideKeyAtomic(VAddr mutex_addr, VAddr condition_variable_addr, | 585 | static ResultCode WaitProcessWideKeyAtomic(VAddr mutex_addr, VAddr condition_variable_addr, |
| 586 | Handle thread_handle, s64 nano_seconds) { | 586 | Handle thread_handle, s64 nano_seconds) { |
| 587 | NGLOG_TRACE( | 587 | LOG_TRACE( |
| 588 | Kernel_SVC, | 588 | Kernel_SVC, |
| 589 | "called mutex_addr={:X}, condition_variable_addr={:X}, thread_handle=0x{:08X}, timeout={}", | 589 | "called mutex_addr={:X}, condition_variable_addr={:X}, thread_handle=0x{:08X}, timeout={}", |
| 590 | mutex_addr, condition_variable_addr, thread_handle, nano_seconds); | 590 | mutex_addr, condition_variable_addr, thread_handle, nano_seconds); |
| @@ -611,7 +611,7 @@ static ResultCode WaitProcessWideKeyAtomic(VAddr mutex_addr, VAddr condition_var | |||
| 611 | 611 | ||
| 612 | /// Signal process wide key | 612 | /// Signal process wide key |
| 613 | static ResultCode SignalProcessWideKey(VAddr condition_variable_addr, s32 target) { | 613 | static ResultCode SignalProcessWideKey(VAddr condition_variable_addr, s32 target) { |
| 614 | NGLOG_TRACE(Kernel_SVC, "called, condition_variable_addr=0x{:X}, target=0x{:08X}", | 614 | LOG_TRACE(Kernel_SVC, "called, condition_variable_addr=0x{:X}, target=0x{:08X}", |
| 615 | condition_variable_addr, target); | 615 | condition_variable_addr, target); |
| 616 | 616 | ||
| 617 | auto RetrieveWaitingThreads = | 617 | auto RetrieveWaitingThreads = |
| @@ -692,7 +692,7 @@ static ResultCode SignalProcessWideKey(VAddr condition_variable_addr, s32 target | |||
| 692 | 692 | ||
| 693 | // Wait for an address (via Address Arbiter) | 693 | // Wait for an address (via Address Arbiter) |
| 694 | static ResultCode WaitForAddress(VAddr address, u32 type, s32 value, s64 timeout) { | 694 | static ResultCode WaitForAddress(VAddr address, u32 type, s32 value, s64 timeout) { |
| 695 | NGLOG_WARNING(Kernel_SVC, "called, address=0x{:X}, type=0x{:X}, value=0x{:X}, timeout={}", | 695 | LOG_WARNING(Kernel_SVC, "called, address=0x{:X}, type=0x{:X}, value=0x{:X}, timeout={}", |
| 696 | address, type, value, timeout); | 696 | address, type, value, timeout); |
| 697 | // If the passed address is a kernel virtual address, return invalid memory state. | 697 | // If the passed address is a kernel virtual address, return invalid memory state. |
| 698 | if (Memory::IsKernelVirtualAddress(address)) { | 698 | if (Memory::IsKernelVirtualAddress(address)) { |
| @@ -717,7 +717,7 @@ static ResultCode WaitForAddress(VAddr address, u32 type, s32 value, s64 timeout | |||
| 717 | 717 | ||
| 718 | // Signals to an address (via Address Arbiter) | 718 | // Signals to an address (via Address Arbiter) |
| 719 | static ResultCode SignalToAddress(VAddr address, u32 type, s32 value, s32 num_to_wake) { | 719 | static ResultCode SignalToAddress(VAddr address, u32 type, s32 value, s32 num_to_wake) { |
| 720 | NGLOG_WARNING(Kernel_SVC, | 720 | LOG_WARNING(Kernel_SVC, |
| 721 | "called, address=0x{:X}, type=0x{:X}, value=0x{:X}, num_to_wake=0x{:X}", address, | 721 | "called, address=0x{:X}, type=0x{:X}, value=0x{:X}, num_to_wake=0x{:X}", address, |
| 722 | type, value, num_to_wake); | 722 | type, value, num_to_wake); |
| 723 | // If the passed address is a kernel virtual address, return invalid memory state. | 723 | // If the passed address is a kernel virtual address, return invalid memory state. |
| @@ -754,13 +754,13 @@ static u64 GetSystemTick() { | |||
| 754 | 754 | ||
| 755 | /// Close a handle | 755 | /// Close a handle |
| 756 | static ResultCode CloseHandle(Handle handle) { | 756 | static ResultCode CloseHandle(Handle handle) { |
| 757 | NGLOG_TRACE(Kernel_SVC, "Closing handle 0x{:08X}", handle); | 757 | LOG_TRACE(Kernel_SVC, "Closing handle 0x{:08X}", handle); |
| 758 | return g_handle_table.Close(handle); | 758 | return g_handle_table.Close(handle); |
| 759 | } | 759 | } |
| 760 | 760 | ||
| 761 | /// Reset an event | 761 | /// Reset an event |
| 762 | static ResultCode ResetSignal(Handle handle) { | 762 | static ResultCode ResetSignal(Handle handle) { |
| 763 | NGLOG_WARNING(Kernel_SVC, "(STUBBED) called handle 0x{:08X}", handle); | 763 | LOG_WARNING(Kernel_SVC, "(STUBBED) called handle 0x{:08X}", handle); |
| 764 | auto event = g_handle_table.Get<Event>(handle); | 764 | auto event = g_handle_table.Get<Event>(handle); |
| 765 | ASSERT(event != nullptr); | 765 | ASSERT(event != nullptr); |
| 766 | event->Clear(); | 766 | event->Clear(); |
| @@ -769,14 +769,14 @@ static ResultCode ResetSignal(Handle handle) { | |||
| 769 | 769 | ||
| 770 | /// Creates a TransferMemory object | 770 | /// Creates a TransferMemory object |
| 771 | static ResultCode CreateTransferMemory(Handle* handle, VAddr addr, u64 size, u32 permissions) { | 771 | static ResultCode CreateTransferMemory(Handle* handle, VAddr addr, u64 size, u32 permissions) { |
| 772 | NGLOG_WARNING(Kernel_SVC, "(STUBBED) called addr=0x{:X}, size=0x{:X}, perms=0x{:08X}", addr, | 772 | LOG_WARNING(Kernel_SVC, "(STUBBED) called addr=0x{:X}, size=0x{:X}, perms=0x{:08X}", addr, |
| 773 | size, permissions); | 773 | size, permissions); |
| 774 | *handle = 0; | 774 | *handle = 0; |
| 775 | return RESULT_SUCCESS; | 775 | return RESULT_SUCCESS; |
| 776 | } | 776 | } |
| 777 | 777 | ||
| 778 | static ResultCode GetThreadCoreMask(Handle thread_handle, u32* core, u64* mask) { | 778 | static ResultCode GetThreadCoreMask(Handle thread_handle, u32* core, u64* mask) { |
| 779 | NGLOG_TRACE(Kernel_SVC, "called, handle=0x{:08X}", thread_handle); | 779 | LOG_TRACE(Kernel_SVC, "called, handle=0x{:08X}", thread_handle); |
| 780 | 780 | ||
| 781 | const SharedPtr<Thread> thread = g_handle_table.Get<Thread>(thread_handle); | 781 | const SharedPtr<Thread> thread = g_handle_table.Get<Thread>(thread_handle); |
| 782 | if (!thread) { | 782 | if (!thread) { |
| @@ -790,7 +790,7 @@ static ResultCode GetThreadCoreMask(Handle thread_handle, u32* core, u64* mask) | |||
| 790 | } | 790 | } |
| 791 | 791 | ||
| 792 | static ResultCode SetThreadCoreMask(Handle thread_handle, u32 core, u64 mask) { | 792 | static ResultCode SetThreadCoreMask(Handle thread_handle, u32 core, u64 mask) { |
| 793 | NGLOG_DEBUG(Kernel_SVC, "called, handle=0x{:08X}, mask=0x{:16X}, core=0x{:X}", thread_handle, | 793 | LOG_DEBUG(Kernel_SVC, "called, handle=0x{:08X}, mask=0x{:16X}, core=0x{:X}", thread_handle, |
| 794 | mask, core); | 794 | mask, core); |
| 795 | 795 | ||
| 796 | const SharedPtr<Thread> thread = g_handle_table.Get<Thread>(thread_handle); | 796 | const SharedPtr<Thread> thread = g_handle_table.Get<Thread>(thread_handle); |
| @@ -830,7 +830,7 @@ static ResultCode SetThreadCoreMask(Handle thread_handle, u32 core, u64 mask) { | |||
| 830 | 830 | ||
| 831 | static ResultCode CreateSharedMemory(Handle* handle, u64 size, u32 local_permissions, | 831 | static ResultCode CreateSharedMemory(Handle* handle, u64 size, u32 local_permissions, |
| 832 | u32 remote_permissions) { | 832 | u32 remote_permissions) { |
| 833 | NGLOG_TRACE(Kernel_SVC, "called, size=0x{:X}, localPerms=0x{:08X}, remotePerms=0x{:08X}", size, | 833 | LOG_TRACE(Kernel_SVC, "called, size=0x{:X}, localPerms=0x{:08X}, remotePerms=0x{:08X}", size, |
| 834 | local_permissions, remote_permissions); | 834 | local_permissions, remote_permissions); |
| 835 | auto sharedMemHandle = | 835 | auto sharedMemHandle = |
| 836 | SharedMemory::Create(g_handle_table.Get<Process>(KernelHandle::CurrentProcess), size, | 836 | SharedMemory::Create(g_handle_table.Get<Process>(KernelHandle::CurrentProcess), size, |
| @@ -842,7 +842,7 @@ static ResultCode CreateSharedMemory(Handle* handle, u64 size, u32 local_permiss | |||
| 842 | } | 842 | } |
| 843 | 843 | ||
| 844 | static ResultCode ClearEvent(Handle handle) { | 844 | static ResultCode ClearEvent(Handle handle) { |
| 845 | NGLOG_TRACE(Kernel_SVC, "called, event=0x{:08X}", handle); | 845 | LOG_TRACE(Kernel_SVC, "called, event=0x{:08X}", handle); |
| 846 | 846 | ||
| 847 | SharedPtr<Event> evt = g_handle_table.Get<Event>(handle); | 847 | SharedPtr<Event> evt = g_handle_table.Get<Event>(handle); |
| 848 | if (evt == nullptr) | 848 | if (evt == nullptr) |
| @@ -994,7 +994,7 @@ static const FunctionDef SVC_Table[] = { | |||
| 994 | 994 | ||
| 995 | static const FunctionDef* GetSVCInfo(u32 func_num) { | 995 | static const FunctionDef* GetSVCInfo(u32 func_num) { |
| 996 | if (func_num >= std::size(SVC_Table)) { | 996 | if (func_num >= std::size(SVC_Table)) { |
| 997 | NGLOG_ERROR(Kernel_SVC, "Unknown svc=0x{:02X}", func_num); | 997 | LOG_ERROR(Kernel_SVC, "Unknown svc=0x{:02X}", func_num); |
| 998 | return nullptr; | 998 | return nullptr; |
| 999 | } | 999 | } |
| 1000 | return &SVC_Table[func_num]; | 1000 | return &SVC_Table[func_num]; |
| @@ -1013,10 +1013,10 @@ void CallSVC(u32 immediate) { | |||
| 1013 | if (info->func) { | 1013 | if (info->func) { |
| 1014 | info->func(); | 1014 | info->func(); |
| 1015 | } else { | 1015 | } else { |
| 1016 | NGLOG_CRITICAL(Kernel_SVC, "Unimplemented SVC function {}(..)", info->name); | 1016 | LOG_CRITICAL(Kernel_SVC, "Unimplemented SVC function {}(..)", info->name); |
| 1017 | } | 1017 | } |
| 1018 | } else { | 1018 | } else { |
| 1019 | NGLOG_CRITICAL(Kernel_SVC, "Unknown SVC function 0x{:X}", immediate); | 1019 | LOG_CRITICAL(Kernel_SVC, "Unknown SVC function 0x{:X}", immediate); |
| 1020 | } | 1020 | } |
| 1021 | } | 1021 | } |
| 1022 | 1022 | ||