From 2415d37ea296e8856267375989a8b95cebe2575a Mon Sep 17 00:00:00 2001 From: Liam Date: Sun, 5 Feb 2023 14:22:02 -0500 Subject: kernel/svc: switch to generated wrappers --- .../hle/kernel/svc/svc_address_translation.cpp | 46 +++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) (limited to 'src/core/hle/kernel/svc/svc_address_translation.cpp') diff --git a/src/core/hle/kernel/svc/svc_address_translation.cpp b/src/core/hle/kernel/svc/svc_address_translation.cpp index 299e22ae6..c25e144cd 100644 --- a/src/core/hle/kernel/svc/svc_address_translation.cpp +++ b/src/core/hle/kernel/svc/svc_address_translation.cpp @@ -2,5 +2,49 @@ // SPDX-License-Identifier: GPL-2.0-or-later #include "core/hle/kernel/svc.h" +#include "core/hle/kernel/svc_results.h" -namespace Kernel::Svc {} // namespace Kernel::Svc +namespace Kernel::Svc { + +Result QueryPhysicalAddress(Core::System& system, lp64::PhysicalMemoryInfo* out_info, + uint64_t address) { + UNIMPLEMENTED(); + R_THROW(ResultNotImplemented); +} + +Result QueryIoMapping(Core::System& system, uintptr_t* out_address, uintptr_t* out_size, + uint64_t physical_address, uint64_t size) { + UNIMPLEMENTED(); + R_THROW(ResultNotImplemented); +} + +Result QueryPhysicalAddress64(Core::System& system, lp64::PhysicalMemoryInfo* out_info, + uint64_t address) { + R_RETURN(QueryPhysicalAddress(system, out_info, address)); +} + +Result QueryIoMapping64(Core::System& system, uintptr_t* out_address, uintptr_t* out_size, + uint64_t physical_address, uint64_t size) { + R_RETURN(QueryIoMapping(system, out_address, out_size, physical_address, size)); +} + +Result QueryPhysicalAddress64From32(Core::System& system, ilp32::PhysicalMemoryInfo* out_info, + uint32_t address) { + lp64::PhysicalMemoryInfo info{}; + R_TRY(QueryPhysicalAddress(system, std::addressof(info), address)); + + *out_info = { + .physical_address = info.physical_address, + .virtual_address = static_cast(info.virtual_address), + .size = static_cast(info.size), + }; + R_SUCCEED(); +} + +Result QueryIoMapping64From32(Core::System& system, uintptr_t* out_address, uintptr_t* out_size, + uint64_t physical_address, uint32_t size) { + R_RETURN(QueryIoMapping(system, reinterpret_cast(out_address), + reinterpret_cast(out_size), physical_address, size)); +} + +} // namespace Kernel::Svc -- cgit v1.2.3