summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2018-11-27 00:23:12 +0100
committerLioncash <mathew1800@gmail.com>2018-11-27 03:10:31 +0100
commit4ef2af8c98354aea8a4a3758d798c6a2b7bf9321 (patch)
tree229565ce72652a2cef9fb051d8340c371e810016 /src/core
parentMerge pull request #1763 from ReinUsesLisp/bfi (diff)
downloadyuzu-4ef2af8c98354aea8a4a3758d798c6a2b7bf9321.tar
yuzu-4ef2af8c98354aea8a4a3758d798c6a2b7bf9321.tar.gz
yuzu-4ef2af8c98354aea8a4a3758d798c6a2b7bf9321.tar.bz2
yuzu-4ef2af8c98354aea8a4a3758d798c6a2b7bf9321.tar.lz
yuzu-4ef2af8c98354aea8a4a3758d798c6a2b7bf9321.tar.xz
yuzu-4ef2af8c98354aea8a4a3758d798c6a2b7bf9321.tar.zst
yuzu-4ef2af8c98354aea8a4a3758d798c6a2b7bf9321.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/hle/kernel/svc.cpp20
-rw-r--r--src/core/hle/kernel/svc_wrap.h8
2 files changed, 27 insertions, 1 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp
index f287f7c97..4b7991c32 100644
--- a/src/core/hle/kernel/svc.cpp
+++ b/src/core/hle/kernel/svc.cpp
@@ -1346,6 +1346,24 @@ static ResultCode GetProcessInfo(u64* out, Handle process_handle, u32 type) {
return RESULT_SUCCESS;
}
+static ResultCode CreateResourceLimit(Handle* out_handle) {
+ LOG_DEBUG(Kernel_SVC, "called");
+
+ auto& kernel = Core::System::GetInstance().Kernel();
+ auto resource_limit = ResourceLimit::Create(kernel);
+
+ auto* const current_process = kernel.CurrentProcess();
+ ASSERT(current_process != nullptr);
+
+ const auto handle = current_process->GetHandleTable().Create(std::move(resource_limit));
+ if (handle.Failed()) {
+ return handle.Code();
+ }
+
+ *out_handle = *handle;
+ return RESULT_SUCCESS;
+}
+
namespace {
struct FunctionDef {
using Func = void();
@@ -1482,7 +1500,7 @@ static const FunctionDef SVC_Table[] = {
{0x7A, nullptr, "StartProcess"},
{0x7B, nullptr, "TerminateProcess"},
{0x7C, SvcWrap<GetProcessInfo>, "GetProcessInfo"},
- {0x7D, nullptr, "CreateResourceLimit"},
+ {0x7D, SvcWrap<CreateResourceLimit>, "CreateResourceLimit"},
{0x7E, nullptr, "SetResourceLimitLimitValue"},
{0x7F, nullptr, "CallSecureMonitor"},
};
diff --git a/src/core/hle/kernel/svc_wrap.h b/src/core/hle/kernel/svc_wrap.h
index 233a99fb0..fa1116624 100644
--- a/src/core/hle/kernel/svc_wrap.h
+++ b/src/core/hle/kernel/svc_wrap.h
@@ -43,6 +43,14 @@ void SvcWrap() {
FuncReturn(func(static_cast<u32>(Param(0)), static_cast<u32>(Param(1))).raw);
}
+template <ResultCode func(u32*)>
+void SvcWrap() {
+ u32 param = 0;
+ const u32 retval = func(&param).raw;
+ Core::CurrentArmInterface().SetReg(1, param);
+ FuncReturn(retval);
+}
+
template <ResultCode func(u32*, u32)>
void SvcWrap() {
u32 param_1 = 0;