diff options
Diffstat (limited to 'src/core/hle/svc.cpp')
| -rw-r--r-- | src/core/hle/svc.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/core/hle/svc.cpp b/src/core/hle/svc.cpp index 6cde4fc87..9d441ccfc 100644 --- a/src/core/hle/svc.cpp +++ b/src/core/hle/svc.cpp | |||
| @@ -22,6 +22,7 @@ | |||
| 22 | #include "core/hle/kernel/shared_memory.h" | 22 | #include "core/hle/kernel/shared_memory.h" |
| 23 | #include "core/hle/kernel/thread.h" | 23 | #include "core/hle/kernel/thread.h" |
| 24 | #include "core/hle/kernel/timer.h" | 24 | #include "core/hle/kernel/timer.h" |
| 25 | #include "core/hle/kernel/vm_manager.h" | ||
| 25 | 26 | ||
| 26 | #include "core/hle/function_wrappers.h" | 27 | #include "core/hle/function_wrappers.h" |
| 27 | #include "core/hle/result.h" | 28 | #include "core/hle/result.h" |
| @@ -530,8 +531,19 @@ static ResultCode ReleaseSemaphore(s32* count, Handle handle, s32 release_count) | |||
| 530 | } | 531 | } |
| 531 | 532 | ||
| 532 | /// Query memory | 533 | /// Query memory |
| 533 | static ResultCode QueryMemory(void* info, void* out, u32 addr) { | 534 | static ResultCode QueryMemory(MemoryInfo* memory_info, PageInfo* page_info, u32 addr) { |
| 534 | LOG_ERROR(Kernel_SVC, "(UNIMPLEMENTED) called addr=0x%08X", addr); | 535 | auto vma = Kernel::g_current_process->address_space->FindVMA(addr); |
| 536 | |||
| 537 | if (vma == Kernel::g_current_process->address_space->vma_map.end()) | ||
| 538 | return ResultCode(ErrorDescription::InvalidAddress, ErrorModule::OS, ErrorSummary::InvalidArgument, ErrorLevel::Usage); | ||
| 539 | |||
| 540 | memory_info->base_address = vma->second.base; | ||
| 541 | memory_info->permission = static_cast<u32>(vma->second.permissions); | ||
| 542 | memory_info->size = vma->second.size; | ||
| 543 | memory_info->state = static_cast<u32>(vma->second.meminfo_state); | ||
| 544 | |||
| 545 | page_info->flags = 0; | ||
| 546 | LOG_TRACE(Kernel_SVC, "called addr=0x%08X", addr); | ||
| 535 | return RESULT_SUCCESS; | 547 | return RESULT_SUCCESS; |
| 536 | } | 548 | } |
| 537 | 549 | ||