diff options
author | bunnei <bunneidev@gmail.com> | 2017-12-29 03:38:38 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2017-12-29 03:38:38 +0100 |
commit | 6e021f22b8c61654aa1e72ceef16202a11d42016 (patch) | |
tree | 965a3c330f88ed6724c5315abb8e673d5af58b38 /src/core/hle/svc.cpp | |
parent | process: Add method to mirror a memory region. (diff) | |
download | yuzu-6e021f22b8c61654aa1e72ceef16202a11d42016.tar yuzu-6e021f22b8c61654aa1e72ceef16202a11d42016.tar.gz yuzu-6e021f22b8c61654aa1e72ceef16202a11d42016.tar.bz2 yuzu-6e021f22b8c61654aa1e72ceef16202a11d42016.tar.lz yuzu-6e021f22b8c61654aa1e72ceef16202a11d42016.tar.xz yuzu-6e021f22b8c61654aa1e72ceef16202a11d42016.tar.zst yuzu-6e021f22b8c61654aa1e72ceef16202a11d42016.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/svc.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/core/hle/svc.cpp b/src/core/hle/svc.cpp index ae0ceb252..47041afd4 100644 --- a/src/core/hle/svc.cpp +++ b/src/core/hle/svc.cpp @@ -26,12 +26,20 @@ namespace SVC { /// Set the process heap to a given Size. It can both extend and shrink the heap. static ResultCode SetHeapSize(VAddr* heap_addr, u64 heap_size) { - LOG_TRACE(Kernel_SVC, "called, heap_size=%ull", heap_size); + LOG_TRACE(Kernel_SVC, "called, heap_size=0x%llx", heap_size); auto& process = *Kernel::g_current_process; - CASCADE_RESULT(*heap_addr, process.HeapAllocate(Memory::HEAP_VADDR, heap_size, Kernel::VMAPermission::ReadWrite)); + CASCADE_RESULT(*heap_addr, process.HeapAllocate(Memory::HEAP_VADDR, heap_size, + Kernel::VMAPermission::ReadWrite)); return RESULT_SUCCESS; } +/// Maps a memory range into a different range. +static ResultCode MapMemory(VAddr dst_addr, VAddr src_addr, u64 size) { + LOG_TRACE(Kernel_SVC, "called, dst_addr=0x%llx, src_addr=0x%llx, size=0x%llx", dst_addr, + src_addr, size); + return Kernel::g_current_process->MirrorMemory(dst_addr, src_addr, size); +} + /// Connect to an OS service given the port name, returns the handle to the port to out static ResultCode ConnectToPort(Kernel::Handle* out_handle, VAddr port_name_address) { if (!Memory::IsValidVirtualAddress(port_name_address)) @@ -216,7 +224,7 @@ static const FunctionDef SVC_Table[] = { {0x01, HLE::Wrap<SetHeapSize>, "svcSetHeapSize"}, {0x02, nullptr, "svcSetMemoryPermission"}, {0x03, nullptr, "svcSetMemoryAttribute"}, - {0x04, nullptr, "svcMapMemory"}, + {0x04, HLE::Wrap<MapMemory>, "svcMapMemory"}, {0x05, nullptr, "svcUnmapMemory"}, {0x06, HLE::Wrap<QueryMemory>, "svcQueryMemory"}, {0x07, nullptr, "svcExitProcess"}, |