diff options
| author | 2018-01-15 15:42:57 -0500 | |
|---|---|---|
| committer | 2018-01-16 18:50:23 -0500 | |
| commit | bf0e20c571326f3b39d0bed0a3b5f2129cef81ea (patch) | |
| tree | 53a44b0e32288d68da9426fd987ee888328d8e07 /src/core/hle/kernel/svc.cpp | |
| parent | SVC: Add 4.0.0+ comment to GetInfoType enum values. (diff) | |
| download | yuzu-bf0e20c571326f3b39d0bed0a3b5f2129cef81ea.tar.gz yuzu-bf0e20c571326f3b39d0bed0a3b5f2129cef81ea.tar.xz yuzu-bf0e20c571326f3b39d0bed0a3b5f2129cef81ea.zip | |
SVC: Correct some return values in svcGetInfo and added TitleId and PrivilegedProcessId stubs.
# Conflicts:
# src/core/hle/kernel/svc.cpp
Diffstat (limited to 'src/core/hle/kernel/svc.cpp')
| -rw-r--r-- | src/core/hle/kernel/svc.cpp | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index 056ba28ef..088058ebc 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp | |||
| @@ -255,8 +255,9 @@ static ResultCode CancelSynchronization(Handle thread_handle) { | |||
| 255 | /// Attempts to locks a mutex, creating it if it does not already exist | 255 | /// Attempts to locks a mutex, creating it if it does not already exist |
| 256 | static ResultCode LockMutex(Handle holding_thread_handle, VAddr mutex_addr, | 256 | static ResultCode LockMutex(Handle holding_thread_handle, VAddr mutex_addr, |
| 257 | Handle requesting_thread_handle) { | 257 | Handle requesting_thread_handle) { |
| 258 | LOG_TRACE(Kernel_SVC, "called holding_thread_handle=0x%08X, mutex_addr=0x%llx, " | 258 | LOG_TRACE(Kernel_SVC, |
| 259 | "requesting_current_thread_handle=0x%08X", | 259 | "called holding_thread_handle=0x%08X, mutex_addr=0x%llx, " |
| 260 | "requesting_current_thread_handle=0x%08X", | ||
| 260 | holding_thread_handle, mutex_addr, requesting_thread_handle); | 261 | holding_thread_handle, mutex_addr, requesting_thread_handle); |
| 261 | 262 | ||
| 262 | SharedPtr<Thread> holding_thread = g_handle_table.Get<Thread>(holding_thread_handle); | 263 | SharedPtr<Thread> holding_thread = g_handle_table.Get<Thread>(holding_thread_handle); |
| @@ -304,8 +305,6 @@ static ResultCode GetInfo(u64* result, u64 info_id, u64 handle, u64 info_sub_id) | |||
| 304 | LOG_TRACE(Kernel_SVC, "called info_id=0x%X, info_sub_id=0x%X, handle=0x%08X", info_id, | 305 | LOG_TRACE(Kernel_SVC, "called info_id=0x%X, info_sub_id=0x%X, handle=0x%08X", info_id, |
| 305 | info_sub_id, handle); | 306 | info_sub_id, handle); |
| 306 | 307 | ||
| 307 | ASSERT(handle == 0 || handle == CurrentProcess); | ||
| 308 | |||
| 309 | auto& vm_manager = g_current_process->vm_manager; | 308 | auto& vm_manager = g_current_process->vm_manager; |
| 310 | 309 | ||
| 311 | switch (static_cast<GetInfoType>(info_id)) { | 310 | switch (static_cast<GetInfoType>(info_id)) { |
| @@ -321,6 +320,12 @@ static ResultCode GetInfo(u64* result, u64 info_id, u64 handle, u64 info_sub_id) | |||
| 321 | case GetInfoType::MapRegionSize: | 320 | case GetInfoType::MapRegionSize: |
| 322 | *result = vm_manager.GetAddressSpaceSize(); | 321 | *result = vm_manager.GetAddressSpaceSize(); |
| 323 | break; | 322 | break; |
| 323 | case GetInfoType::HeapRegionBaseAddr: | ||
| 324 | *result = vm_manager.GetNewMapRegionBaseAddr() + vm_manager.GetNewMapRegionSize(); | ||
| 325 | break; | ||
| 326 | case GetInfoType::HeapRegionSize: | ||
| 327 | *result = Memory::HEAP_SIZE; | ||
| 328 | break; | ||
| 324 | case GetInfoType::TotalMemoryUsage: | 329 | case GetInfoType::TotalMemoryUsage: |
| 325 | *result = vm_manager.GetTotalMemoryUsage(); | 330 | *result = vm_manager.GetTotalMemoryUsage(); |
| 326 | break; | 331 | break; |
| @@ -345,6 +350,15 @@ static ResultCode GetInfo(u64* result, u64 info_id, u64 handle, u64 info_sub_id) | |||
| 345 | case GetInfoType::IsVirtualAddressMemoryEnabled: | 350 | case GetInfoType::IsVirtualAddressMemoryEnabled: |
| 346 | *result = g_current_process->is_virtual_address_memory_enabled; | 351 | *result = g_current_process->is_virtual_address_memory_enabled; |
| 347 | break; | 352 | break; |
| 353 | case GetInfoType::TitleId: | ||
| 354 | LOG_WARNING(Kernel_SVC, "(STUBBED) Attempted to query titleid, returned 0"); | ||
| 355 | *result = 0; | ||
| 356 | break; | ||
| 357 | case GetInfoType::PrivilegedProcessId: | ||
| 358 | LOG_WARNING(Kernel_SVC, | ||
| 359 | "(STUBBED) Attempted to query priviledged process id bounds, returned 0"); | ||
| 360 | *result = 0; | ||
| 361 | break; | ||
| 348 | default: | 362 | default: |
| 349 | UNIMPLEMENTED(); | 363 | UNIMPLEMENTED(); |
| 350 | } | 364 | } |
| @@ -533,8 +547,9 @@ static ResultCode CreateThread(Handle* out_handle, VAddr entry_point, u64 arg, V | |||
| 533 | 547 | ||
| 534 | Core::System::GetInstance().PrepareReschedule(); | 548 | Core::System::GetInstance().PrepareReschedule(); |
| 535 | 549 | ||
| 536 | LOG_TRACE(Kernel_SVC, "called entrypoint=0x%08X (%s), arg=0x%08X, stacktop=0x%08X, " | 550 | LOG_TRACE(Kernel_SVC, |
| 537 | "threadpriority=0x%08X, processorid=0x%08X : created handle=0x%08X", | 551 | "called entrypoint=0x%08X (%s), arg=0x%08X, stacktop=0x%08X, " |
| 552 | "threadpriority=0x%08X, processorid=0x%08X : created handle=0x%08X", | ||
| 538 | entry_point, name.c_str(), arg, stack_top, priority, processor_id, *out_handle); | 553 | entry_point, name.c_str(), arg, stack_top, priority, processor_id, *out_handle); |
| 539 | 554 | ||
| 540 | return RESULT_SUCCESS; | 555 | return RESULT_SUCCESS; |