summaryrefslogtreecommitdiffstats
path: root/src/core/hle/svc.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2017-12-28 21:29:52 +0100
committerbunnei <bunneidev@gmail.com>2017-12-28 21:29:52 +0100
commit7618b5237d4b4f525e3db96bc70e488210da373d (patch)
treee446b8c40cff77e411c288612ba5c1a074bc9f7a /src/core/hle/svc.cpp
parentservice: Clean up apm/lm/applet_oe/controller/sm ctor/dtor. (diff)
downloadyuzu-7618b5237d4b4f525e3db96bc70e488210da373d.tar
yuzu-7618b5237d4b4f525e3db96bc70e488210da373d.tar.gz
yuzu-7618b5237d4b4f525e3db96bc70e488210da373d.tar.bz2
yuzu-7618b5237d4b4f525e3db96bc70e488210da373d.tar.lz
yuzu-7618b5237d4b4f525e3db96bc70e488210da373d.tar.xz
yuzu-7618b5237d4b4f525e3db96bc70e488210da373d.tar.zst
yuzu-7618b5237d4b4f525e3db96bc70e488210da373d.zip
Diffstat (limited to '')
-rw-r--r--src/core/hle/svc.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/core/hle/svc.cpp b/src/core/hle/svc.cpp
index 4b5c1dff3..ae0ceb252 100644
--- a/src/core/hle/svc.cpp
+++ b/src/core/hle/svc.cpp
@@ -24,6 +24,14 @@ using Kernel::SharedPtr;
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);
+ auto& process = *Kernel::g_current_process;
+ CASCADE_RESULT(*heap_addr, process.HeapAllocate(Memory::HEAP_VADDR, heap_size, Kernel::VMAPermission::ReadWrite));
+ return RESULT_SUCCESS;
+}
+
/// 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))
@@ -205,7 +213,7 @@ struct FunctionDef {
static const FunctionDef SVC_Table[] = {
{0x00, nullptr, "Unknown"},
- {0x01, nullptr, "svcSetHeapSize"},
+ {0x01, HLE::Wrap<SetHeapSize>, "svcSetHeapSize"},
{0x02, nullptr, "svcSetMemoryPermission"},
{0x03, nullptr, "svcSetMemoryAttribute"},
{0x04, nullptr, "svcMapMemory"},