From e400e2afc74ae1d83dd6313c8fc8530b4c6a4151 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Tue, 1 Dec 2020 16:23:09 -0800 Subject: [PATCH] kern: stubs for Svc39, 3A, 46, 47 --- .../source/svc/kern_svc_alpha_beta.cpp | 79 +++++++++++++++++++ .../include/vapours/svc/svc_definitions.hpp | 6 +- 2 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 libraries/libmesosphere/source/svc/kern_svc_alpha_beta.cpp diff --git a/libraries/libmesosphere/source/svc/kern_svc_alpha_beta.cpp b/libraries/libmesosphere/source/svc/kern_svc_alpha_beta.cpp new file mode 100644 index 000000000..3aa3b8958 --- /dev/null +++ b/libraries/libmesosphere/source/svc/kern_svc_alpha_beta.cpp @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2018-2020 Atmosphère-NX + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include + +namespace ams::kern::svc { + + /* ============================= Common ============================= */ + + namespace { + + Result Unknown39() { + return svc::ResultNotImplemented(); + } + + Result Unknown3A() { + return svc::ResultNotImplemented(); + } + + Result Unknown46() { + return svc::ResultNotImplemented(); + } + + Result Unknown47() { + return svc::ResultNotImplemented(); + } + + } + + /* ============================= 64 ABI ============================= */ + + Result Unknown3964() { + return Unknown39(); + } + + Result Unknown3A64() { + /* NOTE: From official stubs, true API to this is something like Unknown3A(u64 *, u32_or_u64, u64, u64, u64_or_u32, u64_or_u32); */ + return Unknown3A(); + } + + Result Unknown4664() { + return Unknown46(); + } + + Result Unknown4764() { + return Unknown47(); + } + + /* ============================= 64From32 ABI ============================= */ + + Result Unknown3964From32() { + return Unknown39(); + } + + Result Unknown3A64From32() { + return Unknown3A(); + } + + Result Unknown4664From32() { + return Unknown46(); + } + + Result Unknown4764From32() { + return Unknown47(); + } + +} diff --git a/libraries/libvapours/include/vapours/svc/svc_definitions.hpp b/libraries/libvapours/include/vapours/svc/svc_definitions.hpp index 47bab8fc8..e907f496e 100644 --- a/libraries/libvapours/include/vapours/svc/svc_definitions.hpp +++ b/libraries/libvapours/include/vapours/svc/svc_definitions.hpp @@ -85,6 +85,9 @@ HANDLER(0x36, void, SynchronizePreemptionState) \ HANDLER(0x37, Result, GetResourceLimitPeakValue, OUTPUT(int64_t, out_peak_value), INPUT(::ams::svc::Handle, resource_limit_handle), INPUT(::ams::svc::LimitableResource, which)) \ \ + HANDLER(0x39, Result, Unknown39) \ + HANDLER(0x3A, Result, Unknown3A) \ + \ HANDLER(0x3C, void, KernelDebug, INPUT(::ams::svc::KernelDebugType, kern_debug_type), INPUT(uint64_t, arg0), INPUT(uint64_t, arg1), INPUT(uint64_t, arg2)) \ HANDLER(0x3D, void, ChangeKernelTraceState, INPUT(::ams::svc::KernelTraceState, kern_trace_state)) \ \ @@ -94,7 +97,8 @@ HANDLER(0x43, Result, ReplyAndReceive, OUTPUT(int32_t, out_index), INPTR(::ams::svc::Handle, handles), INPUT(int32_t, num_handles), INPUT(::ams::svc::Handle, reply_target), INPUT(int64_t, timeout_ns)) \ HANDLER(0x44, Result, ReplyAndReceiveWithUserBuffer, OUTPUT(int32_t, out_index), INPUT(::ams::svc::Address, message_buffer), INPUT(::ams::svc::Size, message_buffer_size), INPTR(::ams::svc::Handle, handles), INPUT(int32_t, num_handles), INPUT(::ams::svc::Handle, reply_target), INPUT(int64_t, timeout_ns)) \ HANDLER(0x45, Result, CreateEvent, OUTPUT(::ams::svc::Handle, out_write_handle), OUTPUT(::ams::svc::Handle, out_read_handle)) \ - \ + HANDLER(0x46, Result, Unknown46) \ + HANDLER(0x47, Result, Unknown47) \ HANDLER(0x48, Result, MapPhysicalMemoryUnsafe, INPUT(::ams::svc::Address, address), INPUT(::ams::svc::Size, size)) \ HANDLER(0x49, Result, UnmapPhysicalMemoryUnsafe, INPUT(::ams::svc::Address, address), INPUT(::ams::svc::Size, size)) \ HANDLER(0x4A, Result, SetUnsafeLimit, INPUT(::ams::svc::Size, limit)) \