summaryrefslogtreecommitdiff
path: root/src/core/hle/svc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/svc.cpp')
-rw-r--r--src/core/hle/svc.cpp14
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 {
26 26
27/// Set the process heap to a given Size. It can both extend and shrink the heap. 27/// Set the process heap to a given Size. It can both extend and shrink the heap.
28static ResultCode SetHeapSize(VAddr* heap_addr, u64 heap_size) { 28static ResultCode SetHeapSize(VAddr* heap_addr, u64 heap_size) {
29 LOG_TRACE(Kernel_SVC, "called, heap_size=%ull", heap_size); 29 LOG_TRACE(Kernel_SVC, "called, heap_size=0x%llx", heap_size);
30 auto& process = *Kernel::g_current_process; 30 auto& process = *Kernel::g_current_process;
31 CASCADE_RESULT(*heap_addr, process.HeapAllocate(Memory::HEAP_VADDR, heap_size, Kernel::VMAPermission::ReadWrite)); 31 CASCADE_RESULT(*heap_addr, process.HeapAllocate(Memory::HEAP_VADDR, heap_size,
32 Kernel::VMAPermission::ReadWrite));
32 return RESULT_SUCCESS; 33 return RESULT_SUCCESS;
33} 34}
34 35
36/// Maps a memory range into a different range.
37static ResultCode MapMemory(VAddr dst_addr, VAddr src_addr, u64 size) {
38 LOG_TRACE(Kernel_SVC, "called, dst_addr=0x%llx, src_addr=0x%llx, size=0x%llx", dst_addr,
39 src_addr, size);
40 return Kernel::g_current_process->MirrorMemory(dst_addr, src_addr, size);
41}
42
35/// Connect to an OS service given the port name, returns the handle to the port to out 43/// Connect to an OS service given the port name, returns the handle to the port to out
36static ResultCode ConnectToPort(Kernel::Handle* out_handle, VAddr port_name_address) { 44static ResultCode ConnectToPort(Kernel::Handle* out_handle, VAddr port_name_address) {
37 if (!Memory::IsValidVirtualAddress(port_name_address)) 45 if (!Memory::IsValidVirtualAddress(port_name_address))
@@ -216,7 +224,7 @@ static const FunctionDef SVC_Table[] = {
216 {0x01, HLE::Wrap<SetHeapSize>, "svcSetHeapSize"}, 224 {0x01, HLE::Wrap<SetHeapSize>, "svcSetHeapSize"},
217 {0x02, nullptr, "svcSetMemoryPermission"}, 225 {0x02, nullptr, "svcSetMemoryPermission"},
218 {0x03, nullptr, "svcSetMemoryAttribute"}, 226 {0x03, nullptr, "svcSetMemoryAttribute"},
219 {0x04, nullptr, "svcMapMemory"}, 227 {0x04, HLE::Wrap<MapMemory>, "svcMapMemory"},
220 {0x05, nullptr, "svcUnmapMemory"}, 228 {0x05, nullptr, "svcUnmapMemory"},
221 {0x06, HLE::Wrap<QueryMemory>, "svcQueryMemory"}, 229 {0x06, HLE::Wrap<QueryMemory>, "svcQueryMemory"},
222 {0x07, nullptr, "svcExitProcess"}, 230 {0x07, nullptr, "svcExitProcess"},