diff options
Diffstat (limited to 'src/core/hle/kernel')
| -rw-r--r-- | src/core/hle/kernel/k_page_table_base.cpp | 18 | ||||
| -rw-r--r-- | src/core/hle/kernel/k_process.cpp | 40 | ||||
| -rw-r--r-- | src/core/hle/kernel/k_process.h | 9 | ||||
| -rw-r--r-- | src/core/hle/kernel/k_process_page_table.h | 4 | ||||
| -rw-r--r-- | src/core/hle/kernel/k_scheduler.cpp | 16 | ||||
| -rw-r--r-- | src/core/hle/kernel/k_thread.cpp | 80 | ||||
| -rw-r--r-- | src/core/hle/kernel/k_thread.h | 29 | ||||
| -rw-r--r-- | src/core/hle/kernel/kernel.cpp | 28 | ||||
| -rw-r--r-- | src/core/hle/kernel/kernel.h | 7 | ||||
| -rw-r--r-- | src/core/hle/kernel/physical_core.cpp | 251 | ||||
| -rw-r--r-- | src/core/hle/kernel/physical_core.h | 57 | ||||
| -rw-r--r-- | src/core/hle/kernel/svc.cpp | 2955 | ||||
| -rw-r--r-- | src/core/hle/kernel/svc.h | 14 | ||||
| -rw-r--r-- | src/core/hle/kernel/svc/svc_exception.cpp | 4 | ||||
| -rw-r--r-- | src/core/hle/kernel/svc/svc_light_ipc.cpp | 31 | ||||
| -rw-r--r-- | src/core/hle/kernel/svc/svc_secure_monitor_call.cpp | 22 | ||||
| -rw-r--r-- | src/core/hle/kernel/svc/svc_thread.cpp | 50 | ||||
| -rw-r--r-- | src/core/hle/kernel/svc_generator.py | 59 |
18 files changed, 1890 insertions, 1784 deletions
diff --git a/src/core/hle/kernel/k_page_table_base.cpp b/src/core/hle/kernel/k_page_table_base.cpp index 6691586ed..4c416d809 100644 --- a/src/core/hle/kernel/k_page_table_base.cpp +++ b/src/core/hle/kernel/k_page_table_base.cpp | |||
| @@ -69,8 +69,16 @@ public: | |||
| 69 | }; | 69 | }; |
| 70 | 70 | ||
| 71 | template <typename AddressType> | 71 | template <typename AddressType> |
| 72 | void InvalidateInstructionCache(Core::System& system, AddressType addr, u64 size) { | 72 | void InvalidateInstructionCache(KernelCore& kernel, AddressType addr, u64 size) { |
| 73 | system.InvalidateCpuInstructionCacheRange(GetInteger(addr), size); | 73 | // TODO: lock the process list |
| 74 | for (auto& process : kernel.GetProcessList()) { | ||
| 75 | for (size_t i = 0; i < Core::Hardware::NUM_CPU_CORES; i++) { | ||
| 76 | auto* interface = process->GetArmInterface(i); | ||
| 77 | if (interface) { | ||
| 78 | interface->InvalidateCacheRange(GetInteger(addr), size); | ||
| 79 | } | ||
| 80 | } | ||
| 81 | } | ||
| 74 | } | 82 | } |
| 75 | 83 | ||
| 76 | template <typename AddressType> | 84 | template <typename AddressType> |
| @@ -1261,7 +1269,7 @@ Result KPageTableBase::UnmapCodeMemory(KProcessAddress dst_address, KProcessAddr | |||
| 1261 | bool reprotected_pages = false; | 1269 | bool reprotected_pages = false; |
| 1262 | SCOPE_EXIT({ | 1270 | SCOPE_EXIT({ |
| 1263 | if (reprotected_pages && any_code_pages) { | 1271 | if (reprotected_pages && any_code_pages) { |
| 1264 | InvalidateInstructionCache(m_system, dst_address, size); | 1272 | InvalidateInstructionCache(m_kernel, dst_address, size); |
| 1265 | } | 1273 | } |
| 1266 | }); | 1274 | }); |
| 1267 | 1275 | ||
| @@ -1997,7 +2005,7 @@ Result KPageTableBase::SetProcessMemoryPermission(KProcessAddress addr, size_t s | |||
| 1997 | for (const auto& block : pg) { | 2005 | for (const auto& block : pg) { |
| 1998 | StoreDataCache(GetHeapVirtualPointer(m_kernel, block.GetAddress()), block.GetSize()); | 2006 | StoreDataCache(GetHeapVirtualPointer(m_kernel, block.GetAddress()), block.GetSize()); |
| 1999 | } | 2007 | } |
| 2000 | InvalidateInstructionCache(m_system, addr, size); | 2008 | InvalidateInstructionCache(m_kernel, addr, size); |
| 2001 | } | 2009 | } |
| 2002 | 2010 | ||
| 2003 | R_SUCCEED(); | 2011 | R_SUCCEED(); |
| @@ -3239,7 +3247,7 @@ Result KPageTableBase::WriteDebugMemory(KProcessAddress dst_address, KProcessAdd | |||
| 3239 | R_TRY(PerformCopy()); | 3247 | R_TRY(PerformCopy()); |
| 3240 | 3248 | ||
| 3241 | // Invalidate the instruction cache, as this svc allows modifying executable pages. | 3249 | // Invalidate the instruction cache, as this svc allows modifying executable pages. |
| 3242 | InvalidateInstructionCache(m_system, dst_address, size); | 3250 | InvalidateInstructionCache(m_kernel, dst_address, size); |
| 3243 | 3251 | ||
| 3244 | R_SUCCEED(); | 3252 | R_SUCCEED(); |
| 3245 | } | 3253 | } |
diff --git a/src/core/hle/kernel/k_process.cpp b/src/core/hle/kernel/k_process.cpp index 6c29eb72c..3a2635e1f 100644 --- a/src/core/hle/kernel/k_process.cpp +++ b/src/core/hle/kernel/k_process.cpp | |||
| @@ -13,6 +13,12 @@ | |||
| 13 | #include "core/hle/kernel/k_thread_queue.h" | 13 | #include "core/hle/kernel/k_thread_queue.h" |
| 14 | #include "core/hle/kernel/k_worker_task_manager.h" | 14 | #include "core/hle/kernel/k_worker_task_manager.h" |
| 15 | 15 | ||
| 16 | #include "core/arm/dynarmic/arm_dynarmic_32.h" | ||
| 17 | #include "core/arm/dynarmic/arm_dynarmic_64.h" | ||
| 18 | #ifdef HAS_NCE | ||
| 19 | #include "core/arm/nce/arm_nce.h" | ||
| 20 | #endif | ||
| 21 | |||
| 16 | namespace Kernel { | 22 | namespace Kernel { |
| 17 | 23 | ||
| 18 | namespace { | 24 | namespace { |
| @@ -957,10 +963,8 @@ Result KProcess::Run(s32 priority, size_t stack_size) { | |||
| 957 | R_TRY(m_handle_table.Add(std::addressof(thread_handle), main_thread)); | 963 | R_TRY(m_handle_table.Add(std::addressof(thread_handle), main_thread)); |
| 958 | 964 | ||
| 959 | // Set the thread arguments. | 965 | // Set the thread arguments. |
| 960 | main_thread->GetContext32().cpu_registers[0] = 0; | 966 | main_thread->GetContext().r[0] = 0; |
| 961 | main_thread->GetContext64().cpu_registers[0] = 0; | 967 | main_thread->GetContext().r[1] = thread_handle; |
| 962 | main_thread->GetContext32().cpu_registers[1] = thread_handle; | ||
| 963 | main_thread->GetContext64().cpu_registers[1] = thread_handle; | ||
| 964 | 968 | ||
| 965 | // Update our state. | 969 | // Update our state. |
| 966 | this->ChangeState((state == State::Created) ? State::Running : State::RunningAttached); | 970 | this->ChangeState((state == State::Created) ? State::Running : State::RunningAttached); |
| @@ -1199,6 +1203,9 @@ Result KProcess::LoadFromMetadata(const FileSys::ProgramMetadata& metadata, std: | |||
| 1199 | m_is_hbl = is_hbl; | 1203 | m_is_hbl = is_hbl; |
| 1200 | m_ideal_core_id = metadata.GetMainThreadCore(); | 1204 | m_ideal_core_id = metadata.GetMainThreadCore(); |
| 1201 | 1205 | ||
| 1206 | // Set up emulation context. | ||
| 1207 | this->InitializeInterfaces(); | ||
| 1208 | |||
| 1202 | // We succeeded. | 1209 | // We succeeded. |
| 1203 | R_SUCCEED(); | 1210 | R_SUCCEED(); |
| 1204 | } | 1211 | } |
| @@ -1227,6 +1234,31 @@ void KProcess::LoadModule(CodeSet code_set, KProcessAddress base_addr) { | |||
| 1227 | #endif | 1234 | #endif |
| 1228 | } | 1235 | } |
| 1229 | 1236 | ||
| 1237 | void KProcess::InitializeInterfaces() { | ||
| 1238 | this->GetMemory().SetCurrentPageTable(*this); | ||
| 1239 | |||
| 1240 | #ifdef HAS_NCE | ||
| 1241 | if (this->Is64Bit() && Settings::IsNceEnabled()) { | ||
| 1242 | for (size_t i = 0; i < Core::Hardware::NUM_CPU_CORES; i++) { | ||
| 1243 | m_arm_interfaces[i] = std::make_unique<Core::ArmNce>(m_kernel.System(), true, i); | ||
| 1244 | } | ||
| 1245 | } else | ||
| 1246 | #endif | ||
| 1247 | if (this->Is64Bit()) { | ||
| 1248 | for (size_t i = 0; i < Core::Hardware::NUM_CPU_CORES; i++) { | ||
| 1249 | m_arm_interfaces[i] = std::make_unique<Core::ArmDynarmic64>( | ||
| 1250 | m_kernel.System(), m_kernel.IsMulticore(), this, | ||
| 1251 | static_cast<Core::DynarmicExclusiveMonitor&>(m_kernel.GetExclusiveMonitor()), i); | ||
| 1252 | } | ||
| 1253 | } else { | ||
| 1254 | for (size_t i = 0; i < Core::Hardware::NUM_CPU_CORES; i++) { | ||
| 1255 | m_arm_interfaces[i] = std::make_unique<Core::ArmDynarmic32>( | ||
| 1256 | m_kernel.System(), m_kernel.IsMulticore(), this, | ||
| 1257 | static_cast<Core::DynarmicExclusiveMonitor&>(m_kernel.GetExclusiveMonitor()), i); | ||
| 1258 | } | ||
| 1259 | } | ||
| 1260 | } | ||
| 1261 | |||
| 1230 | bool KProcess::InsertWatchpoint(KProcessAddress addr, u64 size, DebugWatchpointType type) { | 1262 | bool KProcess::InsertWatchpoint(KProcessAddress addr, u64 size, DebugWatchpointType type) { |
| 1231 | const auto watch{std::find_if(m_watchpoints.begin(), m_watchpoints.end(), [&](const auto& wp) { | 1263 | const auto watch{std::find_if(m_watchpoints.begin(), m_watchpoints.end(), [&](const auto& wp) { |
| 1232 | return wp.type == DebugWatchpointType::None; | 1264 | return wp.type == DebugWatchpointType::None; |
diff --git a/src/core/hle/kernel/k_process.h b/src/core/hle/kernel/k_process.h index d8cd0fdde..4b114e39b 100644 --- a/src/core/hle/kernel/k_process.h +++ b/src/core/hle/kernel/k_process.h | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | 5 | ||
| 6 | #include <map> | 6 | #include <map> |
| 7 | 7 | ||
| 8 | #include "core/arm/arm_interface.h" | ||
| 8 | #include "core/file_sys/program_metadata.h" | 9 | #include "core/file_sys/program_metadata.h" |
| 9 | #include "core/hle/kernel/code_set.h" | 10 | #include "core/hle/kernel/code_set.h" |
| 10 | #include "core/hle/kernel/k_address_arbiter.h" | 11 | #include "core/hle/kernel/k_address_arbiter.h" |
| @@ -106,6 +107,8 @@ private: | |||
| 106 | bool m_is_suspended{}; | 107 | bool m_is_suspended{}; |
| 107 | bool m_is_immortal{}; | 108 | bool m_is_immortal{}; |
| 108 | bool m_is_handle_table_initialized{}; | 109 | bool m_is_handle_table_initialized{}; |
| 110 | std::array<std::unique_ptr<Core::ArmInterface>, Core::Hardware::NUM_CPU_CORES> | ||
| 111 | m_arm_interfaces{}; | ||
| 109 | std::array<KThread*, Core::Hardware::NUM_CPU_CORES> m_running_threads{}; | 112 | std::array<KThread*, Core::Hardware::NUM_CPU_CORES> m_running_threads{}; |
| 110 | std::array<u64, Core::Hardware::NUM_CPU_CORES> m_running_thread_idle_counts{}; | 113 | std::array<u64, Core::Hardware::NUM_CPU_CORES> m_running_thread_idle_counts{}; |
| 111 | std::array<u64, Core::Hardware::NUM_CPU_CORES> m_running_thread_switch_counts{}; | 114 | std::array<u64, Core::Hardware::NUM_CPU_CORES> m_running_thread_switch_counts{}; |
| @@ -476,6 +479,10 @@ public: | |||
| 476 | } | 479 | } |
| 477 | #endif | 480 | #endif |
| 478 | 481 | ||
| 482 | Core::ArmInterface* GetArmInterface(size_t core_index) const { | ||
| 483 | return m_arm_interfaces[core_index].get(); | ||
| 484 | } | ||
| 485 | |||
| 479 | public: | 486 | public: |
| 480 | // Attempts to insert a watchpoint into a free slot. Returns false if none are available. | 487 | // Attempts to insert a watchpoint into a free slot. Returns false if none are available. |
| 481 | bool InsertWatchpoint(KProcessAddress addr, u64 size, DebugWatchpointType type); | 488 | bool InsertWatchpoint(KProcessAddress addr, u64 size, DebugWatchpointType type); |
| @@ -493,6 +500,8 @@ public: | |||
| 493 | 500 | ||
| 494 | void LoadModule(CodeSet code_set, KProcessAddress base_addr); | 501 | void LoadModule(CodeSet code_set, KProcessAddress base_addr); |
| 495 | 502 | ||
| 503 | void InitializeInterfaces(); | ||
| 504 | |||
| 496 | Core::Memory::Memory& GetMemory() const; | 505 | Core::Memory::Memory& GetMemory() const; |
| 497 | 506 | ||
| 498 | public: | 507 | public: |
diff --git a/src/core/hle/kernel/k_process_page_table.h b/src/core/hle/kernel/k_process_page_table.h index 9e40f68bc..346d7ca08 100644 --- a/src/core/hle/kernel/k_process_page_table.h +++ b/src/core/hle/kernel/k_process_page_table.h | |||
| @@ -7,10 +7,6 @@ | |||
| 7 | #include "core/hle/kernel/k_scoped_lock.h" | 7 | #include "core/hle/kernel/k_scoped_lock.h" |
| 8 | #include "core/hle/kernel/svc_types.h" | 8 | #include "core/hle/kernel/svc_types.h" |
| 9 | 9 | ||
| 10 | namespace Core { | ||
| 11 | class ARM_Interface; | ||
| 12 | } | ||
| 13 | |||
| 14 | namespace Kernel { | 10 | namespace Kernel { |
| 15 | 11 | ||
| 16 | class KProcessPageTable { | 12 | class KProcessPageTable { |
diff --git a/src/core/hle/kernel/k_scheduler.cpp b/src/core/hle/kernel/k_scheduler.cpp index 1bce63a56..27d1c3846 100644 --- a/src/core/hle/kernel/k_scheduler.cpp +++ b/src/core/hle/kernel/k_scheduler.cpp | |||
| @@ -494,12 +494,7 @@ void KScheduler::ScheduleImplFiber() { | |||
| 494 | } | 494 | } |
| 495 | 495 | ||
| 496 | void KScheduler::Unload(KThread* thread) { | 496 | void KScheduler::Unload(KThread* thread) { |
| 497 | auto& cpu_core = m_kernel.System().ArmInterface(m_core_id); | 497 | m_kernel.PhysicalCore(m_core_id).SaveContext(thread); |
| 498 | cpu_core.SaveContext(thread->GetContext32()); | ||
| 499 | cpu_core.SaveContext(thread->GetContext64()); | ||
| 500 | // Save the TPIDR_EL0 system register in case it was modified. | ||
| 501 | thread->SetTpidrEl0(cpu_core.GetTPIDR_EL0()); | ||
| 502 | cpu_core.ClearExclusiveState(); | ||
| 503 | 498 | ||
| 504 | // Check if the thread is terminated by checking the DPC flags. | 499 | // Check if the thread is terminated by checking the DPC flags. |
| 505 | if ((thread->GetStackParameters().dpc_flags & static_cast<u32>(DpcFlag::Terminated)) == 0) { | 500 | if ((thread->GetStackParameters().dpc_flags & static_cast<u32>(DpcFlag::Terminated)) == 0) { |
| @@ -509,14 +504,7 @@ void KScheduler::Unload(KThread* thread) { | |||
| 509 | } | 504 | } |
| 510 | 505 | ||
| 511 | void KScheduler::Reload(KThread* thread) { | 506 | void KScheduler::Reload(KThread* thread) { |
| 512 | auto& cpu_core = m_kernel.System().ArmInterface(m_core_id); | 507 | m_kernel.PhysicalCore(m_core_id).LoadContext(thread); |
| 513 | auto* process = thread->GetOwnerProcess(); | ||
| 514 | cpu_core.LoadContext(thread->GetContext32()); | ||
| 515 | cpu_core.LoadContext(thread->GetContext64()); | ||
| 516 | cpu_core.SetTlsAddress(GetInteger(thread->GetTlsAddress())); | ||
| 517 | cpu_core.SetTPIDR_EL0(thread->GetTpidrEl0()); | ||
| 518 | cpu_core.LoadWatchpointArray(process ? &process->GetWatchpoints() : nullptr); | ||
| 519 | cpu_core.ClearExclusiveState(); | ||
| 520 | } | 508 | } |
| 521 | 509 | ||
| 522 | void KScheduler::ClearPreviousThread(KernelCore& kernel, KThread* thread) { | 510 | void KScheduler::ClearPreviousThread(KernelCore& kernel, KThread* thread) { |
diff --git a/src/core/hle/kernel/k_thread.cpp b/src/core/hle/kernel/k_thread.cpp index a6deb50ec..7d9a6e9cf 100644 --- a/src/core/hle/kernel/k_thread.cpp +++ b/src/core/hle/kernel/k_thread.cpp | |||
| @@ -41,24 +41,25 @@ namespace { | |||
| 41 | 41 | ||
| 42 | constexpr inline s32 TerminatingThreadPriority = Kernel::Svc::SystemThreadPriorityHighest - 1; | 42 | constexpr inline s32 TerminatingThreadPriority = Kernel::Svc::SystemThreadPriorityHighest - 1; |
| 43 | 43 | ||
| 44 | static void ResetThreadContext32(Kernel::KThread::ThreadContext32& context, u32 stack_top, | 44 | static void ResetThreadContext32(Kernel::Svc::ThreadContext& ctx, u64 stack_top, u64 entry_point, |
| 45 | u32 entry_point, u32 arg) { | 45 | u64 arg) { |
| 46 | context = {}; | 46 | ctx = {}; |
| 47 | context.cpu_registers[0] = arg; | 47 | ctx.r[0] = arg; |
| 48 | context.cpu_registers[15] = entry_point; | 48 | ctx.r[15] = entry_point; |
| 49 | context.cpu_registers[13] = stack_top; | 49 | ctx.r[13] = stack_top; |
| 50 | context.fpscr = 0; | 50 | ctx.fpcr = 0; |
| 51 | } | 51 | ctx.fpsr = 0; |
| 52 | 52 | } | |
| 53 | static void ResetThreadContext64(Kernel::KThread::ThreadContext64& context, u64 stack_top, | 53 | |
| 54 | u64 entry_point, u64 arg) { | 54 | static void ResetThreadContext64(Kernel::Svc::ThreadContext& ctx, u64 stack_top, u64 entry_point, |
| 55 | context = {}; | 55 | u64 arg) { |
| 56 | context.cpu_registers[0] = arg; | 56 | ctx = {}; |
| 57 | context.cpu_registers[18] = Kernel::KSystemControl::GenerateRandomU64() | 1; | 57 | ctx.r[0] = arg; |
| 58 | context.pc = entry_point; | 58 | ctx.r[18] = Kernel::KSystemControl::GenerateRandomU64() | 1; |
| 59 | context.sp = stack_top; | 59 | ctx.pc = entry_point; |
| 60 | context.fpcr = 0; | 60 | ctx.sp = stack_top; |
| 61 | context.fpsr = 0; | 61 | ctx.fpcr = 0; |
| 62 | ctx.fpsr = 0; | ||
| 62 | } | 63 | } |
| 63 | } // namespace | 64 | } // namespace |
| 64 | 65 | ||
| @@ -223,9 +224,11 @@ Result KThread::Initialize(KThreadFunction func, uintptr_t arg, KProcessAddress | |||
| 223 | } | 224 | } |
| 224 | 225 | ||
| 225 | // Initialize thread context. | 226 | // Initialize thread context. |
| 226 | ResetThreadContext64(m_thread_context_64, GetInteger(user_stack_top), GetInteger(func), arg); | 227 | if (m_parent != nullptr && !m_parent->Is64Bit()) { |
| 227 | ResetThreadContext32(m_thread_context_32, static_cast<u32>(GetInteger(user_stack_top)), | 228 | ResetThreadContext32(m_thread_context, GetInteger(user_stack_top), GetInteger(func), arg); |
| 228 | static_cast<u32>(GetInteger(func)), static_cast<u32>(arg)); | 229 | } else { |
| 230 | ResetThreadContext64(m_thread_context, GetInteger(user_stack_top), GetInteger(func), arg); | ||
| 231 | } | ||
| 229 | 232 | ||
| 230 | // Setup the stack parameters. | 233 | // Setup the stack parameters. |
| 231 | StackParameters& sp = this->GetStackParameters(); | 234 | StackParameters& sp = this->GetStackParameters(); |
| @@ -823,20 +826,7 @@ void KThread::CloneFpuStatus() { | |||
| 823 | ASSERT(this->GetOwnerProcess() != nullptr); | 826 | ASSERT(this->GetOwnerProcess() != nullptr); |
| 824 | ASSERT(this->GetOwnerProcess() == GetCurrentProcessPointer(m_kernel)); | 827 | ASSERT(this->GetOwnerProcess() == GetCurrentProcessPointer(m_kernel)); |
| 825 | 828 | ||
| 826 | if (this->GetOwnerProcess()->Is64Bit()) { | 829 | m_kernel.CurrentPhysicalCore().CloneFpuStatus(this); |
| 827 | // Clone FPSR and FPCR. | ||
| 828 | ThreadContext64 cur_ctx{}; | ||
| 829 | m_kernel.System().CurrentArmInterface().SaveContext(cur_ctx); | ||
| 830 | |||
| 831 | this->GetContext64().fpcr = cur_ctx.fpcr; | ||
| 832 | this->GetContext64().fpsr = cur_ctx.fpsr; | ||
| 833 | } else { | ||
| 834 | // Clone FPSCR. | ||
| 835 | ThreadContext32 cur_ctx{}; | ||
| 836 | m_kernel.System().CurrentArmInterface().SaveContext(cur_ctx); | ||
| 837 | |||
| 838 | this->GetContext32().fpscr = cur_ctx.fpscr; | ||
| 839 | } | ||
| 840 | } | 830 | } |
| 841 | 831 | ||
| 842 | Result KThread::SetActivity(Svc::ThreadActivity activity) { | 832 | Result KThread::SetActivity(Svc::ThreadActivity activity) { |
| @@ -912,7 +902,7 @@ Result KThread::SetActivity(Svc::ThreadActivity activity) { | |||
| 912 | R_SUCCEED(); | 902 | R_SUCCEED(); |
| 913 | } | 903 | } |
| 914 | 904 | ||
| 915 | Result KThread::GetThreadContext3(Common::ScratchBuffer<u8>& out) { | 905 | Result KThread::GetThreadContext3(Svc::ThreadContext* out) { |
| 916 | // Lock ourselves. | 906 | // Lock ourselves. |
| 917 | KScopedLightLock lk{m_activity_pause_lock}; | 907 | KScopedLightLock lk{m_activity_pause_lock}; |
| 918 | 908 | ||
| @@ -926,18 +916,16 @@ Result KThread::GetThreadContext3(Common::ScratchBuffer<u8>& out) { | |||
| 926 | 916 | ||
| 927 | // If we're not terminating, get the thread's user context. | 917 | // If we're not terminating, get the thread's user context. |
| 928 | if (!this->IsTerminationRequested()) { | 918 | if (!this->IsTerminationRequested()) { |
| 919 | *out = m_thread_context; | ||
| 920 | |||
| 921 | // Mask away mode bits, interrupt bits, IL bit, and other reserved bits. | ||
| 922 | constexpr u32 El0Aarch64PsrMask = 0xF0000000; | ||
| 923 | constexpr u32 El0Aarch32PsrMask = 0xFE0FFE20; | ||
| 924 | |||
| 929 | if (m_parent->Is64Bit()) { | 925 | if (m_parent->Is64Bit()) { |
| 930 | // Mask away mode bits, interrupt bits, IL bit, and other reserved bits. | 926 | out->pstate &= El0Aarch64PsrMask; |
| 931 | auto context = GetContext64(); | ||
| 932 | context.pstate &= 0xFF0FFE20; | ||
| 933 | out.resize_destructive(sizeof(context)); | ||
| 934 | std::memcpy(out.data(), std::addressof(context), sizeof(context)); | ||
| 935 | } else { | 927 | } else { |
| 936 | // Mask away mode bits, interrupt bits, IL bit, and other reserved bits. | 928 | out->pstate &= El0Aarch32PsrMask; |
| 937 | auto context = GetContext32(); | ||
| 938 | context.cpsr &= 0xFF0FFE20; | ||
| 939 | out.resize_destructive(sizeof(context)); | ||
| 940 | std::memcpy(out.data(), std::addressof(context), sizeof(context)); | ||
| 941 | } | 929 | } |
| 942 | } | 930 | } |
| 943 | } | 931 | } |
diff --git a/src/core/hle/kernel/k_thread.h b/src/core/hle/kernel/k_thread.h index e9ca5dfca..390db2409 100644 --- a/src/core/hle/kernel/k_thread.h +++ b/src/core/hle/kernel/k_thread.h | |||
| @@ -38,7 +38,6 @@ namespace Core { | |||
| 38 | namespace Memory { | 38 | namespace Memory { |
| 39 | class Memory; | 39 | class Memory; |
| 40 | } | 40 | } |
| 41 | class ARM_Interface; | ||
| 42 | class System; | 41 | class System; |
| 43 | } // namespace Core | 42 | } // namespace Core |
| 44 | 43 | ||
| @@ -137,8 +136,6 @@ public: | |||
| 137 | ~KThread() override; | 136 | ~KThread() override; |
| 138 | 137 | ||
| 139 | public: | 138 | public: |
| 140 | using ThreadContext32 = Core::ARM_Interface::ThreadContext32; | ||
| 141 | using ThreadContext64 = Core::ARM_Interface::ThreadContext64; | ||
| 142 | using WaiterList = Common::IntrusiveListBaseTraits<KThread>::ListType; | 139 | using WaiterList = Common::IntrusiveListBaseTraits<KThread>::ListType; |
| 143 | 140 | ||
| 144 | /** | 141 | /** |
| @@ -246,31 +243,22 @@ public: | |||
| 246 | * @returns The value of the TPIDR_EL0 register. | 243 | * @returns The value of the TPIDR_EL0 register. |
| 247 | */ | 244 | */ |
| 248 | u64 GetTpidrEl0() const { | 245 | u64 GetTpidrEl0() const { |
| 249 | return m_thread_context_64.tpidr; | 246 | return m_thread_context.tpidr; |
| 250 | } | 247 | } |
| 251 | 248 | ||
| 252 | /// Sets the value of the TPIDR_EL0 Read/Write system register for this thread. | 249 | /// Sets the value of the TPIDR_EL0 Read/Write system register for this thread. |
| 253 | void SetTpidrEl0(u64 value) { | 250 | void SetTpidrEl0(u64 value) { |
| 254 | m_thread_context_64.tpidr = value; | 251 | m_thread_context.tpidr = value; |
| 255 | m_thread_context_32.tpidr = static_cast<u32>(value); | ||
| 256 | } | 252 | } |
| 257 | 253 | ||
| 258 | void CloneFpuStatus(); | 254 | void CloneFpuStatus(); |
| 259 | 255 | ||
| 260 | ThreadContext32& GetContext32() { | 256 | Svc::ThreadContext& GetContext() { |
| 261 | return m_thread_context_32; | 257 | return m_thread_context; |
| 262 | } | 258 | } |
| 263 | 259 | ||
| 264 | const ThreadContext32& GetContext32() const { | 260 | const Svc::ThreadContext& GetContext() const { |
| 265 | return m_thread_context_32; | 261 | return m_thread_context; |
| 266 | } | ||
| 267 | |||
| 268 | ThreadContext64& GetContext64() { | ||
| 269 | return m_thread_context_64; | ||
| 270 | } | ||
| 271 | |||
| 272 | const ThreadContext64& GetContext64() const { | ||
| 273 | return m_thread_context_64; | ||
| 274 | } | 262 | } |
| 275 | 263 | ||
| 276 | std::shared_ptr<Common::Fiber>& GetHostContext(); | 264 | std::shared_ptr<Common::Fiber>& GetHostContext(); |
| @@ -577,7 +565,7 @@ public: | |||
| 577 | 565 | ||
| 578 | void RemoveWaiter(KThread* thread); | 566 | void RemoveWaiter(KThread* thread); |
| 579 | 567 | ||
| 580 | Result GetThreadContext3(Common::ScratchBuffer<u8>& out); | 568 | Result GetThreadContext3(Svc::ThreadContext* out); |
| 581 | 569 | ||
| 582 | KThread* RemoveUserWaiterByKey(bool* out_has_waiters, KProcessAddress key) { | 570 | KThread* RemoveUserWaiterByKey(bool* out_has_waiters, KProcessAddress key) { |
| 583 | return this->RemoveWaiterByKey(out_has_waiters, key, false); | 571 | return this->RemoveWaiterByKey(out_has_waiters, key, false); |
| @@ -734,8 +722,7 @@ private: | |||
| 734 | std::function<void()>&& init_func); | 722 | std::function<void()>&& init_func); |
| 735 | 723 | ||
| 736 | // For core KThread implementation | 724 | // For core KThread implementation |
| 737 | ThreadContext32 m_thread_context_32{}; | 725 | Svc::ThreadContext m_thread_context{}; |
| 738 | ThreadContext64 m_thread_context_64{}; | ||
| 739 | Common::IntrusiveListNode m_process_list_node; | 726 | Common::IntrusiveListNode m_process_list_node; |
| 740 | Common::IntrusiveRedBlackTreeNode m_condvar_arbiter_tree_node{}; | 727 | Common::IntrusiveRedBlackTreeNode m_condvar_arbiter_tree_node{}; |
| 741 | s32 m_priority{}; | 728 | s32 m_priority{}; |
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp index 4a1559291..032c4e093 100644 --- a/src/core/hle/kernel/kernel.cpp +++ b/src/core/hle/kernel/kernel.cpp | |||
| @@ -99,13 +99,6 @@ struct KernelCore::Impl { | |||
| 99 | RegisterHostThread(nullptr); | 99 | RegisterHostThread(nullptr); |
| 100 | } | 100 | } |
| 101 | 101 | ||
| 102 | void InitializeCores() { | ||
| 103 | for (u32 core_id = 0; core_id < Core::Hardware::NUM_CPU_CORES; core_id++) { | ||
| 104 | cores[core_id]->Initialize((*application_process).Is64Bit()); | ||
| 105 | system.ApplicationMemory().SetCurrentPageTable(*application_process, core_id); | ||
| 106 | } | ||
| 107 | } | ||
| 108 | |||
| 109 | void TerminateApplicationProcess() { | 102 | void TerminateApplicationProcess() { |
| 110 | application_process.load()->Terminate(); | 103 | application_process.load()->Terminate(); |
| 111 | } | 104 | } |
| @@ -205,7 +198,7 @@ struct KernelCore::Impl { | |||
| 205 | const s32 core{static_cast<s32>(i)}; | 198 | const s32 core{static_cast<s32>(i)}; |
| 206 | 199 | ||
| 207 | schedulers[i] = std::make_unique<Kernel::KScheduler>(system.Kernel()); | 200 | schedulers[i] = std::make_unique<Kernel::KScheduler>(system.Kernel()); |
| 208 | cores[i] = std::make_unique<Kernel::PhysicalCore>(i, system, *schedulers[i]); | 201 | cores[i] = std::make_unique<Kernel::PhysicalCore>(system.Kernel(), i); |
| 209 | 202 | ||
| 210 | auto* main_thread{Kernel::KThread::Create(system.Kernel())}; | 203 | auto* main_thread{Kernel::KThread::Create(system.Kernel())}; |
| 211 | main_thread->SetCurrentCore(core); | 204 | main_thread->SetCurrentCore(core); |
| @@ -880,10 +873,6 @@ void KernelCore::Initialize() { | |||
| 880 | impl->Initialize(*this); | 873 | impl->Initialize(*this); |
| 881 | } | 874 | } |
| 882 | 875 | ||
| 883 | void KernelCore::InitializeCores() { | ||
| 884 | impl->InitializeCores(); | ||
| 885 | } | ||
| 886 | |||
| 887 | void KernelCore::Shutdown() { | 876 | void KernelCore::Shutdown() { |
| 888 | impl->Shutdown(); | 877 | impl->Shutdown(); |
| 889 | } | 878 | } |
| @@ -993,21 +982,6 @@ const KAutoObjectWithListContainer& KernelCore::ObjectListContainer() const { | |||
| 993 | return *impl->global_object_list_container; | 982 | return *impl->global_object_list_container; |
| 994 | } | 983 | } |
| 995 | 984 | ||
| 996 | void KernelCore::InvalidateAllInstructionCaches() { | ||
| 997 | for (auto& physical_core : impl->cores) { | ||
| 998 | physical_core->ArmInterface().ClearInstructionCache(); | ||
| 999 | } | ||
| 1000 | } | ||
| 1001 | |||
| 1002 | void KernelCore::InvalidateCpuInstructionCacheRange(KProcessAddress addr, std::size_t size) { | ||
| 1003 | for (auto& physical_core : impl->cores) { | ||
| 1004 | if (!physical_core->IsInitialized()) { | ||
| 1005 | continue; | ||
| 1006 | } | ||
| 1007 | physical_core->ArmInterface().InvalidateCacheRange(GetInteger(addr), size); | ||
| 1008 | } | ||
| 1009 | } | ||
| 1010 | |||
| 1011 | void KernelCore::PrepareReschedule(std::size_t id) { | 985 | void KernelCore::PrepareReschedule(std::size_t id) { |
| 1012 | // TODO: Reimplement, this | 986 | // TODO: Reimplement, this |
| 1013 | } | 987 | } |
diff --git a/src/core/hle/kernel/kernel.h b/src/core/hle/kernel/kernel.h index d8086c0ea..69b5bbd6c 100644 --- a/src/core/hle/kernel/kernel.h +++ b/src/core/hle/kernel/kernel.h | |||
| @@ -104,9 +104,6 @@ public: | |||
| 104 | /// Resets the kernel to a clean slate for use. | 104 | /// Resets the kernel to a clean slate for use. |
| 105 | void Initialize(); | 105 | void Initialize(); |
| 106 | 106 | ||
| 107 | /// Initializes the CPU cores. | ||
| 108 | void InitializeCores(); | ||
| 109 | |||
| 110 | /// Clears all resources in use by the kernel instance. | 107 | /// Clears all resources in use by the kernel instance. |
| 111 | void Shutdown(); | 108 | void Shutdown(); |
| 112 | 109 | ||
| @@ -181,10 +178,6 @@ public: | |||
| 181 | 178 | ||
| 182 | const KAutoObjectWithListContainer& ObjectListContainer() const; | 179 | const KAutoObjectWithListContainer& ObjectListContainer() const; |
| 183 | 180 | ||
| 184 | void InvalidateAllInstructionCaches(); | ||
| 185 | |||
| 186 | void InvalidateCpuInstructionCacheRange(KProcessAddress addr, std::size_t size); | ||
| 187 | |||
| 188 | /// Registers all kernel objects with the global emulation state, this is purely for tracking | 181 | /// Registers all kernel objects with the global emulation state, this is purely for tracking |
| 189 | /// leaks after emulation has been shutdown. | 182 | /// leaks after emulation has been shutdown. |
| 190 | void RegisterKernelObject(KAutoObject* object); | 183 | void RegisterKernelObject(KAutoObject* object); |
diff --git a/src/core/hle/kernel/physical_core.cpp b/src/core/hle/kernel/physical_core.cpp index 073039825..7fa8e2a85 100644 --- a/src/core/hle/kernel/physical_core.cpp +++ b/src/core/hle/kernel/physical_core.cpp | |||
| @@ -1,62 +1,206 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project | 1 | // SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project |
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | 3 | ||
| 4 | #include "common/scope_exit.h" | ||
| 4 | #include "common/settings.h" | 5 | #include "common/settings.h" |
| 5 | #include "core/arm/dynarmic/arm_dynarmic_32.h" | ||
| 6 | #include "core/arm/dynarmic/arm_dynarmic_64.h" | ||
| 7 | #ifdef HAS_NCE | ||
| 8 | #include "core/arm/nce/arm_nce.h" | ||
| 9 | #endif | ||
| 10 | #include "core/core.h" | 6 | #include "core/core.h" |
| 11 | #include "core/hle/kernel/k_scheduler.h" | 7 | #include "core/debugger/debugger.h" |
| 8 | #include "core/hle/kernel/k_process.h" | ||
| 9 | #include "core/hle/kernel/k_thread.h" | ||
| 12 | #include "core/hle/kernel/kernel.h" | 10 | #include "core/hle/kernel/kernel.h" |
| 13 | #include "core/hle/kernel/physical_core.h" | 11 | #include "core/hle/kernel/physical_core.h" |
| 12 | #include "core/hle/kernel/svc.h" | ||
| 14 | 13 | ||
| 15 | namespace Kernel { | 14 | namespace Kernel { |
| 16 | 15 | ||
| 17 | PhysicalCore::PhysicalCore(std::size_t core_index, Core::System& system, KScheduler& scheduler) | 16 | PhysicalCore::PhysicalCore(KernelCore& kernel, std::size_t core_index) |
| 18 | : m_core_index{core_index}, m_system{system}, m_scheduler{scheduler} { | 17 | : m_kernel{kernel}, m_core_index{core_index} { |
| 19 | #if defined(ARCHITECTURE_x86_64) || defined(ARCHITECTURE_arm64) | 18 | m_is_single_core = !kernel.IsMulticore(); |
| 20 | // TODO(bunnei): Initialization relies on a core being available. We may later replace this with | ||
| 21 | // an NCE interface or a 32-bit instance of Dynarmic. This should be abstracted out to a CPU | ||
| 22 | // manager. | ||
| 23 | auto& kernel = system.Kernel(); | ||
| 24 | m_arm_interface = std::make_unique<Core::ARM_Dynarmic_64>( | ||
| 25 | system, kernel.IsMulticore(), | ||
| 26 | reinterpret_cast<Core::DynarmicExclusiveMonitor&>(kernel.GetExclusiveMonitor()), | ||
| 27 | m_core_index); | ||
| 28 | #else | ||
| 29 | #error Platform not supported yet. | ||
| 30 | #endif | ||
| 31 | } | 19 | } |
| 32 | |||
| 33 | PhysicalCore::~PhysicalCore() = default; | 20 | PhysicalCore::~PhysicalCore() = default; |
| 34 | 21 | ||
| 35 | void PhysicalCore::Initialize(bool is_64_bit) { | 22 | void PhysicalCore::RunThread(Kernel::KThread* thread) { |
| 36 | #if defined(HAS_NCE) | 23 | auto* process = thread->GetOwnerProcess(); |
| 37 | if (Settings::IsNceEnabled()) { | 24 | auto& system = m_kernel.System(); |
| 38 | m_arm_interface = std::make_unique<Core::ARM_NCE>(m_system, m_system.Kernel().IsMulticore(), | 25 | auto* interface = process->GetArmInterface(m_core_index); |
| 39 | m_core_index); | 26 | |
| 27 | interface->Initialize(); | ||
| 28 | |||
| 29 | const auto EnterContext = [&]() { | ||
| 30 | system.EnterCPUProfile(); | ||
| 31 | |||
| 32 | // Lock the core context. | ||
| 33 | std::scoped_lock lk{m_guard}; | ||
| 34 | |||
| 35 | // Check if we are already interrupted. If we are, we can just stop immediately. | ||
| 36 | if (m_is_interrupted) { | ||
| 37 | return false; | ||
| 38 | } | ||
| 39 | |||
| 40 | // Mark that we are running. | ||
| 41 | m_arm_interface = interface; | ||
| 42 | m_current_thread = thread; | ||
| 43 | |||
| 44 | // Acquire the lock on the thread parameters. | ||
| 45 | // This allows us to force synchronization with Interrupt. | ||
| 46 | interface->LockThread(thread); | ||
| 47 | |||
| 48 | return true; | ||
| 49 | }; | ||
| 50 | |||
| 51 | const auto ExitContext = [&]() { | ||
| 52 | // Unlock the thread. | ||
| 53 | interface->UnlockThread(thread); | ||
| 54 | |||
| 55 | // Lock the core context. | ||
| 56 | std::scoped_lock lk{m_guard}; | ||
| 57 | |||
| 58 | // On exit, we no longer are running. | ||
| 59 | m_arm_interface = nullptr; | ||
| 60 | m_current_thread = nullptr; | ||
| 61 | |||
| 62 | system.ExitCPUProfile(); | ||
| 63 | }; | ||
| 64 | |||
| 65 | while (true) { | ||
| 66 | // If the thread is scheduled for termination, exit. | ||
| 67 | if (thread->HasDpc() && thread->IsTerminationRequested()) { | ||
| 68 | thread->Exit(); | ||
| 69 | } | ||
| 70 | |||
| 71 | // Notify the debugger and go to sleep if a step was performed | ||
| 72 | // and this thread has been scheduled again. | ||
| 73 | if (thread->GetStepState() == StepState::StepPerformed) { | ||
| 74 | system.GetDebugger().NotifyThreadStopped(thread); | ||
| 75 | thread->RequestSuspend(SuspendType::Debug); | ||
| 76 | return; | ||
| 77 | } | ||
| 78 | |||
| 79 | // Otherwise, run the thread. | ||
| 80 | Core::HaltReason hr{}; | ||
| 81 | { | ||
| 82 | // If we were interrupted, exit immediately. | ||
| 83 | if (!EnterContext()) { | ||
| 84 | return; | ||
| 85 | } | ||
| 86 | |||
| 87 | if (thread->GetStepState() == StepState::StepPending) { | ||
| 88 | hr = interface->StepThread(thread); | ||
| 89 | |||
| 90 | if (True(hr & Core::HaltReason::StepThread)) { | ||
| 91 | thread->SetStepState(StepState::StepPerformed); | ||
| 92 | } | ||
| 93 | } else { | ||
| 94 | hr = interface->RunThread(thread); | ||
| 95 | } | ||
| 96 | |||
| 97 | ExitContext(); | ||
| 98 | } | ||
| 99 | |||
| 100 | // Determine why we stopped. | ||
| 101 | const bool supervisor_call = True(hr & Core::HaltReason::SupervisorCall); | ||
| 102 | const bool prefetch_abort = True(hr & Core::HaltReason::PrefetchAbort); | ||
| 103 | const bool breakpoint = True(hr & Core::HaltReason::InstructionBreakpoint); | ||
| 104 | const bool data_abort = True(hr & Core::HaltReason::DataAbort); | ||
| 105 | const bool interrupt = True(hr & Core::HaltReason::BreakLoop); | ||
| 106 | |||
| 107 | // Since scheduling may occur here, we cannot use any cached | ||
| 108 | // state after returning from calls we make. | ||
| 109 | |||
| 110 | // Notify the debugger and go to sleep if a breakpoint was hit, | ||
| 111 | // or if the thread is unable to continue for any reason. | ||
| 112 | if (breakpoint || prefetch_abort) { | ||
| 113 | if (breakpoint) { | ||
| 114 | interface->RewindBreakpointInstruction(); | ||
| 115 | } | ||
| 116 | if (system.DebuggerEnabled()) { | ||
| 117 | system.GetDebugger().NotifyThreadStopped(thread); | ||
| 118 | } else { | ||
| 119 | interface->LogBacktrace(process); | ||
| 120 | } | ||
| 121 | thread->RequestSuspend(SuspendType::Debug); | ||
| 122 | return; | ||
| 123 | } | ||
| 124 | |||
| 125 | // Notify the debugger and go to sleep on data abort. | ||
| 126 | if (data_abort) { | ||
| 127 | if (system.DebuggerEnabled()) { | ||
| 128 | system.GetDebugger().NotifyThreadWatchpoint(thread, *interface->HaltedWatchpoint()); | ||
| 129 | } | ||
| 130 | thread->RequestSuspend(SuspendType::Debug); | ||
| 131 | return; | ||
| 132 | } | ||
| 133 | |||
| 134 | // Handle system calls. | ||
| 135 | if (supervisor_call) { | ||
| 136 | // Perform call. | ||
| 137 | Svc::Call(system, interface->GetSvcNumber()); | ||
| 138 | return; | ||
| 139 | } | ||
| 140 | |||
| 141 | // Handle external interrupt sources. | ||
| 142 | if (interrupt || !m_is_single_core) { | ||
| 143 | return; | ||
| 144 | } | ||
| 145 | } | ||
| 146 | } | ||
| 147 | |||
| 148 | void PhysicalCore::LoadContext(const KThread* thread) { | ||
| 149 | auto* const process = thread->GetOwnerProcess(); | ||
| 150 | if (!process) { | ||
| 151 | // Kernel threads do not run on emulated CPU cores. | ||
| 40 | return; | 152 | return; |
| 41 | } | 153 | } |
| 42 | #endif | 154 | |
| 43 | #if defined(ARCHITECTURE_x86_64) || defined(ARCHITECTURE_arm64) | 155 | auto* interface = process->GetArmInterface(m_core_index); |
| 44 | auto& kernel = m_system.Kernel(); | 156 | if (interface) { |
| 45 | if (!is_64_bit) { | 157 | interface->SetContext(thread->GetContext()); |
| 46 | // We already initialized a 64-bit core, replace with a 32-bit one. | 158 | interface->SetTpidrroEl0(GetInteger(thread->GetTlsAddress())); |
| 47 | m_arm_interface = std::make_unique<Core::ARM_Dynarmic_32>( | 159 | interface->SetWatchpointArray(&process->GetWatchpoints()); |
| 48 | m_system, kernel.IsMulticore(), | ||
| 49 | reinterpret_cast<Core::DynarmicExclusiveMonitor&>(kernel.GetExclusiveMonitor()), | ||
| 50 | m_core_index); | ||
| 51 | } | 160 | } |
| 52 | #else | ||
| 53 | #error Platform not supported yet. | ||
| 54 | #endif | ||
| 55 | } | 161 | } |
| 56 | 162 | ||
| 57 | void PhysicalCore::Run() { | 163 | void PhysicalCore::LoadSvcArguments(const KProcess& process, std::span<const uint64_t, 8> args) { |
| 58 | m_arm_interface->Run(); | 164 | process.GetArmInterface(m_core_index)->SetSvcArguments(args); |
| 59 | m_arm_interface->ClearExclusiveState(); | 165 | } |
| 166 | |||
| 167 | void PhysicalCore::SaveContext(KThread* thread) const { | ||
| 168 | auto* const process = thread->GetOwnerProcess(); | ||
| 169 | if (!process) { | ||
| 170 | // Kernel threads do not run on emulated CPU cores. | ||
| 171 | return; | ||
| 172 | } | ||
| 173 | |||
| 174 | auto* interface = process->GetArmInterface(m_core_index); | ||
| 175 | if (interface) { | ||
| 176 | interface->GetContext(thread->GetContext()); | ||
| 177 | } | ||
| 178 | } | ||
| 179 | |||
| 180 | void PhysicalCore::SaveSvcArguments(KProcess& process, std::span<uint64_t, 8> args) const { | ||
| 181 | process.GetArmInterface(m_core_index)->GetSvcArguments(args); | ||
| 182 | } | ||
| 183 | |||
| 184 | void PhysicalCore::CloneFpuStatus(KThread* dst) const { | ||
| 185 | auto* process = dst->GetOwnerProcess(); | ||
| 186 | |||
| 187 | Svc::ThreadContext ctx{}; | ||
| 188 | process->GetArmInterface(m_core_index)->GetContext(ctx); | ||
| 189 | |||
| 190 | dst->GetContext().fpcr = ctx.fpcr; | ||
| 191 | dst->GetContext().fpsr = ctx.fpsr; | ||
| 192 | } | ||
| 193 | |||
| 194 | void PhysicalCore::LogBacktrace() { | ||
| 195 | auto* process = GetCurrentProcessPointer(m_kernel); | ||
| 196 | if (!process) { | ||
| 197 | return; | ||
| 198 | } | ||
| 199 | |||
| 200 | auto* interface = process->GetArmInterface(m_core_index); | ||
| 201 | if (interface) { | ||
| 202 | interface->LogBacktrace(process); | ||
| 203 | } | ||
| 60 | } | 204 | } |
| 61 | 205 | ||
| 62 | void PhysicalCore::Idle() { | 206 | void PhysicalCore::Idle() { |
| @@ -69,16 +213,31 @@ bool PhysicalCore::IsInterrupted() const { | |||
| 69 | } | 213 | } |
| 70 | 214 | ||
| 71 | void PhysicalCore::Interrupt() { | 215 | void PhysicalCore::Interrupt() { |
| 72 | std::unique_lock lk{m_guard}; | 216 | // Lock core context. |
| 217 | std::scoped_lock lk{m_guard}; | ||
| 218 | |||
| 219 | // Load members. | ||
| 220 | auto* arm_interface = m_arm_interface; | ||
| 221 | auto* thread = m_current_thread; | ||
| 222 | |||
| 223 | // Add interrupt flag. | ||
| 73 | m_is_interrupted = true; | 224 | m_is_interrupted = true; |
| 74 | m_arm_interface->SignalInterrupt(); | 225 | |
| 75 | m_on_interrupt.notify_all(); | 226 | // Interrupt ourselves. |
| 227 | m_on_interrupt.notify_one(); | ||
| 228 | |||
| 229 | // If there is no thread running, we are done. | ||
| 230 | if (arm_interface == nullptr) { | ||
| 231 | return; | ||
| 232 | } | ||
| 233 | |||
| 234 | // Interrupt the CPU. | ||
| 235 | arm_interface->SignalInterrupt(thread); | ||
| 76 | } | 236 | } |
| 77 | 237 | ||
| 78 | void PhysicalCore::ClearInterrupt() { | 238 | void PhysicalCore::ClearInterrupt() { |
| 79 | std::unique_lock lk{m_guard}; | 239 | std::scoped_lock lk{m_guard}; |
| 80 | m_is_interrupted = false; | 240 | m_is_interrupted = false; |
| 81 | m_arm_interface->ClearInterrupt(); | ||
| 82 | } | 241 | } |
| 83 | 242 | ||
| 84 | } // namespace Kernel | 243 | } // namespace Kernel |
diff --git a/src/core/hle/kernel/physical_core.h b/src/core/hle/kernel/physical_core.h index 5cb398fdc..bae4fe5b8 100644 --- a/src/core/hle/kernel/physical_core.h +++ b/src/core/hle/kernel/physical_core.h | |||
| @@ -11,7 +11,7 @@ | |||
| 11 | #include "core/arm/arm_interface.h" | 11 | #include "core/arm/arm_interface.h" |
| 12 | 12 | ||
| 13 | namespace Kernel { | 13 | namespace Kernel { |
| 14 | class KScheduler; | 14 | class KernelCore; |
| 15 | } // namespace Kernel | 15 | } // namespace Kernel |
| 16 | 16 | ||
| 17 | namespace Core { | 17 | namespace Core { |
| @@ -23,62 +23,55 @@ namespace Kernel { | |||
| 23 | 23 | ||
| 24 | class PhysicalCore { | 24 | class PhysicalCore { |
| 25 | public: | 25 | public: |
| 26 | PhysicalCore(std::size_t core_index_, Core::System& system_, KScheduler& scheduler_); | 26 | PhysicalCore(KernelCore& kernel, std::size_t core_index); |
| 27 | ~PhysicalCore(); | 27 | ~PhysicalCore(); |
| 28 | 28 | ||
| 29 | YUZU_NON_COPYABLE(PhysicalCore); | 29 | YUZU_NON_COPYABLE(PhysicalCore); |
| 30 | YUZU_NON_MOVEABLE(PhysicalCore); | 30 | YUZU_NON_MOVEABLE(PhysicalCore); |
| 31 | 31 | ||
| 32 | /// Initialize the core for the specified parameters. | 32 | // Execute guest code running on the given thread. |
| 33 | void Initialize(bool is_64_bit); | 33 | void RunThread(KThread* thread); |
| 34 | 34 | ||
| 35 | /// Execute current jit state | 35 | // Copy context from thread to current core. |
| 36 | void Run(); | 36 | void LoadContext(const KThread* thread); |
| 37 | void LoadSvcArguments(const KProcess& process, std::span<const uint64_t, 8> args); | ||
| 37 | 38 | ||
| 39 | // Copy context from current core to thread. | ||
| 40 | void SaveContext(KThread* thread) const; | ||
| 41 | void SaveSvcArguments(KProcess& process, std::span<uint64_t, 8> args) const; | ||
| 42 | |||
| 43 | // Copy floating point status registers to the target thread. | ||
| 44 | void CloneFpuStatus(KThread* dst) const; | ||
| 45 | |||
| 46 | // Log backtrace of current processor state. | ||
| 47 | void LogBacktrace(); | ||
| 48 | |||
| 49 | // Wait for an interrupt. | ||
| 38 | void Idle(); | 50 | void Idle(); |
| 39 | 51 | ||
| 40 | /// Interrupt this physical core. | 52 | // Interrupt this core. |
| 41 | void Interrupt(); | 53 | void Interrupt(); |
| 42 | 54 | ||
| 43 | /// Clear this core's interrupt | 55 | // Clear this core's interrupt. |
| 44 | void ClearInterrupt(); | 56 | void ClearInterrupt(); |
| 45 | 57 | ||
| 46 | /// Check if this core is interrupted | 58 | // Check if this core is interrupted. |
| 47 | bool IsInterrupted() const; | 59 | bool IsInterrupted() const; |
| 48 | 60 | ||
| 49 | bool IsInitialized() const { | ||
| 50 | return m_arm_interface != nullptr; | ||
| 51 | } | ||
| 52 | |||
| 53 | Core::ARM_Interface& ArmInterface() { | ||
| 54 | return *m_arm_interface; | ||
| 55 | } | ||
| 56 | |||
| 57 | const Core::ARM_Interface& ArmInterface() const { | ||
| 58 | return *m_arm_interface; | ||
| 59 | } | ||
| 60 | |||
| 61 | std::size_t CoreIndex() const { | 61 | std::size_t CoreIndex() const { |
| 62 | return m_core_index; | 62 | return m_core_index; |
| 63 | } | 63 | } |
| 64 | 64 | ||
| 65 | Kernel::KScheduler& Scheduler() { | ||
| 66 | return m_scheduler; | ||
| 67 | } | ||
| 68 | |||
| 69 | const Kernel::KScheduler& Scheduler() const { | ||
| 70 | return m_scheduler; | ||
| 71 | } | ||
| 72 | |||
| 73 | private: | 65 | private: |
| 66 | KernelCore& m_kernel; | ||
| 74 | const std::size_t m_core_index; | 67 | const std::size_t m_core_index; |
| 75 | Core::System& m_system; | ||
| 76 | Kernel::KScheduler& m_scheduler; | ||
| 77 | 68 | ||
| 78 | std::mutex m_guard; | 69 | std::mutex m_guard; |
| 79 | std::condition_variable m_on_interrupt; | 70 | std::condition_variable m_on_interrupt; |
| 80 | std::unique_ptr<Core::ARM_Interface> m_arm_interface; | 71 | Core::ArmInterface* m_arm_interface{}; |
| 72 | KThread* m_current_thread{}; | ||
| 81 | bool m_is_interrupted{}; | 73 | bool m_is_interrupted{}; |
| 74 | bool m_is_single_core{}; | ||
| 82 | }; | 75 | }; |
| 83 | 76 | ||
| 84 | } // namespace Kernel | 77 | } // namespace Kernel |
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index b76683969..c55dc0c8a 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp | |||
| @@ -12,20 +12,20 @@ | |||
| 12 | 12 | ||
| 13 | namespace Kernel::Svc { | 13 | namespace Kernel::Svc { |
| 14 | 14 | ||
| 15 | static uint32_t GetReg32(Core::System& system, int n) { | 15 | static uint32_t GetArg32(std::span<uint64_t, 8> args, int n) { |
| 16 | return static_cast<uint32_t>(system.CurrentArmInterface().GetReg(n)); | 16 | return static_cast<uint32_t>(args[n]); |
| 17 | } | 17 | } |
| 18 | 18 | ||
| 19 | static void SetReg32(Core::System& system, int n, uint32_t result) { | 19 | static void SetArg32(std::span<uint64_t, 8> args, int n, uint32_t result) { |
| 20 | system.CurrentArmInterface().SetReg(n, static_cast<uint64_t>(result)); | 20 | args[n] = result; |
| 21 | } | 21 | } |
| 22 | 22 | ||
| 23 | static uint64_t GetReg64(Core::System& system, int n) { | 23 | static uint64_t GetArg64(std::span<uint64_t, 8> args, int n) { |
| 24 | return system.CurrentArmInterface().GetReg(n); | 24 | return args[n]; |
| 25 | } | 25 | } |
| 26 | 26 | ||
| 27 | static void SetReg64(Core::System& system, int n, uint64_t result) { | 27 | static void SetArg64(std::span<uint64_t, 8> args, int n, uint64_t result) { |
| 28 | system.CurrentArmInterface().SetReg(n, result); | 28 | args[n] = result; |
| 29 | } | 29 | } |
| 30 | 30 | ||
| 31 | // Like bit_cast, but handles the case when the source and dest | 31 | // Like bit_cast, but handles the case when the source and dest |
| @@ -79,37 +79,37 @@ static_assert(sizeof(int64_t) == 8); | |||
| 79 | static_assert(sizeof(uint32_t) == 4); | 79 | static_assert(sizeof(uint32_t) == 4); |
| 80 | static_assert(sizeof(uint64_t) == 8); | 80 | static_assert(sizeof(uint64_t) == 8); |
| 81 | 81 | ||
| 82 | static void SvcWrap_SetHeapSize64From32(Core::System& system) { | 82 | static void SvcWrap_SetHeapSize64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 83 | Result ret{}; | 83 | Result ret{}; |
| 84 | 84 | ||
| 85 | uint64_t out_address{}; | 85 | uint64_t out_address{}; |
| 86 | uint32_t size{}; | 86 | uint32_t size{}; |
| 87 | 87 | ||
| 88 | size = Convert<uint32_t>(GetReg32(system, 1)); | 88 | size = Convert<uint32_t>(GetArg32(args, 1)); |
| 89 | 89 | ||
| 90 | ret = SetHeapSize64From32(system, std::addressof(out_address), size); | 90 | ret = SetHeapSize64From32(system, std::addressof(out_address), size); |
| 91 | 91 | ||
| 92 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 92 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 93 | SetReg32(system, 1, Convert<uint32_t>(out_address)); | 93 | SetArg32(args, 1, Convert<uint32_t>(out_address)); |
| 94 | } | 94 | } |
| 95 | 95 | ||
| 96 | static void SvcWrap_SetMemoryPermission64From32(Core::System& system) { | 96 | static void SvcWrap_SetMemoryPermission64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 97 | Result ret{}; | 97 | Result ret{}; |
| 98 | 98 | ||
| 99 | uint32_t address{}; | 99 | uint32_t address{}; |
| 100 | uint32_t size{}; | 100 | uint32_t size{}; |
| 101 | MemoryPermission perm{}; | 101 | MemoryPermission perm{}; |
| 102 | 102 | ||
| 103 | address = Convert<uint32_t>(GetReg32(system, 0)); | 103 | address = Convert<uint32_t>(GetArg32(args, 0)); |
| 104 | size = Convert<uint32_t>(GetReg32(system, 1)); | 104 | size = Convert<uint32_t>(GetArg32(args, 1)); |
| 105 | perm = Convert<MemoryPermission>(GetReg32(system, 2)); | 105 | perm = Convert<MemoryPermission>(GetArg32(args, 2)); |
| 106 | 106 | ||
| 107 | ret = SetMemoryPermission64From32(system, address, size, perm); | 107 | ret = SetMemoryPermission64From32(system, address, size, perm); |
| 108 | 108 | ||
| 109 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 109 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 110 | } | 110 | } |
| 111 | 111 | ||
| 112 | static void SvcWrap_SetMemoryAttribute64From32(Core::System& system) { | 112 | static void SvcWrap_SetMemoryAttribute64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 113 | Result ret{}; | 113 | Result ret{}; |
| 114 | 114 | ||
| 115 | uint32_t address{}; | 115 | uint32_t address{}; |
| @@ -117,69 +117,69 @@ static void SvcWrap_SetMemoryAttribute64From32(Core::System& system) { | |||
| 117 | uint32_t mask{}; | 117 | uint32_t mask{}; |
| 118 | uint32_t attr{}; | 118 | uint32_t attr{}; |
| 119 | 119 | ||
| 120 | address = Convert<uint32_t>(GetReg32(system, 0)); | 120 | address = Convert<uint32_t>(GetArg32(args, 0)); |
| 121 | size = Convert<uint32_t>(GetReg32(system, 1)); | 121 | size = Convert<uint32_t>(GetArg32(args, 1)); |
| 122 | mask = Convert<uint32_t>(GetReg32(system, 2)); | 122 | mask = Convert<uint32_t>(GetArg32(args, 2)); |
| 123 | attr = Convert<uint32_t>(GetReg32(system, 3)); | 123 | attr = Convert<uint32_t>(GetArg32(args, 3)); |
| 124 | 124 | ||
| 125 | ret = SetMemoryAttribute64From32(system, address, size, mask, attr); | 125 | ret = SetMemoryAttribute64From32(system, address, size, mask, attr); |
| 126 | 126 | ||
| 127 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 127 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 128 | } | 128 | } |
| 129 | 129 | ||
| 130 | static void SvcWrap_MapMemory64From32(Core::System& system) { | 130 | static void SvcWrap_MapMemory64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 131 | Result ret{}; | 131 | Result ret{}; |
| 132 | 132 | ||
| 133 | uint32_t dst_address{}; | 133 | uint32_t dst_address{}; |
| 134 | uint32_t src_address{}; | 134 | uint32_t src_address{}; |
| 135 | uint32_t size{}; | 135 | uint32_t size{}; |
| 136 | 136 | ||
| 137 | dst_address = Convert<uint32_t>(GetReg32(system, 0)); | 137 | dst_address = Convert<uint32_t>(GetArg32(args, 0)); |
| 138 | src_address = Convert<uint32_t>(GetReg32(system, 1)); | 138 | src_address = Convert<uint32_t>(GetArg32(args, 1)); |
| 139 | size = Convert<uint32_t>(GetReg32(system, 2)); | 139 | size = Convert<uint32_t>(GetArg32(args, 2)); |
| 140 | 140 | ||
| 141 | ret = MapMemory64From32(system, dst_address, src_address, size); | 141 | ret = MapMemory64From32(system, dst_address, src_address, size); |
| 142 | 142 | ||
| 143 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 143 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 144 | } | 144 | } |
| 145 | 145 | ||
| 146 | static void SvcWrap_UnmapMemory64From32(Core::System& system) { | 146 | static void SvcWrap_UnmapMemory64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 147 | Result ret{}; | 147 | Result ret{}; |
| 148 | 148 | ||
| 149 | uint32_t dst_address{}; | 149 | uint32_t dst_address{}; |
| 150 | uint32_t src_address{}; | 150 | uint32_t src_address{}; |
| 151 | uint32_t size{}; | 151 | uint32_t size{}; |
| 152 | 152 | ||
| 153 | dst_address = Convert<uint32_t>(GetReg32(system, 0)); | 153 | dst_address = Convert<uint32_t>(GetArg32(args, 0)); |
| 154 | src_address = Convert<uint32_t>(GetReg32(system, 1)); | 154 | src_address = Convert<uint32_t>(GetArg32(args, 1)); |
| 155 | size = Convert<uint32_t>(GetReg32(system, 2)); | 155 | size = Convert<uint32_t>(GetArg32(args, 2)); |
| 156 | 156 | ||
| 157 | ret = UnmapMemory64From32(system, dst_address, src_address, size); | 157 | ret = UnmapMemory64From32(system, dst_address, src_address, size); |
| 158 | 158 | ||
| 159 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 159 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 160 | } | 160 | } |
| 161 | 161 | ||
| 162 | static void SvcWrap_QueryMemory64From32(Core::System& system) { | 162 | static void SvcWrap_QueryMemory64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 163 | Result ret{}; | 163 | Result ret{}; |
| 164 | 164 | ||
| 165 | PageInfo out_page_info{}; | 165 | PageInfo out_page_info{}; |
| 166 | uint32_t out_memory_info{}; | 166 | uint32_t out_memory_info{}; |
| 167 | uint32_t address{}; | 167 | uint32_t address{}; |
| 168 | 168 | ||
| 169 | out_memory_info = Convert<uint32_t>(GetReg32(system, 0)); | 169 | out_memory_info = Convert<uint32_t>(GetArg32(args, 0)); |
| 170 | address = Convert<uint32_t>(GetReg32(system, 2)); | 170 | address = Convert<uint32_t>(GetArg32(args, 2)); |
| 171 | 171 | ||
| 172 | ret = QueryMemory64From32(system, out_memory_info, std::addressof(out_page_info), address); | 172 | ret = QueryMemory64From32(system, out_memory_info, std::addressof(out_page_info), address); |
| 173 | 173 | ||
| 174 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 174 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 175 | SetReg32(system, 1, Convert<uint32_t>(out_page_info)); | 175 | SetArg32(args, 1, Convert<uint32_t>(out_page_info)); |
| 176 | } | 176 | } |
| 177 | 177 | ||
| 178 | static void SvcWrap_ExitProcess64From32(Core::System& system) { | 178 | static void SvcWrap_ExitProcess64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 179 | ExitProcess64From32(system); | 179 | ExitProcess64From32(system); |
| 180 | } | 180 | } |
| 181 | 181 | ||
| 182 | static void SvcWrap_CreateThread64From32(Core::System& system) { | 182 | static void SvcWrap_CreateThread64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 183 | Result ret{}; | 183 | Result ret{}; |
| 184 | 184 | ||
| 185 | Handle out_handle{}; | 185 | Handle out_handle{}; |
| @@ -189,143 +189,143 @@ static void SvcWrap_CreateThread64From32(Core::System& system) { | |||
| 189 | int32_t priority{}; | 189 | int32_t priority{}; |
| 190 | int32_t core_id{}; | 190 | int32_t core_id{}; |
| 191 | 191 | ||
| 192 | func = Convert<uint32_t>(GetReg32(system, 1)); | 192 | func = Convert<uint32_t>(GetArg32(args, 1)); |
| 193 | arg = Convert<uint32_t>(GetReg32(system, 2)); | 193 | arg = Convert<uint32_t>(GetArg32(args, 2)); |
| 194 | stack_bottom = Convert<uint32_t>(GetReg32(system, 3)); | 194 | stack_bottom = Convert<uint32_t>(GetArg32(args, 3)); |
| 195 | priority = Convert<int32_t>(GetReg32(system, 0)); | 195 | priority = Convert<int32_t>(GetArg32(args, 0)); |
| 196 | core_id = Convert<int32_t>(GetReg32(system, 4)); | 196 | core_id = Convert<int32_t>(GetArg32(args, 4)); |
| 197 | 197 | ||
| 198 | ret = CreateThread64From32(system, std::addressof(out_handle), func, arg, stack_bottom, priority, core_id); | 198 | ret = CreateThread64From32(system, std::addressof(out_handle), func, arg, stack_bottom, priority, core_id); |
| 199 | 199 | ||
| 200 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 200 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 201 | SetReg32(system, 1, Convert<uint32_t>(out_handle)); | 201 | SetArg32(args, 1, Convert<uint32_t>(out_handle)); |
| 202 | } | 202 | } |
| 203 | 203 | ||
| 204 | static void SvcWrap_StartThread64From32(Core::System& system) { | 204 | static void SvcWrap_StartThread64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 205 | Result ret{}; | 205 | Result ret{}; |
| 206 | 206 | ||
| 207 | Handle thread_handle{}; | 207 | Handle thread_handle{}; |
| 208 | 208 | ||
| 209 | thread_handle = Convert<Handle>(GetReg32(system, 0)); | 209 | thread_handle = Convert<Handle>(GetArg32(args, 0)); |
| 210 | 210 | ||
| 211 | ret = StartThread64From32(system, thread_handle); | 211 | ret = StartThread64From32(system, thread_handle); |
| 212 | 212 | ||
| 213 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 213 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 214 | } | 214 | } |
| 215 | 215 | ||
| 216 | static void SvcWrap_ExitThread64From32(Core::System& system) { | 216 | static void SvcWrap_ExitThread64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 217 | ExitThread64From32(system); | 217 | ExitThread64From32(system); |
| 218 | } | 218 | } |
| 219 | 219 | ||
| 220 | static void SvcWrap_SleepThread64From32(Core::System& system) { | 220 | static void SvcWrap_SleepThread64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 221 | int64_t ns{}; | 221 | int64_t ns{}; |
| 222 | 222 | ||
| 223 | std::array<uint32_t, 2> ns_gather{}; | 223 | std::array<uint32_t, 2> ns_gather{}; |
| 224 | ns_gather[0] = GetReg32(system, 0); | 224 | ns_gather[0] = GetArg32(args, 0); |
| 225 | ns_gather[1] = GetReg32(system, 1); | 225 | ns_gather[1] = GetArg32(args, 1); |
| 226 | ns = Convert<int64_t>(ns_gather); | 226 | ns = Convert<int64_t>(ns_gather); |
| 227 | 227 | ||
| 228 | SleepThread64From32(system, ns); | 228 | SleepThread64From32(system, ns); |
| 229 | } | 229 | } |
| 230 | 230 | ||
| 231 | static void SvcWrap_GetThreadPriority64From32(Core::System& system) { | 231 | static void SvcWrap_GetThreadPriority64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 232 | Result ret{}; | 232 | Result ret{}; |
| 233 | 233 | ||
| 234 | int32_t out_priority{}; | 234 | int32_t out_priority{}; |
| 235 | Handle thread_handle{}; | 235 | Handle thread_handle{}; |
| 236 | 236 | ||
| 237 | thread_handle = Convert<Handle>(GetReg32(system, 1)); | 237 | thread_handle = Convert<Handle>(GetArg32(args, 1)); |
| 238 | 238 | ||
| 239 | ret = GetThreadPriority64From32(system, std::addressof(out_priority), thread_handle); | 239 | ret = GetThreadPriority64From32(system, std::addressof(out_priority), thread_handle); |
| 240 | 240 | ||
| 241 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 241 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 242 | SetReg32(system, 1, Convert<uint32_t>(out_priority)); | 242 | SetArg32(args, 1, Convert<uint32_t>(out_priority)); |
| 243 | } | 243 | } |
| 244 | 244 | ||
| 245 | static void SvcWrap_SetThreadPriority64From32(Core::System& system) { | 245 | static void SvcWrap_SetThreadPriority64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 246 | Result ret{}; | 246 | Result ret{}; |
| 247 | 247 | ||
| 248 | Handle thread_handle{}; | 248 | Handle thread_handle{}; |
| 249 | int32_t priority{}; | 249 | int32_t priority{}; |
| 250 | 250 | ||
| 251 | thread_handle = Convert<Handle>(GetReg32(system, 0)); | 251 | thread_handle = Convert<Handle>(GetArg32(args, 0)); |
| 252 | priority = Convert<int32_t>(GetReg32(system, 1)); | 252 | priority = Convert<int32_t>(GetArg32(args, 1)); |
| 253 | 253 | ||
| 254 | ret = SetThreadPriority64From32(system, thread_handle, priority); | 254 | ret = SetThreadPriority64From32(system, thread_handle, priority); |
| 255 | 255 | ||
| 256 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 256 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 257 | } | 257 | } |
| 258 | 258 | ||
| 259 | static void SvcWrap_GetThreadCoreMask64From32(Core::System& system) { | 259 | static void SvcWrap_GetThreadCoreMask64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 260 | Result ret{}; | 260 | Result ret{}; |
| 261 | 261 | ||
| 262 | int32_t out_core_id{}; | 262 | int32_t out_core_id{}; |
| 263 | uint64_t out_affinity_mask{}; | 263 | uint64_t out_affinity_mask{}; |
| 264 | Handle thread_handle{}; | 264 | Handle thread_handle{}; |
| 265 | 265 | ||
| 266 | thread_handle = Convert<Handle>(GetReg32(system, 2)); | 266 | thread_handle = Convert<Handle>(GetArg32(args, 2)); |
| 267 | 267 | ||
| 268 | ret = GetThreadCoreMask64From32(system, std::addressof(out_core_id), std::addressof(out_affinity_mask), thread_handle); | 268 | ret = GetThreadCoreMask64From32(system, std::addressof(out_core_id), std::addressof(out_affinity_mask), thread_handle); |
| 269 | 269 | ||
| 270 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 270 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 271 | SetReg32(system, 1, Convert<uint32_t>(out_core_id)); | 271 | SetArg32(args, 1, Convert<uint32_t>(out_core_id)); |
| 272 | auto out_affinity_mask_scatter = Convert<std::array<uint32_t, 2>>(out_affinity_mask); | 272 | auto out_affinity_mask_scatter = Convert<std::array<uint32_t, 2>>(out_affinity_mask); |
| 273 | SetReg32(system, 2, out_affinity_mask_scatter[0]); | 273 | SetArg32(args, 2, out_affinity_mask_scatter[0]); |
| 274 | SetReg32(system, 3, out_affinity_mask_scatter[1]); | 274 | SetArg32(args, 3, out_affinity_mask_scatter[1]); |
| 275 | } | 275 | } |
| 276 | 276 | ||
| 277 | static void SvcWrap_SetThreadCoreMask64From32(Core::System& system) { | 277 | static void SvcWrap_SetThreadCoreMask64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 278 | Result ret{}; | 278 | Result ret{}; |
| 279 | 279 | ||
| 280 | Handle thread_handle{}; | 280 | Handle thread_handle{}; |
| 281 | int32_t core_id{}; | 281 | int32_t core_id{}; |
| 282 | uint64_t affinity_mask{}; | 282 | uint64_t affinity_mask{}; |
| 283 | 283 | ||
| 284 | thread_handle = Convert<Handle>(GetReg32(system, 0)); | 284 | thread_handle = Convert<Handle>(GetArg32(args, 0)); |
| 285 | core_id = Convert<int32_t>(GetReg32(system, 1)); | 285 | core_id = Convert<int32_t>(GetArg32(args, 1)); |
| 286 | std::array<uint32_t, 2> affinity_mask_gather{}; | 286 | std::array<uint32_t, 2> affinity_mask_gather{}; |
| 287 | affinity_mask_gather[0] = GetReg32(system, 2); | 287 | affinity_mask_gather[0] = GetArg32(args, 2); |
| 288 | affinity_mask_gather[1] = GetReg32(system, 3); | 288 | affinity_mask_gather[1] = GetArg32(args, 3); |
| 289 | affinity_mask = Convert<uint64_t>(affinity_mask_gather); | 289 | affinity_mask = Convert<uint64_t>(affinity_mask_gather); |
| 290 | 290 | ||
| 291 | ret = SetThreadCoreMask64From32(system, thread_handle, core_id, affinity_mask); | 291 | ret = SetThreadCoreMask64From32(system, thread_handle, core_id, affinity_mask); |
| 292 | 292 | ||
| 293 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 293 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 294 | } | 294 | } |
| 295 | 295 | ||
| 296 | static void SvcWrap_GetCurrentProcessorNumber64From32(Core::System& system) { | 296 | static void SvcWrap_GetCurrentProcessorNumber64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 297 | int32_t ret{}; | 297 | int32_t ret{}; |
| 298 | 298 | ||
| 299 | ret = GetCurrentProcessorNumber64From32(system); | 299 | ret = GetCurrentProcessorNumber64From32(system); |
| 300 | 300 | ||
| 301 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 301 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 302 | } | 302 | } |
| 303 | 303 | ||
| 304 | static void SvcWrap_SignalEvent64From32(Core::System& system) { | 304 | static void SvcWrap_SignalEvent64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 305 | Result ret{}; | 305 | Result ret{}; |
| 306 | 306 | ||
| 307 | Handle event_handle{}; | 307 | Handle event_handle{}; |
| 308 | 308 | ||
| 309 | event_handle = Convert<Handle>(GetReg32(system, 0)); | 309 | event_handle = Convert<Handle>(GetArg32(args, 0)); |
| 310 | 310 | ||
| 311 | ret = SignalEvent64From32(system, event_handle); | 311 | ret = SignalEvent64From32(system, event_handle); |
| 312 | 312 | ||
| 313 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 313 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 314 | } | 314 | } |
| 315 | 315 | ||
| 316 | static void SvcWrap_ClearEvent64From32(Core::System& system) { | 316 | static void SvcWrap_ClearEvent64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 317 | Result ret{}; | 317 | Result ret{}; |
| 318 | 318 | ||
| 319 | Handle event_handle{}; | 319 | Handle event_handle{}; |
| 320 | 320 | ||
| 321 | event_handle = Convert<Handle>(GetReg32(system, 0)); | 321 | event_handle = Convert<Handle>(GetArg32(args, 0)); |
| 322 | 322 | ||
| 323 | ret = ClearEvent64From32(system, event_handle); | 323 | ret = ClearEvent64From32(system, event_handle); |
| 324 | 324 | ||
| 325 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 325 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 326 | } | 326 | } |
| 327 | 327 | ||
| 328 | static void SvcWrap_MapSharedMemory64From32(Core::System& system) { | 328 | static void SvcWrap_MapSharedMemory64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 329 | Result ret{}; | 329 | Result ret{}; |
| 330 | 330 | ||
| 331 | Handle shmem_handle{}; | 331 | Handle shmem_handle{}; |
| @@ -333,33 +333,33 @@ static void SvcWrap_MapSharedMemory64From32(Core::System& system) { | |||
| 333 | uint32_t size{}; | 333 | uint32_t size{}; |
| 334 | MemoryPermission map_perm{}; | 334 | MemoryPermission map_perm{}; |
| 335 | 335 | ||
| 336 | shmem_handle = Convert<Handle>(GetReg32(system, 0)); | 336 | shmem_handle = Convert<Handle>(GetArg32(args, 0)); |
| 337 | address = Convert<uint32_t>(GetReg32(system, 1)); | 337 | address = Convert<uint32_t>(GetArg32(args, 1)); |
| 338 | size = Convert<uint32_t>(GetReg32(system, 2)); | 338 | size = Convert<uint32_t>(GetArg32(args, 2)); |
| 339 | map_perm = Convert<MemoryPermission>(GetReg32(system, 3)); | 339 | map_perm = Convert<MemoryPermission>(GetArg32(args, 3)); |
| 340 | 340 | ||
| 341 | ret = MapSharedMemory64From32(system, shmem_handle, address, size, map_perm); | 341 | ret = MapSharedMemory64From32(system, shmem_handle, address, size, map_perm); |
| 342 | 342 | ||
| 343 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 343 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 344 | } | 344 | } |
| 345 | 345 | ||
| 346 | static void SvcWrap_UnmapSharedMemory64From32(Core::System& system) { | 346 | static void SvcWrap_UnmapSharedMemory64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 347 | Result ret{}; | 347 | Result ret{}; |
| 348 | 348 | ||
| 349 | Handle shmem_handle{}; | 349 | Handle shmem_handle{}; |
| 350 | uint32_t address{}; | 350 | uint32_t address{}; |
| 351 | uint32_t size{}; | 351 | uint32_t size{}; |
| 352 | 352 | ||
| 353 | shmem_handle = Convert<Handle>(GetReg32(system, 0)); | 353 | shmem_handle = Convert<Handle>(GetArg32(args, 0)); |
| 354 | address = Convert<uint32_t>(GetReg32(system, 1)); | 354 | address = Convert<uint32_t>(GetArg32(args, 1)); |
| 355 | size = Convert<uint32_t>(GetReg32(system, 2)); | 355 | size = Convert<uint32_t>(GetArg32(args, 2)); |
| 356 | 356 | ||
| 357 | ret = UnmapSharedMemory64From32(system, shmem_handle, address, size); | 357 | ret = UnmapSharedMemory64From32(system, shmem_handle, address, size); |
| 358 | 358 | ||
| 359 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 359 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 360 | } | 360 | } |
| 361 | 361 | ||
| 362 | static void SvcWrap_CreateTransferMemory64From32(Core::System& system) { | 362 | static void SvcWrap_CreateTransferMemory64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 363 | Result ret{}; | 363 | Result ret{}; |
| 364 | 364 | ||
| 365 | Handle out_handle{}; | 365 | Handle out_handle{}; |
| @@ -367,41 +367,41 @@ static void SvcWrap_CreateTransferMemory64From32(Core::System& system) { | |||
| 367 | uint32_t size{}; | 367 | uint32_t size{}; |
| 368 | MemoryPermission map_perm{}; | 368 | MemoryPermission map_perm{}; |
| 369 | 369 | ||
| 370 | address = Convert<uint32_t>(GetReg32(system, 1)); | 370 | address = Convert<uint32_t>(GetArg32(args, 1)); |
| 371 | size = Convert<uint32_t>(GetReg32(system, 2)); | 371 | size = Convert<uint32_t>(GetArg32(args, 2)); |
| 372 | map_perm = Convert<MemoryPermission>(GetReg32(system, 3)); | 372 | map_perm = Convert<MemoryPermission>(GetArg32(args, 3)); |
| 373 | 373 | ||
| 374 | ret = CreateTransferMemory64From32(system, std::addressof(out_handle), address, size, map_perm); | 374 | ret = CreateTransferMemory64From32(system, std::addressof(out_handle), address, size, map_perm); |
| 375 | 375 | ||
| 376 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 376 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 377 | SetReg32(system, 1, Convert<uint32_t>(out_handle)); | 377 | SetArg32(args, 1, Convert<uint32_t>(out_handle)); |
| 378 | } | 378 | } |
| 379 | 379 | ||
| 380 | static void SvcWrap_CloseHandle64From32(Core::System& system) { | 380 | static void SvcWrap_CloseHandle64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 381 | Result ret{}; | 381 | Result ret{}; |
| 382 | 382 | ||
| 383 | Handle handle{}; | 383 | Handle handle{}; |
| 384 | 384 | ||
| 385 | handle = Convert<Handle>(GetReg32(system, 0)); | 385 | handle = Convert<Handle>(GetArg32(args, 0)); |
| 386 | 386 | ||
| 387 | ret = CloseHandle64From32(system, handle); | 387 | ret = CloseHandle64From32(system, handle); |
| 388 | 388 | ||
| 389 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 389 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 390 | } | 390 | } |
| 391 | 391 | ||
| 392 | static void SvcWrap_ResetSignal64From32(Core::System& system) { | 392 | static void SvcWrap_ResetSignal64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 393 | Result ret{}; | 393 | Result ret{}; |
| 394 | 394 | ||
| 395 | Handle handle{}; | 395 | Handle handle{}; |
| 396 | 396 | ||
| 397 | handle = Convert<Handle>(GetReg32(system, 0)); | 397 | handle = Convert<Handle>(GetArg32(args, 0)); |
| 398 | 398 | ||
| 399 | ret = ResetSignal64From32(system, handle); | 399 | ret = ResetSignal64From32(system, handle); |
| 400 | 400 | ||
| 401 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 401 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 402 | } | 402 | } |
| 403 | 403 | ||
| 404 | static void SvcWrap_WaitSynchronization64From32(Core::System& system) { | 404 | static void SvcWrap_WaitSynchronization64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 405 | Result ret{}; | 405 | Result ret{}; |
| 406 | 406 | ||
| 407 | int32_t out_index{}; | 407 | int32_t out_index{}; |
| @@ -409,60 +409,60 @@ static void SvcWrap_WaitSynchronization64From32(Core::System& system) { | |||
| 409 | int32_t num_handles{}; | 409 | int32_t num_handles{}; |
| 410 | int64_t timeout_ns{}; | 410 | int64_t timeout_ns{}; |
| 411 | 411 | ||
| 412 | handles = Convert<uint32_t>(GetReg32(system, 1)); | 412 | handles = Convert<uint32_t>(GetArg32(args, 1)); |
| 413 | num_handles = Convert<int32_t>(GetReg32(system, 2)); | 413 | num_handles = Convert<int32_t>(GetArg32(args, 2)); |
| 414 | std::array<uint32_t, 2> timeout_ns_gather{}; | 414 | std::array<uint32_t, 2> timeout_ns_gather{}; |
| 415 | timeout_ns_gather[0] = GetReg32(system, 0); | 415 | timeout_ns_gather[0] = GetArg32(args, 0); |
| 416 | timeout_ns_gather[1] = GetReg32(system, 3); | 416 | timeout_ns_gather[1] = GetArg32(args, 3); |
| 417 | timeout_ns = Convert<int64_t>(timeout_ns_gather); | 417 | timeout_ns = Convert<int64_t>(timeout_ns_gather); |
| 418 | 418 | ||
| 419 | ret = WaitSynchronization64From32(system, std::addressof(out_index), handles, num_handles, timeout_ns); | 419 | ret = WaitSynchronization64From32(system, std::addressof(out_index), handles, num_handles, timeout_ns); |
| 420 | 420 | ||
| 421 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 421 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 422 | SetReg32(system, 1, Convert<uint32_t>(out_index)); | 422 | SetArg32(args, 1, Convert<uint32_t>(out_index)); |
| 423 | } | 423 | } |
| 424 | 424 | ||
| 425 | static void SvcWrap_CancelSynchronization64From32(Core::System& system) { | 425 | static void SvcWrap_CancelSynchronization64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 426 | Result ret{}; | 426 | Result ret{}; |
| 427 | 427 | ||
| 428 | Handle handle{}; | 428 | Handle handle{}; |
| 429 | 429 | ||
| 430 | handle = Convert<Handle>(GetReg32(system, 0)); | 430 | handle = Convert<Handle>(GetArg32(args, 0)); |
| 431 | 431 | ||
| 432 | ret = CancelSynchronization64From32(system, handle); | 432 | ret = CancelSynchronization64From32(system, handle); |
| 433 | 433 | ||
| 434 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 434 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 435 | } | 435 | } |
| 436 | 436 | ||
| 437 | static void SvcWrap_ArbitrateLock64From32(Core::System& system) { | 437 | static void SvcWrap_ArbitrateLock64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 438 | Result ret{}; | 438 | Result ret{}; |
| 439 | 439 | ||
| 440 | Handle thread_handle{}; | 440 | Handle thread_handle{}; |
| 441 | uint32_t address{}; | 441 | uint32_t address{}; |
| 442 | uint32_t tag{}; | 442 | uint32_t tag{}; |
| 443 | 443 | ||
| 444 | thread_handle = Convert<Handle>(GetReg32(system, 0)); | 444 | thread_handle = Convert<Handle>(GetArg32(args, 0)); |
| 445 | address = Convert<uint32_t>(GetReg32(system, 1)); | 445 | address = Convert<uint32_t>(GetArg32(args, 1)); |
| 446 | tag = Convert<uint32_t>(GetReg32(system, 2)); | 446 | tag = Convert<uint32_t>(GetArg32(args, 2)); |
| 447 | 447 | ||
| 448 | ret = ArbitrateLock64From32(system, thread_handle, address, tag); | 448 | ret = ArbitrateLock64From32(system, thread_handle, address, tag); |
| 449 | 449 | ||
| 450 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 450 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 451 | } | 451 | } |
| 452 | 452 | ||
| 453 | static void SvcWrap_ArbitrateUnlock64From32(Core::System& system) { | 453 | static void SvcWrap_ArbitrateUnlock64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 454 | Result ret{}; | 454 | Result ret{}; |
| 455 | 455 | ||
| 456 | uint32_t address{}; | 456 | uint32_t address{}; |
| 457 | 457 | ||
| 458 | address = Convert<uint32_t>(GetReg32(system, 0)); | 458 | address = Convert<uint32_t>(GetArg32(args, 0)); |
| 459 | 459 | ||
| 460 | ret = ArbitrateUnlock64From32(system, address); | 460 | ret = ArbitrateUnlock64From32(system, address); |
| 461 | 461 | ||
| 462 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 462 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 463 | } | 463 | } |
| 464 | 464 | ||
| 465 | static void SvcWrap_WaitProcessWideKeyAtomic64From32(Core::System& system) { | 465 | static void SvcWrap_WaitProcessWideKeyAtomic64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 466 | Result ret{}; | 466 | Result ret{}; |
| 467 | 467 | ||
| 468 | uint32_t address{}; | 468 | uint32_t address{}; |
| @@ -470,82 +470,82 @@ static void SvcWrap_WaitProcessWideKeyAtomic64From32(Core::System& system) { | |||
| 470 | uint32_t tag{}; | 470 | uint32_t tag{}; |
| 471 | int64_t timeout_ns{}; | 471 | int64_t timeout_ns{}; |
| 472 | 472 | ||
| 473 | address = Convert<uint32_t>(GetReg32(system, 0)); | 473 | address = Convert<uint32_t>(GetArg32(args, 0)); |
| 474 | cv_key = Convert<uint32_t>(GetReg32(system, 1)); | 474 | cv_key = Convert<uint32_t>(GetArg32(args, 1)); |
| 475 | tag = Convert<uint32_t>(GetReg32(system, 2)); | 475 | tag = Convert<uint32_t>(GetArg32(args, 2)); |
| 476 | std::array<uint32_t, 2> timeout_ns_gather{}; | 476 | std::array<uint32_t, 2> timeout_ns_gather{}; |
| 477 | timeout_ns_gather[0] = GetReg32(system, 3); | 477 | timeout_ns_gather[0] = GetArg32(args, 3); |
| 478 | timeout_ns_gather[1] = GetReg32(system, 4); | 478 | timeout_ns_gather[1] = GetArg32(args, 4); |
| 479 | timeout_ns = Convert<int64_t>(timeout_ns_gather); | 479 | timeout_ns = Convert<int64_t>(timeout_ns_gather); |
| 480 | 480 | ||
| 481 | ret = WaitProcessWideKeyAtomic64From32(system, address, cv_key, tag, timeout_ns); | 481 | ret = WaitProcessWideKeyAtomic64From32(system, address, cv_key, tag, timeout_ns); |
| 482 | 482 | ||
| 483 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 483 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 484 | } | 484 | } |
| 485 | 485 | ||
| 486 | static void SvcWrap_SignalProcessWideKey64From32(Core::System& system) { | 486 | static void SvcWrap_SignalProcessWideKey64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 487 | uint32_t cv_key{}; | 487 | uint32_t cv_key{}; |
| 488 | int32_t count{}; | 488 | int32_t count{}; |
| 489 | 489 | ||
| 490 | cv_key = Convert<uint32_t>(GetReg32(system, 0)); | 490 | cv_key = Convert<uint32_t>(GetArg32(args, 0)); |
| 491 | count = Convert<int32_t>(GetReg32(system, 1)); | 491 | count = Convert<int32_t>(GetArg32(args, 1)); |
| 492 | 492 | ||
| 493 | SignalProcessWideKey64From32(system, cv_key, count); | 493 | SignalProcessWideKey64From32(system, cv_key, count); |
| 494 | } | 494 | } |
| 495 | 495 | ||
| 496 | static void SvcWrap_GetSystemTick64From32(Core::System& system) { | 496 | static void SvcWrap_GetSystemTick64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 497 | int64_t ret{}; | 497 | int64_t ret{}; |
| 498 | 498 | ||
| 499 | ret = GetSystemTick64From32(system); | 499 | ret = GetSystemTick64From32(system); |
| 500 | 500 | ||
| 501 | auto ret_scatter = Convert<std::array<uint32_t, 2>>(ret); | 501 | auto ret_scatter = Convert<std::array<uint32_t, 2>>(ret); |
| 502 | SetReg32(system, 0, ret_scatter[0]); | 502 | SetArg32(args, 0, ret_scatter[0]); |
| 503 | SetReg32(system, 1, ret_scatter[1]); | 503 | SetArg32(args, 1, ret_scatter[1]); |
| 504 | } | 504 | } |
| 505 | 505 | ||
| 506 | static void SvcWrap_ConnectToNamedPort64From32(Core::System& system) { | 506 | static void SvcWrap_ConnectToNamedPort64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 507 | Result ret{}; | 507 | Result ret{}; |
| 508 | 508 | ||
| 509 | Handle out_handle{}; | 509 | Handle out_handle{}; |
| 510 | uint32_t name{}; | 510 | uint32_t name{}; |
| 511 | 511 | ||
| 512 | name = Convert<uint32_t>(GetReg32(system, 1)); | 512 | name = Convert<uint32_t>(GetArg32(args, 1)); |
| 513 | 513 | ||
| 514 | ret = ConnectToNamedPort64From32(system, std::addressof(out_handle), name); | 514 | ret = ConnectToNamedPort64From32(system, std::addressof(out_handle), name); |
| 515 | 515 | ||
| 516 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 516 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 517 | SetReg32(system, 1, Convert<uint32_t>(out_handle)); | 517 | SetArg32(args, 1, Convert<uint32_t>(out_handle)); |
| 518 | } | 518 | } |
| 519 | 519 | ||
| 520 | static void SvcWrap_SendSyncRequest64From32(Core::System& system) { | 520 | static void SvcWrap_SendSyncRequest64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 521 | Result ret{}; | 521 | Result ret{}; |
| 522 | 522 | ||
| 523 | Handle session_handle{}; | 523 | Handle session_handle{}; |
| 524 | 524 | ||
| 525 | session_handle = Convert<Handle>(GetReg32(system, 0)); | 525 | session_handle = Convert<Handle>(GetArg32(args, 0)); |
| 526 | 526 | ||
| 527 | ret = SendSyncRequest64From32(system, session_handle); | 527 | ret = SendSyncRequest64From32(system, session_handle); |
| 528 | 528 | ||
| 529 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 529 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 530 | } | 530 | } |
| 531 | 531 | ||
| 532 | static void SvcWrap_SendSyncRequestWithUserBuffer64From32(Core::System& system) { | 532 | static void SvcWrap_SendSyncRequestWithUserBuffer64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 533 | Result ret{}; | 533 | Result ret{}; |
| 534 | 534 | ||
| 535 | uint32_t message_buffer{}; | 535 | uint32_t message_buffer{}; |
| 536 | uint32_t message_buffer_size{}; | 536 | uint32_t message_buffer_size{}; |
| 537 | Handle session_handle{}; | 537 | Handle session_handle{}; |
| 538 | 538 | ||
| 539 | message_buffer = Convert<uint32_t>(GetReg32(system, 0)); | 539 | message_buffer = Convert<uint32_t>(GetArg32(args, 0)); |
| 540 | message_buffer_size = Convert<uint32_t>(GetReg32(system, 1)); | 540 | message_buffer_size = Convert<uint32_t>(GetArg32(args, 1)); |
| 541 | session_handle = Convert<Handle>(GetReg32(system, 2)); | 541 | session_handle = Convert<Handle>(GetArg32(args, 2)); |
| 542 | 542 | ||
| 543 | ret = SendSyncRequestWithUserBuffer64From32(system, message_buffer, message_buffer_size, session_handle); | 543 | ret = SendSyncRequestWithUserBuffer64From32(system, message_buffer, message_buffer_size, session_handle); |
| 544 | 544 | ||
| 545 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 545 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 546 | } | 546 | } |
| 547 | 547 | ||
| 548 | static void SvcWrap_SendAsyncRequestWithUserBuffer64From32(Core::System& system) { | 548 | static void SvcWrap_SendAsyncRequestWithUserBuffer64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 549 | Result ret{}; | 549 | Result ret{}; |
| 550 | 550 | ||
| 551 | Handle out_event_handle{}; | 551 | Handle out_event_handle{}; |
| @@ -553,83 +553,83 @@ static void SvcWrap_SendAsyncRequestWithUserBuffer64From32(Core::System& system) | |||
| 553 | uint32_t message_buffer_size{}; | 553 | uint32_t message_buffer_size{}; |
| 554 | Handle session_handle{}; | 554 | Handle session_handle{}; |
| 555 | 555 | ||
| 556 | message_buffer = Convert<uint32_t>(GetReg32(system, 1)); | 556 | message_buffer = Convert<uint32_t>(GetArg32(args, 1)); |
| 557 | message_buffer_size = Convert<uint32_t>(GetReg32(system, 2)); | 557 | message_buffer_size = Convert<uint32_t>(GetArg32(args, 2)); |
| 558 | session_handle = Convert<Handle>(GetReg32(system, 3)); | 558 | session_handle = Convert<Handle>(GetArg32(args, 3)); |
| 559 | 559 | ||
| 560 | ret = SendAsyncRequestWithUserBuffer64From32(system, std::addressof(out_event_handle), message_buffer, message_buffer_size, session_handle); | 560 | ret = SendAsyncRequestWithUserBuffer64From32(system, std::addressof(out_event_handle), message_buffer, message_buffer_size, session_handle); |
| 561 | 561 | ||
| 562 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 562 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 563 | SetReg32(system, 1, Convert<uint32_t>(out_event_handle)); | 563 | SetArg32(args, 1, Convert<uint32_t>(out_event_handle)); |
| 564 | } | 564 | } |
| 565 | 565 | ||
| 566 | static void SvcWrap_GetProcessId64From32(Core::System& system) { | 566 | static void SvcWrap_GetProcessId64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 567 | Result ret{}; | 567 | Result ret{}; |
| 568 | 568 | ||
| 569 | uint64_t out_process_id{}; | 569 | uint64_t out_process_id{}; |
| 570 | Handle process_handle{}; | 570 | Handle process_handle{}; |
| 571 | 571 | ||
| 572 | process_handle = Convert<Handle>(GetReg32(system, 1)); | 572 | process_handle = Convert<Handle>(GetArg32(args, 1)); |
| 573 | 573 | ||
| 574 | ret = GetProcessId64From32(system, std::addressof(out_process_id), process_handle); | 574 | ret = GetProcessId64From32(system, std::addressof(out_process_id), process_handle); |
| 575 | 575 | ||
| 576 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 576 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 577 | auto out_process_id_scatter = Convert<std::array<uint32_t, 2>>(out_process_id); | 577 | auto out_process_id_scatter = Convert<std::array<uint32_t, 2>>(out_process_id); |
| 578 | SetReg32(system, 1, out_process_id_scatter[0]); | 578 | SetArg32(args, 1, out_process_id_scatter[0]); |
| 579 | SetReg32(system, 2, out_process_id_scatter[1]); | 579 | SetArg32(args, 2, out_process_id_scatter[1]); |
| 580 | } | 580 | } |
| 581 | 581 | ||
| 582 | static void SvcWrap_GetThreadId64From32(Core::System& system) { | 582 | static void SvcWrap_GetThreadId64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 583 | Result ret{}; | 583 | Result ret{}; |
| 584 | 584 | ||
| 585 | uint64_t out_thread_id{}; | 585 | uint64_t out_thread_id{}; |
| 586 | Handle thread_handle{}; | 586 | Handle thread_handle{}; |
| 587 | 587 | ||
| 588 | thread_handle = Convert<Handle>(GetReg32(system, 1)); | 588 | thread_handle = Convert<Handle>(GetArg32(args, 1)); |
| 589 | 589 | ||
| 590 | ret = GetThreadId64From32(system, std::addressof(out_thread_id), thread_handle); | 590 | ret = GetThreadId64From32(system, std::addressof(out_thread_id), thread_handle); |
| 591 | 591 | ||
| 592 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 592 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 593 | auto out_thread_id_scatter = Convert<std::array<uint32_t, 2>>(out_thread_id); | 593 | auto out_thread_id_scatter = Convert<std::array<uint32_t, 2>>(out_thread_id); |
| 594 | SetReg32(system, 1, out_thread_id_scatter[0]); | 594 | SetArg32(args, 1, out_thread_id_scatter[0]); |
| 595 | SetReg32(system, 2, out_thread_id_scatter[1]); | 595 | SetArg32(args, 2, out_thread_id_scatter[1]); |
| 596 | } | 596 | } |
| 597 | 597 | ||
| 598 | static void SvcWrap_Break64From32(Core::System& system) { | 598 | static void SvcWrap_Break64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 599 | BreakReason break_reason{}; | 599 | BreakReason break_reason{}; |
| 600 | uint32_t arg{}; | 600 | uint32_t arg{}; |
| 601 | uint32_t size{}; | 601 | uint32_t size{}; |
| 602 | 602 | ||
| 603 | break_reason = Convert<BreakReason>(GetReg32(system, 0)); | 603 | break_reason = Convert<BreakReason>(GetArg32(args, 0)); |
| 604 | arg = Convert<uint32_t>(GetReg32(system, 1)); | 604 | arg = Convert<uint32_t>(GetArg32(args, 1)); |
| 605 | size = Convert<uint32_t>(GetReg32(system, 2)); | 605 | size = Convert<uint32_t>(GetArg32(args, 2)); |
| 606 | 606 | ||
| 607 | Break64From32(system, break_reason, arg, size); | 607 | Break64From32(system, break_reason, arg, size); |
| 608 | } | 608 | } |
| 609 | 609 | ||
| 610 | static void SvcWrap_OutputDebugString64From32(Core::System& system) { | 610 | static void SvcWrap_OutputDebugString64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 611 | Result ret{}; | 611 | Result ret{}; |
| 612 | 612 | ||
| 613 | uint32_t debug_str{}; | 613 | uint32_t debug_str{}; |
| 614 | uint32_t len{}; | 614 | uint32_t len{}; |
| 615 | 615 | ||
| 616 | debug_str = Convert<uint32_t>(GetReg32(system, 0)); | 616 | debug_str = Convert<uint32_t>(GetArg32(args, 0)); |
| 617 | len = Convert<uint32_t>(GetReg32(system, 1)); | 617 | len = Convert<uint32_t>(GetArg32(args, 1)); |
| 618 | 618 | ||
| 619 | ret = OutputDebugString64From32(system, debug_str, len); | 619 | ret = OutputDebugString64From32(system, debug_str, len); |
| 620 | 620 | ||
| 621 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 621 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 622 | } | 622 | } |
| 623 | 623 | ||
| 624 | static void SvcWrap_ReturnFromException64From32(Core::System& system) { | 624 | static void SvcWrap_ReturnFromException64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 625 | Result result{}; | 625 | Result result{}; |
| 626 | 626 | ||
| 627 | result = Convert<Result>(GetReg32(system, 0)); | 627 | result = Convert<Result>(GetArg32(args, 0)); |
| 628 | 628 | ||
| 629 | ReturnFromException64From32(system, result); | 629 | ReturnFromException64From32(system, result); |
| 630 | } | 630 | } |
| 631 | 631 | ||
| 632 | static void SvcWrap_GetInfo64From32(Core::System& system) { | 632 | static void SvcWrap_GetInfo64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 633 | Result ret{}; | 633 | Result ret{}; |
| 634 | 634 | ||
| 635 | uint64_t out{}; | 635 | uint64_t out{}; |
| @@ -637,68 +637,68 @@ static void SvcWrap_GetInfo64From32(Core::System& system) { | |||
| 637 | Handle handle{}; | 637 | Handle handle{}; |
| 638 | uint64_t info_subtype{}; | 638 | uint64_t info_subtype{}; |
| 639 | 639 | ||
| 640 | info_type = Convert<InfoType>(GetReg32(system, 1)); | 640 | info_type = Convert<InfoType>(GetArg32(args, 1)); |
| 641 | handle = Convert<Handle>(GetReg32(system, 2)); | 641 | handle = Convert<Handle>(GetArg32(args, 2)); |
| 642 | std::array<uint32_t, 2> info_subtype_gather{}; | 642 | std::array<uint32_t, 2> info_subtype_gather{}; |
| 643 | info_subtype_gather[0] = GetReg32(system, 0); | 643 | info_subtype_gather[0] = GetArg32(args, 0); |
| 644 | info_subtype_gather[1] = GetReg32(system, 3); | 644 | info_subtype_gather[1] = GetArg32(args, 3); |
| 645 | info_subtype = Convert<uint64_t>(info_subtype_gather); | 645 | info_subtype = Convert<uint64_t>(info_subtype_gather); |
| 646 | 646 | ||
| 647 | ret = GetInfo64From32(system, std::addressof(out), info_type, handle, info_subtype); | 647 | ret = GetInfo64From32(system, std::addressof(out), info_type, handle, info_subtype); |
| 648 | 648 | ||
| 649 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 649 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 650 | auto out_scatter = Convert<std::array<uint32_t, 2>>(out); | 650 | auto out_scatter = Convert<std::array<uint32_t, 2>>(out); |
| 651 | SetReg32(system, 1, out_scatter[0]); | 651 | SetArg32(args, 1, out_scatter[0]); |
| 652 | SetReg32(system, 2, out_scatter[1]); | 652 | SetArg32(args, 2, out_scatter[1]); |
| 653 | } | 653 | } |
| 654 | 654 | ||
| 655 | static void SvcWrap_FlushEntireDataCache64From32(Core::System& system) { | 655 | static void SvcWrap_FlushEntireDataCache64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 656 | FlushEntireDataCache64From32(system); | 656 | FlushEntireDataCache64From32(system); |
| 657 | } | 657 | } |
| 658 | 658 | ||
| 659 | static void SvcWrap_FlushDataCache64From32(Core::System& system) { | 659 | static void SvcWrap_FlushDataCache64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 660 | Result ret{}; | 660 | Result ret{}; |
| 661 | 661 | ||
| 662 | uint32_t address{}; | 662 | uint32_t address{}; |
| 663 | uint32_t size{}; | 663 | uint32_t size{}; |
| 664 | 664 | ||
| 665 | address = Convert<uint32_t>(GetReg32(system, 0)); | 665 | address = Convert<uint32_t>(GetArg32(args, 0)); |
| 666 | size = Convert<uint32_t>(GetReg32(system, 1)); | 666 | size = Convert<uint32_t>(GetArg32(args, 1)); |
| 667 | 667 | ||
| 668 | ret = FlushDataCache64From32(system, address, size); | 668 | ret = FlushDataCache64From32(system, address, size); |
| 669 | 669 | ||
| 670 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 670 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 671 | } | 671 | } |
| 672 | 672 | ||
| 673 | static void SvcWrap_MapPhysicalMemory64From32(Core::System& system) { | 673 | static void SvcWrap_MapPhysicalMemory64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 674 | Result ret{}; | 674 | Result ret{}; |
| 675 | 675 | ||
| 676 | uint32_t address{}; | 676 | uint32_t address{}; |
| 677 | uint32_t size{}; | 677 | uint32_t size{}; |
| 678 | 678 | ||
| 679 | address = Convert<uint32_t>(GetReg32(system, 0)); | 679 | address = Convert<uint32_t>(GetArg32(args, 0)); |
| 680 | size = Convert<uint32_t>(GetReg32(system, 1)); | 680 | size = Convert<uint32_t>(GetArg32(args, 1)); |
| 681 | 681 | ||
| 682 | ret = MapPhysicalMemory64From32(system, address, size); | 682 | ret = MapPhysicalMemory64From32(system, address, size); |
| 683 | 683 | ||
| 684 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 684 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 685 | } | 685 | } |
| 686 | 686 | ||
| 687 | static void SvcWrap_UnmapPhysicalMemory64From32(Core::System& system) { | 687 | static void SvcWrap_UnmapPhysicalMemory64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 688 | Result ret{}; | 688 | Result ret{}; |
| 689 | 689 | ||
| 690 | uint32_t address{}; | 690 | uint32_t address{}; |
| 691 | uint32_t size{}; | 691 | uint32_t size{}; |
| 692 | 692 | ||
| 693 | address = Convert<uint32_t>(GetReg32(system, 0)); | 693 | address = Convert<uint32_t>(GetArg32(args, 0)); |
| 694 | size = Convert<uint32_t>(GetReg32(system, 1)); | 694 | size = Convert<uint32_t>(GetArg32(args, 1)); |
| 695 | 695 | ||
| 696 | ret = UnmapPhysicalMemory64From32(system, address, size); | 696 | ret = UnmapPhysicalMemory64From32(system, address, size); |
| 697 | 697 | ||
| 698 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 698 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 699 | } | 699 | } |
| 700 | 700 | ||
| 701 | static void SvcWrap_GetDebugFutureThreadInfo64From32(Core::System& system) { | 701 | static void SvcWrap_GetDebugFutureThreadInfo64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 702 | Result ret{}; | 702 | Result ret{}; |
| 703 | 703 | ||
| 704 | ilp32::LastThreadContext out_context{}; | 704 | ilp32::LastThreadContext out_context{}; |
| @@ -706,26 +706,26 @@ static void SvcWrap_GetDebugFutureThreadInfo64From32(Core::System& system) { | |||
| 706 | Handle debug_handle{}; | 706 | Handle debug_handle{}; |
| 707 | int64_t ns{}; | 707 | int64_t ns{}; |
| 708 | 708 | ||
| 709 | debug_handle = Convert<Handle>(GetReg32(system, 2)); | 709 | debug_handle = Convert<Handle>(GetArg32(args, 2)); |
| 710 | std::array<uint32_t, 2> ns_gather{}; | 710 | std::array<uint32_t, 2> ns_gather{}; |
| 711 | ns_gather[0] = GetReg32(system, 0); | 711 | ns_gather[0] = GetArg32(args, 0); |
| 712 | ns_gather[1] = GetReg32(system, 1); | 712 | ns_gather[1] = GetArg32(args, 1); |
| 713 | ns = Convert<int64_t>(ns_gather); | 713 | ns = Convert<int64_t>(ns_gather); |
| 714 | 714 | ||
| 715 | ret = GetDebugFutureThreadInfo64From32(system, std::addressof(out_context), std::addressof(out_thread_id), debug_handle, ns); | 715 | ret = GetDebugFutureThreadInfo64From32(system, std::addressof(out_context), std::addressof(out_thread_id), debug_handle, ns); |
| 716 | 716 | ||
| 717 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 717 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 718 | auto out_context_scatter = Convert<std::array<uint32_t, 4>>(out_context); | 718 | auto out_context_scatter = Convert<std::array<uint32_t, 4>>(out_context); |
| 719 | SetReg32(system, 1, out_context_scatter[0]); | 719 | SetArg32(args, 1, out_context_scatter[0]); |
| 720 | SetReg32(system, 2, out_context_scatter[1]); | 720 | SetArg32(args, 2, out_context_scatter[1]); |
| 721 | SetReg32(system, 3, out_context_scatter[2]); | 721 | SetArg32(args, 3, out_context_scatter[2]); |
| 722 | SetReg32(system, 4, out_context_scatter[3]); | 722 | SetArg32(args, 4, out_context_scatter[3]); |
| 723 | auto out_thread_id_scatter = Convert<std::array<uint32_t, 2>>(out_thread_id); | 723 | auto out_thread_id_scatter = Convert<std::array<uint32_t, 2>>(out_thread_id); |
| 724 | SetReg32(system, 5, out_thread_id_scatter[0]); | 724 | SetArg32(args, 5, out_thread_id_scatter[0]); |
| 725 | SetReg32(system, 6, out_thread_id_scatter[1]); | 725 | SetArg32(args, 6, out_thread_id_scatter[1]); |
| 726 | } | 726 | } |
| 727 | 727 | ||
| 728 | static void SvcWrap_GetLastThreadInfo64From32(Core::System& system) { | 728 | static void SvcWrap_GetLastThreadInfo64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 729 | Result ret{}; | 729 | Result ret{}; |
| 730 | 730 | ||
| 731 | ilp32::LastThreadContext out_context{}; | 731 | ilp32::LastThreadContext out_context{}; |
| @@ -734,81 +734,81 @@ static void SvcWrap_GetLastThreadInfo64From32(Core::System& system) { | |||
| 734 | 734 | ||
| 735 | ret = GetLastThreadInfo64From32(system, std::addressof(out_context), std::addressof(out_tls_address), std::addressof(out_flags)); | 735 | ret = GetLastThreadInfo64From32(system, std::addressof(out_context), std::addressof(out_tls_address), std::addressof(out_flags)); |
| 736 | 736 | ||
| 737 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 737 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 738 | auto out_context_scatter = Convert<std::array<uint32_t, 4>>(out_context); | 738 | auto out_context_scatter = Convert<std::array<uint32_t, 4>>(out_context); |
| 739 | SetReg32(system, 1, out_context_scatter[0]); | 739 | SetArg32(args, 1, out_context_scatter[0]); |
| 740 | SetReg32(system, 2, out_context_scatter[1]); | 740 | SetArg32(args, 2, out_context_scatter[1]); |
| 741 | SetReg32(system, 3, out_context_scatter[2]); | 741 | SetArg32(args, 3, out_context_scatter[2]); |
| 742 | SetReg32(system, 4, out_context_scatter[3]); | 742 | SetArg32(args, 4, out_context_scatter[3]); |
| 743 | SetReg32(system, 5, Convert<uint32_t>(out_tls_address)); | 743 | SetArg32(args, 5, Convert<uint32_t>(out_tls_address)); |
| 744 | SetReg32(system, 6, Convert<uint32_t>(out_flags)); | 744 | SetArg32(args, 6, Convert<uint32_t>(out_flags)); |
| 745 | } | 745 | } |
| 746 | 746 | ||
| 747 | static void SvcWrap_GetResourceLimitLimitValue64From32(Core::System& system) { | 747 | static void SvcWrap_GetResourceLimitLimitValue64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 748 | Result ret{}; | 748 | Result ret{}; |
| 749 | 749 | ||
| 750 | int64_t out_limit_value{}; | 750 | int64_t out_limit_value{}; |
| 751 | Handle resource_limit_handle{}; | 751 | Handle resource_limit_handle{}; |
| 752 | LimitableResource which{}; | 752 | LimitableResource which{}; |
| 753 | 753 | ||
| 754 | resource_limit_handle = Convert<Handle>(GetReg32(system, 1)); | 754 | resource_limit_handle = Convert<Handle>(GetArg32(args, 1)); |
| 755 | which = Convert<LimitableResource>(GetReg32(system, 2)); | 755 | which = Convert<LimitableResource>(GetArg32(args, 2)); |
| 756 | 756 | ||
| 757 | ret = GetResourceLimitLimitValue64From32(system, std::addressof(out_limit_value), resource_limit_handle, which); | 757 | ret = GetResourceLimitLimitValue64From32(system, std::addressof(out_limit_value), resource_limit_handle, which); |
| 758 | 758 | ||
| 759 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 759 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 760 | auto out_limit_value_scatter = Convert<std::array<uint32_t, 2>>(out_limit_value); | 760 | auto out_limit_value_scatter = Convert<std::array<uint32_t, 2>>(out_limit_value); |
| 761 | SetReg32(system, 1, out_limit_value_scatter[0]); | 761 | SetArg32(args, 1, out_limit_value_scatter[0]); |
| 762 | SetReg32(system, 2, out_limit_value_scatter[1]); | 762 | SetArg32(args, 2, out_limit_value_scatter[1]); |
| 763 | } | 763 | } |
| 764 | 764 | ||
| 765 | static void SvcWrap_GetResourceLimitCurrentValue64From32(Core::System& system) { | 765 | static void SvcWrap_GetResourceLimitCurrentValue64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 766 | Result ret{}; | 766 | Result ret{}; |
| 767 | 767 | ||
| 768 | int64_t out_current_value{}; | 768 | int64_t out_current_value{}; |
| 769 | Handle resource_limit_handle{}; | 769 | Handle resource_limit_handle{}; |
| 770 | LimitableResource which{}; | 770 | LimitableResource which{}; |
| 771 | 771 | ||
| 772 | resource_limit_handle = Convert<Handle>(GetReg32(system, 1)); | 772 | resource_limit_handle = Convert<Handle>(GetArg32(args, 1)); |
| 773 | which = Convert<LimitableResource>(GetReg32(system, 2)); | 773 | which = Convert<LimitableResource>(GetArg32(args, 2)); |
| 774 | 774 | ||
| 775 | ret = GetResourceLimitCurrentValue64From32(system, std::addressof(out_current_value), resource_limit_handle, which); | 775 | ret = GetResourceLimitCurrentValue64From32(system, std::addressof(out_current_value), resource_limit_handle, which); |
| 776 | 776 | ||
| 777 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 777 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 778 | auto out_current_value_scatter = Convert<std::array<uint32_t, 2>>(out_current_value); | 778 | auto out_current_value_scatter = Convert<std::array<uint32_t, 2>>(out_current_value); |
| 779 | SetReg32(system, 1, out_current_value_scatter[0]); | 779 | SetArg32(args, 1, out_current_value_scatter[0]); |
| 780 | SetReg32(system, 2, out_current_value_scatter[1]); | 780 | SetArg32(args, 2, out_current_value_scatter[1]); |
| 781 | } | 781 | } |
| 782 | 782 | ||
| 783 | static void SvcWrap_SetThreadActivity64From32(Core::System& system) { | 783 | static void SvcWrap_SetThreadActivity64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 784 | Result ret{}; | 784 | Result ret{}; |
| 785 | 785 | ||
| 786 | Handle thread_handle{}; | 786 | Handle thread_handle{}; |
| 787 | ThreadActivity thread_activity{}; | 787 | ThreadActivity thread_activity{}; |
| 788 | 788 | ||
| 789 | thread_handle = Convert<Handle>(GetReg32(system, 0)); | 789 | thread_handle = Convert<Handle>(GetArg32(args, 0)); |
| 790 | thread_activity = Convert<ThreadActivity>(GetReg32(system, 1)); | 790 | thread_activity = Convert<ThreadActivity>(GetArg32(args, 1)); |
| 791 | 791 | ||
| 792 | ret = SetThreadActivity64From32(system, thread_handle, thread_activity); | 792 | ret = SetThreadActivity64From32(system, thread_handle, thread_activity); |
| 793 | 793 | ||
| 794 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 794 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 795 | } | 795 | } |
| 796 | 796 | ||
| 797 | static void SvcWrap_GetThreadContext364From32(Core::System& system) { | 797 | static void SvcWrap_GetThreadContext364From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 798 | Result ret{}; | 798 | Result ret{}; |
| 799 | 799 | ||
| 800 | uint32_t out_context{}; | 800 | uint32_t out_context{}; |
| 801 | Handle thread_handle{}; | 801 | Handle thread_handle{}; |
| 802 | 802 | ||
| 803 | out_context = Convert<uint32_t>(GetReg32(system, 0)); | 803 | out_context = Convert<uint32_t>(GetArg32(args, 0)); |
| 804 | thread_handle = Convert<Handle>(GetReg32(system, 1)); | 804 | thread_handle = Convert<Handle>(GetArg32(args, 1)); |
| 805 | 805 | ||
| 806 | ret = GetThreadContext364From32(system, out_context, thread_handle); | 806 | ret = GetThreadContext364From32(system, out_context, thread_handle); |
| 807 | 807 | ||
| 808 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 808 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 809 | } | 809 | } |
| 810 | 810 | ||
| 811 | static void SvcWrap_WaitForAddress64From32(Core::System& system) { | 811 | static void SvcWrap_WaitForAddress64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 812 | Result ret{}; | 812 | Result ret{}; |
| 813 | 813 | ||
| 814 | uint32_t address{}; | 814 | uint32_t address{}; |
| @@ -816,20 +816,20 @@ static void SvcWrap_WaitForAddress64From32(Core::System& system) { | |||
| 816 | int32_t value{}; | 816 | int32_t value{}; |
| 817 | int64_t timeout_ns{}; | 817 | int64_t timeout_ns{}; |
| 818 | 818 | ||
| 819 | address = Convert<uint32_t>(GetReg32(system, 0)); | 819 | address = Convert<uint32_t>(GetArg32(args, 0)); |
| 820 | arb_type = Convert<ArbitrationType>(GetReg32(system, 1)); | 820 | arb_type = Convert<ArbitrationType>(GetArg32(args, 1)); |
| 821 | value = Convert<int32_t>(GetReg32(system, 2)); | 821 | value = Convert<int32_t>(GetArg32(args, 2)); |
| 822 | std::array<uint32_t, 2> timeout_ns_gather{}; | 822 | std::array<uint32_t, 2> timeout_ns_gather{}; |
| 823 | timeout_ns_gather[0] = GetReg32(system, 3); | 823 | timeout_ns_gather[0] = GetArg32(args, 3); |
| 824 | timeout_ns_gather[1] = GetReg32(system, 4); | 824 | timeout_ns_gather[1] = GetArg32(args, 4); |
| 825 | timeout_ns = Convert<int64_t>(timeout_ns_gather); | 825 | timeout_ns = Convert<int64_t>(timeout_ns_gather); |
| 826 | 826 | ||
| 827 | ret = WaitForAddress64From32(system, address, arb_type, value, timeout_ns); | 827 | ret = WaitForAddress64From32(system, address, arb_type, value, timeout_ns); |
| 828 | 828 | ||
| 829 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 829 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 830 | } | 830 | } |
| 831 | 831 | ||
| 832 | static void SvcWrap_SignalToAddress64From32(Core::System& system) { | 832 | static void SvcWrap_SignalToAddress64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 833 | Result ret{}; | 833 | Result ret{}; |
| 834 | 834 | ||
| 835 | uint32_t address{}; | 835 | uint32_t address{}; |
| @@ -837,53 +837,53 @@ static void SvcWrap_SignalToAddress64From32(Core::System& system) { | |||
| 837 | int32_t value{}; | 837 | int32_t value{}; |
| 838 | int32_t count{}; | 838 | int32_t count{}; |
| 839 | 839 | ||
| 840 | address = Convert<uint32_t>(GetReg32(system, 0)); | 840 | address = Convert<uint32_t>(GetArg32(args, 0)); |
| 841 | signal_type = Convert<SignalType>(GetReg32(system, 1)); | 841 | signal_type = Convert<SignalType>(GetArg32(args, 1)); |
| 842 | value = Convert<int32_t>(GetReg32(system, 2)); | 842 | value = Convert<int32_t>(GetArg32(args, 2)); |
| 843 | count = Convert<int32_t>(GetReg32(system, 3)); | 843 | count = Convert<int32_t>(GetArg32(args, 3)); |
| 844 | 844 | ||
| 845 | ret = SignalToAddress64From32(system, address, signal_type, value, count); | 845 | ret = SignalToAddress64From32(system, address, signal_type, value, count); |
| 846 | 846 | ||
| 847 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 847 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 848 | } | 848 | } |
| 849 | 849 | ||
| 850 | static void SvcWrap_SynchronizePreemptionState64From32(Core::System& system) { | 850 | static void SvcWrap_SynchronizePreemptionState64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 851 | SynchronizePreemptionState64From32(system); | 851 | SynchronizePreemptionState64From32(system); |
| 852 | } | 852 | } |
| 853 | 853 | ||
| 854 | static void SvcWrap_GetResourceLimitPeakValue64From32(Core::System& system) { | 854 | static void SvcWrap_GetResourceLimitPeakValue64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 855 | Result ret{}; | 855 | Result ret{}; |
| 856 | 856 | ||
| 857 | int64_t out_peak_value{}; | 857 | int64_t out_peak_value{}; |
| 858 | Handle resource_limit_handle{}; | 858 | Handle resource_limit_handle{}; |
| 859 | LimitableResource which{}; | 859 | LimitableResource which{}; |
| 860 | 860 | ||
| 861 | resource_limit_handle = Convert<Handle>(GetReg32(system, 1)); | 861 | resource_limit_handle = Convert<Handle>(GetArg32(args, 1)); |
| 862 | which = Convert<LimitableResource>(GetReg32(system, 2)); | 862 | which = Convert<LimitableResource>(GetArg32(args, 2)); |
| 863 | 863 | ||
| 864 | ret = GetResourceLimitPeakValue64From32(system, std::addressof(out_peak_value), resource_limit_handle, which); | 864 | ret = GetResourceLimitPeakValue64From32(system, std::addressof(out_peak_value), resource_limit_handle, which); |
| 865 | 865 | ||
| 866 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 866 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 867 | auto out_peak_value_scatter = Convert<std::array<uint32_t, 2>>(out_peak_value); | 867 | auto out_peak_value_scatter = Convert<std::array<uint32_t, 2>>(out_peak_value); |
| 868 | SetReg32(system, 1, out_peak_value_scatter[0]); | 868 | SetArg32(args, 1, out_peak_value_scatter[0]); |
| 869 | SetReg32(system, 2, out_peak_value_scatter[1]); | 869 | SetArg32(args, 2, out_peak_value_scatter[1]); |
| 870 | } | 870 | } |
| 871 | 871 | ||
| 872 | static void SvcWrap_CreateIoPool64From32(Core::System& system) { | 872 | static void SvcWrap_CreateIoPool64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 873 | Result ret{}; | 873 | Result ret{}; |
| 874 | 874 | ||
| 875 | Handle out_handle{}; | 875 | Handle out_handle{}; |
| 876 | IoPoolType which{}; | 876 | IoPoolType which{}; |
| 877 | 877 | ||
| 878 | which = Convert<IoPoolType>(GetReg32(system, 1)); | 878 | which = Convert<IoPoolType>(GetArg32(args, 1)); |
| 879 | 879 | ||
| 880 | ret = CreateIoPool64From32(system, std::addressof(out_handle), which); | 880 | ret = CreateIoPool64From32(system, std::addressof(out_handle), which); |
| 881 | 881 | ||
| 882 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 882 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 883 | SetReg32(system, 1, Convert<uint32_t>(out_handle)); | 883 | SetArg32(args, 1, Convert<uint32_t>(out_handle)); |
| 884 | } | 884 | } |
| 885 | 885 | ||
| 886 | static void SvcWrap_CreateIoRegion64From32(Core::System& system) { | 886 | static void SvcWrap_CreateIoRegion64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 887 | Result ret{}; | 887 | Result ret{}; |
| 888 | 888 | ||
| 889 | Handle out_handle{}; | 889 | Handle out_handle{}; |
| @@ -893,53 +893,53 @@ static void SvcWrap_CreateIoRegion64From32(Core::System& system) { | |||
| 893 | MemoryMapping mapping{}; | 893 | MemoryMapping mapping{}; |
| 894 | MemoryPermission perm{}; | 894 | MemoryPermission perm{}; |
| 895 | 895 | ||
| 896 | io_pool = Convert<Handle>(GetReg32(system, 1)); | 896 | io_pool = Convert<Handle>(GetArg32(args, 1)); |
| 897 | std::array<uint32_t, 2> physical_address_gather{}; | 897 | std::array<uint32_t, 2> physical_address_gather{}; |
| 898 | physical_address_gather[0] = GetReg32(system, 2); | 898 | physical_address_gather[0] = GetArg32(args, 2); |
| 899 | physical_address_gather[1] = GetReg32(system, 3); | 899 | physical_address_gather[1] = GetArg32(args, 3); |
| 900 | physical_address = Convert<uint64_t>(physical_address_gather); | 900 | physical_address = Convert<uint64_t>(physical_address_gather); |
| 901 | size = Convert<uint32_t>(GetReg32(system, 0)); | 901 | size = Convert<uint32_t>(GetArg32(args, 0)); |
| 902 | mapping = Convert<MemoryMapping>(GetReg32(system, 4)); | 902 | mapping = Convert<MemoryMapping>(GetArg32(args, 4)); |
| 903 | perm = Convert<MemoryPermission>(GetReg32(system, 5)); | 903 | perm = Convert<MemoryPermission>(GetArg32(args, 5)); |
| 904 | 904 | ||
| 905 | ret = CreateIoRegion64From32(system, std::addressof(out_handle), io_pool, physical_address, size, mapping, perm); | 905 | ret = CreateIoRegion64From32(system, std::addressof(out_handle), io_pool, physical_address, size, mapping, perm); |
| 906 | 906 | ||
| 907 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 907 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 908 | SetReg32(system, 1, Convert<uint32_t>(out_handle)); | 908 | SetArg32(args, 1, Convert<uint32_t>(out_handle)); |
| 909 | } | 909 | } |
| 910 | 910 | ||
| 911 | static void SvcWrap_KernelDebug64From32(Core::System& system) { | 911 | static void SvcWrap_KernelDebug64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 912 | KernelDebugType kern_debug_type{}; | 912 | KernelDebugType kern_debug_type{}; |
| 913 | uint64_t arg0{}; | 913 | uint64_t arg0{}; |
| 914 | uint64_t arg1{}; | 914 | uint64_t arg1{}; |
| 915 | uint64_t arg2{}; | 915 | uint64_t arg2{}; |
| 916 | 916 | ||
| 917 | kern_debug_type = Convert<KernelDebugType>(GetReg32(system, 0)); | 917 | kern_debug_type = Convert<KernelDebugType>(GetArg32(args, 0)); |
| 918 | std::array<uint32_t, 2> arg0_gather{}; | 918 | std::array<uint32_t, 2> arg0_gather{}; |
| 919 | arg0_gather[0] = GetReg32(system, 2); | 919 | arg0_gather[0] = GetArg32(args, 2); |
| 920 | arg0_gather[1] = GetReg32(system, 3); | 920 | arg0_gather[1] = GetArg32(args, 3); |
| 921 | arg0 = Convert<uint64_t>(arg0_gather); | 921 | arg0 = Convert<uint64_t>(arg0_gather); |
| 922 | std::array<uint32_t, 2> arg1_gather{}; | 922 | std::array<uint32_t, 2> arg1_gather{}; |
| 923 | arg1_gather[0] = GetReg32(system, 1); | 923 | arg1_gather[0] = GetArg32(args, 1); |
| 924 | arg1_gather[1] = GetReg32(system, 4); | 924 | arg1_gather[1] = GetArg32(args, 4); |
| 925 | arg1 = Convert<uint64_t>(arg1_gather); | 925 | arg1 = Convert<uint64_t>(arg1_gather); |
| 926 | std::array<uint32_t, 2> arg2_gather{}; | 926 | std::array<uint32_t, 2> arg2_gather{}; |
| 927 | arg2_gather[0] = GetReg32(system, 5); | 927 | arg2_gather[0] = GetArg32(args, 5); |
| 928 | arg2_gather[1] = GetReg32(system, 6); | 928 | arg2_gather[1] = GetArg32(args, 6); |
| 929 | arg2 = Convert<uint64_t>(arg2_gather); | 929 | arg2 = Convert<uint64_t>(arg2_gather); |
| 930 | 930 | ||
| 931 | KernelDebug64From32(system, kern_debug_type, arg0, arg1, arg2); | 931 | KernelDebug64From32(system, kern_debug_type, arg0, arg1, arg2); |
| 932 | } | 932 | } |
| 933 | 933 | ||
| 934 | static void SvcWrap_ChangeKernelTraceState64From32(Core::System& system) { | 934 | static void SvcWrap_ChangeKernelTraceState64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 935 | KernelTraceState kern_trace_state{}; | 935 | KernelTraceState kern_trace_state{}; |
| 936 | 936 | ||
| 937 | kern_trace_state = Convert<KernelTraceState>(GetReg32(system, 0)); | 937 | kern_trace_state = Convert<KernelTraceState>(GetArg32(args, 0)); |
| 938 | 938 | ||
| 939 | ChangeKernelTraceState64From32(system, kern_trace_state); | 939 | ChangeKernelTraceState64From32(system, kern_trace_state); |
| 940 | } | 940 | } |
| 941 | 941 | ||
| 942 | static void SvcWrap_CreateSession64From32(Core::System& system) { | 942 | static void SvcWrap_CreateSession64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 943 | Result ret{}; | 943 | Result ret{}; |
| 944 | 944 | ||
| 945 | Handle out_server_session_handle{}; | 945 | Handle out_server_session_handle{}; |
| @@ -947,31 +947,31 @@ static void SvcWrap_CreateSession64From32(Core::System& system) { | |||
| 947 | bool is_light{}; | 947 | bool is_light{}; |
| 948 | uint32_t name{}; | 948 | uint32_t name{}; |
| 949 | 949 | ||
| 950 | is_light = Convert<bool>(GetReg32(system, 2)); | 950 | is_light = Convert<bool>(GetArg32(args, 2)); |
| 951 | name = Convert<uint32_t>(GetReg32(system, 3)); | 951 | name = Convert<uint32_t>(GetArg32(args, 3)); |
| 952 | 952 | ||
| 953 | ret = CreateSession64From32(system, std::addressof(out_server_session_handle), std::addressof(out_client_session_handle), is_light, name); | 953 | ret = CreateSession64From32(system, std::addressof(out_server_session_handle), std::addressof(out_client_session_handle), is_light, name); |
| 954 | 954 | ||
| 955 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 955 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 956 | SetReg32(system, 1, Convert<uint32_t>(out_server_session_handle)); | 956 | SetArg32(args, 1, Convert<uint32_t>(out_server_session_handle)); |
| 957 | SetReg32(system, 2, Convert<uint32_t>(out_client_session_handle)); | 957 | SetArg32(args, 2, Convert<uint32_t>(out_client_session_handle)); |
| 958 | } | 958 | } |
| 959 | 959 | ||
| 960 | static void SvcWrap_AcceptSession64From32(Core::System& system) { | 960 | static void SvcWrap_AcceptSession64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 961 | Result ret{}; | 961 | Result ret{}; |
| 962 | 962 | ||
| 963 | Handle out_handle{}; | 963 | Handle out_handle{}; |
| 964 | Handle port{}; | 964 | Handle port{}; |
| 965 | 965 | ||
| 966 | port = Convert<Handle>(GetReg32(system, 1)); | 966 | port = Convert<Handle>(GetArg32(args, 1)); |
| 967 | 967 | ||
| 968 | ret = AcceptSession64From32(system, std::addressof(out_handle), port); | 968 | ret = AcceptSession64From32(system, std::addressof(out_handle), port); |
| 969 | 969 | ||
| 970 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 970 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 971 | SetReg32(system, 1, Convert<uint32_t>(out_handle)); | 971 | SetArg32(args, 1, Convert<uint32_t>(out_handle)); |
| 972 | } | 972 | } |
| 973 | 973 | ||
| 974 | static void SvcWrap_ReplyAndReceive64From32(Core::System& system) { | 974 | static void SvcWrap_ReplyAndReceive64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 975 | Result ret{}; | 975 | Result ret{}; |
| 976 | 976 | ||
| 977 | int32_t out_index{}; | 977 | int32_t out_index{}; |
| @@ -980,21 +980,21 @@ static void SvcWrap_ReplyAndReceive64From32(Core::System& system) { | |||
| 980 | Handle reply_target{}; | 980 | Handle reply_target{}; |
| 981 | int64_t timeout_ns{}; | 981 | int64_t timeout_ns{}; |
| 982 | 982 | ||
| 983 | handles = Convert<uint32_t>(GetReg32(system, 1)); | 983 | handles = Convert<uint32_t>(GetArg32(args, 1)); |
| 984 | num_handles = Convert<int32_t>(GetReg32(system, 2)); | 984 | num_handles = Convert<int32_t>(GetArg32(args, 2)); |
| 985 | reply_target = Convert<Handle>(GetReg32(system, 3)); | 985 | reply_target = Convert<Handle>(GetArg32(args, 3)); |
| 986 | std::array<uint32_t, 2> timeout_ns_gather{}; | 986 | std::array<uint32_t, 2> timeout_ns_gather{}; |
| 987 | timeout_ns_gather[0] = GetReg32(system, 0); | 987 | timeout_ns_gather[0] = GetArg32(args, 0); |
| 988 | timeout_ns_gather[1] = GetReg32(system, 4); | 988 | timeout_ns_gather[1] = GetArg32(args, 4); |
| 989 | timeout_ns = Convert<int64_t>(timeout_ns_gather); | 989 | timeout_ns = Convert<int64_t>(timeout_ns_gather); |
| 990 | 990 | ||
| 991 | ret = ReplyAndReceive64From32(system, std::addressof(out_index), handles, num_handles, reply_target, timeout_ns); | 991 | ret = ReplyAndReceive64From32(system, std::addressof(out_index), handles, num_handles, reply_target, timeout_ns); |
| 992 | 992 | ||
| 993 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 993 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 994 | SetReg32(system, 1, Convert<uint32_t>(out_index)); | 994 | SetArg32(args, 1, Convert<uint32_t>(out_index)); |
| 995 | } | 995 | } |
| 996 | 996 | ||
| 997 | static void SvcWrap_ReplyAndReceiveWithUserBuffer64From32(Core::System& system) { | 997 | static void SvcWrap_ReplyAndReceiveWithUserBuffer64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 998 | Result ret{}; | 998 | Result ret{}; |
| 999 | 999 | ||
| 1000 | int32_t out_index{}; | 1000 | int32_t out_index{}; |
| @@ -1005,23 +1005,23 @@ static void SvcWrap_ReplyAndReceiveWithUserBuffer64From32(Core::System& system) | |||
| 1005 | Handle reply_target{}; | 1005 | Handle reply_target{}; |
| 1006 | int64_t timeout_ns{}; | 1006 | int64_t timeout_ns{}; |
| 1007 | 1007 | ||
| 1008 | message_buffer = Convert<uint32_t>(GetReg32(system, 1)); | 1008 | message_buffer = Convert<uint32_t>(GetArg32(args, 1)); |
| 1009 | message_buffer_size = Convert<uint32_t>(GetReg32(system, 2)); | 1009 | message_buffer_size = Convert<uint32_t>(GetArg32(args, 2)); |
| 1010 | handles = Convert<uint32_t>(GetReg32(system, 3)); | 1010 | handles = Convert<uint32_t>(GetArg32(args, 3)); |
| 1011 | num_handles = Convert<int32_t>(GetReg32(system, 0)); | 1011 | num_handles = Convert<int32_t>(GetArg32(args, 0)); |
| 1012 | reply_target = Convert<Handle>(GetReg32(system, 4)); | 1012 | reply_target = Convert<Handle>(GetArg32(args, 4)); |
| 1013 | std::array<uint32_t, 2> timeout_ns_gather{}; | 1013 | std::array<uint32_t, 2> timeout_ns_gather{}; |
| 1014 | timeout_ns_gather[0] = GetReg32(system, 5); | 1014 | timeout_ns_gather[0] = GetArg32(args, 5); |
| 1015 | timeout_ns_gather[1] = GetReg32(system, 6); | 1015 | timeout_ns_gather[1] = GetArg32(args, 6); |
| 1016 | timeout_ns = Convert<int64_t>(timeout_ns_gather); | 1016 | timeout_ns = Convert<int64_t>(timeout_ns_gather); |
| 1017 | 1017 | ||
| 1018 | ret = ReplyAndReceiveWithUserBuffer64From32(system, std::addressof(out_index), message_buffer, message_buffer_size, handles, num_handles, reply_target, timeout_ns); | 1018 | ret = ReplyAndReceiveWithUserBuffer64From32(system, std::addressof(out_index), message_buffer, message_buffer_size, handles, num_handles, reply_target, timeout_ns); |
| 1019 | 1019 | ||
| 1020 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 1020 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 1021 | SetReg32(system, 1, Convert<uint32_t>(out_index)); | 1021 | SetArg32(args, 1, Convert<uint32_t>(out_index)); |
| 1022 | } | 1022 | } |
| 1023 | 1023 | ||
| 1024 | static void SvcWrap_CreateEvent64From32(Core::System& system) { | 1024 | static void SvcWrap_CreateEvent64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 1025 | Result ret{}; | 1025 | Result ret{}; |
| 1026 | 1026 | ||
| 1027 | Handle out_write_handle{}; | 1027 | Handle out_write_handle{}; |
| @@ -1029,12 +1029,12 @@ static void SvcWrap_CreateEvent64From32(Core::System& system) { | |||
| 1029 | 1029 | ||
| 1030 | ret = CreateEvent64From32(system, std::addressof(out_write_handle), std::addressof(out_read_handle)); | 1030 | ret = CreateEvent64From32(system, std::addressof(out_write_handle), std::addressof(out_read_handle)); |
| 1031 | 1031 | ||
| 1032 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 1032 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 1033 | SetReg32(system, 1, Convert<uint32_t>(out_write_handle)); | 1033 | SetArg32(args, 1, Convert<uint32_t>(out_write_handle)); |
| 1034 | SetReg32(system, 2, Convert<uint32_t>(out_read_handle)); | 1034 | SetArg32(args, 2, Convert<uint32_t>(out_read_handle)); |
| 1035 | } | 1035 | } |
| 1036 | 1036 | ||
| 1037 | static void SvcWrap_MapIoRegion64From32(Core::System& system) { | 1037 | static void SvcWrap_MapIoRegion64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 1038 | Result ret{}; | 1038 | Result ret{}; |
| 1039 | 1039 | ||
| 1040 | Handle io_region{}; | 1040 | Handle io_region{}; |
| @@ -1042,89 +1042,89 @@ static void SvcWrap_MapIoRegion64From32(Core::System& system) { | |||
| 1042 | uint32_t size{}; | 1042 | uint32_t size{}; |
| 1043 | MemoryPermission perm{}; | 1043 | MemoryPermission perm{}; |
| 1044 | 1044 | ||
| 1045 | io_region = Convert<Handle>(GetReg32(system, 0)); | 1045 | io_region = Convert<Handle>(GetArg32(args, 0)); |
| 1046 | address = Convert<uint32_t>(GetReg32(system, 1)); | 1046 | address = Convert<uint32_t>(GetArg32(args, 1)); |
| 1047 | size = Convert<uint32_t>(GetReg32(system, 2)); | 1047 | size = Convert<uint32_t>(GetArg32(args, 2)); |
| 1048 | perm = Convert<MemoryPermission>(GetReg32(system, 3)); | 1048 | perm = Convert<MemoryPermission>(GetArg32(args, 3)); |
| 1049 | 1049 | ||
| 1050 | ret = MapIoRegion64From32(system, io_region, address, size, perm); | 1050 | ret = MapIoRegion64From32(system, io_region, address, size, perm); |
| 1051 | 1051 | ||
| 1052 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 1052 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 1053 | } | 1053 | } |
| 1054 | 1054 | ||
| 1055 | static void SvcWrap_UnmapIoRegion64From32(Core::System& system) { | 1055 | static void SvcWrap_UnmapIoRegion64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 1056 | Result ret{}; | 1056 | Result ret{}; |
| 1057 | 1057 | ||
| 1058 | Handle io_region{}; | 1058 | Handle io_region{}; |
| 1059 | uint32_t address{}; | 1059 | uint32_t address{}; |
| 1060 | uint32_t size{}; | 1060 | uint32_t size{}; |
| 1061 | 1061 | ||
| 1062 | io_region = Convert<Handle>(GetReg32(system, 0)); | 1062 | io_region = Convert<Handle>(GetArg32(args, 0)); |
| 1063 | address = Convert<uint32_t>(GetReg32(system, 1)); | 1063 | address = Convert<uint32_t>(GetArg32(args, 1)); |
| 1064 | size = Convert<uint32_t>(GetReg32(system, 2)); | 1064 | size = Convert<uint32_t>(GetArg32(args, 2)); |
| 1065 | 1065 | ||
| 1066 | ret = UnmapIoRegion64From32(system, io_region, address, size); | 1066 | ret = UnmapIoRegion64From32(system, io_region, address, size); |
| 1067 | 1067 | ||
| 1068 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 1068 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 1069 | } | 1069 | } |
| 1070 | 1070 | ||
| 1071 | static void SvcWrap_MapPhysicalMemoryUnsafe64From32(Core::System& system) { | 1071 | static void SvcWrap_MapPhysicalMemoryUnsafe64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 1072 | Result ret{}; | 1072 | Result ret{}; |
| 1073 | 1073 | ||
| 1074 | uint32_t address{}; | 1074 | uint32_t address{}; |
| 1075 | uint32_t size{}; | 1075 | uint32_t size{}; |
| 1076 | 1076 | ||
| 1077 | address = Convert<uint32_t>(GetReg32(system, 0)); | 1077 | address = Convert<uint32_t>(GetArg32(args, 0)); |
| 1078 | size = Convert<uint32_t>(GetReg32(system, 1)); | 1078 | size = Convert<uint32_t>(GetArg32(args, 1)); |
| 1079 | 1079 | ||
| 1080 | ret = MapPhysicalMemoryUnsafe64From32(system, address, size); | 1080 | ret = MapPhysicalMemoryUnsafe64From32(system, address, size); |
| 1081 | 1081 | ||
| 1082 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 1082 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 1083 | } | 1083 | } |
| 1084 | 1084 | ||
| 1085 | static void SvcWrap_UnmapPhysicalMemoryUnsafe64From32(Core::System& system) { | 1085 | static void SvcWrap_UnmapPhysicalMemoryUnsafe64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 1086 | Result ret{}; | 1086 | Result ret{}; |
| 1087 | 1087 | ||
| 1088 | uint32_t address{}; | 1088 | uint32_t address{}; |
| 1089 | uint32_t size{}; | 1089 | uint32_t size{}; |
| 1090 | 1090 | ||
| 1091 | address = Convert<uint32_t>(GetReg32(system, 0)); | 1091 | address = Convert<uint32_t>(GetArg32(args, 0)); |
| 1092 | size = Convert<uint32_t>(GetReg32(system, 1)); | 1092 | size = Convert<uint32_t>(GetArg32(args, 1)); |
| 1093 | 1093 | ||
| 1094 | ret = UnmapPhysicalMemoryUnsafe64From32(system, address, size); | 1094 | ret = UnmapPhysicalMemoryUnsafe64From32(system, address, size); |
| 1095 | 1095 | ||
| 1096 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 1096 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 1097 | } | 1097 | } |
| 1098 | 1098 | ||
| 1099 | static void SvcWrap_SetUnsafeLimit64From32(Core::System& system) { | 1099 | static void SvcWrap_SetUnsafeLimit64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 1100 | Result ret{}; | 1100 | Result ret{}; |
| 1101 | 1101 | ||
| 1102 | uint32_t limit{}; | 1102 | uint32_t limit{}; |
| 1103 | 1103 | ||
| 1104 | limit = Convert<uint32_t>(GetReg32(system, 0)); | 1104 | limit = Convert<uint32_t>(GetArg32(args, 0)); |
| 1105 | 1105 | ||
| 1106 | ret = SetUnsafeLimit64From32(system, limit); | 1106 | ret = SetUnsafeLimit64From32(system, limit); |
| 1107 | 1107 | ||
| 1108 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 1108 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 1109 | } | 1109 | } |
| 1110 | 1110 | ||
| 1111 | static void SvcWrap_CreateCodeMemory64From32(Core::System& system) { | 1111 | static void SvcWrap_CreateCodeMemory64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 1112 | Result ret{}; | 1112 | Result ret{}; |
| 1113 | 1113 | ||
| 1114 | Handle out_handle{}; | 1114 | Handle out_handle{}; |
| 1115 | uint32_t address{}; | 1115 | uint32_t address{}; |
| 1116 | uint32_t size{}; | 1116 | uint32_t size{}; |
| 1117 | 1117 | ||
| 1118 | address = Convert<uint32_t>(GetReg32(system, 1)); | 1118 | address = Convert<uint32_t>(GetArg32(args, 1)); |
| 1119 | size = Convert<uint32_t>(GetReg32(system, 2)); | 1119 | size = Convert<uint32_t>(GetArg32(args, 2)); |
| 1120 | 1120 | ||
| 1121 | ret = CreateCodeMemory64From32(system, std::addressof(out_handle), address, size); | 1121 | ret = CreateCodeMemory64From32(system, std::addressof(out_handle), address, size); |
| 1122 | 1122 | ||
| 1123 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 1123 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 1124 | SetReg32(system, 1, Convert<uint32_t>(out_handle)); | 1124 | SetArg32(args, 1, Convert<uint32_t>(out_handle)); |
| 1125 | } | 1125 | } |
| 1126 | 1126 | ||
| 1127 | static void SvcWrap_ControlCodeMemory64From32(Core::System& system) { | 1127 | static void SvcWrap_ControlCodeMemory64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 1128 | Result ret{}; | 1128 | Result ret{}; |
| 1129 | 1129 | ||
| 1130 | Handle code_memory_handle{}; | 1130 | Handle code_memory_handle{}; |
| @@ -1133,28 +1133,28 @@ static void SvcWrap_ControlCodeMemory64From32(Core::System& system) { | |||
| 1133 | uint64_t size{}; | 1133 | uint64_t size{}; |
| 1134 | MemoryPermission perm{}; | 1134 | MemoryPermission perm{}; |
| 1135 | 1135 | ||
| 1136 | code_memory_handle = Convert<Handle>(GetReg32(system, 0)); | 1136 | code_memory_handle = Convert<Handle>(GetArg32(args, 0)); |
| 1137 | operation = Convert<CodeMemoryOperation>(GetReg32(system, 1)); | 1137 | operation = Convert<CodeMemoryOperation>(GetArg32(args, 1)); |
| 1138 | std::array<uint32_t, 2> address_gather{}; | 1138 | std::array<uint32_t, 2> address_gather{}; |
| 1139 | address_gather[0] = GetReg32(system, 2); | 1139 | address_gather[0] = GetArg32(args, 2); |
| 1140 | address_gather[1] = GetReg32(system, 3); | 1140 | address_gather[1] = GetArg32(args, 3); |
| 1141 | address = Convert<uint64_t>(address_gather); | 1141 | address = Convert<uint64_t>(address_gather); |
| 1142 | std::array<uint32_t, 2> size_gather{}; | 1142 | std::array<uint32_t, 2> size_gather{}; |
| 1143 | size_gather[0] = GetReg32(system, 4); | 1143 | size_gather[0] = GetArg32(args, 4); |
| 1144 | size_gather[1] = GetReg32(system, 5); | 1144 | size_gather[1] = GetArg32(args, 5); |
| 1145 | size = Convert<uint64_t>(size_gather); | 1145 | size = Convert<uint64_t>(size_gather); |
| 1146 | perm = Convert<MemoryPermission>(GetReg32(system, 6)); | 1146 | perm = Convert<MemoryPermission>(GetArg32(args, 6)); |
| 1147 | 1147 | ||
| 1148 | ret = ControlCodeMemory64From32(system, code_memory_handle, operation, address, size, perm); | 1148 | ret = ControlCodeMemory64From32(system, code_memory_handle, operation, address, size, perm); |
| 1149 | 1149 | ||
| 1150 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 1150 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 1151 | } | 1151 | } |
| 1152 | 1152 | ||
| 1153 | static void SvcWrap_SleepSystem64From32(Core::System& system) { | 1153 | static void SvcWrap_SleepSystem64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 1154 | SleepSystem64From32(system); | 1154 | SleepSystem64From32(system); |
| 1155 | } | 1155 | } |
| 1156 | 1156 | ||
| 1157 | static void SvcWrap_ReadWriteRegister64From32(Core::System& system) { | 1157 | static void SvcWrap_ReadWriteRegister64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 1158 | Result ret{}; | 1158 | Result ret{}; |
| 1159 | 1159 | ||
| 1160 | uint32_t out_value{}; | 1160 | uint32_t out_value{}; |
| @@ -1163,33 +1163,33 @@ static void SvcWrap_ReadWriteRegister64From32(Core::System& system) { | |||
| 1163 | uint32_t value{}; | 1163 | uint32_t value{}; |
| 1164 | 1164 | ||
| 1165 | std::array<uint32_t, 2> address_gather{}; | 1165 | std::array<uint32_t, 2> address_gather{}; |
| 1166 | address_gather[0] = GetReg32(system, 2); | 1166 | address_gather[0] = GetArg32(args, 2); |
| 1167 | address_gather[1] = GetReg32(system, 3); | 1167 | address_gather[1] = GetArg32(args, 3); |
| 1168 | address = Convert<uint64_t>(address_gather); | 1168 | address = Convert<uint64_t>(address_gather); |
| 1169 | mask = Convert<uint32_t>(GetReg32(system, 0)); | 1169 | mask = Convert<uint32_t>(GetArg32(args, 0)); |
| 1170 | value = Convert<uint32_t>(GetReg32(system, 1)); | 1170 | value = Convert<uint32_t>(GetArg32(args, 1)); |
| 1171 | 1171 | ||
| 1172 | ret = ReadWriteRegister64From32(system, std::addressof(out_value), address, mask, value); | 1172 | ret = ReadWriteRegister64From32(system, std::addressof(out_value), address, mask, value); |
| 1173 | 1173 | ||
| 1174 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 1174 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 1175 | SetReg32(system, 1, Convert<uint32_t>(out_value)); | 1175 | SetArg32(args, 1, Convert<uint32_t>(out_value)); |
| 1176 | } | 1176 | } |
| 1177 | 1177 | ||
| 1178 | static void SvcWrap_SetProcessActivity64From32(Core::System& system) { | 1178 | static void SvcWrap_SetProcessActivity64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 1179 | Result ret{}; | 1179 | Result ret{}; |
| 1180 | 1180 | ||
| 1181 | Handle process_handle{}; | 1181 | Handle process_handle{}; |
| 1182 | ProcessActivity process_activity{}; | 1182 | ProcessActivity process_activity{}; |
| 1183 | 1183 | ||
| 1184 | process_handle = Convert<Handle>(GetReg32(system, 0)); | 1184 | process_handle = Convert<Handle>(GetArg32(args, 0)); |
| 1185 | process_activity = Convert<ProcessActivity>(GetReg32(system, 1)); | 1185 | process_activity = Convert<ProcessActivity>(GetArg32(args, 1)); |
| 1186 | 1186 | ||
| 1187 | ret = SetProcessActivity64From32(system, process_handle, process_activity); | 1187 | ret = SetProcessActivity64From32(system, process_handle, process_activity); |
| 1188 | 1188 | ||
| 1189 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 1189 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 1190 | } | 1190 | } |
| 1191 | 1191 | ||
| 1192 | static void SvcWrap_CreateSharedMemory64From32(Core::System& system) { | 1192 | static void SvcWrap_CreateSharedMemory64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 1193 | Result ret{}; | 1193 | Result ret{}; |
| 1194 | 1194 | ||
| 1195 | Handle out_handle{}; | 1195 | Handle out_handle{}; |
| @@ -1197,17 +1197,17 @@ static void SvcWrap_CreateSharedMemory64From32(Core::System& system) { | |||
| 1197 | MemoryPermission owner_perm{}; | 1197 | MemoryPermission owner_perm{}; |
| 1198 | MemoryPermission remote_perm{}; | 1198 | MemoryPermission remote_perm{}; |
| 1199 | 1199 | ||
| 1200 | size = Convert<uint32_t>(GetReg32(system, 1)); | 1200 | size = Convert<uint32_t>(GetArg32(args, 1)); |
| 1201 | owner_perm = Convert<MemoryPermission>(GetReg32(system, 2)); | 1201 | owner_perm = Convert<MemoryPermission>(GetArg32(args, 2)); |
| 1202 | remote_perm = Convert<MemoryPermission>(GetReg32(system, 3)); | 1202 | remote_perm = Convert<MemoryPermission>(GetArg32(args, 3)); |
| 1203 | 1203 | ||
| 1204 | ret = CreateSharedMemory64From32(system, std::addressof(out_handle), size, owner_perm, remote_perm); | 1204 | ret = CreateSharedMemory64From32(system, std::addressof(out_handle), size, owner_perm, remote_perm); |
| 1205 | 1205 | ||
| 1206 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 1206 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 1207 | SetReg32(system, 1, Convert<uint32_t>(out_handle)); | 1207 | SetArg32(args, 1, Convert<uint32_t>(out_handle)); |
| 1208 | } | 1208 | } |
| 1209 | 1209 | ||
| 1210 | static void SvcWrap_MapTransferMemory64From32(Core::System& system) { | 1210 | static void SvcWrap_MapTransferMemory64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 1211 | Result ret{}; | 1211 | Result ret{}; |
| 1212 | 1212 | ||
| 1213 | Handle trmem_handle{}; | 1213 | Handle trmem_handle{}; |
| @@ -1215,67 +1215,67 @@ static void SvcWrap_MapTransferMemory64From32(Core::System& system) { | |||
| 1215 | uint32_t size{}; | 1215 | uint32_t size{}; |
| 1216 | MemoryPermission owner_perm{}; | 1216 | MemoryPermission owner_perm{}; |
| 1217 | 1217 | ||
| 1218 | trmem_handle = Convert<Handle>(GetReg32(system, 0)); | 1218 | trmem_handle = Convert<Handle>(GetArg32(args, 0)); |
| 1219 | address = Convert<uint32_t>(GetReg32(system, 1)); | 1219 | address = Convert<uint32_t>(GetArg32(args, 1)); |
| 1220 | size = Convert<uint32_t>(GetReg32(system, 2)); | 1220 | size = Convert<uint32_t>(GetArg32(args, 2)); |
| 1221 | owner_perm = Convert<MemoryPermission>(GetReg32(system, 3)); | 1221 | owner_perm = Convert<MemoryPermission>(GetArg32(args, 3)); |
| 1222 | 1222 | ||
| 1223 | ret = MapTransferMemory64From32(system, trmem_handle, address, size, owner_perm); | 1223 | ret = MapTransferMemory64From32(system, trmem_handle, address, size, owner_perm); |
| 1224 | 1224 | ||
| 1225 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 1225 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 1226 | } | 1226 | } |
| 1227 | 1227 | ||
| 1228 | static void SvcWrap_UnmapTransferMemory64From32(Core::System& system) { | 1228 | static void SvcWrap_UnmapTransferMemory64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 1229 | Result ret{}; | 1229 | Result ret{}; |
| 1230 | 1230 | ||
| 1231 | Handle trmem_handle{}; | 1231 | Handle trmem_handle{}; |
| 1232 | uint32_t address{}; | 1232 | uint32_t address{}; |
| 1233 | uint32_t size{}; | 1233 | uint32_t size{}; |
| 1234 | 1234 | ||
| 1235 | trmem_handle = Convert<Handle>(GetReg32(system, 0)); | 1235 | trmem_handle = Convert<Handle>(GetArg32(args, 0)); |
| 1236 | address = Convert<uint32_t>(GetReg32(system, 1)); | 1236 | address = Convert<uint32_t>(GetArg32(args, 1)); |
| 1237 | size = Convert<uint32_t>(GetReg32(system, 2)); | 1237 | size = Convert<uint32_t>(GetArg32(args, 2)); |
| 1238 | 1238 | ||
| 1239 | ret = UnmapTransferMemory64From32(system, trmem_handle, address, size); | 1239 | ret = UnmapTransferMemory64From32(system, trmem_handle, address, size); |
| 1240 | 1240 | ||
| 1241 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 1241 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 1242 | } | 1242 | } |
| 1243 | 1243 | ||
| 1244 | static void SvcWrap_CreateInterruptEvent64From32(Core::System& system) { | 1244 | static void SvcWrap_CreateInterruptEvent64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 1245 | Result ret{}; | 1245 | Result ret{}; |
| 1246 | 1246 | ||
| 1247 | Handle out_read_handle{}; | 1247 | Handle out_read_handle{}; |
| 1248 | int32_t interrupt_id{}; | 1248 | int32_t interrupt_id{}; |
| 1249 | InterruptType interrupt_type{}; | 1249 | InterruptType interrupt_type{}; |
| 1250 | 1250 | ||
| 1251 | interrupt_id = Convert<int32_t>(GetReg32(system, 1)); | 1251 | interrupt_id = Convert<int32_t>(GetArg32(args, 1)); |
| 1252 | interrupt_type = Convert<InterruptType>(GetReg32(system, 2)); | 1252 | interrupt_type = Convert<InterruptType>(GetArg32(args, 2)); |
| 1253 | 1253 | ||
| 1254 | ret = CreateInterruptEvent64From32(system, std::addressof(out_read_handle), interrupt_id, interrupt_type); | 1254 | ret = CreateInterruptEvent64From32(system, std::addressof(out_read_handle), interrupt_id, interrupt_type); |
| 1255 | 1255 | ||
| 1256 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 1256 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 1257 | SetReg32(system, 1, Convert<uint32_t>(out_read_handle)); | 1257 | SetArg32(args, 1, Convert<uint32_t>(out_read_handle)); |
| 1258 | } | 1258 | } |
| 1259 | 1259 | ||
| 1260 | static void SvcWrap_QueryPhysicalAddress64From32(Core::System& system) { | 1260 | static void SvcWrap_QueryPhysicalAddress64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 1261 | Result ret{}; | 1261 | Result ret{}; |
| 1262 | 1262 | ||
| 1263 | ilp32::PhysicalMemoryInfo out_info{}; | 1263 | ilp32::PhysicalMemoryInfo out_info{}; |
| 1264 | uint32_t address{}; | 1264 | uint32_t address{}; |
| 1265 | 1265 | ||
| 1266 | address = Convert<uint32_t>(GetReg32(system, 1)); | 1266 | address = Convert<uint32_t>(GetArg32(args, 1)); |
| 1267 | 1267 | ||
| 1268 | ret = QueryPhysicalAddress64From32(system, std::addressof(out_info), address); | 1268 | ret = QueryPhysicalAddress64From32(system, std::addressof(out_info), address); |
| 1269 | 1269 | ||
| 1270 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 1270 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 1271 | auto out_info_scatter = Convert<std::array<uint32_t, 4>>(out_info); | 1271 | auto out_info_scatter = Convert<std::array<uint32_t, 4>>(out_info); |
| 1272 | SetReg32(system, 1, out_info_scatter[0]); | 1272 | SetArg32(args, 1, out_info_scatter[0]); |
| 1273 | SetReg32(system, 2, out_info_scatter[1]); | 1273 | SetArg32(args, 2, out_info_scatter[1]); |
| 1274 | SetReg32(system, 3, out_info_scatter[2]); | 1274 | SetArg32(args, 3, out_info_scatter[2]); |
| 1275 | SetReg32(system, 4, out_info_scatter[3]); | 1275 | SetArg32(args, 4, out_info_scatter[3]); |
| 1276 | } | 1276 | } |
| 1277 | 1277 | ||
| 1278 | static void SvcWrap_QueryIoMapping64From32(Core::System& system) { | 1278 | static void SvcWrap_QueryIoMapping64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 1279 | Result ret{}; | 1279 | Result ret{}; |
| 1280 | 1280 | ||
| 1281 | uint64_t out_address{}; | 1281 | uint64_t out_address{}; |
| @@ -1284,19 +1284,19 @@ static void SvcWrap_QueryIoMapping64From32(Core::System& system) { | |||
| 1284 | uint32_t size{}; | 1284 | uint32_t size{}; |
| 1285 | 1285 | ||
| 1286 | std::array<uint32_t, 2> physical_address_gather{}; | 1286 | std::array<uint32_t, 2> physical_address_gather{}; |
| 1287 | physical_address_gather[0] = GetReg32(system, 2); | 1287 | physical_address_gather[0] = GetArg32(args, 2); |
| 1288 | physical_address_gather[1] = GetReg32(system, 3); | 1288 | physical_address_gather[1] = GetArg32(args, 3); |
| 1289 | physical_address = Convert<uint64_t>(physical_address_gather); | 1289 | physical_address = Convert<uint64_t>(physical_address_gather); |
| 1290 | size = Convert<uint32_t>(GetReg32(system, 0)); | 1290 | size = Convert<uint32_t>(GetArg32(args, 0)); |
| 1291 | 1291 | ||
| 1292 | ret = QueryIoMapping64From32(system, std::addressof(out_address), std::addressof(out_size), physical_address, size); | 1292 | ret = QueryIoMapping64From32(system, std::addressof(out_address), std::addressof(out_size), physical_address, size); |
| 1293 | 1293 | ||
| 1294 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 1294 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 1295 | SetReg32(system, 1, Convert<uint32_t>(out_address)); | 1295 | SetArg32(args, 1, Convert<uint32_t>(out_address)); |
| 1296 | SetReg32(system, 2, Convert<uint32_t>(out_size)); | 1296 | SetArg32(args, 2, Convert<uint32_t>(out_size)); |
| 1297 | } | 1297 | } |
| 1298 | 1298 | ||
| 1299 | static void SvcWrap_CreateDeviceAddressSpace64From32(Core::System& system) { | 1299 | static void SvcWrap_CreateDeviceAddressSpace64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 1300 | Result ret{}; | 1300 | Result ret{}; |
| 1301 | 1301 | ||
| 1302 | Handle out_handle{}; | 1302 | Handle out_handle{}; |
| @@ -1304,49 +1304,49 @@ static void SvcWrap_CreateDeviceAddressSpace64From32(Core::System& system) { | |||
| 1304 | uint64_t das_size{}; | 1304 | uint64_t das_size{}; |
| 1305 | 1305 | ||
| 1306 | std::array<uint32_t, 2> das_address_gather{}; | 1306 | std::array<uint32_t, 2> das_address_gather{}; |
| 1307 | das_address_gather[0] = GetReg32(system, 2); | 1307 | das_address_gather[0] = GetArg32(args, 2); |
| 1308 | das_address_gather[1] = GetReg32(system, 3); | 1308 | das_address_gather[1] = GetArg32(args, 3); |
| 1309 | das_address = Convert<uint64_t>(das_address_gather); | 1309 | das_address = Convert<uint64_t>(das_address_gather); |
| 1310 | std::array<uint32_t, 2> das_size_gather{}; | 1310 | std::array<uint32_t, 2> das_size_gather{}; |
| 1311 | das_size_gather[0] = GetReg32(system, 0); | 1311 | das_size_gather[0] = GetArg32(args, 0); |
| 1312 | das_size_gather[1] = GetReg32(system, 1); | 1312 | das_size_gather[1] = GetArg32(args, 1); |
| 1313 | das_size = Convert<uint64_t>(das_size_gather); | 1313 | das_size = Convert<uint64_t>(das_size_gather); |
| 1314 | 1314 | ||
| 1315 | ret = CreateDeviceAddressSpace64From32(system, std::addressof(out_handle), das_address, das_size); | 1315 | ret = CreateDeviceAddressSpace64From32(system, std::addressof(out_handle), das_address, das_size); |
| 1316 | 1316 | ||
| 1317 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 1317 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 1318 | SetReg32(system, 1, Convert<uint32_t>(out_handle)); | 1318 | SetArg32(args, 1, Convert<uint32_t>(out_handle)); |
| 1319 | } | 1319 | } |
| 1320 | 1320 | ||
| 1321 | static void SvcWrap_AttachDeviceAddressSpace64From32(Core::System& system) { | 1321 | static void SvcWrap_AttachDeviceAddressSpace64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 1322 | Result ret{}; | 1322 | Result ret{}; |
| 1323 | 1323 | ||
| 1324 | DeviceName device_name{}; | 1324 | DeviceName device_name{}; |
| 1325 | Handle das_handle{}; | 1325 | Handle das_handle{}; |
| 1326 | 1326 | ||
| 1327 | device_name = Convert<DeviceName>(GetReg32(system, 0)); | 1327 | device_name = Convert<DeviceName>(GetArg32(args, 0)); |
| 1328 | das_handle = Convert<Handle>(GetReg32(system, 1)); | 1328 | das_handle = Convert<Handle>(GetArg32(args, 1)); |
| 1329 | 1329 | ||
| 1330 | ret = AttachDeviceAddressSpace64From32(system, device_name, das_handle); | 1330 | ret = AttachDeviceAddressSpace64From32(system, device_name, das_handle); |
| 1331 | 1331 | ||
| 1332 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 1332 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 1333 | } | 1333 | } |
| 1334 | 1334 | ||
| 1335 | static void SvcWrap_DetachDeviceAddressSpace64From32(Core::System& system) { | 1335 | static void SvcWrap_DetachDeviceAddressSpace64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 1336 | Result ret{}; | 1336 | Result ret{}; |
| 1337 | 1337 | ||
| 1338 | DeviceName device_name{}; | 1338 | DeviceName device_name{}; |
| 1339 | Handle das_handle{}; | 1339 | Handle das_handle{}; |
| 1340 | 1340 | ||
| 1341 | device_name = Convert<DeviceName>(GetReg32(system, 0)); | 1341 | device_name = Convert<DeviceName>(GetArg32(args, 0)); |
| 1342 | das_handle = Convert<Handle>(GetReg32(system, 1)); | 1342 | das_handle = Convert<Handle>(GetArg32(args, 1)); |
| 1343 | 1343 | ||
| 1344 | ret = DetachDeviceAddressSpace64From32(system, device_name, das_handle); | 1344 | ret = DetachDeviceAddressSpace64From32(system, device_name, das_handle); |
| 1345 | 1345 | ||
| 1346 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 1346 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 1347 | } | 1347 | } |
| 1348 | 1348 | ||
| 1349 | static void SvcWrap_MapDeviceAddressSpaceByForce64From32(Core::System& system) { | 1349 | static void SvcWrap_MapDeviceAddressSpaceByForce64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 1350 | Result ret{}; | 1350 | Result ret{}; |
| 1351 | 1351 | ||
| 1352 | Handle das_handle{}; | 1352 | Handle das_handle{}; |
| @@ -1356,25 +1356,25 @@ static void SvcWrap_MapDeviceAddressSpaceByForce64From32(Core::System& system) { | |||
| 1356 | uint64_t device_address{}; | 1356 | uint64_t device_address{}; |
| 1357 | uint32_t option{}; | 1357 | uint32_t option{}; |
| 1358 | 1358 | ||
| 1359 | das_handle = Convert<Handle>(GetReg32(system, 0)); | 1359 | das_handle = Convert<Handle>(GetArg32(args, 0)); |
| 1360 | process_handle = Convert<Handle>(GetReg32(system, 1)); | 1360 | process_handle = Convert<Handle>(GetArg32(args, 1)); |
| 1361 | std::array<uint32_t, 2> process_address_gather{}; | 1361 | std::array<uint32_t, 2> process_address_gather{}; |
| 1362 | process_address_gather[0] = GetReg32(system, 2); | 1362 | process_address_gather[0] = GetArg32(args, 2); |
| 1363 | process_address_gather[1] = GetReg32(system, 3); | 1363 | process_address_gather[1] = GetArg32(args, 3); |
| 1364 | process_address = Convert<uint64_t>(process_address_gather); | 1364 | process_address = Convert<uint64_t>(process_address_gather); |
| 1365 | size = Convert<uint32_t>(GetReg32(system, 4)); | 1365 | size = Convert<uint32_t>(GetArg32(args, 4)); |
| 1366 | std::array<uint32_t, 2> device_address_gather{}; | 1366 | std::array<uint32_t, 2> device_address_gather{}; |
| 1367 | device_address_gather[0] = GetReg32(system, 5); | 1367 | device_address_gather[0] = GetArg32(args, 5); |
| 1368 | device_address_gather[1] = GetReg32(system, 6); | 1368 | device_address_gather[1] = GetArg32(args, 6); |
| 1369 | device_address = Convert<uint64_t>(device_address_gather); | 1369 | device_address = Convert<uint64_t>(device_address_gather); |
| 1370 | option = Convert<uint32_t>(GetReg32(system, 7)); | 1370 | option = Convert<uint32_t>(GetArg32(args, 7)); |
| 1371 | 1371 | ||
| 1372 | ret = MapDeviceAddressSpaceByForce64From32(system, das_handle, process_handle, process_address, size, device_address, option); | 1372 | ret = MapDeviceAddressSpaceByForce64From32(system, das_handle, process_handle, process_address, size, device_address, option); |
| 1373 | 1373 | ||
| 1374 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 1374 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 1375 | } | 1375 | } |
| 1376 | 1376 | ||
| 1377 | static void SvcWrap_MapDeviceAddressSpaceAligned64From32(Core::System& system) { | 1377 | static void SvcWrap_MapDeviceAddressSpaceAligned64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 1378 | Result ret{}; | 1378 | Result ret{}; |
| 1379 | 1379 | ||
| 1380 | Handle das_handle{}; | 1380 | Handle das_handle{}; |
| @@ -1384,25 +1384,25 @@ static void SvcWrap_MapDeviceAddressSpaceAligned64From32(Core::System& system) { | |||
| 1384 | uint64_t device_address{}; | 1384 | uint64_t device_address{}; |
| 1385 | uint32_t option{}; | 1385 | uint32_t option{}; |
| 1386 | 1386 | ||
| 1387 | das_handle = Convert<Handle>(GetReg32(system, 0)); | 1387 | das_handle = Convert<Handle>(GetArg32(args, 0)); |
| 1388 | process_handle = Convert<Handle>(GetReg32(system, 1)); | 1388 | process_handle = Convert<Handle>(GetArg32(args, 1)); |
| 1389 | std::array<uint32_t, 2> process_address_gather{}; | 1389 | std::array<uint32_t, 2> process_address_gather{}; |
| 1390 | process_address_gather[0] = GetReg32(system, 2); | 1390 | process_address_gather[0] = GetArg32(args, 2); |
| 1391 | process_address_gather[1] = GetReg32(system, 3); | 1391 | process_address_gather[1] = GetArg32(args, 3); |
| 1392 | process_address = Convert<uint64_t>(process_address_gather); | 1392 | process_address = Convert<uint64_t>(process_address_gather); |
| 1393 | size = Convert<uint32_t>(GetReg32(system, 4)); | 1393 | size = Convert<uint32_t>(GetArg32(args, 4)); |
| 1394 | std::array<uint32_t, 2> device_address_gather{}; | 1394 | std::array<uint32_t, 2> device_address_gather{}; |
| 1395 | device_address_gather[0] = GetReg32(system, 5); | 1395 | device_address_gather[0] = GetArg32(args, 5); |
| 1396 | device_address_gather[1] = GetReg32(system, 6); | 1396 | device_address_gather[1] = GetArg32(args, 6); |
| 1397 | device_address = Convert<uint64_t>(device_address_gather); | 1397 | device_address = Convert<uint64_t>(device_address_gather); |
| 1398 | option = Convert<uint32_t>(GetReg32(system, 7)); | 1398 | option = Convert<uint32_t>(GetArg32(args, 7)); |
| 1399 | 1399 | ||
| 1400 | ret = MapDeviceAddressSpaceAligned64From32(system, das_handle, process_handle, process_address, size, device_address, option); | 1400 | ret = MapDeviceAddressSpaceAligned64From32(system, das_handle, process_handle, process_address, size, device_address, option); |
| 1401 | 1401 | ||
| 1402 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 1402 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 1403 | } | 1403 | } |
| 1404 | 1404 | ||
| 1405 | static void SvcWrap_UnmapDeviceAddressSpace64From32(Core::System& system) { | 1405 | static void SvcWrap_UnmapDeviceAddressSpace64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 1406 | Result ret{}; | 1406 | Result ret{}; |
| 1407 | 1407 | ||
| 1408 | Handle das_handle{}; | 1408 | Handle das_handle{}; |
| @@ -1411,145 +1411,145 @@ static void SvcWrap_UnmapDeviceAddressSpace64From32(Core::System& system) { | |||
| 1411 | uint32_t size{}; | 1411 | uint32_t size{}; |
| 1412 | uint64_t device_address{}; | 1412 | uint64_t device_address{}; |
| 1413 | 1413 | ||
| 1414 | das_handle = Convert<Handle>(GetReg32(system, 0)); | 1414 | das_handle = Convert<Handle>(GetArg32(args, 0)); |
| 1415 | process_handle = Convert<Handle>(GetReg32(system, 1)); | 1415 | process_handle = Convert<Handle>(GetArg32(args, 1)); |
| 1416 | std::array<uint32_t, 2> process_address_gather{}; | 1416 | std::array<uint32_t, 2> process_address_gather{}; |
| 1417 | process_address_gather[0] = GetReg32(system, 2); | 1417 | process_address_gather[0] = GetArg32(args, 2); |
| 1418 | process_address_gather[1] = GetReg32(system, 3); | 1418 | process_address_gather[1] = GetArg32(args, 3); |
| 1419 | process_address = Convert<uint64_t>(process_address_gather); | 1419 | process_address = Convert<uint64_t>(process_address_gather); |
| 1420 | size = Convert<uint32_t>(GetReg32(system, 4)); | 1420 | size = Convert<uint32_t>(GetArg32(args, 4)); |
| 1421 | std::array<uint32_t, 2> device_address_gather{}; | 1421 | std::array<uint32_t, 2> device_address_gather{}; |
| 1422 | device_address_gather[0] = GetReg32(system, 5); | 1422 | device_address_gather[0] = GetArg32(args, 5); |
| 1423 | device_address_gather[1] = GetReg32(system, 6); | 1423 | device_address_gather[1] = GetArg32(args, 6); |
| 1424 | device_address = Convert<uint64_t>(device_address_gather); | 1424 | device_address = Convert<uint64_t>(device_address_gather); |
| 1425 | 1425 | ||
| 1426 | ret = UnmapDeviceAddressSpace64From32(system, das_handle, process_handle, process_address, size, device_address); | 1426 | ret = UnmapDeviceAddressSpace64From32(system, das_handle, process_handle, process_address, size, device_address); |
| 1427 | 1427 | ||
| 1428 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 1428 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 1429 | } | 1429 | } |
| 1430 | 1430 | ||
| 1431 | static void SvcWrap_InvalidateProcessDataCache64From32(Core::System& system) { | 1431 | static void SvcWrap_InvalidateProcessDataCache64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 1432 | Result ret{}; | 1432 | Result ret{}; |
| 1433 | 1433 | ||
| 1434 | Handle process_handle{}; | 1434 | Handle process_handle{}; |
| 1435 | uint64_t address{}; | 1435 | uint64_t address{}; |
| 1436 | uint64_t size{}; | 1436 | uint64_t size{}; |
| 1437 | 1437 | ||
| 1438 | process_handle = Convert<Handle>(GetReg32(system, 0)); | 1438 | process_handle = Convert<Handle>(GetArg32(args, 0)); |
| 1439 | std::array<uint32_t, 2> address_gather{}; | 1439 | std::array<uint32_t, 2> address_gather{}; |
| 1440 | address_gather[0] = GetReg32(system, 2); | 1440 | address_gather[0] = GetArg32(args, 2); |
| 1441 | address_gather[1] = GetReg32(system, 3); | 1441 | address_gather[1] = GetArg32(args, 3); |
| 1442 | address = Convert<uint64_t>(address_gather); | 1442 | address = Convert<uint64_t>(address_gather); |
| 1443 | std::array<uint32_t, 2> size_gather{}; | 1443 | std::array<uint32_t, 2> size_gather{}; |
| 1444 | size_gather[0] = GetReg32(system, 1); | 1444 | size_gather[0] = GetArg32(args, 1); |
| 1445 | size_gather[1] = GetReg32(system, 4); | 1445 | size_gather[1] = GetArg32(args, 4); |
| 1446 | size = Convert<uint64_t>(size_gather); | 1446 | size = Convert<uint64_t>(size_gather); |
| 1447 | 1447 | ||
| 1448 | ret = InvalidateProcessDataCache64From32(system, process_handle, address, size); | 1448 | ret = InvalidateProcessDataCache64From32(system, process_handle, address, size); |
| 1449 | 1449 | ||
| 1450 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 1450 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 1451 | } | 1451 | } |
| 1452 | 1452 | ||
| 1453 | static void SvcWrap_StoreProcessDataCache64From32(Core::System& system) { | 1453 | static void SvcWrap_StoreProcessDataCache64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 1454 | Result ret{}; | 1454 | Result ret{}; |
| 1455 | 1455 | ||
| 1456 | Handle process_handle{}; | 1456 | Handle process_handle{}; |
| 1457 | uint64_t address{}; | 1457 | uint64_t address{}; |
| 1458 | uint64_t size{}; | 1458 | uint64_t size{}; |
| 1459 | 1459 | ||
| 1460 | process_handle = Convert<Handle>(GetReg32(system, 0)); | 1460 | process_handle = Convert<Handle>(GetArg32(args, 0)); |
| 1461 | std::array<uint32_t, 2> address_gather{}; | 1461 | std::array<uint32_t, 2> address_gather{}; |
| 1462 | address_gather[0] = GetReg32(system, 2); | 1462 | address_gather[0] = GetArg32(args, 2); |
| 1463 | address_gather[1] = GetReg32(system, 3); | 1463 | address_gather[1] = GetArg32(args, 3); |
| 1464 | address = Convert<uint64_t>(address_gather); | 1464 | address = Convert<uint64_t>(address_gather); |
| 1465 | std::array<uint32_t, 2> size_gather{}; | 1465 | std::array<uint32_t, 2> size_gather{}; |
| 1466 | size_gather[0] = GetReg32(system, 1); | 1466 | size_gather[0] = GetArg32(args, 1); |
| 1467 | size_gather[1] = GetReg32(system, 4); | 1467 | size_gather[1] = GetArg32(args, 4); |
| 1468 | size = Convert<uint64_t>(size_gather); | 1468 | size = Convert<uint64_t>(size_gather); |
| 1469 | 1469 | ||
| 1470 | ret = StoreProcessDataCache64From32(system, process_handle, address, size); | 1470 | ret = StoreProcessDataCache64From32(system, process_handle, address, size); |
| 1471 | 1471 | ||
| 1472 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 1472 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 1473 | } | 1473 | } |
| 1474 | 1474 | ||
| 1475 | static void SvcWrap_FlushProcessDataCache64From32(Core::System& system) { | 1475 | static void SvcWrap_FlushProcessDataCache64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 1476 | Result ret{}; | 1476 | Result ret{}; |
| 1477 | 1477 | ||
| 1478 | Handle process_handle{}; | 1478 | Handle process_handle{}; |
| 1479 | uint64_t address{}; | 1479 | uint64_t address{}; |
| 1480 | uint64_t size{}; | 1480 | uint64_t size{}; |
| 1481 | 1481 | ||
| 1482 | process_handle = Convert<Handle>(GetReg32(system, 0)); | 1482 | process_handle = Convert<Handle>(GetArg32(args, 0)); |
| 1483 | std::array<uint32_t, 2> address_gather{}; | 1483 | std::array<uint32_t, 2> address_gather{}; |
| 1484 | address_gather[0] = GetReg32(system, 2); | 1484 | address_gather[0] = GetArg32(args, 2); |
| 1485 | address_gather[1] = GetReg32(system, 3); | 1485 | address_gather[1] = GetArg32(args, 3); |
| 1486 | address = Convert<uint64_t>(address_gather); | 1486 | address = Convert<uint64_t>(address_gather); |
| 1487 | std::array<uint32_t, 2> size_gather{}; | 1487 | std::array<uint32_t, 2> size_gather{}; |
| 1488 | size_gather[0] = GetReg32(system, 1); | 1488 | size_gather[0] = GetArg32(args, 1); |
| 1489 | size_gather[1] = GetReg32(system, 4); | 1489 | size_gather[1] = GetArg32(args, 4); |
| 1490 | size = Convert<uint64_t>(size_gather); | 1490 | size = Convert<uint64_t>(size_gather); |
| 1491 | 1491 | ||
| 1492 | ret = FlushProcessDataCache64From32(system, process_handle, address, size); | 1492 | ret = FlushProcessDataCache64From32(system, process_handle, address, size); |
| 1493 | 1493 | ||
| 1494 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 1494 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 1495 | } | 1495 | } |
| 1496 | 1496 | ||
| 1497 | static void SvcWrap_DebugActiveProcess64From32(Core::System& system) { | 1497 | static void SvcWrap_DebugActiveProcess64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 1498 | Result ret{}; | 1498 | Result ret{}; |
| 1499 | 1499 | ||
| 1500 | Handle out_handle{}; | 1500 | Handle out_handle{}; |
| 1501 | uint64_t process_id{}; | 1501 | uint64_t process_id{}; |
| 1502 | 1502 | ||
| 1503 | std::array<uint32_t, 2> process_id_gather{}; | 1503 | std::array<uint32_t, 2> process_id_gather{}; |
| 1504 | process_id_gather[0] = GetReg32(system, 2); | 1504 | process_id_gather[0] = GetArg32(args, 2); |
| 1505 | process_id_gather[1] = GetReg32(system, 3); | 1505 | process_id_gather[1] = GetArg32(args, 3); |
| 1506 | process_id = Convert<uint64_t>(process_id_gather); | 1506 | process_id = Convert<uint64_t>(process_id_gather); |
| 1507 | 1507 | ||
| 1508 | ret = DebugActiveProcess64From32(system, std::addressof(out_handle), process_id); | 1508 | ret = DebugActiveProcess64From32(system, std::addressof(out_handle), process_id); |
| 1509 | 1509 | ||
| 1510 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 1510 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 1511 | SetReg32(system, 1, Convert<uint32_t>(out_handle)); | 1511 | SetArg32(args, 1, Convert<uint32_t>(out_handle)); |
| 1512 | } | 1512 | } |
| 1513 | 1513 | ||
| 1514 | static void SvcWrap_BreakDebugProcess64From32(Core::System& system) { | 1514 | static void SvcWrap_BreakDebugProcess64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 1515 | Result ret{}; | 1515 | Result ret{}; |
| 1516 | 1516 | ||
| 1517 | Handle debug_handle{}; | 1517 | Handle debug_handle{}; |
| 1518 | 1518 | ||
| 1519 | debug_handle = Convert<Handle>(GetReg32(system, 0)); | 1519 | debug_handle = Convert<Handle>(GetArg32(args, 0)); |
| 1520 | 1520 | ||
| 1521 | ret = BreakDebugProcess64From32(system, debug_handle); | 1521 | ret = BreakDebugProcess64From32(system, debug_handle); |
| 1522 | 1522 | ||
| 1523 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 1523 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 1524 | } | 1524 | } |
| 1525 | 1525 | ||
| 1526 | static void SvcWrap_TerminateDebugProcess64From32(Core::System& system) { | 1526 | static void SvcWrap_TerminateDebugProcess64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 1527 | Result ret{}; | 1527 | Result ret{}; |
| 1528 | 1528 | ||
| 1529 | Handle debug_handle{}; | 1529 | Handle debug_handle{}; |
| 1530 | 1530 | ||
| 1531 | debug_handle = Convert<Handle>(GetReg32(system, 0)); | 1531 | debug_handle = Convert<Handle>(GetArg32(args, 0)); |
| 1532 | 1532 | ||
| 1533 | ret = TerminateDebugProcess64From32(system, debug_handle); | 1533 | ret = TerminateDebugProcess64From32(system, debug_handle); |
| 1534 | 1534 | ||
| 1535 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 1535 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 1536 | } | 1536 | } |
| 1537 | 1537 | ||
| 1538 | static void SvcWrap_GetDebugEvent64From32(Core::System& system) { | 1538 | static void SvcWrap_GetDebugEvent64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 1539 | Result ret{}; | 1539 | Result ret{}; |
| 1540 | 1540 | ||
| 1541 | uint32_t out_info{}; | 1541 | uint32_t out_info{}; |
| 1542 | Handle debug_handle{}; | 1542 | Handle debug_handle{}; |
| 1543 | 1543 | ||
| 1544 | out_info = Convert<uint32_t>(GetReg32(system, 0)); | 1544 | out_info = Convert<uint32_t>(GetArg32(args, 0)); |
| 1545 | debug_handle = Convert<Handle>(GetReg32(system, 1)); | 1545 | debug_handle = Convert<Handle>(GetArg32(args, 1)); |
| 1546 | 1546 | ||
| 1547 | ret = GetDebugEvent64From32(system, out_info, debug_handle); | 1547 | ret = GetDebugEvent64From32(system, out_info, debug_handle); |
| 1548 | 1548 | ||
| 1549 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 1549 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 1550 | } | 1550 | } |
| 1551 | 1551 | ||
| 1552 | static void SvcWrap_ContinueDebugEvent64From32(Core::System& system) { | 1552 | static void SvcWrap_ContinueDebugEvent64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 1553 | Result ret{}; | 1553 | Result ret{}; |
| 1554 | 1554 | ||
| 1555 | Handle debug_handle{}; | 1555 | Handle debug_handle{}; |
| @@ -1557,33 +1557,33 @@ static void SvcWrap_ContinueDebugEvent64From32(Core::System& system) { | |||
| 1557 | uint32_t thread_ids{}; | 1557 | uint32_t thread_ids{}; |
| 1558 | int32_t num_thread_ids{}; | 1558 | int32_t num_thread_ids{}; |
| 1559 | 1559 | ||
| 1560 | debug_handle = Convert<Handle>(GetReg32(system, 0)); | 1560 | debug_handle = Convert<Handle>(GetArg32(args, 0)); |
| 1561 | flags = Convert<uint32_t>(GetReg32(system, 1)); | 1561 | flags = Convert<uint32_t>(GetArg32(args, 1)); |
| 1562 | thread_ids = Convert<uint32_t>(GetReg32(system, 2)); | 1562 | thread_ids = Convert<uint32_t>(GetArg32(args, 2)); |
| 1563 | num_thread_ids = Convert<int32_t>(GetReg32(system, 3)); | 1563 | num_thread_ids = Convert<int32_t>(GetArg32(args, 3)); |
| 1564 | 1564 | ||
| 1565 | ret = ContinueDebugEvent64From32(system, debug_handle, flags, thread_ids, num_thread_ids); | 1565 | ret = ContinueDebugEvent64From32(system, debug_handle, flags, thread_ids, num_thread_ids); |
| 1566 | 1566 | ||
| 1567 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 1567 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 1568 | } | 1568 | } |
| 1569 | 1569 | ||
| 1570 | static void SvcWrap_GetProcessList64From32(Core::System& system) { | 1570 | static void SvcWrap_GetProcessList64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 1571 | Result ret{}; | 1571 | Result ret{}; |
| 1572 | 1572 | ||
| 1573 | int32_t out_num_processes{}; | 1573 | int32_t out_num_processes{}; |
| 1574 | uint32_t out_process_ids{}; | 1574 | uint32_t out_process_ids{}; |
| 1575 | int32_t max_out_count{}; | 1575 | int32_t max_out_count{}; |
| 1576 | 1576 | ||
| 1577 | out_process_ids = Convert<uint32_t>(GetReg32(system, 1)); | 1577 | out_process_ids = Convert<uint32_t>(GetArg32(args, 1)); |
| 1578 | max_out_count = Convert<int32_t>(GetReg32(system, 2)); | 1578 | max_out_count = Convert<int32_t>(GetArg32(args, 2)); |
| 1579 | 1579 | ||
| 1580 | ret = GetProcessList64From32(system, std::addressof(out_num_processes), out_process_ids, max_out_count); | 1580 | ret = GetProcessList64From32(system, std::addressof(out_num_processes), out_process_ids, max_out_count); |
| 1581 | 1581 | ||
| 1582 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 1582 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 1583 | SetReg32(system, 1, Convert<uint32_t>(out_num_processes)); | 1583 | SetArg32(args, 1, Convert<uint32_t>(out_num_processes)); |
| 1584 | } | 1584 | } |
| 1585 | 1585 | ||
| 1586 | static void SvcWrap_GetThreadList64From32(Core::System& system) { | 1586 | static void SvcWrap_GetThreadList64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 1587 | Result ret{}; | 1587 | Result ret{}; |
| 1588 | 1588 | ||
| 1589 | int32_t out_num_threads{}; | 1589 | int32_t out_num_threads{}; |
| @@ -1591,17 +1591,17 @@ static void SvcWrap_GetThreadList64From32(Core::System& system) { | |||
| 1591 | int32_t max_out_count{}; | 1591 | int32_t max_out_count{}; |
| 1592 | Handle debug_handle{}; | 1592 | Handle debug_handle{}; |
| 1593 | 1593 | ||
| 1594 | out_thread_ids = Convert<uint32_t>(GetReg32(system, 1)); | 1594 | out_thread_ids = Convert<uint32_t>(GetArg32(args, 1)); |
| 1595 | max_out_count = Convert<int32_t>(GetReg32(system, 2)); | 1595 | max_out_count = Convert<int32_t>(GetArg32(args, 2)); |
| 1596 | debug_handle = Convert<Handle>(GetReg32(system, 3)); | 1596 | debug_handle = Convert<Handle>(GetArg32(args, 3)); |
| 1597 | 1597 | ||
| 1598 | ret = GetThreadList64From32(system, std::addressof(out_num_threads), out_thread_ids, max_out_count, debug_handle); | 1598 | ret = GetThreadList64From32(system, std::addressof(out_num_threads), out_thread_ids, max_out_count, debug_handle); |
| 1599 | 1599 | ||
| 1600 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 1600 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 1601 | SetReg32(system, 1, Convert<uint32_t>(out_num_threads)); | 1601 | SetArg32(args, 1, Convert<uint32_t>(out_num_threads)); |
| 1602 | } | 1602 | } |
| 1603 | 1603 | ||
| 1604 | static void SvcWrap_GetDebugThreadContext64From32(Core::System& system) { | 1604 | static void SvcWrap_GetDebugThreadContext64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 1605 | Result ret{}; | 1605 | Result ret{}; |
| 1606 | 1606 | ||
| 1607 | uint32_t out_context{}; | 1607 | uint32_t out_context{}; |
| @@ -1609,20 +1609,20 @@ static void SvcWrap_GetDebugThreadContext64From32(Core::System& system) { | |||
| 1609 | uint64_t thread_id{}; | 1609 | uint64_t thread_id{}; |
| 1610 | uint32_t context_flags{}; | 1610 | uint32_t context_flags{}; |
| 1611 | 1611 | ||
| 1612 | out_context = Convert<uint32_t>(GetReg32(system, 0)); | 1612 | out_context = Convert<uint32_t>(GetArg32(args, 0)); |
| 1613 | debug_handle = Convert<Handle>(GetReg32(system, 1)); | 1613 | debug_handle = Convert<Handle>(GetArg32(args, 1)); |
| 1614 | std::array<uint32_t, 2> thread_id_gather{}; | 1614 | std::array<uint32_t, 2> thread_id_gather{}; |
| 1615 | thread_id_gather[0] = GetReg32(system, 2); | 1615 | thread_id_gather[0] = GetArg32(args, 2); |
| 1616 | thread_id_gather[1] = GetReg32(system, 3); | 1616 | thread_id_gather[1] = GetArg32(args, 3); |
| 1617 | thread_id = Convert<uint64_t>(thread_id_gather); | 1617 | thread_id = Convert<uint64_t>(thread_id_gather); |
| 1618 | context_flags = Convert<uint32_t>(GetReg32(system, 4)); | 1618 | context_flags = Convert<uint32_t>(GetArg32(args, 4)); |
| 1619 | 1619 | ||
| 1620 | ret = GetDebugThreadContext64From32(system, out_context, debug_handle, thread_id, context_flags); | 1620 | ret = GetDebugThreadContext64From32(system, out_context, debug_handle, thread_id, context_flags); |
| 1621 | 1621 | ||
| 1622 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 1622 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 1623 | } | 1623 | } |
| 1624 | 1624 | ||
| 1625 | static void SvcWrap_SetDebugThreadContext64From32(Core::System& system) { | 1625 | static void SvcWrap_SetDebugThreadContext64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 1626 | Result ret{}; | 1626 | Result ret{}; |
| 1627 | 1627 | ||
| 1628 | Handle debug_handle{}; | 1628 | Handle debug_handle{}; |
| @@ -1630,20 +1630,20 @@ static void SvcWrap_SetDebugThreadContext64From32(Core::System& system) { | |||
| 1630 | uint32_t context{}; | 1630 | uint32_t context{}; |
| 1631 | uint32_t context_flags{}; | 1631 | uint32_t context_flags{}; |
| 1632 | 1632 | ||
| 1633 | debug_handle = Convert<Handle>(GetReg32(system, 0)); | 1633 | debug_handle = Convert<Handle>(GetArg32(args, 0)); |
| 1634 | std::array<uint32_t, 2> thread_id_gather{}; | 1634 | std::array<uint32_t, 2> thread_id_gather{}; |
| 1635 | thread_id_gather[0] = GetReg32(system, 2); | 1635 | thread_id_gather[0] = GetArg32(args, 2); |
| 1636 | thread_id_gather[1] = GetReg32(system, 3); | 1636 | thread_id_gather[1] = GetArg32(args, 3); |
| 1637 | thread_id = Convert<uint64_t>(thread_id_gather); | 1637 | thread_id = Convert<uint64_t>(thread_id_gather); |
| 1638 | context = Convert<uint32_t>(GetReg32(system, 1)); | 1638 | context = Convert<uint32_t>(GetArg32(args, 1)); |
| 1639 | context_flags = Convert<uint32_t>(GetReg32(system, 4)); | 1639 | context_flags = Convert<uint32_t>(GetArg32(args, 4)); |
| 1640 | 1640 | ||
| 1641 | ret = SetDebugThreadContext64From32(system, debug_handle, thread_id, context, context_flags); | 1641 | ret = SetDebugThreadContext64From32(system, debug_handle, thread_id, context, context_flags); |
| 1642 | 1642 | ||
| 1643 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 1643 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 1644 | } | 1644 | } |
| 1645 | 1645 | ||
| 1646 | static void SvcWrap_QueryDebugProcessMemory64From32(Core::System& system) { | 1646 | static void SvcWrap_QueryDebugProcessMemory64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 1647 | Result ret{}; | 1647 | Result ret{}; |
| 1648 | 1648 | ||
| 1649 | PageInfo out_page_info{}; | 1649 | PageInfo out_page_info{}; |
| @@ -1651,17 +1651,17 @@ static void SvcWrap_QueryDebugProcessMemory64From32(Core::System& system) { | |||
| 1651 | Handle process_handle{}; | 1651 | Handle process_handle{}; |
| 1652 | uint32_t address{}; | 1652 | uint32_t address{}; |
| 1653 | 1653 | ||
| 1654 | out_memory_info = Convert<uint32_t>(GetReg32(system, 0)); | 1654 | out_memory_info = Convert<uint32_t>(GetArg32(args, 0)); |
| 1655 | process_handle = Convert<Handle>(GetReg32(system, 2)); | 1655 | process_handle = Convert<Handle>(GetArg32(args, 2)); |
| 1656 | address = Convert<uint32_t>(GetReg32(system, 3)); | 1656 | address = Convert<uint32_t>(GetArg32(args, 3)); |
| 1657 | 1657 | ||
| 1658 | ret = QueryDebugProcessMemory64From32(system, out_memory_info, std::addressof(out_page_info), process_handle, address); | 1658 | ret = QueryDebugProcessMemory64From32(system, out_memory_info, std::addressof(out_page_info), process_handle, address); |
| 1659 | 1659 | ||
| 1660 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 1660 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 1661 | SetReg32(system, 1, Convert<uint32_t>(out_page_info)); | 1661 | SetArg32(args, 1, Convert<uint32_t>(out_page_info)); |
| 1662 | } | 1662 | } |
| 1663 | 1663 | ||
| 1664 | static void SvcWrap_ReadDebugProcessMemory64From32(Core::System& system) { | 1664 | static void SvcWrap_ReadDebugProcessMemory64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 1665 | Result ret{}; | 1665 | Result ret{}; |
| 1666 | 1666 | ||
| 1667 | uint32_t buffer{}; | 1667 | uint32_t buffer{}; |
| @@ -1669,17 +1669,17 @@ static void SvcWrap_ReadDebugProcessMemory64From32(Core::System& system) { | |||
| 1669 | uint32_t address{}; | 1669 | uint32_t address{}; |
| 1670 | uint32_t size{}; | 1670 | uint32_t size{}; |
| 1671 | 1671 | ||
| 1672 | buffer = Convert<uint32_t>(GetReg32(system, 0)); | 1672 | buffer = Convert<uint32_t>(GetArg32(args, 0)); |
| 1673 | debug_handle = Convert<Handle>(GetReg32(system, 1)); | 1673 | debug_handle = Convert<Handle>(GetArg32(args, 1)); |
| 1674 | address = Convert<uint32_t>(GetReg32(system, 2)); | 1674 | address = Convert<uint32_t>(GetArg32(args, 2)); |
| 1675 | size = Convert<uint32_t>(GetReg32(system, 3)); | 1675 | size = Convert<uint32_t>(GetArg32(args, 3)); |
| 1676 | 1676 | ||
| 1677 | ret = ReadDebugProcessMemory64From32(system, buffer, debug_handle, address, size); | 1677 | ret = ReadDebugProcessMemory64From32(system, buffer, debug_handle, address, size); |
| 1678 | 1678 | ||
| 1679 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 1679 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 1680 | } | 1680 | } |
| 1681 | 1681 | ||
| 1682 | static void SvcWrap_WriteDebugProcessMemory64From32(Core::System& system) { | 1682 | static void SvcWrap_WriteDebugProcessMemory64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 1683 | Result ret{}; | 1683 | Result ret{}; |
| 1684 | 1684 | ||
| 1685 | Handle debug_handle{}; | 1685 | Handle debug_handle{}; |
| @@ -1687,39 +1687,39 @@ static void SvcWrap_WriteDebugProcessMemory64From32(Core::System& system) { | |||
| 1687 | uint32_t address{}; | 1687 | uint32_t address{}; |
| 1688 | uint32_t size{}; | 1688 | uint32_t size{}; |
| 1689 | 1689 | ||
| 1690 | debug_handle = Convert<Handle>(GetReg32(system, 0)); | 1690 | debug_handle = Convert<Handle>(GetArg32(args, 0)); |
| 1691 | buffer = Convert<uint32_t>(GetReg32(system, 1)); | 1691 | buffer = Convert<uint32_t>(GetArg32(args, 1)); |
| 1692 | address = Convert<uint32_t>(GetReg32(system, 2)); | 1692 | address = Convert<uint32_t>(GetArg32(args, 2)); |
| 1693 | size = Convert<uint32_t>(GetReg32(system, 3)); | 1693 | size = Convert<uint32_t>(GetArg32(args, 3)); |
| 1694 | 1694 | ||
| 1695 | ret = WriteDebugProcessMemory64From32(system, debug_handle, buffer, address, size); | 1695 | ret = WriteDebugProcessMemory64From32(system, debug_handle, buffer, address, size); |
| 1696 | 1696 | ||
| 1697 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 1697 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 1698 | } | 1698 | } |
| 1699 | 1699 | ||
| 1700 | static void SvcWrap_SetHardwareBreakPoint64From32(Core::System& system) { | 1700 | static void SvcWrap_SetHardwareBreakPoint64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 1701 | Result ret{}; | 1701 | Result ret{}; |
| 1702 | 1702 | ||
| 1703 | HardwareBreakPointRegisterName name{}; | 1703 | HardwareBreakPointRegisterName name{}; |
| 1704 | uint64_t flags{}; | 1704 | uint64_t flags{}; |
| 1705 | uint64_t value{}; | 1705 | uint64_t value{}; |
| 1706 | 1706 | ||
| 1707 | name = Convert<HardwareBreakPointRegisterName>(GetReg32(system, 0)); | 1707 | name = Convert<HardwareBreakPointRegisterName>(GetArg32(args, 0)); |
| 1708 | std::array<uint32_t, 2> flags_gather{}; | 1708 | std::array<uint32_t, 2> flags_gather{}; |
| 1709 | flags_gather[0] = GetReg32(system, 2); | 1709 | flags_gather[0] = GetArg32(args, 2); |
| 1710 | flags_gather[1] = GetReg32(system, 3); | 1710 | flags_gather[1] = GetArg32(args, 3); |
| 1711 | flags = Convert<uint64_t>(flags_gather); | 1711 | flags = Convert<uint64_t>(flags_gather); |
| 1712 | std::array<uint32_t, 2> value_gather{}; | 1712 | std::array<uint32_t, 2> value_gather{}; |
| 1713 | value_gather[0] = GetReg32(system, 1); | 1713 | value_gather[0] = GetArg32(args, 1); |
| 1714 | value_gather[1] = GetReg32(system, 4); | 1714 | value_gather[1] = GetArg32(args, 4); |
| 1715 | value = Convert<uint64_t>(value_gather); | 1715 | value = Convert<uint64_t>(value_gather); |
| 1716 | 1716 | ||
| 1717 | ret = SetHardwareBreakPoint64From32(system, name, flags, value); | 1717 | ret = SetHardwareBreakPoint64From32(system, name, flags, value); |
| 1718 | 1718 | ||
| 1719 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 1719 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 1720 | } | 1720 | } |
| 1721 | 1721 | ||
| 1722 | static void SvcWrap_GetDebugThreadParam64From32(Core::System& system) { | 1722 | static void SvcWrap_GetDebugThreadParam64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 1723 | Result ret{}; | 1723 | Result ret{}; |
| 1724 | 1724 | ||
| 1725 | uint64_t out_64{}; | 1725 | uint64_t out_64{}; |
| @@ -1728,23 +1728,23 @@ static void SvcWrap_GetDebugThreadParam64From32(Core::System& system) { | |||
| 1728 | uint64_t thread_id{}; | 1728 | uint64_t thread_id{}; |
| 1729 | DebugThreadParam param{}; | 1729 | DebugThreadParam param{}; |
| 1730 | 1730 | ||
| 1731 | debug_handle = Convert<Handle>(GetReg32(system, 2)); | 1731 | debug_handle = Convert<Handle>(GetArg32(args, 2)); |
| 1732 | std::array<uint32_t, 2> thread_id_gather{}; | 1732 | std::array<uint32_t, 2> thread_id_gather{}; |
| 1733 | thread_id_gather[0] = GetReg32(system, 0); | 1733 | thread_id_gather[0] = GetArg32(args, 0); |
| 1734 | thread_id_gather[1] = GetReg32(system, 1); | 1734 | thread_id_gather[1] = GetArg32(args, 1); |
| 1735 | thread_id = Convert<uint64_t>(thread_id_gather); | 1735 | thread_id = Convert<uint64_t>(thread_id_gather); |
| 1736 | param = Convert<DebugThreadParam>(GetReg32(system, 3)); | 1736 | param = Convert<DebugThreadParam>(GetArg32(args, 3)); |
| 1737 | 1737 | ||
| 1738 | ret = GetDebugThreadParam64From32(system, std::addressof(out_64), std::addressof(out_32), debug_handle, thread_id, param); | 1738 | ret = GetDebugThreadParam64From32(system, std::addressof(out_64), std::addressof(out_32), debug_handle, thread_id, param); |
| 1739 | 1739 | ||
| 1740 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 1740 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 1741 | auto out_64_scatter = Convert<std::array<uint32_t, 2>>(out_64); | 1741 | auto out_64_scatter = Convert<std::array<uint32_t, 2>>(out_64); |
| 1742 | SetReg32(system, 1, out_64_scatter[0]); | 1742 | SetArg32(args, 1, out_64_scatter[0]); |
| 1743 | SetReg32(system, 2, out_64_scatter[1]); | 1743 | SetArg32(args, 2, out_64_scatter[1]); |
| 1744 | SetReg32(system, 3, Convert<uint32_t>(out_32)); | 1744 | SetArg32(args, 3, Convert<uint32_t>(out_32)); |
| 1745 | } | 1745 | } |
| 1746 | 1746 | ||
| 1747 | static void SvcWrap_GetSystemInfo64From32(Core::System& system) { | 1747 | static void SvcWrap_GetSystemInfo64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 1748 | Result ret{}; | 1748 | Result ret{}; |
| 1749 | 1749 | ||
| 1750 | uint64_t out{}; | 1750 | uint64_t out{}; |
| @@ -1752,22 +1752,22 @@ static void SvcWrap_GetSystemInfo64From32(Core::System& system) { | |||
| 1752 | Handle handle{}; | 1752 | Handle handle{}; |
| 1753 | uint64_t info_subtype{}; | 1753 | uint64_t info_subtype{}; |
| 1754 | 1754 | ||
| 1755 | info_type = Convert<SystemInfoType>(GetReg32(system, 1)); | 1755 | info_type = Convert<SystemInfoType>(GetArg32(args, 1)); |
| 1756 | handle = Convert<Handle>(GetReg32(system, 2)); | 1756 | handle = Convert<Handle>(GetArg32(args, 2)); |
| 1757 | std::array<uint32_t, 2> info_subtype_gather{}; | 1757 | std::array<uint32_t, 2> info_subtype_gather{}; |
| 1758 | info_subtype_gather[0] = GetReg32(system, 0); | 1758 | info_subtype_gather[0] = GetArg32(args, 0); |
| 1759 | info_subtype_gather[1] = GetReg32(system, 3); | 1759 | info_subtype_gather[1] = GetArg32(args, 3); |
| 1760 | info_subtype = Convert<uint64_t>(info_subtype_gather); | 1760 | info_subtype = Convert<uint64_t>(info_subtype_gather); |
| 1761 | 1761 | ||
| 1762 | ret = GetSystemInfo64From32(system, std::addressof(out), info_type, handle, info_subtype); | 1762 | ret = GetSystemInfo64From32(system, std::addressof(out), info_type, handle, info_subtype); |
| 1763 | 1763 | ||
| 1764 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 1764 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 1765 | auto out_scatter = Convert<std::array<uint32_t, 2>>(out); | 1765 | auto out_scatter = Convert<std::array<uint32_t, 2>>(out); |
| 1766 | SetReg32(system, 1, out_scatter[0]); | 1766 | SetArg32(args, 1, out_scatter[0]); |
| 1767 | SetReg32(system, 2, out_scatter[1]); | 1767 | SetArg32(args, 2, out_scatter[1]); |
| 1768 | } | 1768 | } |
| 1769 | 1769 | ||
| 1770 | static void SvcWrap_CreatePort64From32(Core::System& system) { | 1770 | static void SvcWrap_CreatePort64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 1771 | Result ret{}; | 1771 | Result ret{}; |
| 1772 | 1772 | ||
| 1773 | Handle out_server_handle{}; | 1773 | Handle out_server_handle{}; |
| @@ -1776,48 +1776,48 @@ static void SvcWrap_CreatePort64From32(Core::System& system) { | |||
| 1776 | bool is_light{}; | 1776 | bool is_light{}; |
| 1777 | uint32_t name{}; | 1777 | uint32_t name{}; |
| 1778 | 1778 | ||
| 1779 | max_sessions = Convert<int32_t>(GetReg32(system, 2)); | 1779 | max_sessions = Convert<int32_t>(GetArg32(args, 2)); |
| 1780 | is_light = Convert<bool>(GetReg32(system, 3)); | 1780 | is_light = Convert<bool>(GetArg32(args, 3)); |
| 1781 | name = Convert<uint32_t>(GetReg32(system, 0)); | 1781 | name = Convert<uint32_t>(GetArg32(args, 0)); |
| 1782 | 1782 | ||
| 1783 | ret = CreatePort64From32(system, std::addressof(out_server_handle), std::addressof(out_client_handle), max_sessions, is_light, name); | 1783 | ret = CreatePort64From32(system, std::addressof(out_server_handle), std::addressof(out_client_handle), max_sessions, is_light, name); |
| 1784 | 1784 | ||
| 1785 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 1785 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 1786 | SetReg32(system, 1, Convert<uint32_t>(out_server_handle)); | 1786 | SetArg32(args, 1, Convert<uint32_t>(out_server_handle)); |
| 1787 | SetReg32(system, 2, Convert<uint32_t>(out_client_handle)); | 1787 | SetArg32(args, 2, Convert<uint32_t>(out_client_handle)); |
| 1788 | } | 1788 | } |
| 1789 | 1789 | ||
| 1790 | static void SvcWrap_ManageNamedPort64From32(Core::System& system) { | 1790 | static void SvcWrap_ManageNamedPort64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 1791 | Result ret{}; | 1791 | Result ret{}; |
| 1792 | 1792 | ||
| 1793 | Handle out_server_handle{}; | 1793 | Handle out_server_handle{}; |
| 1794 | uint32_t name{}; | 1794 | uint32_t name{}; |
| 1795 | int32_t max_sessions{}; | 1795 | int32_t max_sessions{}; |
| 1796 | 1796 | ||
| 1797 | name = Convert<uint32_t>(GetReg32(system, 1)); | 1797 | name = Convert<uint32_t>(GetArg32(args, 1)); |
| 1798 | max_sessions = Convert<int32_t>(GetReg32(system, 2)); | 1798 | max_sessions = Convert<int32_t>(GetArg32(args, 2)); |
| 1799 | 1799 | ||
| 1800 | ret = ManageNamedPort64From32(system, std::addressof(out_server_handle), name, max_sessions); | 1800 | ret = ManageNamedPort64From32(system, std::addressof(out_server_handle), name, max_sessions); |
| 1801 | 1801 | ||
| 1802 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 1802 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 1803 | SetReg32(system, 1, Convert<uint32_t>(out_server_handle)); | 1803 | SetArg32(args, 1, Convert<uint32_t>(out_server_handle)); |
| 1804 | } | 1804 | } |
| 1805 | 1805 | ||
| 1806 | static void SvcWrap_ConnectToPort64From32(Core::System& system) { | 1806 | static void SvcWrap_ConnectToPort64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 1807 | Result ret{}; | 1807 | Result ret{}; |
| 1808 | 1808 | ||
| 1809 | Handle out_handle{}; | 1809 | Handle out_handle{}; |
| 1810 | Handle port{}; | 1810 | Handle port{}; |
| 1811 | 1811 | ||
| 1812 | port = Convert<Handle>(GetReg32(system, 1)); | 1812 | port = Convert<Handle>(GetArg32(args, 1)); |
| 1813 | 1813 | ||
| 1814 | ret = ConnectToPort64From32(system, std::addressof(out_handle), port); | 1814 | ret = ConnectToPort64From32(system, std::addressof(out_handle), port); |
| 1815 | 1815 | ||
| 1816 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 1816 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 1817 | SetReg32(system, 1, Convert<uint32_t>(out_handle)); | 1817 | SetArg32(args, 1, Convert<uint32_t>(out_handle)); |
| 1818 | } | 1818 | } |
| 1819 | 1819 | ||
| 1820 | static void SvcWrap_SetProcessMemoryPermission64From32(Core::System& system) { | 1820 | static void SvcWrap_SetProcessMemoryPermission64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 1821 | Result ret{}; | 1821 | Result ret{}; |
| 1822 | 1822 | ||
| 1823 | Handle process_handle{}; | 1823 | Handle process_handle{}; |
| @@ -1825,23 +1825,23 @@ static void SvcWrap_SetProcessMemoryPermission64From32(Core::System& system) { | |||
| 1825 | uint64_t size{}; | 1825 | uint64_t size{}; |
| 1826 | MemoryPermission perm{}; | 1826 | MemoryPermission perm{}; |
| 1827 | 1827 | ||
| 1828 | process_handle = Convert<Handle>(GetReg32(system, 0)); | 1828 | process_handle = Convert<Handle>(GetArg32(args, 0)); |
| 1829 | std::array<uint32_t, 2> address_gather{}; | 1829 | std::array<uint32_t, 2> address_gather{}; |
| 1830 | address_gather[0] = GetReg32(system, 2); | 1830 | address_gather[0] = GetArg32(args, 2); |
| 1831 | address_gather[1] = GetReg32(system, 3); | 1831 | address_gather[1] = GetArg32(args, 3); |
| 1832 | address = Convert<uint64_t>(address_gather); | 1832 | address = Convert<uint64_t>(address_gather); |
| 1833 | std::array<uint32_t, 2> size_gather{}; | 1833 | std::array<uint32_t, 2> size_gather{}; |
| 1834 | size_gather[0] = GetReg32(system, 1); | 1834 | size_gather[0] = GetArg32(args, 1); |
| 1835 | size_gather[1] = GetReg32(system, 4); | 1835 | size_gather[1] = GetArg32(args, 4); |
| 1836 | size = Convert<uint64_t>(size_gather); | 1836 | size = Convert<uint64_t>(size_gather); |
| 1837 | perm = Convert<MemoryPermission>(GetReg32(system, 5)); | 1837 | perm = Convert<MemoryPermission>(GetArg32(args, 5)); |
| 1838 | 1838 | ||
| 1839 | ret = SetProcessMemoryPermission64From32(system, process_handle, address, size, perm); | 1839 | ret = SetProcessMemoryPermission64From32(system, process_handle, address, size, perm); |
| 1840 | 1840 | ||
| 1841 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 1841 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 1842 | } | 1842 | } |
| 1843 | 1843 | ||
| 1844 | static void SvcWrap_MapProcessMemory64From32(Core::System& system) { | 1844 | static void SvcWrap_MapProcessMemory64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 1845 | Result ret{}; | 1845 | Result ret{}; |
| 1846 | 1846 | ||
| 1847 | uint32_t dst_address{}; | 1847 | uint32_t dst_address{}; |
| @@ -1849,20 +1849,20 @@ static void SvcWrap_MapProcessMemory64From32(Core::System& system) { | |||
| 1849 | uint64_t src_address{}; | 1849 | uint64_t src_address{}; |
| 1850 | uint32_t size{}; | 1850 | uint32_t size{}; |
| 1851 | 1851 | ||
| 1852 | dst_address = Convert<uint32_t>(GetReg32(system, 0)); | 1852 | dst_address = Convert<uint32_t>(GetArg32(args, 0)); |
| 1853 | process_handle = Convert<Handle>(GetReg32(system, 1)); | 1853 | process_handle = Convert<Handle>(GetArg32(args, 1)); |
| 1854 | std::array<uint32_t, 2> src_address_gather{}; | 1854 | std::array<uint32_t, 2> src_address_gather{}; |
| 1855 | src_address_gather[0] = GetReg32(system, 2); | 1855 | src_address_gather[0] = GetArg32(args, 2); |
| 1856 | src_address_gather[1] = GetReg32(system, 3); | 1856 | src_address_gather[1] = GetArg32(args, 3); |
| 1857 | src_address = Convert<uint64_t>(src_address_gather); | 1857 | src_address = Convert<uint64_t>(src_address_gather); |
| 1858 | size = Convert<uint32_t>(GetReg32(system, 4)); | 1858 | size = Convert<uint32_t>(GetArg32(args, 4)); |
| 1859 | 1859 | ||
| 1860 | ret = MapProcessMemory64From32(system, dst_address, process_handle, src_address, size); | 1860 | ret = MapProcessMemory64From32(system, dst_address, process_handle, src_address, size); |
| 1861 | 1861 | ||
| 1862 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 1862 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 1863 | } | 1863 | } |
| 1864 | 1864 | ||
| 1865 | static void SvcWrap_UnmapProcessMemory64From32(Core::System& system) { | 1865 | static void SvcWrap_UnmapProcessMemory64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 1866 | Result ret{}; | 1866 | Result ret{}; |
| 1867 | 1867 | ||
| 1868 | uint32_t dst_address{}; | 1868 | uint32_t dst_address{}; |
| @@ -1870,20 +1870,20 @@ static void SvcWrap_UnmapProcessMemory64From32(Core::System& system) { | |||
| 1870 | uint64_t src_address{}; | 1870 | uint64_t src_address{}; |
| 1871 | uint32_t size{}; | 1871 | uint32_t size{}; |
| 1872 | 1872 | ||
| 1873 | dst_address = Convert<uint32_t>(GetReg32(system, 0)); | 1873 | dst_address = Convert<uint32_t>(GetArg32(args, 0)); |
| 1874 | process_handle = Convert<Handle>(GetReg32(system, 1)); | 1874 | process_handle = Convert<Handle>(GetArg32(args, 1)); |
| 1875 | std::array<uint32_t, 2> src_address_gather{}; | 1875 | std::array<uint32_t, 2> src_address_gather{}; |
| 1876 | src_address_gather[0] = GetReg32(system, 2); | 1876 | src_address_gather[0] = GetArg32(args, 2); |
| 1877 | src_address_gather[1] = GetReg32(system, 3); | 1877 | src_address_gather[1] = GetArg32(args, 3); |
| 1878 | src_address = Convert<uint64_t>(src_address_gather); | 1878 | src_address = Convert<uint64_t>(src_address_gather); |
| 1879 | size = Convert<uint32_t>(GetReg32(system, 4)); | 1879 | size = Convert<uint32_t>(GetArg32(args, 4)); |
| 1880 | 1880 | ||
| 1881 | ret = UnmapProcessMemory64From32(system, dst_address, process_handle, src_address, size); | 1881 | ret = UnmapProcessMemory64From32(system, dst_address, process_handle, src_address, size); |
| 1882 | 1882 | ||
| 1883 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 1883 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 1884 | } | 1884 | } |
| 1885 | 1885 | ||
| 1886 | static void SvcWrap_QueryProcessMemory64From32(Core::System& system) { | 1886 | static void SvcWrap_QueryProcessMemory64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 1887 | Result ret{}; | 1887 | Result ret{}; |
| 1888 | 1888 | ||
| 1889 | PageInfo out_page_info{}; | 1889 | PageInfo out_page_info{}; |
| @@ -1891,20 +1891,20 @@ static void SvcWrap_QueryProcessMemory64From32(Core::System& system) { | |||
| 1891 | Handle process_handle{}; | 1891 | Handle process_handle{}; |
| 1892 | uint64_t address{}; | 1892 | uint64_t address{}; |
| 1893 | 1893 | ||
| 1894 | out_memory_info = Convert<uint32_t>(GetReg32(system, 0)); | 1894 | out_memory_info = Convert<uint32_t>(GetArg32(args, 0)); |
| 1895 | process_handle = Convert<Handle>(GetReg32(system, 2)); | 1895 | process_handle = Convert<Handle>(GetArg32(args, 2)); |
| 1896 | std::array<uint32_t, 2> address_gather{}; | 1896 | std::array<uint32_t, 2> address_gather{}; |
| 1897 | address_gather[0] = GetReg32(system, 1); | 1897 | address_gather[0] = GetArg32(args, 1); |
| 1898 | address_gather[1] = GetReg32(system, 3); | 1898 | address_gather[1] = GetArg32(args, 3); |
| 1899 | address = Convert<uint64_t>(address_gather); | 1899 | address = Convert<uint64_t>(address_gather); |
| 1900 | 1900 | ||
| 1901 | ret = QueryProcessMemory64From32(system, out_memory_info, std::addressof(out_page_info), process_handle, address); | 1901 | ret = QueryProcessMemory64From32(system, out_memory_info, std::addressof(out_page_info), process_handle, address); |
| 1902 | 1902 | ||
| 1903 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 1903 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 1904 | SetReg32(system, 1, Convert<uint32_t>(out_page_info)); | 1904 | SetArg32(args, 1, Convert<uint32_t>(out_page_info)); |
| 1905 | } | 1905 | } |
| 1906 | 1906 | ||
| 1907 | static void SvcWrap_MapProcessCodeMemory64From32(Core::System& system) { | 1907 | static void SvcWrap_MapProcessCodeMemory64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 1908 | Result ret{}; | 1908 | Result ret{}; |
| 1909 | 1909 | ||
| 1910 | Handle process_handle{}; | 1910 | Handle process_handle{}; |
| @@ -1912,26 +1912,26 @@ static void SvcWrap_MapProcessCodeMemory64From32(Core::System& system) { | |||
| 1912 | uint64_t src_address{}; | 1912 | uint64_t src_address{}; |
| 1913 | uint64_t size{}; | 1913 | uint64_t size{}; |
| 1914 | 1914 | ||
| 1915 | process_handle = Convert<Handle>(GetReg32(system, 0)); | 1915 | process_handle = Convert<Handle>(GetArg32(args, 0)); |
| 1916 | std::array<uint32_t, 2> dst_address_gather{}; | 1916 | std::array<uint32_t, 2> dst_address_gather{}; |
| 1917 | dst_address_gather[0] = GetReg32(system, 2); | 1917 | dst_address_gather[0] = GetArg32(args, 2); |
| 1918 | dst_address_gather[1] = GetReg32(system, 3); | 1918 | dst_address_gather[1] = GetArg32(args, 3); |
| 1919 | dst_address = Convert<uint64_t>(dst_address_gather); | 1919 | dst_address = Convert<uint64_t>(dst_address_gather); |
| 1920 | std::array<uint32_t, 2> src_address_gather{}; | 1920 | std::array<uint32_t, 2> src_address_gather{}; |
| 1921 | src_address_gather[0] = GetReg32(system, 1); | 1921 | src_address_gather[0] = GetArg32(args, 1); |
| 1922 | src_address_gather[1] = GetReg32(system, 4); | 1922 | src_address_gather[1] = GetArg32(args, 4); |
| 1923 | src_address = Convert<uint64_t>(src_address_gather); | 1923 | src_address = Convert<uint64_t>(src_address_gather); |
| 1924 | std::array<uint32_t, 2> size_gather{}; | 1924 | std::array<uint32_t, 2> size_gather{}; |
| 1925 | size_gather[0] = GetReg32(system, 5); | 1925 | size_gather[0] = GetArg32(args, 5); |
| 1926 | size_gather[1] = GetReg32(system, 6); | 1926 | size_gather[1] = GetArg32(args, 6); |
| 1927 | size = Convert<uint64_t>(size_gather); | 1927 | size = Convert<uint64_t>(size_gather); |
| 1928 | 1928 | ||
| 1929 | ret = MapProcessCodeMemory64From32(system, process_handle, dst_address, src_address, size); | 1929 | ret = MapProcessCodeMemory64From32(system, process_handle, dst_address, src_address, size); |
| 1930 | 1930 | ||
| 1931 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 1931 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 1932 | } | 1932 | } |
| 1933 | 1933 | ||
| 1934 | static void SvcWrap_UnmapProcessCodeMemory64From32(Core::System& system) { | 1934 | static void SvcWrap_UnmapProcessCodeMemory64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 1935 | Result ret{}; | 1935 | Result ret{}; |
| 1936 | 1936 | ||
| 1937 | Handle process_handle{}; | 1937 | Handle process_handle{}; |
| @@ -1939,26 +1939,26 @@ static void SvcWrap_UnmapProcessCodeMemory64From32(Core::System& system) { | |||
| 1939 | uint64_t src_address{}; | 1939 | uint64_t src_address{}; |
| 1940 | uint64_t size{}; | 1940 | uint64_t size{}; |
| 1941 | 1941 | ||
| 1942 | process_handle = Convert<Handle>(GetReg32(system, 0)); | 1942 | process_handle = Convert<Handle>(GetArg32(args, 0)); |
| 1943 | std::array<uint32_t, 2> dst_address_gather{}; | 1943 | std::array<uint32_t, 2> dst_address_gather{}; |
| 1944 | dst_address_gather[0] = GetReg32(system, 2); | 1944 | dst_address_gather[0] = GetArg32(args, 2); |
| 1945 | dst_address_gather[1] = GetReg32(system, 3); | 1945 | dst_address_gather[1] = GetArg32(args, 3); |
| 1946 | dst_address = Convert<uint64_t>(dst_address_gather); | 1946 | dst_address = Convert<uint64_t>(dst_address_gather); |
| 1947 | std::array<uint32_t, 2> src_address_gather{}; | 1947 | std::array<uint32_t, 2> src_address_gather{}; |
| 1948 | src_address_gather[0] = GetReg32(system, 1); | 1948 | src_address_gather[0] = GetArg32(args, 1); |
| 1949 | src_address_gather[1] = GetReg32(system, 4); | 1949 | src_address_gather[1] = GetArg32(args, 4); |
| 1950 | src_address = Convert<uint64_t>(src_address_gather); | 1950 | src_address = Convert<uint64_t>(src_address_gather); |
| 1951 | std::array<uint32_t, 2> size_gather{}; | 1951 | std::array<uint32_t, 2> size_gather{}; |
| 1952 | size_gather[0] = GetReg32(system, 5); | 1952 | size_gather[0] = GetArg32(args, 5); |
| 1953 | size_gather[1] = GetReg32(system, 6); | 1953 | size_gather[1] = GetArg32(args, 6); |
| 1954 | size = Convert<uint64_t>(size_gather); | 1954 | size = Convert<uint64_t>(size_gather); |
| 1955 | 1955 | ||
| 1956 | ret = UnmapProcessCodeMemory64From32(system, process_handle, dst_address, src_address, size); | 1956 | ret = UnmapProcessCodeMemory64From32(system, process_handle, dst_address, src_address, size); |
| 1957 | 1957 | ||
| 1958 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 1958 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 1959 | } | 1959 | } |
| 1960 | 1960 | ||
| 1961 | static void SvcWrap_CreateProcess64From32(Core::System& system) { | 1961 | static void SvcWrap_CreateProcess64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 1962 | Result ret{}; | 1962 | Result ret{}; |
| 1963 | 1963 | ||
| 1964 | Handle out_handle{}; | 1964 | Handle out_handle{}; |
| @@ -1966,17 +1966,17 @@ static void SvcWrap_CreateProcess64From32(Core::System& system) { | |||
| 1966 | uint32_t caps{}; | 1966 | uint32_t caps{}; |
| 1967 | int32_t num_caps{}; | 1967 | int32_t num_caps{}; |
| 1968 | 1968 | ||
| 1969 | parameters = Convert<uint32_t>(GetReg32(system, 1)); | 1969 | parameters = Convert<uint32_t>(GetArg32(args, 1)); |
| 1970 | caps = Convert<uint32_t>(GetReg32(system, 2)); | 1970 | caps = Convert<uint32_t>(GetArg32(args, 2)); |
| 1971 | num_caps = Convert<int32_t>(GetReg32(system, 3)); | 1971 | num_caps = Convert<int32_t>(GetArg32(args, 3)); |
| 1972 | 1972 | ||
| 1973 | ret = CreateProcess64From32(system, std::addressof(out_handle), parameters, caps, num_caps); | 1973 | ret = CreateProcess64From32(system, std::addressof(out_handle), parameters, caps, num_caps); |
| 1974 | 1974 | ||
| 1975 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 1975 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 1976 | SetReg32(system, 1, Convert<uint32_t>(out_handle)); | 1976 | SetArg32(args, 1, Convert<uint32_t>(out_handle)); |
| 1977 | } | 1977 | } |
| 1978 | 1978 | ||
| 1979 | static void SvcWrap_StartProcess64From32(Core::System& system) { | 1979 | static void SvcWrap_StartProcess64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 1980 | Result ret{}; | 1980 | Result ret{}; |
| 1981 | 1981 | ||
| 1982 | Handle process_handle{}; | 1982 | Handle process_handle{}; |
| @@ -1984,138 +1984,138 @@ static void SvcWrap_StartProcess64From32(Core::System& system) { | |||
| 1984 | int32_t core_id{}; | 1984 | int32_t core_id{}; |
| 1985 | uint64_t main_thread_stack_size{}; | 1985 | uint64_t main_thread_stack_size{}; |
| 1986 | 1986 | ||
| 1987 | process_handle = Convert<Handle>(GetReg32(system, 0)); | 1987 | process_handle = Convert<Handle>(GetArg32(args, 0)); |
| 1988 | priority = Convert<int32_t>(GetReg32(system, 1)); | 1988 | priority = Convert<int32_t>(GetArg32(args, 1)); |
| 1989 | core_id = Convert<int32_t>(GetReg32(system, 2)); | 1989 | core_id = Convert<int32_t>(GetArg32(args, 2)); |
| 1990 | std::array<uint32_t, 2> main_thread_stack_size_gather{}; | 1990 | std::array<uint32_t, 2> main_thread_stack_size_gather{}; |
| 1991 | main_thread_stack_size_gather[0] = GetReg32(system, 3); | 1991 | main_thread_stack_size_gather[0] = GetArg32(args, 3); |
| 1992 | main_thread_stack_size_gather[1] = GetReg32(system, 4); | 1992 | main_thread_stack_size_gather[1] = GetArg32(args, 4); |
| 1993 | main_thread_stack_size = Convert<uint64_t>(main_thread_stack_size_gather); | 1993 | main_thread_stack_size = Convert<uint64_t>(main_thread_stack_size_gather); |
| 1994 | 1994 | ||
| 1995 | ret = StartProcess64From32(system, process_handle, priority, core_id, main_thread_stack_size); | 1995 | ret = StartProcess64From32(system, process_handle, priority, core_id, main_thread_stack_size); |
| 1996 | 1996 | ||
| 1997 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 1997 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 1998 | } | 1998 | } |
| 1999 | 1999 | ||
| 2000 | static void SvcWrap_TerminateProcess64From32(Core::System& system) { | 2000 | static void SvcWrap_TerminateProcess64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 2001 | Result ret{}; | 2001 | Result ret{}; |
| 2002 | 2002 | ||
| 2003 | Handle process_handle{}; | 2003 | Handle process_handle{}; |
| 2004 | 2004 | ||
| 2005 | process_handle = Convert<Handle>(GetReg32(system, 0)); | 2005 | process_handle = Convert<Handle>(GetArg32(args, 0)); |
| 2006 | 2006 | ||
| 2007 | ret = TerminateProcess64From32(system, process_handle); | 2007 | ret = TerminateProcess64From32(system, process_handle); |
| 2008 | 2008 | ||
| 2009 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 2009 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 2010 | } | 2010 | } |
| 2011 | 2011 | ||
| 2012 | static void SvcWrap_GetProcessInfo64From32(Core::System& system) { | 2012 | static void SvcWrap_GetProcessInfo64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 2013 | Result ret{}; | 2013 | Result ret{}; |
| 2014 | 2014 | ||
| 2015 | int64_t out_info{}; | 2015 | int64_t out_info{}; |
| 2016 | Handle process_handle{}; | 2016 | Handle process_handle{}; |
| 2017 | ProcessInfoType info_type{}; | 2017 | ProcessInfoType info_type{}; |
| 2018 | 2018 | ||
| 2019 | process_handle = Convert<Handle>(GetReg32(system, 1)); | 2019 | process_handle = Convert<Handle>(GetArg32(args, 1)); |
| 2020 | info_type = Convert<ProcessInfoType>(GetReg32(system, 2)); | 2020 | info_type = Convert<ProcessInfoType>(GetArg32(args, 2)); |
| 2021 | 2021 | ||
| 2022 | ret = GetProcessInfo64From32(system, std::addressof(out_info), process_handle, info_type); | 2022 | ret = GetProcessInfo64From32(system, std::addressof(out_info), process_handle, info_type); |
| 2023 | 2023 | ||
| 2024 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 2024 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 2025 | auto out_info_scatter = Convert<std::array<uint32_t, 2>>(out_info); | 2025 | auto out_info_scatter = Convert<std::array<uint32_t, 2>>(out_info); |
| 2026 | SetReg32(system, 1, out_info_scatter[0]); | 2026 | SetArg32(args, 1, out_info_scatter[0]); |
| 2027 | SetReg32(system, 2, out_info_scatter[1]); | 2027 | SetArg32(args, 2, out_info_scatter[1]); |
| 2028 | } | 2028 | } |
| 2029 | 2029 | ||
| 2030 | static void SvcWrap_CreateResourceLimit64From32(Core::System& system) { | 2030 | static void SvcWrap_CreateResourceLimit64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 2031 | Result ret{}; | 2031 | Result ret{}; |
| 2032 | 2032 | ||
| 2033 | Handle out_handle{}; | 2033 | Handle out_handle{}; |
| 2034 | 2034 | ||
| 2035 | ret = CreateResourceLimit64From32(system, std::addressof(out_handle)); | 2035 | ret = CreateResourceLimit64From32(system, std::addressof(out_handle)); |
| 2036 | 2036 | ||
| 2037 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 2037 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 2038 | SetReg32(system, 1, Convert<uint32_t>(out_handle)); | 2038 | SetArg32(args, 1, Convert<uint32_t>(out_handle)); |
| 2039 | } | 2039 | } |
| 2040 | 2040 | ||
| 2041 | static void SvcWrap_SetResourceLimitLimitValue64From32(Core::System& system) { | 2041 | static void SvcWrap_SetResourceLimitLimitValue64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 2042 | Result ret{}; | 2042 | Result ret{}; |
| 2043 | 2043 | ||
| 2044 | Handle resource_limit_handle{}; | 2044 | Handle resource_limit_handle{}; |
| 2045 | LimitableResource which{}; | 2045 | LimitableResource which{}; |
| 2046 | int64_t limit_value{}; | 2046 | int64_t limit_value{}; |
| 2047 | 2047 | ||
| 2048 | resource_limit_handle = Convert<Handle>(GetReg32(system, 0)); | 2048 | resource_limit_handle = Convert<Handle>(GetArg32(args, 0)); |
| 2049 | which = Convert<LimitableResource>(GetReg32(system, 1)); | 2049 | which = Convert<LimitableResource>(GetArg32(args, 1)); |
| 2050 | std::array<uint32_t, 2> limit_value_gather{}; | 2050 | std::array<uint32_t, 2> limit_value_gather{}; |
| 2051 | limit_value_gather[0] = GetReg32(system, 2); | 2051 | limit_value_gather[0] = GetArg32(args, 2); |
| 2052 | limit_value_gather[1] = GetReg32(system, 3); | 2052 | limit_value_gather[1] = GetArg32(args, 3); |
| 2053 | limit_value = Convert<int64_t>(limit_value_gather); | 2053 | limit_value = Convert<int64_t>(limit_value_gather); |
| 2054 | 2054 | ||
| 2055 | ret = SetResourceLimitLimitValue64From32(system, resource_limit_handle, which, limit_value); | 2055 | ret = SetResourceLimitLimitValue64From32(system, resource_limit_handle, which, limit_value); |
| 2056 | 2056 | ||
| 2057 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 2057 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 2058 | } | 2058 | } |
| 2059 | 2059 | ||
| 2060 | static void SvcWrap_MapInsecureMemory64From32(Core::System& system) { | 2060 | static void SvcWrap_MapInsecureMemory64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 2061 | Result ret{}; | 2061 | Result ret{}; |
| 2062 | 2062 | ||
| 2063 | uint32_t address{}; | 2063 | uint32_t address{}; |
| 2064 | uint32_t size{}; | 2064 | uint32_t size{}; |
| 2065 | 2065 | ||
| 2066 | address = Convert<uint32_t>(GetReg32(system, 0)); | 2066 | address = Convert<uint32_t>(GetArg32(args, 0)); |
| 2067 | size = Convert<uint32_t>(GetReg32(system, 1)); | 2067 | size = Convert<uint32_t>(GetArg32(args, 1)); |
| 2068 | 2068 | ||
| 2069 | ret = MapInsecureMemory64From32(system, address, size); | 2069 | ret = MapInsecureMemory64From32(system, address, size); |
| 2070 | 2070 | ||
| 2071 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 2071 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 2072 | } | 2072 | } |
| 2073 | 2073 | ||
| 2074 | static void SvcWrap_UnmapInsecureMemory64From32(Core::System& system) { | 2074 | static void SvcWrap_UnmapInsecureMemory64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 2075 | Result ret{}; | 2075 | Result ret{}; |
| 2076 | 2076 | ||
| 2077 | uint32_t address{}; | 2077 | uint32_t address{}; |
| 2078 | uint32_t size{}; | 2078 | uint32_t size{}; |
| 2079 | 2079 | ||
| 2080 | address = Convert<uint32_t>(GetReg32(system, 0)); | 2080 | address = Convert<uint32_t>(GetArg32(args, 0)); |
| 2081 | size = Convert<uint32_t>(GetReg32(system, 1)); | 2081 | size = Convert<uint32_t>(GetArg32(args, 1)); |
| 2082 | 2082 | ||
| 2083 | ret = UnmapInsecureMemory64From32(system, address, size); | 2083 | ret = UnmapInsecureMemory64From32(system, address, size); |
| 2084 | 2084 | ||
| 2085 | SetReg32(system, 0, Convert<uint32_t>(ret)); | 2085 | SetArg32(args, 0, Convert<uint32_t>(ret)); |
| 2086 | } | 2086 | } |
| 2087 | 2087 | ||
| 2088 | static void SvcWrap_SetHeapSize64(Core::System& system) { | 2088 | static void SvcWrap_SetHeapSize64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2089 | Result ret{}; | 2089 | Result ret{}; |
| 2090 | 2090 | ||
| 2091 | uint64_t out_address{}; | 2091 | uint64_t out_address{}; |
| 2092 | uint64_t size{}; | 2092 | uint64_t size{}; |
| 2093 | 2093 | ||
| 2094 | size = Convert<uint64_t>(GetReg64(system, 1)); | 2094 | size = Convert<uint64_t>(GetArg64(args, 1)); |
| 2095 | 2095 | ||
| 2096 | ret = SetHeapSize64(system, std::addressof(out_address), size); | 2096 | ret = SetHeapSize64(system, std::addressof(out_address), size); |
| 2097 | 2097 | ||
| 2098 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 2098 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 2099 | SetReg64(system, 1, Convert<uint64_t>(out_address)); | 2099 | SetArg64(args, 1, Convert<uint64_t>(out_address)); |
| 2100 | } | 2100 | } |
| 2101 | 2101 | ||
| 2102 | static void SvcWrap_SetMemoryPermission64(Core::System& system) { | 2102 | static void SvcWrap_SetMemoryPermission64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2103 | Result ret{}; | 2103 | Result ret{}; |
| 2104 | 2104 | ||
| 2105 | uint64_t address{}; | 2105 | uint64_t address{}; |
| 2106 | uint64_t size{}; | 2106 | uint64_t size{}; |
| 2107 | MemoryPermission perm{}; | 2107 | MemoryPermission perm{}; |
| 2108 | 2108 | ||
| 2109 | address = Convert<uint64_t>(GetReg64(system, 0)); | 2109 | address = Convert<uint64_t>(GetArg64(args, 0)); |
| 2110 | size = Convert<uint64_t>(GetReg64(system, 1)); | 2110 | size = Convert<uint64_t>(GetArg64(args, 1)); |
| 2111 | perm = Convert<MemoryPermission>(GetReg64(system, 2)); | 2111 | perm = Convert<MemoryPermission>(GetArg64(args, 2)); |
| 2112 | 2112 | ||
| 2113 | ret = SetMemoryPermission64(system, address, size, perm); | 2113 | ret = SetMemoryPermission64(system, address, size, perm); |
| 2114 | 2114 | ||
| 2115 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 2115 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 2116 | } | 2116 | } |
| 2117 | 2117 | ||
| 2118 | static void SvcWrap_SetMemoryAttribute64(Core::System& system) { | 2118 | static void SvcWrap_SetMemoryAttribute64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2119 | Result ret{}; | 2119 | Result ret{}; |
| 2120 | 2120 | ||
| 2121 | uint64_t address{}; | 2121 | uint64_t address{}; |
| @@ -2123,69 +2123,69 @@ static void SvcWrap_SetMemoryAttribute64(Core::System& system) { | |||
| 2123 | uint32_t mask{}; | 2123 | uint32_t mask{}; |
| 2124 | uint32_t attr{}; | 2124 | uint32_t attr{}; |
| 2125 | 2125 | ||
| 2126 | address = Convert<uint64_t>(GetReg64(system, 0)); | 2126 | address = Convert<uint64_t>(GetArg64(args, 0)); |
| 2127 | size = Convert<uint64_t>(GetReg64(system, 1)); | 2127 | size = Convert<uint64_t>(GetArg64(args, 1)); |
| 2128 | mask = Convert<uint32_t>(GetReg64(system, 2)); | 2128 | mask = Convert<uint32_t>(GetArg64(args, 2)); |
| 2129 | attr = Convert<uint32_t>(GetReg64(system, 3)); | 2129 | attr = Convert<uint32_t>(GetArg64(args, 3)); |
| 2130 | 2130 | ||
| 2131 | ret = SetMemoryAttribute64(system, address, size, mask, attr); | 2131 | ret = SetMemoryAttribute64(system, address, size, mask, attr); |
| 2132 | 2132 | ||
| 2133 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 2133 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 2134 | } | 2134 | } |
| 2135 | 2135 | ||
| 2136 | static void SvcWrap_MapMemory64(Core::System& system) { | 2136 | static void SvcWrap_MapMemory64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2137 | Result ret{}; | 2137 | Result ret{}; |
| 2138 | 2138 | ||
| 2139 | uint64_t dst_address{}; | 2139 | uint64_t dst_address{}; |
| 2140 | uint64_t src_address{}; | 2140 | uint64_t src_address{}; |
| 2141 | uint64_t size{}; | 2141 | uint64_t size{}; |
| 2142 | 2142 | ||
| 2143 | dst_address = Convert<uint64_t>(GetReg64(system, 0)); | 2143 | dst_address = Convert<uint64_t>(GetArg64(args, 0)); |
| 2144 | src_address = Convert<uint64_t>(GetReg64(system, 1)); | 2144 | src_address = Convert<uint64_t>(GetArg64(args, 1)); |
| 2145 | size = Convert<uint64_t>(GetReg64(system, 2)); | 2145 | size = Convert<uint64_t>(GetArg64(args, 2)); |
| 2146 | 2146 | ||
| 2147 | ret = MapMemory64(system, dst_address, src_address, size); | 2147 | ret = MapMemory64(system, dst_address, src_address, size); |
| 2148 | 2148 | ||
| 2149 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 2149 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 2150 | } | 2150 | } |
| 2151 | 2151 | ||
| 2152 | static void SvcWrap_UnmapMemory64(Core::System& system) { | 2152 | static void SvcWrap_UnmapMemory64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2153 | Result ret{}; | 2153 | Result ret{}; |
| 2154 | 2154 | ||
| 2155 | uint64_t dst_address{}; | 2155 | uint64_t dst_address{}; |
| 2156 | uint64_t src_address{}; | 2156 | uint64_t src_address{}; |
| 2157 | uint64_t size{}; | 2157 | uint64_t size{}; |
| 2158 | 2158 | ||
| 2159 | dst_address = Convert<uint64_t>(GetReg64(system, 0)); | 2159 | dst_address = Convert<uint64_t>(GetArg64(args, 0)); |
| 2160 | src_address = Convert<uint64_t>(GetReg64(system, 1)); | 2160 | src_address = Convert<uint64_t>(GetArg64(args, 1)); |
| 2161 | size = Convert<uint64_t>(GetReg64(system, 2)); | 2161 | size = Convert<uint64_t>(GetArg64(args, 2)); |
| 2162 | 2162 | ||
| 2163 | ret = UnmapMemory64(system, dst_address, src_address, size); | 2163 | ret = UnmapMemory64(system, dst_address, src_address, size); |
| 2164 | 2164 | ||
| 2165 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 2165 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 2166 | } | 2166 | } |
| 2167 | 2167 | ||
| 2168 | static void SvcWrap_QueryMemory64(Core::System& system) { | 2168 | static void SvcWrap_QueryMemory64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2169 | Result ret{}; | 2169 | Result ret{}; |
| 2170 | 2170 | ||
| 2171 | PageInfo out_page_info{}; | 2171 | PageInfo out_page_info{}; |
| 2172 | uint64_t out_memory_info{}; | 2172 | uint64_t out_memory_info{}; |
| 2173 | uint64_t address{}; | 2173 | uint64_t address{}; |
| 2174 | 2174 | ||
| 2175 | out_memory_info = Convert<uint64_t>(GetReg64(system, 0)); | 2175 | out_memory_info = Convert<uint64_t>(GetArg64(args, 0)); |
| 2176 | address = Convert<uint64_t>(GetReg64(system, 2)); | 2176 | address = Convert<uint64_t>(GetArg64(args, 2)); |
| 2177 | 2177 | ||
| 2178 | ret = QueryMemory64(system, out_memory_info, std::addressof(out_page_info), address); | 2178 | ret = QueryMemory64(system, out_memory_info, std::addressof(out_page_info), address); |
| 2179 | 2179 | ||
| 2180 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 2180 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 2181 | SetReg64(system, 1, Convert<uint64_t>(out_page_info)); | 2181 | SetArg64(args, 1, Convert<uint64_t>(out_page_info)); |
| 2182 | } | 2182 | } |
| 2183 | 2183 | ||
| 2184 | static void SvcWrap_ExitProcess64(Core::System& system) { | 2184 | static void SvcWrap_ExitProcess64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2185 | ExitProcess64(system); | 2185 | ExitProcess64(system); |
| 2186 | } | 2186 | } |
| 2187 | 2187 | ||
| 2188 | static void SvcWrap_CreateThread64(Core::System& system) { | 2188 | static void SvcWrap_CreateThread64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2189 | Result ret{}; | 2189 | Result ret{}; |
| 2190 | 2190 | ||
| 2191 | Handle out_handle{}; | 2191 | Handle out_handle{}; |
| @@ -2195,135 +2195,135 @@ static void SvcWrap_CreateThread64(Core::System& system) { | |||
| 2195 | int32_t priority{}; | 2195 | int32_t priority{}; |
| 2196 | int32_t core_id{}; | 2196 | int32_t core_id{}; |
| 2197 | 2197 | ||
| 2198 | func = Convert<uint64_t>(GetReg64(system, 1)); | 2198 | func = Convert<uint64_t>(GetArg64(args, 1)); |
| 2199 | arg = Convert<uint64_t>(GetReg64(system, 2)); | 2199 | arg = Convert<uint64_t>(GetArg64(args, 2)); |
| 2200 | stack_bottom = Convert<uint64_t>(GetReg64(system, 3)); | 2200 | stack_bottom = Convert<uint64_t>(GetArg64(args, 3)); |
| 2201 | priority = Convert<int32_t>(GetReg64(system, 4)); | 2201 | priority = Convert<int32_t>(GetArg64(args, 4)); |
| 2202 | core_id = Convert<int32_t>(GetReg64(system, 5)); | 2202 | core_id = Convert<int32_t>(GetArg64(args, 5)); |
| 2203 | 2203 | ||
| 2204 | ret = CreateThread64(system, std::addressof(out_handle), func, arg, stack_bottom, priority, core_id); | 2204 | ret = CreateThread64(system, std::addressof(out_handle), func, arg, stack_bottom, priority, core_id); |
| 2205 | 2205 | ||
| 2206 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 2206 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 2207 | SetReg64(system, 1, Convert<uint64_t>(out_handle)); | 2207 | SetArg64(args, 1, Convert<uint64_t>(out_handle)); |
| 2208 | } | 2208 | } |
| 2209 | 2209 | ||
| 2210 | static void SvcWrap_StartThread64(Core::System& system) { | 2210 | static void SvcWrap_StartThread64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2211 | Result ret{}; | 2211 | Result ret{}; |
| 2212 | 2212 | ||
| 2213 | Handle thread_handle{}; | 2213 | Handle thread_handle{}; |
| 2214 | 2214 | ||
| 2215 | thread_handle = Convert<Handle>(GetReg64(system, 0)); | 2215 | thread_handle = Convert<Handle>(GetArg64(args, 0)); |
| 2216 | 2216 | ||
| 2217 | ret = StartThread64(system, thread_handle); | 2217 | ret = StartThread64(system, thread_handle); |
| 2218 | 2218 | ||
| 2219 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 2219 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 2220 | } | 2220 | } |
| 2221 | 2221 | ||
| 2222 | static void SvcWrap_ExitThread64(Core::System& system) { | 2222 | static void SvcWrap_ExitThread64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2223 | ExitThread64(system); | 2223 | ExitThread64(system); |
| 2224 | } | 2224 | } |
| 2225 | 2225 | ||
| 2226 | static void SvcWrap_SleepThread64(Core::System& system) { | 2226 | static void SvcWrap_SleepThread64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2227 | int64_t ns{}; | 2227 | int64_t ns{}; |
| 2228 | 2228 | ||
| 2229 | ns = Convert<int64_t>(GetReg64(system, 0)); | 2229 | ns = Convert<int64_t>(GetArg64(args, 0)); |
| 2230 | 2230 | ||
| 2231 | SleepThread64(system, ns); | 2231 | SleepThread64(system, ns); |
| 2232 | } | 2232 | } |
| 2233 | 2233 | ||
| 2234 | static void SvcWrap_GetThreadPriority64(Core::System& system) { | 2234 | static void SvcWrap_GetThreadPriority64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2235 | Result ret{}; | 2235 | Result ret{}; |
| 2236 | 2236 | ||
| 2237 | int32_t out_priority{}; | 2237 | int32_t out_priority{}; |
| 2238 | Handle thread_handle{}; | 2238 | Handle thread_handle{}; |
| 2239 | 2239 | ||
| 2240 | thread_handle = Convert<Handle>(GetReg64(system, 1)); | 2240 | thread_handle = Convert<Handle>(GetArg64(args, 1)); |
| 2241 | 2241 | ||
| 2242 | ret = GetThreadPriority64(system, std::addressof(out_priority), thread_handle); | 2242 | ret = GetThreadPriority64(system, std::addressof(out_priority), thread_handle); |
| 2243 | 2243 | ||
| 2244 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 2244 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 2245 | SetReg64(system, 1, Convert<uint64_t>(out_priority)); | 2245 | SetArg64(args, 1, Convert<uint64_t>(out_priority)); |
| 2246 | } | 2246 | } |
| 2247 | 2247 | ||
| 2248 | static void SvcWrap_SetThreadPriority64(Core::System& system) { | 2248 | static void SvcWrap_SetThreadPriority64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2249 | Result ret{}; | 2249 | Result ret{}; |
| 2250 | 2250 | ||
| 2251 | Handle thread_handle{}; | 2251 | Handle thread_handle{}; |
| 2252 | int32_t priority{}; | 2252 | int32_t priority{}; |
| 2253 | 2253 | ||
| 2254 | thread_handle = Convert<Handle>(GetReg64(system, 0)); | 2254 | thread_handle = Convert<Handle>(GetArg64(args, 0)); |
| 2255 | priority = Convert<int32_t>(GetReg64(system, 1)); | 2255 | priority = Convert<int32_t>(GetArg64(args, 1)); |
| 2256 | 2256 | ||
| 2257 | ret = SetThreadPriority64(system, thread_handle, priority); | 2257 | ret = SetThreadPriority64(system, thread_handle, priority); |
| 2258 | 2258 | ||
| 2259 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 2259 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 2260 | } | 2260 | } |
| 2261 | 2261 | ||
| 2262 | static void SvcWrap_GetThreadCoreMask64(Core::System& system) { | 2262 | static void SvcWrap_GetThreadCoreMask64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2263 | Result ret{}; | 2263 | Result ret{}; |
| 2264 | 2264 | ||
| 2265 | int32_t out_core_id{}; | 2265 | int32_t out_core_id{}; |
| 2266 | uint64_t out_affinity_mask{}; | 2266 | uint64_t out_affinity_mask{}; |
| 2267 | Handle thread_handle{}; | 2267 | Handle thread_handle{}; |
| 2268 | 2268 | ||
| 2269 | thread_handle = Convert<Handle>(GetReg64(system, 2)); | 2269 | thread_handle = Convert<Handle>(GetArg64(args, 2)); |
| 2270 | 2270 | ||
| 2271 | ret = GetThreadCoreMask64(system, std::addressof(out_core_id), std::addressof(out_affinity_mask), thread_handle); | 2271 | ret = GetThreadCoreMask64(system, std::addressof(out_core_id), std::addressof(out_affinity_mask), thread_handle); |
| 2272 | 2272 | ||
| 2273 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 2273 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 2274 | SetReg64(system, 1, Convert<uint64_t>(out_core_id)); | 2274 | SetArg64(args, 1, Convert<uint64_t>(out_core_id)); |
| 2275 | SetReg64(system, 2, Convert<uint64_t>(out_affinity_mask)); | 2275 | SetArg64(args, 2, Convert<uint64_t>(out_affinity_mask)); |
| 2276 | } | 2276 | } |
| 2277 | 2277 | ||
| 2278 | static void SvcWrap_SetThreadCoreMask64(Core::System& system) { | 2278 | static void SvcWrap_SetThreadCoreMask64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2279 | Result ret{}; | 2279 | Result ret{}; |
| 2280 | 2280 | ||
| 2281 | Handle thread_handle{}; | 2281 | Handle thread_handle{}; |
| 2282 | int32_t core_id{}; | 2282 | int32_t core_id{}; |
| 2283 | uint64_t affinity_mask{}; | 2283 | uint64_t affinity_mask{}; |
| 2284 | 2284 | ||
| 2285 | thread_handle = Convert<Handle>(GetReg64(system, 0)); | 2285 | thread_handle = Convert<Handle>(GetArg64(args, 0)); |
| 2286 | core_id = Convert<int32_t>(GetReg64(system, 1)); | 2286 | core_id = Convert<int32_t>(GetArg64(args, 1)); |
| 2287 | affinity_mask = Convert<uint64_t>(GetReg64(system, 2)); | 2287 | affinity_mask = Convert<uint64_t>(GetArg64(args, 2)); |
| 2288 | 2288 | ||
| 2289 | ret = SetThreadCoreMask64(system, thread_handle, core_id, affinity_mask); | 2289 | ret = SetThreadCoreMask64(system, thread_handle, core_id, affinity_mask); |
| 2290 | 2290 | ||
| 2291 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 2291 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 2292 | } | 2292 | } |
| 2293 | 2293 | ||
| 2294 | static void SvcWrap_GetCurrentProcessorNumber64(Core::System& system) { | 2294 | static void SvcWrap_GetCurrentProcessorNumber64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2295 | int32_t ret{}; | 2295 | int32_t ret{}; |
| 2296 | 2296 | ||
| 2297 | ret = GetCurrentProcessorNumber64(system); | 2297 | ret = GetCurrentProcessorNumber64(system); |
| 2298 | 2298 | ||
| 2299 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 2299 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 2300 | } | 2300 | } |
| 2301 | 2301 | ||
| 2302 | static void SvcWrap_SignalEvent64(Core::System& system) { | 2302 | static void SvcWrap_SignalEvent64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2303 | Result ret{}; | 2303 | Result ret{}; |
| 2304 | 2304 | ||
| 2305 | Handle event_handle{}; | 2305 | Handle event_handle{}; |
| 2306 | 2306 | ||
| 2307 | event_handle = Convert<Handle>(GetReg64(system, 0)); | 2307 | event_handle = Convert<Handle>(GetArg64(args, 0)); |
| 2308 | 2308 | ||
| 2309 | ret = SignalEvent64(system, event_handle); | 2309 | ret = SignalEvent64(system, event_handle); |
| 2310 | 2310 | ||
| 2311 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 2311 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 2312 | } | 2312 | } |
| 2313 | 2313 | ||
| 2314 | static void SvcWrap_ClearEvent64(Core::System& system) { | 2314 | static void SvcWrap_ClearEvent64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2315 | Result ret{}; | 2315 | Result ret{}; |
| 2316 | 2316 | ||
| 2317 | Handle event_handle{}; | 2317 | Handle event_handle{}; |
| 2318 | 2318 | ||
| 2319 | event_handle = Convert<Handle>(GetReg64(system, 0)); | 2319 | event_handle = Convert<Handle>(GetArg64(args, 0)); |
| 2320 | 2320 | ||
| 2321 | ret = ClearEvent64(system, event_handle); | 2321 | ret = ClearEvent64(system, event_handle); |
| 2322 | 2322 | ||
| 2323 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 2323 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 2324 | } | 2324 | } |
| 2325 | 2325 | ||
| 2326 | static void SvcWrap_MapSharedMemory64(Core::System& system) { | 2326 | static void SvcWrap_MapSharedMemory64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2327 | Result ret{}; | 2327 | Result ret{}; |
| 2328 | 2328 | ||
| 2329 | Handle shmem_handle{}; | 2329 | Handle shmem_handle{}; |
| @@ -2331,33 +2331,33 @@ static void SvcWrap_MapSharedMemory64(Core::System& system) { | |||
| 2331 | uint64_t size{}; | 2331 | uint64_t size{}; |
| 2332 | MemoryPermission map_perm{}; | 2332 | MemoryPermission map_perm{}; |
| 2333 | 2333 | ||
| 2334 | shmem_handle = Convert<Handle>(GetReg64(system, 0)); | 2334 | shmem_handle = Convert<Handle>(GetArg64(args, 0)); |
| 2335 | address = Convert<uint64_t>(GetReg64(system, 1)); | 2335 | address = Convert<uint64_t>(GetArg64(args, 1)); |
| 2336 | size = Convert<uint64_t>(GetReg64(system, 2)); | 2336 | size = Convert<uint64_t>(GetArg64(args, 2)); |
| 2337 | map_perm = Convert<MemoryPermission>(GetReg64(system, 3)); | 2337 | map_perm = Convert<MemoryPermission>(GetArg64(args, 3)); |
| 2338 | 2338 | ||
| 2339 | ret = MapSharedMemory64(system, shmem_handle, address, size, map_perm); | 2339 | ret = MapSharedMemory64(system, shmem_handle, address, size, map_perm); |
| 2340 | 2340 | ||
| 2341 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 2341 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 2342 | } | 2342 | } |
| 2343 | 2343 | ||
| 2344 | static void SvcWrap_UnmapSharedMemory64(Core::System& system) { | 2344 | static void SvcWrap_UnmapSharedMemory64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2345 | Result ret{}; | 2345 | Result ret{}; |
| 2346 | 2346 | ||
| 2347 | Handle shmem_handle{}; | 2347 | Handle shmem_handle{}; |
| 2348 | uint64_t address{}; | 2348 | uint64_t address{}; |
| 2349 | uint64_t size{}; | 2349 | uint64_t size{}; |
| 2350 | 2350 | ||
| 2351 | shmem_handle = Convert<Handle>(GetReg64(system, 0)); | 2351 | shmem_handle = Convert<Handle>(GetArg64(args, 0)); |
| 2352 | address = Convert<uint64_t>(GetReg64(system, 1)); | 2352 | address = Convert<uint64_t>(GetArg64(args, 1)); |
| 2353 | size = Convert<uint64_t>(GetReg64(system, 2)); | 2353 | size = Convert<uint64_t>(GetArg64(args, 2)); |
| 2354 | 2354 | ||
| 2355 | ret = UnmapSharedMemory64(system, shmem_handle, address, size); | 2355 | ret = UnmapSharedMemory64(system, shmem_handle, address, size); |
| 2356 | 2356 | ||
| 2357 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 2357 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 2358 | } | 2358 | } |
| 2359 | 2359 | ||
| 2360 | static void SvcWrap_CreateTransferMemory64(Core::System& system) { | 2360 | static void SvcWrap_CreateTransferMemory64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2361 | Result ret{}; | 2361 | Result ret{}; |
| 2362 | 2362 | ||
| 2363 | Handle out_handle{}; | 2363 | Handle out_handle{}; |
| @@ -2365,41 +2365,41 @@ static void SvcWrap_CreateTransferMemory64(Core::System& system) { | |||
| 2365 | uint64_t size{}; | 2365 | uint64_t size{}; |
| 2366 | MemoryPermission map_perm{}; | 2366 | MemoryPermission map_perm{}; |
| 2367 | 2367 | ||
| 2368 | address = Convert<uint64_t>(GetReg64(system, 1)); | 2368 | address = Convert<uint64_t>(GetArg64(args, 1)); |
| 2369 | size = Convert<uint64_t>(GetReg64(system, 2)); | 2369 | size = Convert<uint64_t>(GetArg64(args, 2)); |
| 2370 | map_perm = Convert<MemoryPermission>(GetReg64(system, 3)); | 2370 | map_perm = Convert<MemoryPermission>(GetArg64(args, 3)); |
| 2371 | 2371 | ||
| 2372 | ret = CreateTransferMemory64(system, std::addressof(out_handle), address, size, map_perm); | 2372 | ret = CreateTransferMemory64(system, std::addressof(out_handle), address, size, map_perm); |
| 2373 | 2373 | ||
| 2374 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 2374 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 2375 | SetReg64(system, 1, Convert<uint64_t>(out_handle)); | 2375 | SetArg64(args, 1, Convert<uint64_t>(out_handle)); |
| 2376 | } | 2376 | } |
| 2377 | 2377 | ||
| 2378 | static void SvcWrap_CloseHandle64(Core::System& system) { | 2378 | static void SvcWrap_CloseHandle64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2379 | Result ret{}; | 2379 | Result ret{}; |
| 2380 | 2380 | ||
| 2381 | Handle handle{}; | 2381 | Handle handle{}; |
| 2382 | 2382 | ||
| 2383 | handle = Convert<Handle>(GetReg64(system, 0)); | 2383 | handle = Convert<Handle>(GetArg64(args, 0)); |
| 2384 | 2384 | ||
| 2385 | ret = CloseHandle64(system, handle); | 2385 | ret = CloseHandle64(system, handle); |
| 2386 | 2386 | ||
| 2387 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 2387 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 2388 | } | 2388 | } |
| 2389 | 2389 | ||
| 2390 | static void SvcWrap_ResetSignal64(Core::System& system) { | 2390 | static void SvcWrap_ResetSignal64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2391 | Result ret{}; | 2391 | Result ret{}; |
| 2392 | 2392 | ||
| 2393 | Handle handle{}; | 2393 | Handle handle{}; |
| 2394 | 2394 | ||
| 2395 | handle = Convert<Handle>(GetReg64(system, 0)); | 2395 | handle = Convert<Handle>(GetArg64(args, 0)); |
| 2396 | 2396 | ||
| 2397 | ret = ResetSignal64(system, handle); | 2397 | ret = ResetSignal64(system, handle); |
| 2398 | 2398 | ||
| 2399 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 2399 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 2400 | } | 2400 | } |
| 2401 | 2401 | ||
| 2402 | static void SvcWrap_WaitSynchronization64(Core::System& system) { | 2402 | static void SvcWrap_WaitSynchronization64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2403 | Result ret{}; | 2403 | Result ret{}; |
| 2404 | 2404 | ||
| 2405 | int32_t out_index{}; | 2405 | int32_t out_index{}; |
| @@ -2407,57 +2407,57 @@ static void SvcWrap_WaitSynchronization64(Core::System& system) { | |||
| 2407 | int32_t num_handles{}; | 2407 | int32_t num_handles{}; |
| 2408 | int64_t timeout_ns{}; | 2408 | int64_t timeout_ns{}; |
| 2409 | 2409 | ||
| 2410 | handles = Convert<uint64_t>(GetReg64(system, 1)); | 2410 | handles = Convert<uint64_t>(GetArg64(args, 1)); |
| 2411 | num_handles = Convert<int32_t>(GetReg64(system, 2)); | 2411 | num_handles = Convert<int32_t>(GetArg64(args, 2)); |
| 2412 | timeout_ns = Convert<int64_t>(GetReg64(system, 3)); | 2412 | timeout_ns = Convert<int64_t>(GetArg64(args, 3)); |
| 2413 | 2413 | ||
| 2414 | ret = WaitSynchronization64(system, std::addressof(out_index), handles, num_handles, timeout_ns); | 2414 | ret = WaitSynchronization64(system, std::addressof(out_index), handles, num_handles, timeout_ns); |
| 2415 | 2415 | ||
| 2416 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 2416 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 2417 | SetReg64(system, 1, Convert<uint64_t>(out_index)); | 2417 | SetArg64(args, 1, Convert<uint64_t>(out_index)); |
| 2418 | } | 2418 | } |
| 2419 | 2419 | ||
| 2420 | static void SvcWrap_CancelSynchronization64(Core::System& system) { | 2420 | static void SvcWrap_CancelSynchronization64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2421 | Result ret{}; | 2421 | Result ret{}; |
| 2422 | 2422 | ||
| 2423 | Handle handle{}; | 2423 | Handle handle{}; |
| 2424 | 2424 | ||
| 2425 | handle = Convert<Handle>(GetReg64(system, 0)); | 2425 | handle = Convert<Handle>(GetArg64(args, 0)); |
| 2426 | 2426 | ||
| 2427 | ret = CancelSynchronization64(system, handle); | 2427 | ret = CancelSynchronization64(system, handle); |
| 2428 | 2428 | ||
| 2429 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 2429 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 2430 | } | 2430 | } |
| 2431 | 2431 | ||
| 2432 | static void SvcWrap_ArbitrateLock64(Core::System& system) { | 2432 | static void SvcWrap_ArbitrateLock64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2433 | Result ret{}; | 2433 | Result ret{}; |
| 2434 | 2434 | ||
| 2435 | Handle thread_handle{}; | 2435 | Handle thread_handle{}; |
| 2436 | uint64_t address{}; | 2436 | uint64_t address{}; |
| 2437 | uint32_t tag{}; | 2437 | uint32_t tag{}; |
| 2438 | 2438 | ||
| 2439 | thread_handle = Convert<Handle>(GetReg64(system, 0)); | 2439 | thread_handle = Convert<Handle>(GetArg64(args, 0)); |
| 2440 | address = Convert<uint64_t>(GetReg64(system, 1)); | 2440 | address = Convert<uint64_t>(GetArg64(args, 1)); |
| 2441 | tag = Convert<uint32_t>(GetReg64(system, 2)); | 2441 | tag = Convert<uint32_t>(GetArg64(args, 2)); |
| 2442 | 2442 | ||
| 2443 | ret = ArbitrateLock64(system, thread_handle, address, tag); | 2443 | ret = ArbitrateLock64(system, thread_handle, address, tag); |
| 2444 | 2444 | ||
| 2445 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 2445 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 2446 | } | 2446 | } |
| 2447 | 2447 | ||
| 2448 | static void SvcWrap_ArbitrateUnlock64(Core::System& system) { | 2448 | static void SvcWrap_ArbitrateUnlock64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2449 | Result ret{}; | 2449 | Result ret{}; |
| 2450 | 2450 | ||
| 2451 | uint64_t address{}; | 2451 | uint64_t address{}; |
| 2452 | 2452 | ||
| 2453 | address = Convert<uint64_t>(GetReg64(system, 0)); | 2453 | address = Convert<uint64_t>(GetArg64(args, 0)); |
| 2454 | 2454 | ||
| 2455 | ret = ArbitrateUnlock64(system, address); | 2455 | ret = ArbitrateUnlock64(system, address); |
| 2456 | 2456 | ||
| 2457 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 2457 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 2458 | } | 2458 | } |
| 2459 | 2459 | ||
| 2460 | static void SvcWrap_WaitProcessWideKeyAtomic64(Core::System& system) { | 2460 | static void SvcWrap_WaitProcessWideKeyAtomic64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2461 | Result ret{}; | 2461 | Result ret{}; |
| 2462 | 2462 | ||
| 2463 | uint64_t address{}; | 2463 | uint64_t address{}; |
| @@ -2465,77 +2465,77 @@ static void SvcWrap_WaitProcessWideKeyAtomic64(Core::System& system) { | |||
| 2465 | uint32_t tag{}; | 2465 | uint32_t tag{}; |
| 2466 | int64_t timeout_ns{}; | 2466 | int64_t timeout_ns{}; |
| 2467 | 2467 | ||
| 2468 | address = Convert<uint64_t>(GetReg64(system, 0)); | 2468 | address = Convert<uint64_t>(GetArg64(args, 0)); |
| 2469 | cv_key = Convert<uint64_t>(GetReg64(system, 1)); | 2469 | cv_key = Convert<uint64_t>(GetArg64(args, 1)); |
| 2470 | tag = Convert<uint32_t>(GetReg64(system, 2)); | 2470 | tag = Convert<uint32_t>(GetArg64(args, 2)); |
| 2471 | timeout_ns = Convert<int64_t>(GetReg64(system, 3)); | 2471 | timeout_ns = Convert<int64_t>(GetArg64(args, 3)); |
| 2472 | 2472 | ||
| 2473 | ret = WaitProcessWideKeyAtomic64(system, address, cv_key, tag, timeout_ns); | 2473 | ret = WaitProcessWideKeyAtomic64(system, address, cv_key, tag, timeout_ns); |
| 2474 | 2474 | ||
| 2475 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 2475 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 2476 | } | 2476 | } |
| 2477 | 2477 | ||
| 2478 | static void SvcWrap_SignalProcessWideKey64(Core::System& system) { | 2478 | static void SvcWrap_SignalProcessWideKey64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2479 | uint64_t cv_key{}; | 2479 | uint64_t cv_key{}; |
| 2480 | int32_t count{}; | 2480 | int32_t count{}; |
| 2481 | 2481 | ||
| 2482 | cv_key = Convert<uint64_t>(GetReg64(system, 0)); | 2482 | cv_key = Convert<uint64_t>(GetArg64(args, 0)); |
| 2483 | count = Convert<int32_t>(GetReg64(system, 1)); | 2483 | count = Convert<int32_t>(GetArg64(args, 1)); |
| 2484 | 2484 | ||
| 2485 | SignalProcessWideKey64(system, cv_key, count); | 2485 | SignalProcessWideKey64(system, cv_key, count); |
| 2486 | } | 2486 | } |
| 2487 | 2487 | ||
| 2488 | static void SvcWrap_GetSystemTick64(Core::System& system) { | 2488 | static void SvcWrap_GetSystemTick64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2489 | int64_t ret{}; | 2489 | int64_t ret{}; |
| 2490 | 2490 | ||
| 2491 | ret = GetSystemTick64(system); | 2491 | ret = GetSystemTick64(system); |
| 2492 | 2492 | ||
| 2493 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 2493 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 2494 | } | 2494 | } |
| 2495 | 2495 | ||
| 2496 | static void SvcWrap_ConnectToNamedPort64(Core::System& system) { | 2496 | static void SvcWrap_ConnectToNamedPort64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2497 | Result ret{}; | 2497 | Result ret{}; |
| 2498 | 2498 | ||
| 2499 | Handle out_handle{}; | 2499 | Handle out_handle{}; |
| 2500 | uint64_t name{}; | 2500 | uint64_t name{}; |
| 2501 | 2501 | ||
| 2502 | name = Convert<uint64_t>(GetReg64(system, 1)); | 2502 | name = Convert<uint64_t>(GetArg64(args, 1)); |
| 2503 | 2503 | ||
| 2504 | ret = ConnectToNamedPort64(system, std::addressof(out_handle), name); | 2504 | ret = ConnectToNamedPort64(system, std::addressof(out_handle), name); |
| 2505 | 2505 | ||
| 2506 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 2506 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 2507 | SetReg64(system, 1, Convert<uint64_t>(out_handle)); | 2507 | SetArg64(args, 1, Convert<uint64_t>(out_handle)); |
| 2508 | } | 2508 | } |
| 2509 | 2509 | ||
| 2510 | static void SvcWrap_SendSyncRequest64(Core::System& system) { | 2510 | static void SvcWrap_SendSyncRequest64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2511 | Result ret{}; | 2511 | Result ret{}; |
| 2512 | 2512 | ||
| 2513 | Handle session_handle{}; | 2513 | Handle session_handle{}; |
| 2514 | 2514 | ||
| 2515 | session_handle = Convert<Handle>(GetReg64(system, 0)); | 2515 | session_handle = Convert<Handle>(GetArg64(args, 0)); |
| 2516 | 2516 | ||
| 2517 | ret = SendSyncRequest64(system, session_handle); | 2517 | ret = SendSyncRequest64(system, session_handle); |
| 2518 | 2518 | ||
| 2519 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 2519 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 2520 | } | 2520 | } |
| 2521 | 2521 | ||
| 2522 | static void SvcWrap_SendSyncRequestWithUserBuffer64(Core::System& system) { | 2522 | static void SvcWrap_SendSyncRequestWithUserBuffer64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2523 | Result ret{}; | 2523 | Result ret{}; |
| 2524 | 2524 | ||
| 2525 | uint64_t message_buffer{}; | 2525 | uint64_t message_buffer{}; |
| 2526 | uint64_t message_buffer_size{}; | 2526 | uint64_t message_buffer_size{}; |
| 2527 | Handle session_handle{}; | 2527 | Handle session_handle{}; |
| 2528 | 2528 | ||
| 2529 | message_buffer = Convert<uint64_t>(GetReg64(system, 0)); | 2529 | message_buffer = Convert<uint64_t>(GetArg64(args, 0)); |
| 2530 | message_buffer_size = Convert<uint64_t>(GetReg64(system, 1)); | 2530 | message_buffer_size = Convert<uint64_t>(GetArg64(args, 1)); |
| 2531 | session_handle = Convert<Handle>(GetReg64(system, 2)); | 2531 | session_handle = Convert<Handle>(GetArg64(args, 2)); |
| 2532 | 2532 | ||
| 2533 | ret = SendSyncRequestWithUserBuffer64(system, message_buffer, message_buffer_size, session_handle); | 2533 | ret = SendSyncRequestWithUserBuffer64(system, message_buffer, message_buffer_size, session_handle); |
| 2534 | 2534 | ||
| 2535 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 2535 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 2536 | } | 2536 | } |
| 2537 | 2537 | ||
| 2538 | static void SvcWrap_SendAsyncRequestWithUserBuffer64(Core::System& system) { | 2538 | static void SvcWrap_SendAsyncRequestWithUserBuffer64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2539 | Result ret{}; | 2539 | Result ret{}; |
| 2540 | 2540 | ||
| 2541 | Handle out_event_handle{}; | 2541 | Handle out_event_handle{}; |
| @@ -2543,79 +2543,79 @@ static void SvcWrap_SendAsyncRequestWithUserBuffer64(Core::System& system) { | |||
| 2543 | uint64_t message_buffer_size{}; | 2543 | uint64_t message_buffer_size{}; |
| 2544 | Handle session_handle{}; | 2544 | Handle session_handle{}; |
| 2545 | 2545 | ||
| 2546 | message_buffer = Convert<uint64_t>(GetReg64(system, 1)); | 2546 | message_buffer = Convert<uint64_t>(GetArg64(args, 1)); |
| 2547 | message_buffer_size = Convert<uint64_t>(GetReg64(system, 2)); | 2547 | message_buffer_size = Convert<uint64_t>(GetArg64(args, 2)); |
| 2548 | session_handle = Convert<Handle>(GetReg64(system, 3)); | 2548 | session_handle = Convert<Handle>(GetArg64(args, 3)); |
| 2549 | 2549 | ||
| 2550 | ret = SendAsyncRequestWithUserBuffer64(system, std::addressof(out_event_handle), message_buffer, message_buffer_size, session_handle); | 2550 | ret = SendAsyncRequestWithUserBuffer64(system, std::addressof(out_event_handle), message_buffer, message_buffer_size, session_handle); |
| 2551 | 2551 | ||
| 2552 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 2552 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 2553 | SetReg64(system, 1, Convert<uint64_t>(out_event_handle)); | 2553 | SetArg64(args, 1, Convert<uint64_t>(out_event_handle)); |
| 2554 | } | 2554 | } |
| 2555 | 2555 | ||
| 2556 | static void SvcWrap_GetProcessId64(Core::System& system) { | 2556 | static void SvcWrap_GetProcessId64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2557 | Result ret{}; | 2557 | Result ret{}; |
| 2558 | 2558 | ||
| 2559 | uint64_t out_process_id{}; | 2559 | uint64_t out_process_id{}; |
| 2560 | Handle process_handle{}; | 2560 | Handle process_handle{}; |
| 2561 | 2561 | ||
| 2562 | process_handle = Convert<Handle>(GetReg64(system, 1)); | 2562 | process_handle = Convert<Handle>(GetArg64(args, 1)); |
| 2563 | 2563 | ||
| 2564 | ret = GetProcessId64(system, std::addressof(out_process_id), process_handle); | 2564 | ret = GetProcessId64(system, std::addressof(out_process_id), process_handle); |
| 2565 | 2565 | ||
| 2566 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 2566 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 2567 | SetReg64(system, 1, Convert<uint64_t>(out_process_id)); | 2567 | SetArg64(args, 1, Convert<uint64_t>(out_process_id)); |
| 2568 | } | 2568 | } |
| 2569 | 2569 | ||
| 2570 | static void SvcWrap_GetThreadId64(Core::System& system) { | 2570 | static void SvcWrap_GetThreadId64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2571 | Result ret{}; | 2571 | Result ret{}; |
| 2572 | 2572 | ||
| 2573 | uint64_t out_thread_id{}; | 2573 | uint64_t out_thread_id{}; |
| 2574 | Handle thread_handle{}; | 2574 | Handle thread_handle{}; |
| 2575 | 2575 | ||
| 2576 | thread_handle = Convert<Handle>(GetReg64(system, 1)); | 2576 | thread_handle = Convert<Handle>(GetArg64(args, 1)); |
| 2577 | 2577 | ||
| 2578 | ret = GetThreadId64(system, std::addressof(out_thread_id), thread_handle); | 2578 | ret = GetThreadId64(system, std::addressof(out_thread_id), thread_handle); |
| 2579 | 2579 | ||
| 2580 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 2580 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 2581 | SetReg64(system, 1, Convert<uint64_t>(out_thread_id)); | 2581 | SetArg64(args, 1, Convert<uint64_t>(out_thread_id)); |
| 2582 | } | 2582 | } |
| 2583 | 2583 | ||
| 2584 | static void SvcWrap_Break64(Core::System& system) { | 2584 | static void SvcWrap_Break64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2585 | BreakReason break_reason{}; | 2585 | BreakReason break_reason{}; |
| 2586 | uint64_t arg{}; | 2586 | uint64_t arg{}; |
| 2587 | uint64_t size{}; | 2587 | uint64_t size{}; |
| 2588 | 2588 | ||
| 2589 | break_reason = Convert<BreakReason>(GetReg64(system, 0)); | 2589 | break_reason = Convert<BreakReason>(GetArg64(args, 0)); |
| 2590 | arg = Convert<uint64_t>(GetReg64(system, 1)); | 2590 | arg = Convert<uint64_t>(GetArg64(args, 1)); |
| 2591 | size = Convert<uint64_t>(GetReg64(system, 2)); | 2591 | size = Convert<uint64_t>(GetArg64(args, 2)); |
| 2592 | 2592 | ||
| 2593 | Break64(system, break_reason, arg, size); | 2593 | Break64(system, break_reason, arg, size); |
| 2594 | } | 2594 | } |
| 2595 | 2595 | ||
| 2596 | static void SvcWrap_OutputDebugString64(Core::System& system) { | 2596 | static void SvcWrap_OutputDebugString64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2597 | Result ret{}; | 2597 | Result ret{}; |
| 2598 | 2598 | ||
| 2599 | uint64_t debug_str{}; | 2599 | uint64_t debug_str{}; |
| 2600 | uint64_t len{}; | 2600 | uint64_t len{}; |
| 2601 | 2601 | ||
| 2602 | debug_str = Convert<uint64_t>(GetReg64(system, 0)); | 2602 | debug_str = Convert<uint64_t>(GetArg64(args, 0)); |
| 2603 | len = Convert<uint64_t>(GetReg64(system, 1)); | 2603 | len = Convert<uint64_t>(GetArg64(args, 1)); |
| 2604 | 2604 | ||
| 2605 | ret = OutputDebugString64(system, debug_str, len); | 2605 | ret = OutputDebugString64(system, debug_str, len); |
| 2606 | 2606 | ||
| 2607 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 2607 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 2608 | } | 2608 | } |
| 2609 | 2609 | ||
| 2610 | static void SvcWrap_ReturnFromException64(Core::System& system) { | 2610 | static void SvcWrap_ReturnFromException64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2611 | Result result{}; | 2611 | Result result{}; |
| 2612 | 2612 | ||
| 2613 | result = Convert<Result>(GetReg64(system, 0)); | 2613 | result = Convert<Result>(GetArg64(args, 0)); |
| 2614 | 2614 | ||
| 2615 | ReturnFromException64(system, result); | 2615 | ReturnFromException64(system, result); |
| 2616 | } | 2616 | } |
| 2617 | 2617 | ||
| 2618 | static void SvcWrap_GetInfo64(Core::System& system) { | 2618 | static void SvcWrap_GetInfo64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2619 | Result ret{}; | 2619 | Result ret{}; |
| 2620 | 2620 | ||
| 2621 | uint64_t out{}; | 2621 | uint64_t out{}; |
| @@ -2623,63 +2623,63 @@ static void SvcWrap_GetInfo64(Core::System& system) { | |||
| 2623 | Handle handle{}; | 2623 | Handle handle{}; |
| 2624 | uint64_t info_subtype{}; | 2624 | uint64_t info_subtype{}; |
| 2625 | 2625 | ||
| 2626 | info_type = Convert<InfoType>(GetReg64(system, 1)); | 2626 | info_type = Convert<InfoType>(GetArg64(args, 1)); |
| 2627 | handle = Convert<Handle>(GetReg64(system, 2)); | 2627 | handle = Convert<Handle>(GetArg64(args, 2)); |
| 2628 | info_subtype = Convert<uint64_t>(GetReg64(system, 3)); | 2628 | info_subtype = Convert<uint64_t>(GetArg64(args, 3)); |
| 2629 | 2629 | ||
| 2630 | ret = GetInfo64(system, std::addressof(out), info_type, handle, info_subtype); | 2630 | ret = GetInfo64(system, std::addressof(out), info_type, handle, info_subtype); |
| 2631 | 2631 | ||
| 2632 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 2632 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 2633 | SetReg64(system, 1, Convert<uint64_t>(out)); | 2633 | SetArg64(args, 1, Convert<uint64_t>(out)); |
| 2634 | } | 2634 | } |
| 2635 | 2635 | ||
| 2636 | static void SvcWrap_FlushEntireDataCache64(Core::System& system) { | 2636 | static void SvcWrap_FlushEntireDataCache64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2637 | FlushEntireDataCache64(system); | 2637 | FlushEntireDataCache64(system); |
| 2638 | } | 2638 | } |
| 2639 | 2639 | ||
| 2640 | static void SvcWrap_FlushDataCache64(Core::System& system) { | 2640 | static void SvcWrap_FlushDataCache64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2641 | Result ret{}; | 2641 | Result ret{}; |
| 2642 | 2642 | ||
| 2643 | uint64_t address{}; | 2643 | uint64_t address{}; |
| 2644 | uint64_t size{}; | 2644 | uint64_t size{}; |
| 2645 | 2645 | ||
| 2646 | address = Convert<uint64_t>(GetReg64(system, 0)); | 2646 | address = Convert<uint64_t>(GetArg64(args, 0)); |
| 2647 | size = Convert<uint64_t>(GetReg64(system, 1)); | 2647 | size = Convert<uint64_t>(GetArg64(args, 1)); |
| 2648 | 2648 | ||
| 2649 | ret = FlushDataCache64(system, address, size); | 2649 | ret = FlushDataCache64(system, address, size); |
| 2650 | 2650 | ||
| 2651 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 2651 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 2652 | } | 2652 | } |
| 2653 | 2653 | ||
| 2654 | static void SvcWrap_MapPhysicalMemory64(Core::System& system) { | 2654 | static void SvcWrap_MapPhysicalMemory64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2655 | Result ret{}; | 2655 | Result ret{}; |
| 2656 | 2656 | ||
| 2657 | uint64_t address{}; | 2657 | uint64_t address{}; |
| 2658 | uint64_t size{}; | 2658 | uint64_t size{}; |
| 2659 | 2659 | ||
| 2660 | address = Convert<uint64_t>(GetReg64(system, 0)); | 2660 | address = Convert<uint64_t>(GetArg64(args, 0)); |
| 2661 | size = Convert<uint64_t>(GetReg64(system, 1)); | 2661 | size = Convert<uint64_t>(GetArg64(args, 1)); |
| 2662 | 2662 | ||
| 2663 | ret = MapPhysicalMemory64(system, address, size); | 2663 | ret = MapPhysicalMemory64(system, address, size); |
| 2664 | 2664 | ||
| 2665 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 2665 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 2666 | } | 2666 | } |
| 2667 | 2667 | ||
| 2668 | static void SvcWrap_UnmapPhysicalMemory64(Core::System& system) { | 2668 | static void SvcWrap_UnmapPhysicalMemory64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2669 | Result ret{}; | 2669 | Result ret{}; |
| 2670 | 2670 | ||
| 2671 | uint64_t address{}; | 2671 | uint64_t address{}; |
| 2672 | uint64_t size{}; | 2672 | uint64_t size{}; |
| 2673 | 2673 | ||
| 2674 | address = Convert<uint64_t>(GetReg64(system, 0)); | 2674 | address = Convert<uint64_t>(GetArg64(args, 0)); |
| 2675 | size = Convert<uint64_t>(GetReg64(system, 1)); | 2675 | size = Convert<uint64_t>(GetArg64(args, 1)); |
| 2676 | 2676 | ||
| 2677 | ret = UnmapPhysicalMemory64(system, address, size); | 2677 | ret = UnmapPhysicalMemory64(system, address, size); |
| 2678 | 2678 | ||
| 2679 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 2679 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 2680 | } | 2680 | } |
| 2681 | 2681 | ||
| 2682 | static void SvcWrap_GetDebugFutureThreadInfo64(Core::System& system) { | 2682 | static void SvcWrap_GetDebugFutureThreadInfo64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2683 | Result ret{}; | 2683 | Result ret{}; |
| 2684 | 2684 | ||
| 2685 | lp64::LastThreadContext out_context{}; | 2685 | lp64::LastThreadContext out_context{}; |
| @@ -2687,21 +2687,21 @@ static void SvcWrap_GetDebugFutureThreadInfo64(Core::System& system) { | |||
| 2687 | Handle debug_handle{}; | 2687 | Handle debug_handle{}; |
| 2688 | int64_t ns{}; | 2688 | int64_t ns{}; |
| 2689 | 2689 | ||
| 2690 | debug_handle = Convert<Handle>(GetReg64(system, 2)); | 2690 | debug_handle = Convert<Handle>(GetArg64(args, 2)); |
| 2691 | ns = Convert<int64_t>(GetReg64(system, 3)); | 2691 | ns = Convert<int64_t>(GetArg64(args, 3)); |
| 2692 | 2692 | ||
| 2693 | ret = GetDebugFutureThreadInfo64(system, std::addressof(out_context), std::addressof(out_thread_id), debug_handle, ns); | 2693 | ret = GetDebugFutureThreadInfo64(system, std::addressof(out_context), std::addressof(out_thread_id), debug_handle, ns); |
| 2694 | 2694 | ||
| 2695 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 2695 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 2696 | auto out_context_scatter = Convert<std::array<uint64_t, 4>>(out_context); | 2696 | auto out_context_scatter = Convert<std::array<uint64_t, 4>>(out_context); |
| 2697 | SetReg64(system, 1, out_context_scatter[0]); | 2697 | SetArg64(args, 1, out_context_scatter[0]); |
| 2698 | SetReg64(system, 2, out_context_scatter[1]); | 2698 | SetArg64(args, 2, out_context_scatter[1]); |
| 2699 | SetReg64(system, 3, out_context_scatter[2]); | 2699 | SetArg64(args, 3, out_context_scatter[2]); |
| 2700 | SetReg64(system, 4, out_context_scatter[3]); | 2700 | SetArg64(args, 4, out_context_scatter[3]); |
| 2701 | SetReg64(system, 5, Convert<uint64_t>(out_thread_id)); | 2701 | SetArg64(args, 5, Convert<uint64_t>(out_thread_id)); |
| 2702 | } | 2702 | } |
| 2703 | 2703 | ||
| 2704 | static void SvcWrap_GetLastThreadInfo64(Core::System& system) { | 2704 | static void SvcWrap_GetLastThreadInfo64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2705 | Result ret{}; | 2705 | Result ret{}; |
| 2706 | 2706 | ||
| 2707 | lp64::LastThreadContext out_context{}; | 2707 | lp64::LastThreadContext out_context{}; |
| @@ -2710,77 +2710,77 @@ static void SvcWrap_GetLastThreadInfo64(Core::System& system) { | |||
| 2710 | 2710 | ||
| 2711 | ret = GetLastThreadInfo64(system, std::addressof(out_context), std::addressof(out_tls_address), std::addressof(out_flags)); | 2711 | ret = GetLastThreadInfo64(system, std::addressof(out_context), std::addressof(out_tls_address), std::addressof(out_flags)); |
| 2712 | 2712 | ||
| 2713 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 2713 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 2714 | auto out_context_scatter = Convert<std::array<uint64_t, 4>>(out_context); | 2714 | auto out_context_scatter = Convert<std::array<uint64_t, 4>>(out_context); |
| 2715 | SetReg64(system, 1, out_context_scatter[0]); | 2715 | SetArg64(args, 1, out_context_scatter[0]); |
| 2716 | SetReg64(system, 2, out_context_scatter[1]); | 2716 | SetArg64(args, 2, out_context_scatter[1]); |
| 2717 | SetReg64(system, 3, out_context_scatter[2]); | 2717 | SetArg64(args, 3, out_context_scatter[2]); |
| 2718 | SetReg64(system, 4, out_context_scatter[3]); | 2718 | SetArg64(args, 4, out_context_scatter[3]); |
| 2719 | SetReg64(system, 5, Convert<uint64_t>(out_tls_address)); | 2719 | SetArg64(args, 5, Convert<uint64_t>(out_tls_address)); |
| 2720 | SetReg64(system, 6, Convert<uint64_t>(out_flags)); | 2720 | SetArg64(args, 6, Convert<uint64_t>(out_flags)); |
| 2721 | } | 2721 | } |
| 2722 | 2722 | ||
| 2723 | static void SvcWrap_GetResourceLimitLimitValue64(Core::System& system) { | 2723 | static void SvcWrap_GetResourceLimitLimitValue64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2724 | Result ret{}; | 2724 | Result ret{}; |
| 2725 | 2725 | ||
| 2726 | int64_t out_limit_value{}; | 2726 | int64_t out_limit_value{}; |
| 2727 | Handle resource_limit_handle{}; | 2727 | Handle resource_limit_handle{}; |
| 2728 | LimitableResource which{}; | 2728 | LimitableResource which{}; |
| 2729 | 2729 | ||
| 2730 | resource_limit_handle = Convert<Handle>(GetReg64(system, 1)); | 2730 | resource_limit_handle = Convert<Handle>(GetArg64(args, 1)); |
| 2731 | which = Convert<LimitableResource>(GetReg64(system, 2)); | 2731 | which = Convert<LimitableResource>(GetArg64(args, 2)); |
| 2732 | 2732 | ||
| 2733 | ret = GetResourceLimitLimitValue64(system, std::addressof(out_limit_value), resource_limit_handle, which); | 2733 | ret = GetResourceLimitLimitValue64(system, std::addressof(out_limit_value), resource_limit_handle, which); |
| 2734 | 2734 | ||
| 2735 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 2735 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 2736 | SetReg64(system, 1, Convert<uint64_t>(out_limit_value)); | 2736 | SetArg64(args, 1, Convert<uint64_t>(out_limit_value)); |
| 2737 | } | 2737 | } |
| 2738 | 2738 | ||
| 2739 | static void SvcWrap_GetResourceLimitCurrentValue64(Core::System& system) { | 2739 | static void SvcWrap_GetResourceLimitCurrentValue64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2740 | Result ret{}; | 2740 | Result ret{}; |
| 2741 | 2741 | ||
| 2742 | int64_t out_current_value{}; | 2742 | int64_t out_current_value{}; |
| 2743 | Handle resource_limit_handle{}; | 2743 | Handle resource_limit_handle{}; |
| 2744 | LimitableResource which{}; | 2744 | LimitableResource which{}; |
| 2745 | 2745 | ||
| 2746 | resource_limit_handle = Convert<Handle>(GetReg64(system, 1)); | 2746 | resource_limit_handle = Convert<Handle>(GetArg64(args, 1)); |
| 2747 | which = Convert<LimitableResource>(GetReg64(system, 2)); | 2747 | which = Convert<LimitableResource>(GetArg64(args, 2)); |
| 2748 | 2748 | ||
| 2749 | ret = GetResourceLimitCurrentValue64(system, std::addressof(out_current_value), resource_limit_handle, which); | 2749 | ret = GetResourceLimitCurrentValue64(system, std::addressof(out_current_value), resource_limit_handle, which); |
| 2750 | 2750 | ||
| 2751 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 2751 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 2752 | SetReg64(system, 1, Convert<uint64_t>(out_current_value)); | 2752 | SetArg64(args, 1, Convert<uint64_t>(out_current_value)); |
| 2753 | } | 2753 | } |
| 2754 | 2754 | ||
| 2755 | static void SvcWrap_SetThreadActivity64(Core::System& system) { | 2755 | static void SvcWrap_SetThreadActivity64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2756 | Result ret{}; | 2756 | Result ret{}; |
| 2757 | 2757 | ||
| 2758 | Handle thread_handle{}; | 2758 | Handle thread_handle{}; |
| 2759 | ThreadActivity thread_activity{}; | 2759 | ThreadActivity thread_activity{}; |
| 2760 | 2760 | ||
| 2761 | thread_handle = Convert<Handle>(GetReg64(system, 0)); | 2761 | thread_handle = Convert<Handle>(GetArg64(args, 0)); |
| 2762 | thread_activity = Convert<ThreadActivity>(GetReg64(system, 1)); | 2762 | thread_activity = Convert<ThreadActivity>(GetArg64(args, 1)); |
| 2763 | 2763 | ||
| 2764 | ret = SetThreadActivity64(system, thread_handle, thread_activity); | 2764 | ret = SetThreadActivity64(system, thread_handle, thread_activity); |
| 2765 | 2765 | ||
| 2766 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 2766 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 2767 | } | 2767 | } |
| 2768 | 2768 | ||
| 2769 | static void SvcWrap_GetThreadContext364(Core::System& system) { | 2769 | static void SvcWrap_GetThreadContext364(Core::System& system, std::span<uint64_t, 8> args) { |
| 2770 | Result ret{}; | 2770 | Result ret{}; |
| 2771 | 2771 | ||
| 2772 | uint64_t out_context{}; | 2772 | uint64_t out_context{}; |
| 2773 | Handle thread_handle{}; | 2773 | Handle thread_handle{}; |
| 2774 | 2774 | ||
| 2775 | out_context = Convert<uint64_t>(GetReg64(system, 0)); | 2775 | out_context = Convert<uint64_t>(GetArg64(args, 0)); |
| 2776 | thread_handle = Convert<Handle>(GetReg64(system, 1)); | 2776 | thread_handle = Convert<Handle>(GetArg64(args, 1)); |
| 2777 | 2777 | ||
| 2778 | ret = GetThreadContext364(system, out_context, thread_handle); | 2778 | ret = GetThreadContext364(system, out_context, thread_handle); |
| 2779 | 2779 | ||
| 2780 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 2780 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 2781 | } | 2781 | } |
| 2782 | 2782 | ||
| 2783 | static void SvcWrap_WaitForAddress64(Core::System& system) { | 2783 | static void SvcWrap_WaitForAddress64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2784 | Result ret{}; | 2784 | Result ret{}; |
| 2785 | 2785 | ||
| 2786 | uint64_t address{}; | 2786 | uint64_t address{}; |
| @@ -2788,17 +2788,17 @@ static void SvcWrap_WaitForAddress64(Core::System& system) { | |||
| 2788 | int32_t value{}; | 2788 | int32_t value{}; |
| 2789 | int64_t timeout_ns{}; | 2789 | int64_t timeout_ns{}; |
| 2790 | 2790 | ||
| 2791 | address = Convert<uint64_t>(GetReg64(system, 0)); | 2791 | address = Convert<uint64_t>(GetArg64(args, 0)); |
| 2792 | arb_type = Convert<ArbitrationType>(GetReg64(system, 1)); | 2792 | arb_type = Convert<ArbitrationType>(GetArg64(args, 1)); |
| 2793 | value = Convert<int32_t>(GetReg64(system, 2)); | 2793 | value = Convert<int32_t>(GetArg64(args, 2)); |
| 2794 | timeout_ns = Convert<int64_t>(GetReg64(system, 3)); | 2794 | timeout_ns = Convert<int64_t>(GetArg64(args, 3)); |
| 2795 | 2795 | ||
| 2796 | ret = WaitForAddress64(system, address, arb_type, value, timeout_ns); | 2796 | ret = WaitForAddress64(system, address, arb_type, value, timeout_ns); |
| 2797 | 2797 | ||
| 2798 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 2798 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 2799 | } | 2799 | } |
| 2800 | 2800 | ||
| 2801 | static void SvcWrap_SignalToAddress64(Core::System& system) { | 2801 | static void SvcWrap_SignalToAddress64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2802 | Result ret{}; | 2802 | Result ret{}; |
| 2803 | 2803 | ||
| 2804 | uint64_t address{}; | 2804 | uint64_t address{}; |
| @@ -2806,51 +2806,51 @@ static void SvcWrap_SignalToAddress64(Core::System& system) { | |||
| 2806 | int32_t value{}; | 2806 | int32_t value{}; |
| 2807 | int32_t count{}; | 2807 | int32_t count{}; |
| 2808 | 2808 | ||
| 2809 | address = Convert<uint64_t>(GetReg64(system, 0)); | 2809 | address = Convert<uint64_t>(GetArg64(args, 0)); |
| 2810 | signal_type = Convert<SignalType>(GetReg64(system, 1)); | 2810 | signal_type = Convert<SignalType>(GetArg64(args, 1)); |
| 2811 | value = Convert<int32_t>(GetReg64(system, 2)); | 2811 | value = Convert<int32_t>(GetArg64(args, 2)); |
| 2812 | count = Convert<int32_t>(GetReg64(system, 3)); | 2812 | count = Convert<int32_t>(GetArg64(args, 3)); |
| 2813 | 2813 | ||
| 2814 | ret = SignalToAddress64(system, address, signal_type, value, count); | 2814 | ret = SignalToAddress64(system, address, signal_type, value, count); |
| 2815 | 2815 | ||
| 2816 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 2816 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 2817 | } | 2817 | } |
| 2818 | 2818 | ||
| 2819 | static void SvcWrap_SynchronizePreemptionState64(Core::System& system) { | 2819 | static void SvcWrap_SynchronizePreemptionState64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2820 | SynchronizePreemptionState64(system); | 2820 | SynchronizePreemptionState64(system); |
| 2821 | } | 2821 | } |
| 2822 | 2822 | ||
| 2823 | static void SvcWrap_GetResourceLimitPeakValue64(Core::System& system) { | 2823 | static void SvcWrap_GetResourceLimitPeakValue64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2824 | Result ret{}; | 2824 | Result ret{}; |
| 2825 | 2825 | ||
| 2826 | int64_t out_peak_value{}; | 2826 | int64_t out_peak_value{}; |
| 2827 | Handle resource_limit_handle{}; | 2827 | Handle resource_limit_handle{}; |
| 2828 | LimitableResource which{}; | 2828 | LimitableResource which{}; |
| 2829 | 2829 | ||
| 2830 | resource_limit_handle = Convert<Handle>(GetReg64(system, 1)); | 2830 | resource_limit_handle = Convert<Handle>(GetArg64(args, 1)); |
| 2831 | which = Convert<LimitableResource>(GetReg64(system, 2)); | 2831 | which = Convert<LimitableResource>(GetArg64(args, 2)); |
| 2832 | 2832 | ||
| 2833 | ret = GetResourceLimitPeakValue64(system, std::addressof(out_peak_value), resource_limit_handle, which); | 2833 | ret = GetResourceLimitPeakValue64(system, std::addressof(out_peak_value), resource_limit_handle, which); |
| 2834 | 2834 | ||
| 2835 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 2835 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 2836 | SetReg64(system, 1, Convert<uint64_t>(out_peak_value)); | 2836 | SetArg64(args, 1, Convert<uint64_t>(out_peak_value)); |
| 2837 | } | 2837 | } |
| 2838 | 2838 | ||
| 2839 | static void SvcWrap_CreateIoPool64(Core::System& system) { | 2839 | static void SvcWrap_CreateIoPool64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2840 | Result ret{}; | 2840 | Result ret{}; |
| 2841 | 2841 | ||
| 2842 | Handle out_handle{}; | 2842 | Handle out_handle{}; |
| 2843 | IoPoolType which{}; | 2843 | IoPoolType which{}; |
| 2844 | 2844 | ||
| 2845 | which = Convert<IoPoolType>(GetReg64(system, 1)); | 2845 | which = Convert<IoPoolType>(GetArg64(args, 1)); |
| 2846 | 2846 | ||
| 2847 | ret = CreateIoPool64(system, std::addressof(out_handle), which); | 2847 | ret = CreateIoPool64(system, std::addressof(out_handle), which); |
| 2848 | 2848 | ||
| 2849 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 2849 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 2850 | SetReg64(system, 1, Convert<uint64_t>(out_handle)); | 2850 | SetArg64(args, 1, Convert<uint64_t>(out_handle)); |
| 2851 | } | 2851 | } |
| 2852 | 2852 | ||
| 2853 | static void SvcWrap_CreateIoRegion64(Core::System& system) { | 2853 | static void SvcWrap_CreateIoRegion64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2854 | Result ret{}; | 2854 | Result ret{}; |
| 2855 | 2855 | ||
| 2856 | Handle out_handle{}; | 2856 | Handle out_handle{}; |
| @@ -2860,41 +2860,41 @@ static void SvcWrap_CreateIoRegion64(Core::System& system) { | |||
| 2860 | MemoryMapping mapping{}; | 2860 | MemoryMapping mapping{}; |
| 2861 | MemoryPermission perm{}; | 2861 | MemoryPermission perm{}; |
| 2862 | 2862 | ||
| 2863 | io_pool = Convert<Handle>(GetReg64(system, 1)); | 2863 | io_pool = Convert<Handle>(GetArg64(args, 1)); |
| 2864 | physical_address = Convert<uint64_t>(GetReg64(system, 2)); | 2864 | physical_address = Convert<uint64_t>(GetArg64(args, 2)); |
| 2865 | size = Convert<uint64_t>(GetReg64(system, 3)); | 2865 | size = Convert<uint64_t>(GetArg64(args, 3)); |
| 2866 | mapping = Convert<MemoryMapping>(GetReg64(system, 4)); | 2866 | mapping = Convert<MemoryMapping>(GetArg64(args, 4)); |
| 2867 | perm = Convert<MemoryPermission>(GetReg64(system, 5)); | 2867 | perm = Convert<MemoryPermission>(GetArg64(args, 5)); |
| 2868 | 2868 | ||
| 2869 | ret = CreateIoRegion64(system, std::addressof(out_handle), io_pool, physical_address, size, mapping, perm); | 2869 | ret = CreateIoRegion64(system, std::addressof(out_handle), io_pool, physical_address, size, mapping, perm); |
| 2870 | 2870 | ||
| 2871 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 2871 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 2872 | SetReg64(system, 1, Convert<uint64_t>(out_handle)); | 2872 | SetArg64(args, 1, Convert<uint64_t>(out_handle)); |
| 2873 | } | 2873 | } |
| 2874 | 2874 | ||
| 2875 | static void SvcWrap_KernelDebug64(Core::System& system) { | 2875 | static void SvcWrap_KernelDebug64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2876 | KernelDebugType kern_debug_type{}; | 2876 | KernelDebugType kern_debug_type{}; |
| 2877 | uint64_t arg0{}; | 2877 | uint64_t arg0{}; |
| 2878 | uint64_t arg1{}; | 2878 | uint64_t arg1{}; |
| 2879 | uint64_t arg2{}; | 2879 | uint64_t arg2{}; |
| 2880 | 2880 | ||
| 2881 | kern_debug_type = Convert<KernelDebugType>(GetReg64(system, 0)); | 2881 | kern_debug_type = Convert<KernelDebugType>(GetArg64(args, 0)); |
| 2882 | arg0 = Convert<uint64_t>(GetReg64(system, 1)); | 2882 | arg0 = Convert<uint64_t>(GetArg64(args, 1)); |
| 2883 | arg1 = Convert<uint64_t>(GetReg64(system, 2)); | 2883 | arg1 = Convert<uint64_t>(GetArg64(args, 2)); |
| 2884 | arg2 = Convert<uint64_t>(GetReg64(system, 3)); | 2884 | arg2 = Convert<uint64_t>(GetArg64(args, 3)); |
| 2885 | 2885 | ||
| 2886 | KernelDebug64(system, kern_debug_type, arg0, arg1, arg2); | 2886 | KernelDebug64(system, kern_debug_type, arg0, arg1, arg2); |
| 2887 | } | 2887 | } |
| 2888 | 2888 | ||
| 2889 | static void SvcWrap_ChangeKernelTraceState64(Core::System& system) { | 2889 | static void SvcWrap_ChangeKernelTraceState64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2890 | KernelTraceState kern_trace_state{}; | 2890 | KernelTraceState kern_trace_state{}; |
| 2891 | 2891 | ||
| 2892 | kern_trace_state = Convert<KernelTraceState>(GetReg64(system, 0)); | 2892 | kern_trace_state = Convert<KernelTraceState>(GetArg64(args, 0)); |
| 2893 | 2893 | ||
| 2894 | ChangeKernelTraceState64(system, kern_trace_state); | 2894 | ChangeKernelTraceState64(system, kern_trace_state); |
| 2895 | } | 2895 | } |
| 2896 | 2896 | ||
| 2897 | static void SvcWrap_CreateSession64(Core::System& system) { | 2897 | static void SvcWrap_CreateSession64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2898 | Result ret{}; | 2898 | Result ret{}; |
| 2899 | 2899 | ||
| 2900 | Handle out_server_session_handle{}; | 2900 | Handle out_server_session_handle{}; |
| @@ -2902,31 +2902,31 @@ static void SvcWrap_CreateSession64(Core::System& system) { | |||
| 2902 | bool is_light{}; | 2902 | bool is_light{}; |
| 2903 | uint64_t name{}; | 2903 | uint64_t name{}; |
| 2904 | 2904 | ||
| 2905 | is_light = Convert<bool>(GetReg64(system, 2)); | 2905 | is_light = Convert<bool>(GetArg64(args, 2)); |
| 2906 | name = Convert<uint64_t>(GetReg64(system, 3)); | 2906 | name = Convert<uint64_t>(GetArg64(args, 3)); |
| 2907 | 2907 | ||
| 2908 | ret = CreateSession64(system, std::addressof(out_server_session_handle), std::addressof(out_client_session_handle), is_light, name); | 2908 | ret = CreateSession64(system, std::addressof(out_server_session_handle), std::addressof(out_client_session_handle), is_light, name); |
| 2909 | 2909 | ||
| 2910 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 2910 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 2911 | SetReg64(system, 1, Convert<uint64_t>(out_server_session_handle)); | 2911 | SetArg64(args, 1, Convert<uint64_t>(out_server_session_handle)); |
| 2912 | SetReg64(system, 2, Convert<uint64_t>(out_client_session_handle)); | 2912 | SetArg64(args, 2, Convert<uint64_t>(out_client_session_handle)); |
| 2913 | } | 2913 | } |
| 2914 | 2914 | ||
| 2915 | static void SvcWrap_AcceptSession64(Core::System& system) { | 2915 | static void SvcWrap_AcceptSession64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2916 | Result ret{}; | 2916 | Result ret{}; |
| 2917 | 2917 | ||
| 2918 | Handle out_handle{}; | 2918 | Handle out_handle{}; |
| 2919 | Handle port{}; | 2919 | Handle port{}; |
| 2920 | 2920 | ||
| 2921 | port = Convert<Handle>(GetReg64(system, 1)); | 2921 | port = Convert<Handle>(GetArg64(args, 1)); |
| 2922 | 2922 | ||
| 2923 | ret = AcceptSession64(system, std::addressof(out_handle), port); | 2923 | ret = AcceptSession64(system, std::addressof(out_handle), port); |
| 2924 | 2924 | ||
| 2925 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 2925 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 2926 | SetReg64(system, 1, Convert<uint64_t>(out_handle)); | 2926 | SetArg64(args, 1, Convert<uint64_t>(out_handle)); |
| 2927 | } | 2927 | } |
| 2928 | 2928 | ||
| 2929 | static void SvcWrap_ReplyAndReceive64(Core::System& system) { | 2929 | static void SvcWrap_ReplyAndReceive64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2930 | Result ret{}; | 2930 | Result ret{}; |
| 2931 | 2931 | ||
| 2932 | int32_t out_index{}; | 2932 | int32_t out_index{}; |
| @@ -2935,18 +2935,18 @@ static void SvcWrap_ReplyAndReceive64(Core::System& system) { | |||
| 2935 | Handle reply_target{}; | 2935 | Handle reply_target{}; |
| 2936 | int64_t timeout_ns{}; | 2936 | int64_t timeout_ns{}; |
| 2937 | 2937 | ||
| 2938 | handles = Convert<uint64_t>(GetReg64(system, 1)); | 2938 | handles = Convert<uint64_t>(GetArg64(args, 1)); |
| 2939 | num_handles = Convert<int32_t>(GetReg64(system, 2)); | 2939 | num_handles = Convert<int32_t>(GetArg64(args, 2)); |
| 2940 | reply_target = Convert<Handle>(GetReg64(system, 3)); | 2940 | reply_target = Convert<Handle>(GetArg64(args, 3)); |
| 2941 | timeout_ns = Convert<int64_t>(GetReg64(system, 4)); | 2941 | timeout_ns = Convert<int64_t>(GetArg64(args, 4)); |
| 2942 | 2942 | ||
| 2943 | ret = ReplyAndReceive64(system, std::addressof(out_index), handles, num_handles, reply_target, timeout_ns); | 2943 | ret = ReplyAndReceive64(system, std::addressof(out_index), handles, num_handles, reply_target, timeout_ns); |
| 2944 | 2944 | ||
| 2945 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 2945 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 2946 | SetReg64(system, 1, Convert<uint64_t>(out_index)); | 2946 | SetArg64(args, 1, Convert<uint64_t>(out_index)); |
| 2947 | } | 2947 | } |
| 2948 | 2948 | ||
| 2949 | static void SvcWrap_ReplyAndReceiveWithUserBuffer64(Core::System& system) { | 2949 | static void SvcWrap_ReplyAndReceiveWithUserBuffer64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2950 | Result ret{}; | 2950 | Result ret{}; |
| 2951 | 2951 | ||
| 2952 | int32_t out_index{}; | 2952 | int32_t out_index{}; |
| @@ -2957,20 +2957,20 @@ static void SvcWrap_ReplyAndReceiveWithUserBuffer64(Core::System& system) { | |||
| 2957 | Handle reply_target{}; | 2957 | Handle reply_target{}; |
| 2958 | int64_t timeout_ns{}; | 2958 | int64_t timeout_ns{}; |
| 2959 | 2959 | ||
| 2960 | message_buffer = Convert<uint64_t>(GetReg64(system, 1)); | 2960 | message_buffer = Convert<uint64_t>(GetArg64(args, 1)); |
| 2961 | message_buffer_size = Convert<uint64_t>(GetReg64(system, 2)); | 2961 | message_buffer_size = Convert<uint64_t>(GetArg64(args, 2)); |
| 2962 | handles = Convert<uint64_t>(GetReg64(system, 3)); | 2962 | handles = Convert<uint64_t>(GetArg64(args, 3)); |
| 2963 | num_handles = Convert<int32_t>(GetReg64(system, 4)); | 2963 | num_handles = Convert<int32_t>(GetArg64(args, 4)); |
| 2964 | reply_target = Convert<Handle>(GetReg64(system, 5)); | 2964 | reply_target = Convert<Handle>(GetArg64(args, 5)); |
| 2965 | timeout_ns = Convert<int64_t>(GetReg64(system, 6)); | 2965 | timeout_ns = Convert<int64_t>(GetArg64(args, 6)); |
| 2966 | 2966 | ||
| 2967 | ret = ReplyAndReceiveWithUserBuffer64(system, std::addressof(out_index), message_buffer, message_buffer_size, handles, num_handles, reply_target, timeout_ns); | 2967 | ret = ReplyAndReceiveWithUserBuffer64(system, std::addressof(out_index), message_buffer, message_buffer_size, handles, num_handles, reply_target, timeout_ns); |
| 2968 | 2968 | ||
| 2969 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 2969 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 2970 | SetReg64(system, 1, Convert<uint64_t>(out_index)); | 2970 | SetArg64(args, 1, Convert<uint64_t>(out_index)); |
| 2971 | } | 2971 | } |
| 2972 | 2972 | ||
| 2973 | static void SvcWrap_CreateEvent64(Core::System& system) { | 2973 | static void SvcWrap_CreateEvent64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2974 | Result ret{}; | 2974 | Result ret{}; |
| 2975 | 2975 | ||
| 2976 | Handle out_write_handle{}; | 2976 | Handle out_write_handle{}; |
| @@ -2978,12 +2978,12 @@ static void SvcWrap_CreateEvent64(Core::System& system) { | |||
| 2978 | 2978 | ||
| 2979 | ret = CreateEvent64(system, std::addressof(out_write_handle), std::addressof(out_read_handle)); | 2979 | ret = CreateEvent64(system, std::addressof(out_write_handle), std::addressof(out_read_handle)); |
| 2980 | 2980 | ||
| 2981 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 2981 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 2982 | SetReg64(system, 1, Convert<uint64_t>(out_write_handle)); | 2982 | SetArg64(args, 1, Convert<uint64_t>(out_write_handle)); |
| 2983 | SetReg64(system, 2, Convert<uint64_t>(out_read_handle)); | 2983 | SetArg64(args, 2, Convert<uint64_t>(out_read_handle)); |
| 2984 | } | 2984 | } |
| 2985 | 2985 | ||
| 2986 | static void SvcWrap_MapIoRegion64(Core::System& system) { | 2986 | static void SvcWrap_MapIoRegion64(Core::System& system, std::span<uint64_t, 8> args) { |
| 2987 | Result ret{}; | 2987 | Result ret{}; |
| 2988 | 2988 | ||
| 2989 | Handle io_region{}; | 2989 | Handle io_region{}; |
| @@ -2991,89 +2991,89 @@ static void SvcWrap_MapIoRegion64(Core::System& system) { | |||
| 2991 | uint64_t size{}; | 2991 | uint64_t size{}; |
| 2992 | MemoryPermission perm{}; | 2992 | MemoryPermission perm{}; |
| 2993 | 2993 | ||
| 2994 | io_region = Convert<Handle>(GetReg64(system, 0)); | 2994 | io_region = Convert<Handle>(GetArg64(args, 0)); |
| 2995 | address = Convert<uint64_t>(GetReg64(system, 1)); | 2995 | address = Convert<uint64_t>(GetArg64(args, 1)); |
| 2996 | size = Convert<uint64_t>(GetReg64(system, 2)); | 2996 | size = Convert<uint64_t>(GetArg64(args, 2)); |
| 2997 | perm = Convert<MemoryPermission>(GetReg64(system, 3)); | 2997 | perm = Convert<MemoryPermission>(GetArg64(args, 3)); |
| 2998 | 2998 | ||
| 2999 | ret = MapIoRegion64(system, io_region, address, size, perm); | 2999 | ret = MapIoRegion64(system, io_region, address, size, perm); |
| 3000 | 3000 | ||
| 3001 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 3001 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 3002 | } | 3002 | } |
| 3003 | 3003 | ||
| 3004 | static void SvcWrap_UnmapIoRegion64(Core::System& system) { | 3004 | static void SvcWrap_UnmapIoRegion64(Core::System& system, std::span<uint64_t, 8> args) { |
| 3005 | Result ret{}; | 3005 | Result ret{}; |
| 3006 | 3006 | ||
| 3007 | Handle io_region{}; | 3007 | Handle io_region{}; |
| 3008 | uint64_t address{}; | 3008 | uint64_t address{}; |
| 3009 | uint64_t size{}; | 3009 | uint64_t size{}; |
| 3010 | 3010 | ||
| 3011 | io_region = Convert<Handle>(GetReg64(system, 0)); | 3011 | io_region = Convert<Handle>(GetArg64(args, 0)); |
| 3012 | address = Convert<uint64_t>(GetReg64(system, 1)); | 3012 | address = Convert<uint64_t>(GetArg64(args, 1)); |
| 3013 | size = Convert<uint64_t>(GetReg64(system, 2)); | 3013 | size = Convert<uint64_t>(GetArg64(args, 2)); |
| 3014 | 3014 | ||
| 3015 | ret = UnmapIoRegion64(system, io_region, address, size); | 3015 | ret = UnmapIoRegion64(system, io_region, address, size); |
| 3016 | 3016 | ||
| 3017 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 3017 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 3018 | } | 3018 | } |
| 3019 | 3019 | ||
| 3020 | static void SvcWrap_MapPhysicalMemoryUnsafe64(Core::System& system) { | 3020 | static void SvcWrap_MapPhysicalMemoryUnsafe64(Core::System& system, std::span<uint64_t, 8> args) { |
| 3021 | Result ret{}; | 3021 | Result ret{}; |
| 3022 | 3022 | ||
| 3023 | uint64_t address{}; | 3023 | uint64_t address{}; |
| 3024 | uint64_t size{}; | 3024 | uint64_t size{}; |
| 3025 | 3025 | ||
| 3026 | address = Convert<uint64_t>(GetReg64(system, 0)); | 3026 | address = Convert<uint64_t>(GetArg64(args, 0)); |
| 3027 | size = Convert<uint64_t>(GetReg64(system, 1)); | 3027 | size = Convert<uint64_t>(GetArg64(args, 1)); |
| 3028 | 3028 | ||
| 3029 | ret = MapPhysicalMemoryUnsafe64(system, address, size); | 3029 | ret = MapPhysicalMemoryUnsafe64(system, address, size); |
| 3030 | 3030 | ||
| 3031 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 3031 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 3032 | } | 3032 | } |
| 3033 | 3033 | ||
| 3034 | static void SvcWrap_UnmapPhysicalMemoryUnsafe64(Core::System& system) { | 3034 | static void SvcWrap_UnmapPhysicalMemoryUnsafe64(Core::System& system, std::span<uint64_t, 8> args) { |
| 3035 | Result ret{}; | 3035 | Result ret{}; |
| 3036 | 3036 | ||
| 3037 | uint64_t address{}; | 3037 | uint64_t address{}; |
| 3038 | uint64_t size{}; | 3038 | uint64_t size{}; |
| 3039 | 3039 | ||
| 3040 | address = Convert<uint64_t>(GetReg64(system, 0)); | 3040 | address = Convert<uint64_t>(GetArg64(args, 0)); |
| 3041 | size = Convert<uint64_t>(GetReg64(system, 1)); | 3041 | size = Convert<uint64_t>(GetArg64(args, 1)); |
| 3042 | 3042 | ||
| 3043 | ret = UnmapPhysicalMemoryUnsafe64(system, address, size); | 3043 | ret = UnmapPhysicalMemoryUnsafe64(system, address, size); |
| 3044 | 3044 | ||
| 3045 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 3045 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 3046 | } | 3046 | } |
| 3047 | 3047 | ||
| 3048 | static void SvcWrap_SetUnsafeLimit64(Core::System& system) { | 3048 | static void SvcWrap_SetUnsafeLimit64(Core::System& system, std::span<uint64_t, 8> args) { |
| 3049 | Result ret{}; | 3049 | Result ret{}; |
| 3050 | 3050 | ||
| 3051 | uint64_t limit{}; | 3051 | uint64_t limit{}; |
| 3052 | 3052 | ||
| 3053 | limit = Convert<uint64_t>(GetReg64(system, 0)); | 3053 | limit = Convert<uint64_t>(GetArg64(args, 0)); |
| 3054 | 3054 | ||
| 3055 | ret = SetUnsafeLimit64(system, limit); | 3055 | ret = SetUnsafeLimit64(system, limit); |
| 3056 | 3056 | ||
| 3057 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 3057 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 3058 | } | 3058 | } |
| 3059 | 3059 | ||
| 3060 | static void SvcWrap_CreateCodeMemory64(Core::System& system) { | 3060 | static void SvcWrap_CreateCodeMemory64(Core::System& system, std::span<uint64_t, 8> args) { |
| 3061 | Result ret{}; | 3061 | Result ret{}; |
| 3062 | 3062 | ||
| 3063 | Handle out_handle{}; | 3063 | Handle out_handle{}; |
| 3064 | uint64_t address{}; | 3064 | uint64_t address{}; |
| 3065 | uint64_t size{}; | 3065 | uint64_t size{}; |
| 3066 | 3066 | ||
| 3067 | address = Convert<uint64_t>(GetReg64(system, 1)); | 3067 | address = Convert<uint64_t>(GetArg64(args, 1)); |
| 3068 | size = Convert<uint64_t>(GetReg64(system, 2)); | 3068 | size = Convert<uint64_t>(GetArg64(args, 2)); |
| 3069 | 3069 | ||
| 3070 | ret = CreateCodeMemory64(system, std::addressof(out_handle), address, size); | 3070 | ret = CreateCodeMemory64(system, std::addressof(out_handle), address, size); |
| 3071 | 3071 | ||
| 3072 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 3072 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 3073 | SetReg64(system, 1, Convert<uint64_t>(out_handle)); | 3073 | SetArg64(args, 1, Convert<uint64_t>(out_handle)); |
| 3074 | } | 3074 | } |
| 3075 | 3075 | ||
| 3076 | static void SvcWrap_ControlCodeMemory64(Core::System& system) { | 3076 | static void SvcWrap_ControlCodeMemory64(Core::System& system, std::span<uint64_t, 8> args) { |
| 3077 | Result ret{}; | 3077 | Result ret{}; |
| 3078 | 3078 | ||
| 3079 | Handle code_memory_handle{}; | 3079 | Handle code_memory_handle{}; |
| @@ -3082,22 +3082,22 @@ static void SvcWrap_ControlCodeMemory64(Core::System& system) { | |||
| 3082 | uint64_t size{}; | 3082 | uint64_t size{}; |
| 3083 | MemoryPermission perm{}; | 3083 | MemoryPermission perm{}; |
| 3084 | 3084 | ||
| 3085 | code_memory_handle = Convert<Handle>(GetReg64(system, 0)); | 3085 | code_memory_handle = Convert<Handle>(GetArg64(args, 0)); |
| 3086 | operation = Convert<CodeMemoryOperation>(GetReg64(system, 1)); | 3086 | operation = Convert<CodeMemoryOperation>(GetArg64(args, 1)); |
| 3087 | address = Convert<uint64_t>(GetReg64(system, 2)); | 3087 | address = Convert<uint64_t>(GetArg64(args, 2)); |
| 3088 | size = Convert<uint64_t>(GetReg64(system, 3)); | 3088 | size = Convert<uint64_t>(GetArg64(args, 3)); |
| 3089 | perm = Convert<MemoryPermission>(GetReg64(system, 4)); | 3089 | perm = Convert<MemoryPermission>(GetArg64(args, 4)); |
| 3090 | 3090 | ||
| 3091 | ret = ControlCodeMemory64(system, code_memory_handle, operation, address, size, perm); | 3091 | ret = ControlCodeMemory64(system, code_memory_handle, operation, address, size, perm); |
| 3092 | 3092 | ||
| 3093 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 3093 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 3094 | } | 3094 | } |
| 3095 | 3095 | ||
| 3096 | static void SvcWrap_SleepSystem64(Core::System& system) { | 3096 | static void SvcWrap_SleepSystem64(Core::System& system, std::span<uint64_t, 8> args) { |
| 3097 | SleepSystem64(system); | 3097 | SleepSystem64(system); |
| 3098 | } | 3098 | } |
| 3099 | 3099 | ||
| 3100 | static void SvcWrap_ReadWriteRegister64(Core::System& system) { | 3100 | static void SvcWrap_ReadWriteRegister64(Core::System& system, std::span<uint64_t, 8> args) { |
| 3101 | Result ret{}; | 3101 | Result ret{}; |
| 3102 | 3102 | ||
| 3103 | uint32_t out_value{}; | 3103 | uint32_t out_value{}; |
| @@ -3105,31 +3105,31 @@ static void SvcWrap_ReadWriteRegister64(Core::System& system) { | |||
| 3105 | uint32_t mask{}; | 3105 | uint32_t mask{}; |
| 3106 | uint32_t value{}; | 3106 | uint32_t value{}; |
| 3107 | 3107 | ||
| 3108 | address = Convert<uint64_t>(GetReg64(system, 1)); | 3108 | address = Convert<uint64_t>(GetArg64(args, 1)); |
| 3109 | mask = Convert<uint32_t>(GetReg64(system, 2)); | 3109 | mask = Convert<uint32_t>(GetArg64(args, 2)); |
| 3110 | value = Convert<uint32_t>(GetReg64(system, 3)); | 3110 | value = Convert<uint32_t>(GetArg64(args, 3)); |
| 3111 | 3111 | ||
| 3112 | ret = ReadWriteRegister64(system, std::addressof(out_value), address, mask, value); | 3112 | ret = ReadWriteRegister64(system, std::addressof(out_value), address, mask, value); |
| 3113 | 3113 | ||
| 3114 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 3114 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 3115 | SetReg64(system, 1, Convert<uint64_t>(out_value)); | 3115 | SetArg64(args, 1, Convert<uint64_t>(out_value)); |
| 3116 | } | 3116 | } |
| 3117 | 3117 | ||
| 3118 | static void SvcWrap_SetProcessActivity64(Core::System& system) { | 3118 | static void SvcWrap_SetProcessActivity64(Core::System& system, std::span<uint64_t, 8> args) { |
| 3119 | Result ret{}; | 3119 | Result ret{}; |
| 3120 | 3120 | ||
| 3121 | Handle process_handle{}; | 3121 | Handle process_handle{}; |
| 3122 | ProcessActivity process_activity{}; | 3122 | ProcessActivity process_activity{}; |
| 3123 | 3123 | ||
| 3124 | process_handle = Convert<Handle>(GetReg64(system, 0)); | 3124 | process_handle = Convert<Handle>(GetArg64(args, 0)); |
| 3125 | process_activity = Convert<ProcessActivity>(GetReg64(system, 1)); | 3125 | process_activity = Convert<ProcessActivity>(GetArg64(args, 1)); |
| 3126 | 3126 | ||
| 3127 | ret = SetProcessActivity64(system, process_handle, process_activity); | 3127 | ret = SetProcessActivity64(system, process_handle, process_activity); |
| 3128 | 3128 | ||
| 3129 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 3129 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 3130 | } | 3130 | } |
| 3131 | 3131 | ||
| 3132 | static void SvcWrap_CreateSharedMemory64(Core::System& system) { | 3132 | static void SvcWrap_CreateSharedMemory64(Core::System& system, std::span<uint64_t, 8> args) { |
| 3133 | Result ret{}; | 3133 | Result ret{}; |
| 3134 | 3134 | ||
| 3135 | Handle out_handle{}; | 3135 | Handle out_handle{}; |
| @@ -3137,17 +3137,17 @@ static void SvcWrap_CreateSharedMemory64(Core::System& system) { | |||
| 3137 | MemoryPermission owner_perm{}; | 3137 | MemoryPermission owner_perm{}; |
| 3138 | MemoryPermission remote_perm{}; | 3138 | MemoryPermission remote_perm{}; |
| 3139 | 3139 | ||
| 3140 | size = Convert<uint64_t>(GetReg64(system, 1)); | 3140 | size = Convert<uint64_t>(GetArg64(args, 1)); |
| 3141 | owner_perm = Convert<MemoryPermission>(GetReg64(system, 2)); | 3141 | owner_perm = Convert<MemoryPermission>(GetArg64(args, 2)); |
| 3142 | remote_perm = Convert<MemoryPermission>(GetReg64(system, 3)); | 3142 | remote_perm = Convert<MemoryPermission>(GetArg64(args, 3)); |
| 3143 | 3143 | ||
| 3144 | ret = CreateSharedMemory64(system, std::addressof(out_handle), size, owner_perm, remote_perm); | 3144 | ret = CreateSharedMemory64(system, std::addressof(out_handle), size, owner_perm, remote_perm); |
| 3145 | 3145 | ||
| 3146 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 3146 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 3147 | SetReg64(system, 1, Convert<uint64_t>(out_handle)); | 3147 | SetArg64(args, 1, Convert<uint64_t>(out_handle)); |
| 3148 | } | 3148 | } |
| 3149 | 3149 | ||
| 3150 | static void SvcWrap_MapTransferMemory64(Core::System& system) { | 3150 | static void SvcWrap_MapTransferMemory64(Core::System& system, std::span<uint64_t, 8> args) { |
| 3151 | Result ret{}; | 3151 | Result ret{}; |
| 3152 | 3152 | ||
| 3153 | Handle trmem_handle{}; | 3153 | Handle trmem_handle{}; |
| @@ -3155,66 +3155,66 @@ static void SvcWrap_MapTransferMemory64(Core::System& system) { | |||
| 3155 | uint64_t size{}; | 3155 | uint64_t size{}; |
| 3156 | MemoryPermission owner_perm{}; | 3156 | MemoryPermission owner_perm{}; |
| 3157 | 3157 | ||
| 3158 | trmem_handle = Convert<Handle>(GetReg64(system, 0)); | 3158 | trmem_handle = Convert<Handle>(GetArg64(args, 0)); |
| 3159 | address = Convert<uint64_t>(GetReg64(system, 1)); | 3159 | address = Convert<uint64_t>(GetArg64(args, 1)); |
| 3160 | size = Convert<uint64_t>(GetReg64(system, 2)); | 3160 | size = Convert<uint64_t>(GetArg64(args, 2)); |
| 3161 | owner_perm = Convert<MemoryPermission>(GetReg64(system, 3)); | 3161 | owner_perm = Convert<MemoryPermission>(GetArg64(args, 3)); |
| 3162 | 3162 | ||
| 3163 | ret = MapTransferMemory64(system, trmem_handle, address, size, owner_perm); | 3163 | ret = MapTransferMemory64(system, trmem_handle, address, size, owner_perm); |
| 3164 | 3164 | ||
| 3165 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 3165 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 3166 | } | 3166 | } |
| 3167 | 3167 | ||
| 3168 | static void SvcWrap_UnmapTransferMemory64(Core::System& system) { | 3168 | static void SvcWrap_UnmapTransferMemory64(Core::System& system, std::span<uint64_t, 8> args) { |
| 3169 | Result ret{}; | 3169 | Result ret{}; |
| 3170 | 3170 | ||
| 3171 | Handle trmem_handle{}; | 3171 | Handle trmem_handle{}; |
| 3172 | uint64_t address{}; | 3172 | uint64_t address{}; |
| 3173 | uint64_t size{}; | 3173 | uint64_t size{}; |
| 3174 | 3174 | ||
| 3175 | trmem_handle = Convert<Handle>(GetReg64(system, 0)); | 3175 | trmem_handle = Convert<Handle>(GetArg64(args, 0)); |
| 3176 | address = Convert<uint64_t>(GetReg64(system, 1)); | 3176 | address = Convert<uint64_t>(GetArg64(args, 1)); |
| 3177 | size = Convert<uint64_t>(GetReg64(system, 2)); | 3177 | size = Convert<uint64_t>(GetArg64(args, 2)); |
| 3178 | 3178 | ||
| 3179 | ret = UnmapTransferMemory64(system, trmem_handle, address, size); | 3179 | ret = UnmapTransferMemory64(system, trmem_handle, address, size); |
| 3180 | 3180 | ||
| 3181 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 3181 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 3182 | } | 3182 | } |
| 3183 | 3183 | ||
| 3184 | static void SvcWrap_CreateInterruptEvent64(Core::System& system) { | 3184 | static void SvcWrap_CreateInterruptEvent64(Core::System& system, std::span<uint64_t, 8> args) { |
| 3185 | Result ret{}; | 3185 | Result ret{}; |
| 3186 | 3186 | ||
| 3187 | Handle out_read_handle{}; | 3187 | Handle out_read_handle{}; |
| 3188 | int32_t interrupt_id{}; | 3188 | int32_t interrupt_id{}; |
| 3189 | InterruptType interrupt_type{}; | 3189 | InterruptType interrupt_type{}; |
| 3190 | 3190 | ||
| 3191 | interrupt_id = Convert<int32_t>(GetReg64(system, 1)); | 3191 | interrupt_id = Convert<int32_t>(GetArg64(args, 1)); |
| 3192 | interrupt_type = Convert<InterruptType>(GetReg64(system, 2)); | 3192 | interrupt_type = Convert<InterruptType>(GetArg64(args, 2)); |
| 3193 | 3193 | ||
| 3194 | ret = CreateInterruptEvent64(system, std::addressof(out_read_handle), interrupt_id, interrupt_type); | 3194 | ret = CreateInterruptEvent64(system, std::addressof(out_read_handle), interrupt_id, interrupt_type); |
| 3195 | 3195 | ||
| 3196 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 3196 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 3197 | SetReg64(system, 1, Convert<uint64_t>(out_read_handle)); | 3197 | SetArg64(args, 1, Convert<uint64_t>(out_read_handle)); |
| 3198 | } | 3198 | } |
| 3199 | 3199 | ||
| 3200 | static void SvcWrap_QueryPhysicalAddress64(Core::System& system) { | 3200 | static void SvcWrap_QueryPhysicalAddress64(Core::System& system, std::span<uint64_t, 8> args) { |
| 3201 | Result ret{}; | 3201 | Result ret{}; |
| 3202 | 3202 | ||
| 3203 | lp64::PhysicalMemoryInfo out_info{}; | 3203 | lp64::PhysicalMemoryInfo out_info{}; |
| 3204 | uint64_t address{}; | 3204 | uint64_t address{}; |
| 3205 | 3205 | ||
| 3206 | address = Convert<uint64_t>(GetReg64(system, 1)); | 3206 | address = Convert<uint64_t>(GetArg64(args, 1)); |
| 3207 | 3207 | ||
| 3208 | ret = QueryPhysicalAddress64(system, std::addressof(out_info), address); | 3208 | ret = QueryPhysicalAddress64(system, std::addressof(out_info), address); |
| 3209 | 3209 | ||
| 3210 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 3210 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 3211 | auto out_info_scatter = Convert<std::array<uint64_t, 3>>(out_info); | 3211 | auto out_info_scatter = Convert<std::array<uint64_t, 3>>(out_info); |
| 3212 | SetReg64(system, 1, out_info_scatter[0]); | 3212 | SetArg64(args, 1, out_info_scatter[0]); |
| 3213 | SetReg64(system, 2, out_info_scatter[1]); | 3213 | SetArg64(args, 2, out_info_scatter[1]); |
| 3214 | SetReg64(system, 3, out_info_scatter[2]); | 3214 | SetArg64(args, 3, out_info_scatter[2]); |
| 3215 | } | 3215 | } |
| 3216 | 3216 | ||
| 3217 | static void SvcWrap_QueryIoMapping64(Core::System& system) { | 3217 | static void SvcWrap_QueryIoMapping64(Core::System& system, std::span<uint64_t, 8> args) { |
| 3218 | Result ret{}; | 3218 | Result ret{}; |
| 3219 | 3219 | ||
| 3220 | uint64_t out_address{}; | 3220 | uint64_t out_address{}; |
| @@ -3222,61 +3222,61 @@ static void SvcWrap_QueryIoMapping64(Core::System& system) { | |||
| 3222 | uint64_t physical_address{}; | 3222 | uint64_t physical_address{}; |
| 3223 | uint64_t size{}; | 3223 | uint64_t size{}; |
| 3224 | 3224 | ||
| 3225 | physical_address = Convert<uint64_t>(GetReg64(system, 2)); | 3225 | physical_address = Convert<uint64_t>(GetArg64(args, 2)); |
| 3226 | size = Convert<uint64_t>(GetReg64(system, 3)); | 3226 | size = Convert<uint64_t>(GetArg64(args, 3)); |
| 3227 | 3227 | ||
| 3228 | ret = QueryIoMapping64(system, std::addressof(out_address), std::addressof(out_size), physical_address, size); | 3228 | ret = QueryIoMapping64(system, std::addressof(out_address), std::addressof(out_size), physical_address, size); |
| 3229 | 3229 | ||
| 3230 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 3230 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 3231 | SetReg64(system, 1, Convert<uint64_t>(out_address)); | 3231 | SetArg64(args, 1, Convert<uint64_t>(out_address)); |
| 3232 | SetReg64(system, 2, Convert<uint64_t>(out_size)); | 3232 | SetArg64(args, 2, Convert<uint64_t>(out_size)); |
| 3233 | } | 3233 | } |
| 3234 | 3234 | ||
| 3235 | static void SvcWrap_CreateDeviceAddressSpace64(Core::System& system) { | 3235 | static void SvcWrap_CreateDeviceAddressSpace64(Core::System& system, std::span<uint64_t, 8> args) { |
| 3236 | Result ret{}; | 3236 | Result ret{}; |
| 3237 | 3237 | ||
| 3238 | Handle out_handle{}; | 3238 | Handle out_handle{}; |
| 3239 | uint64_t das_address{}; | 3239 | uint64_t das_address{}; |
| 3240 | uint64_t das_size{}; | 3240 | uint64_t das_size{}; |
| 3241 | 3241 | ||
| 3242 | das_address = Convert<uint64_t>(GetReg64(system, 1)); | 3242 | das_address = Convert<uint64_t>(GetArg64(args, 1)); |
| 3243 | das_size = Convert<uint64_t>(GetReg64(system, 2)); | 3243 | das_size = Convert<uint64_t>(GetArg64(args, 2)); |
| 3244 | 3244 | ||
| 3245 | ret = CreateDeviceAddressSpace64(system, std::addressof(out_handle), das_address, das_size); | 3245 | ret = CreateDeviceAddressSpace64(system, std::addressof(out_handle), das_address, das_size); |
| 3246 | 3246 | ||
| 3247 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 3247 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 3248 | SetReg64(system, 1, Convert<uint64_t>(out_handle)); | 3248 | SetArg64(args, 1, Convert<uint64_t>(out_handle)); |
| 3249 | } | 3249 | } |
| 3250 | 3250 | ||
| 3251 | static void SvcWrap_AttachDeviceAddressSpace64(Core::System& system) { | 3251 | static void SvcWrap_AttachDeviceAddressSpace64(Core::System& system, std::span<uint64_t, 8> args) { |
| 3252 | Result ret{}; | 3252 | Result ret{}; |
| 3253 | 3253 | ||
| 3254 | DeviceName device_name{}; | 3254 | DeviceName device_name{}; |
| 3255 | Handle das_handle{}; | 3255 | Handle das_handle{}; |
| 3256 | 3256 | ||
| 3257 | device_name = Convert<DeviceName>(GetReg64(system, 0)); | 3257 | device_name = Convert<DeviceName>(GetArg64(args, 0)); |
| 3258 | das_handle = Convert<Handle>(GetReg64(system, 1)); | 3258 | das_handle = Convert<Handle>(GetArg64(args, 1)); |
| 3259 | 3259 | ||
| 3260 | ret = AttachDeviceAddressSpace64(system, device_name, das_handle); | 3260 | ret = AttachDeviceAddressSpace64(system, device_name, das_handle); |
| 3261 | 3261 | ||
| 3262 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 3262 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 3263 | } | 3263 | } |
| 3264 | 3264 | ||
| 3265 | static void SvcWrap_DetachDeviceAddressSpace64(Core::System& system) { | 3265 | static void SvcWrap_DetachDeviceAddressSpace64(Core::System& system, std::span<uint64_t, 8> args) { |
| 3266 | Result ret{}; | 3266 | Result ret{}; |
| 3267 | 3267 | ||
| 3268 | DeviceName device_name{}; | 3268 | DeviceName device_name{}; |
| 3269 | Handle das_handle{}; | 3269 | Handle das_handle{}; |
| 3270 | 3270 | ||
| 3271 | device_name = Convert<DeviceName>(GetReg64(system, 0)); | 3271 | device_name = Convert<DeviceName>(GetArg64(args, 0)); |
| 3272 | das_handle = Convert<Handle>(GetReg64(system, 1)); | 3272 | das_handle = Convert<Handle>(GetArg64(args, 1)); |
| 3273 | 3273 | ||
| 3274 | ret = DetachDeviceAddressSpace64(system, device_name, das_handle); | 3274 | ret = DetachDeviceAddressSpace64(system, device_name, das_handle); |
| 3275 | 3275 | ||
| 3276 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 3276 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 3277 | } | 3277 | } |
| 3278 | 3278 | ||
| 3279 | static void SvcWrap_MapDeviceAddressSpaceByForce64(Core::System& system) { | 3279 | static void SvcWrap_MapDeviceAddressSpaceByForce64(Core::System& system, std::span<uint64_t, 8> args) { |
| 3280 | Result ret{}; | 3280 | Result ret{}; |
| 3281 | 3281 | ||
| 3282 | Handle das_handle{}; | 3282 | Handle das_handle{}; |
| @@ -3286,19 +3286,19 @@ static void SvcWrap_MapDeviceAddressSpaceByForce64(Core::System& system) { | |||
| 3286 | uint64_t device_address{}; | 3286 | uint64_t device_address{}; |
| 3287 | uint32_t option{}; | 3287 | uint32_t option{}; |
| 3288 | 3288 | ||
| 3289 | das_handle = Convert<Handle>(GetReg64(system, 0)); | 3289 | das_handle = Convert<Handle>(GetArg64(args, 0)); |
| 3290 | process_handle = Convert<Handle>(GetReg64(system, 1)); | 3290 | process_handle = Convert<Handle>(GetArg64(args, 1)); |
| 3291 | process_address = Convert<uint64_t>(GetReg64(system, 2)); | 3291 | process_address = Convert<uint64_t>(GetArg64(args, 2)); |
| 3292 | size = Convert<uint64_t>(GetReg64(system, 3)); | 3292 | size = Convert<uint64_t>(GetArg64(args, 3)); |
| 3293 | device_address = Convert<uint64_t>(GetReg64(system, 4)); | 3293 | device_address = Convert<uint64_t>(GetArg64(args, 4)); |
| 3294 | option = Convert<uint32_t>(GetReg64(system, 5)); | 3294 | option = Convert<uint32_t>(GetArg64(args, 5)); |
| 3295 | 3295 | ||
| 3296 | ret = MapDeviceAddressSpaceByForce64(system, das_handle, process_handle, process_address, size, device_address, option); | 3296 | ret = MapDeviceAddressSpaceByForce64(system, das_handle, process_handle, process_address, size, device_address, option); |
| 3297 | 3297 | ||
| 3298 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 3298 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 3299 | } | 3299 | } |
| 3300 | 3300 | ||
| 3301 | static void SvcWrap_MapDeviceAddressSpaceAligned64(Core::System& system) { | 3301 | static void SvcWrap_MapDeviceAddressSpaceAligned64(Core::System& system, std::span<uint64_t, 8> args) { |
| 3302 | Result ret{}; | 3302 | Result ret{}; |
| 3303 | 3303 | ||
| 3304 | Handle das_handle{}; | 3304 | Handle das_handle{}; |
| @@ -3308,19 +3308,19 @@ static void SvcWrap_MapDeviceAddressSpaceAligned64(Core::System& system) { | |||
| 3308 | uint64_t device_address{}; | 3308 | uint64_t device_address{}; |
| 3309 | uint32_t option{}; | 3309 | uint32_t option{}; |
| 3310 | 3310 | ||
| 3311 | das_handle = Convert<Handle>(GetReg64(system, 0)); | 3311 | das_handle = Convert<Handle>(GetArg64(args, 0)); |
| 3312 | process_handle = Convert<Handle>(GetReg64(system, 1)); | 3312 | process_handle = Convert<Handle>(GetArg64(args, 1)); |
| 3313 | process_address = Convert<uint64_t>(GetReg64(system, 2)); | 3313 | process_address = Convert<uint64_t>(GetArg64(args, 2)); |
| 3314 | size = Convert<uint64_t>(GetReg64(system, 3)); | 3314 | size = Convert<uint64_t>(GetArg64(args, 3)); |
| 3315 | device_address = Convert<uint64_t>(GetReg64(system, 4)); | 3315 | device_address = Convert<uint64_t>(GetArg64(args, 4)); |
| 3316 | option = Convert<uint32_t>(GetReg64(system, 5)); | 3316 | option = Convert<uint32_t>(GetArg64(args, 5)); |
| 3317 | 3317 | ||
| 3318 | ret = MapDeviceAddressSpaceAligned64(system, das_handle, process_handle, process_address, size, device_address, option); | 3318 | ret = MapDeviceAddressSpaceAligned64(system, das_handle, process_handle, process_address, size, device_address, option); |
| 3319 | 3319 | ||
| 3320 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 3320 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 3321 | } | 3321 | } |
| 3322 | 3322 | ||
| 3323 | static void SvcWrap_UnmapDeviceAddressSpace64(Core::System& system) { | 3323 | static void SvcWrap_UnmapDeviceAddressSpace64(Core::System& system, std::span<uint64_t, 8> args) { |
| 3324 | Result ret{}; | 3324 | Result ret{}; |
| 3325 | 3325 | ||
| 3326 | Handle das_handle{}; | 3326 | Handle das_handle{}; |
| @@ -3329,118 +3329,118 @@ static void SvcWrap_UnmapDeviceAddressSpace64(Core::System& system) { | |||
| 3329 | uint64_t size{}; | 3329 | uint64_t size{}; |
| 3330 | uint64_t device_address{}; | 3330 | uint64_t device_address{}; |
| 3331 | 3331 | ||
| 3332 | das_handle = Convert<Handle>(GetReg64(system, 0)); | 3332 | das_handle = Convert<Handle>(GetArg64(args, 0)); |
| 3333 | process_handle = Convert<Handle>(GetReg64(system, 1)); | 3333 | process_handle = Convert<Handle>(GetArg64(args, 1)); |
| 3334 | process_address = Convert<uint64_t>(GetReg64(system, 2)); | 3334 | process_address = Convert<uint64_t>(GetArg64(args, 2)); |
| 3335 | size = Convert<uint64_t>(GetReg64(system, 3)); | 3335 | size = Convert<uint64_t>(GetArg64(args, 3)); |
| 3336 | device_address = Convert<uint64_t>(GetReg64(system, 4)); | 3336 | device_address = Convert<uint64_t>(GetArg64(args, 4)); |
| 3337 | 3337 | ||
| 3338 | ret = UnmapDeviceAddressSpace64(system, das_handle, process_handle, process_address, size, device_address); | 3338 | ret = UnmapDeviceAddressSpace64(system, das_handle, process_handle, process_address, size, device_address); |
| 3339 | 3339 | ||
| 3340 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 3340 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 3341 | } | 3341 | } |
| 3342 | 3342 | ||
| 3343 | static void SvcWrap_InvalidateProcessDataCache64(Core::System& system) { | 3343 | static void SvcWrap_InvalidateProcessDataCache64(Core::System& system, std::span<uint64_t, 8> args) { |
| 3344 | Result ret{}; | 3344 | Result ret{}; |
| 3345 | 3345 | ||
| 3346 | Handle process_handle{}; | 3346 | Handle process_handle{}; |
| 3347 | uint64_t address{}; | 3347 | uint64_t address{}; |
| 3348 | uint64_t size{}; | 3348 | uint64_t size{}; |
| 3349 | 3349 | ||
| 3350 | process_handle = Convert<Handle>(GetReg64(system, 0)); | 3350 | process_handle = Convert<Handle>(GetArg64(args, 0)); |
| 3351 | address = Convert<uint64_t>(GetReg64(system, 1)); | 3351 | address = Convert<uint64_t>(GetArg64(args, 1)); |
| 3352 | size = Convert<uint64_t>(GetReg64(system, 2)); | 3352 | size = Convert<uint64_t>(GetArg64(args, 2)); |
| 3353 | 3353 | ||
| 3354 | ret = InvalidateProcessDataCache64(system, process_handle, address, size); | 3354 | ret = InvalidateProcessDataCache64(system, process_handle, address, size); |
| 3355 | 3355 | ||
| 3356 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 3356 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 3357 | } | 3357 | } |
| 3358 | 3358 | ||
| 3359 | static void SvcWrap_StoreProcessDataCache64(Core::System& system) { | 3359 | static void SvcWrap_StoreProcessDataCache64(Core::System& system, std::span<uint64_t, 8> args) { |
| 3360 | Result ret{}; | 3360 | Result ret{}; |
| 3361 | 3361 | ||
| 3362 | Handle process_handle{}; | 3362 | Handle process_handle{}; |
| 3363 | uint64_t address{}; | 3363 | uint64_t address{}; |
| 3364 | uint64_t size{}; | 3364 | uint64_t size{}; |
| 3365 | 3365 | ||
| 3366 | process_handle = Convert<Handle>(GetReg64(system, 0)); | 3366 | process_handle = Convert<Handle>(GetArg64(args, 0)); |
| 3367 | address = Convert<uint64_t>(GetReg64(system, 1)); | 3367 | address = Convert<uint64_t>(GetArg64(args, 1)); |
| 3368 | size = Convert<uint64_t>(GetReg64(system, 2)); | 3368 | size = Convert<uint64_t>(GetArg64(args, 2)); |
| 3369 | 3369 | ||
| 3370 | ret = StoreProcessDataCache64(system, process_handle, address, size); | 3370 | ret = StoreProcessDataCache64(system, process_handle, address, size); |
| 3371 | 3371 | ||
| 3372 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 3372 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 3373 | } | 3373 | } |
| 3374 | 3374 | ||
| 3375 | static void SvcWrap_FlushProcessDataCache64(Core::System& system) { | 3375 | static void SvcWrap_FlushProcessDataCache64(Core::System& system, std::span<uint64_t, 8> args) { |
| 3376 | Result ret{}; | 3376 | Result ret{}; |
| 3377 | 3377 | ||
| 3378 | Handle process_handle{}; | 3378 | Handle process_handle{}; |
| 3379 | uint64_t address{}; | 3379 | uint64_t address{}; |
| 3380 | uint64_t size{}; | 3380 | uint64_t size{}; |
| 3381 | 3381 | ||
| 3382 | process_handle = Convert<Handle>(GetReg64(system, 0)); | 3382 | process_handle = Convert<Handle>(GetArg64(args, 0)); |
| 3383 | address = Convert<uint64_t>(GetReg64(system, 1)); | 3383 | address = Convert<uint64_t>(GetArg64(args, 1)); |
| 3384 | size = Convert<uint64_t>(GetReg64(system, 2)); | 3384 | size = Convert<uint64_t>(GetArg64(args, 2)); |
| 3385 | 3385 | ||
| 3386 | ret = FlushProcessDataCache64(system, process_handle, address, size); | 3386 | ret = FlushProcessDataCache64(system, process_handle, address, size); |
| 3387 | 3387 | ||
| 3388 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 3388 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 3389 | } | 3389 | } |
| 3390 | 3390 | ||
| 3391 | static void SvcWrap_DebugActiveProcess64(Core::System& system) { | 3391 | static void SvcWrap_DebugActiveProcess64(Core::System& system, std::span<uint64_t, 8> args) { |
| 3392 | Result ret{}; | 3392 | Result ret{}; |
| 3393 | 3393 | ||
| 3394 | Handle out_handle{}; | 3394 | Handle out_handle{}; |
| 3395 | uint64_t process_id{}; | 3395 | uint64_t process_id{}; |
| 3396 | 3396 | ||
| 3397 | process_id = Convert<uint64_t>(GetReg64(system, 1)); | 3397 | process_id = Convert<uint64_t>(GetArg64(args, 1)); |
| 3398 | 3398 | ||
| 3399 | ret = DebugActiveProcess64(system, std::addressof(out_handle), process_id); | 3399 | ret = DebugActiveProcess64(system, std::addressof(out_handle), process_id); |
| 3400 | 3400 | ||
| 3401 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 3401 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 3402 | SetReg64(system, 1, Convert<uint64_t>(out_handle)); | 3402 | SetArg64(args, 1, Convert<uint64_t>(out_handle)); |
| 3403 | } | 3403 | } |
| 3404 | 3404 | ||
| 3405 | static void SvcWrap_BreakDebugProcess64(Core::System& system) { | 3405 | static void SvcWrap_BreakDebugProcess64(Core::System& system, std::span<uint64_t, 8> args) { |
| 3406 | Result ret{}; | 3406 | Result ret{}; |
| 3407 | 3407 | ||
| 3408 | Handle debug_handle{}; | 3408 | Handle debug_handle{}; |
| 3409 | 3409 | ||
| 3410 | debug_handle = Convert<Handle>(GetReg64(system, 0)); | 3410 | debug_handle = Convert<Handle>(GetArg64(args, 0)); |
| 3411 | 3411 | ||
| 3412 | ret = BreakDebugProcess64(system, debug_handle); | 3412 | ret = BreakDebugProcess64(system, debug_handle); |
| 3413 | 3413 | ||
| 3414 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 3414 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 3415 | } | 3415 | } |
| 3416 | 3416 | ||
| 3417 | static void SvcWrap_TerminateDebugProcess64(Core::System& system) { | 3417 | static void SvcWrap_TerminateDebugProcess64(Core::System& system, std::span<uint64_t, 8> args) { |
| 3418 | Result ret{}; | 3418 | Result ret{}; |
| 3419 | 3419 | ||
| 3420 | Handle debug_handle{}; | 3420 | Handle debug_handle{}; |
| 3421 | 3421 | ||
| 3422 | debug_handle = Convert<Handle>(GetReg64(system, 0)); | 3422 | debug_handle = Convert<Handle>(GetArg64(args, 0)); |
| 3423 | 3423 | ||
| 3424 | ret = TerminateDebugProcess64(system, debug_handle); | 3424 | ret = TerminateDebugProcess64(system, debug_handle); |
| 3425 | 3425 | ||
| 3426 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 3426 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 3427 | } | 3427 | } |
| 3428 | 3428 | ||
| 3429 | static void SvcWrap_GetDebugEvent64(Core::System& system) { | 3429 | static void SvcWrap_GetDebugEvent64(Core::System& system, std::span<uint64_t, 8> args) { |
| 3430 | Result ret{}; | 3430 | Result ret{}; |
| 3431 | 3431 | ||
| 3432 | uint64_t out_info{}; | 3432 | uint64_t out_info{}; |
| 3433 | Handle debug_handle{}; | 3433 | Handle debug_handle{}; |
| 3434 | 3434 | ||
| 3435 | out_info = Convert<uint64_t>(GetReg64(system, 0)); | 3435 | out_info = Convert<uint64_t>(GetArg64(args, 0)); |
| 3436 | debug_handle = Convert<Handle>(GetReg64(system, 1)); | 3436 | debug_handle = Convert<Handle>(GetArg64(args, 1)); |
| 3437 | 3437 | ||
| 3438 | ret = GetDebugEvent64(system, out_info, debug_handle); | 3438 | ret = GetDebugEvent64(system, out_info, debug_handle); |
| 3439 | 3439 | ||
| 3440 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 3440 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 3441 | } | 3441 | } |
| 3442 | 3442 | ||
| 3443 | static void SvcWrap_ContinueDebugEvent64(Core::System& system) { | 3443 | static void SvcWrap_ContinueDebugEvent64(Core::System& system, std::span<uint64_t, 8> args) { |
| 3444 | Result ret{}; | 3444 | Result ret{}; |
| 3445 | 3445 | ||
| 3446 | Handle debug_handle{}; | 3446 | Handle debug_handle{}; |
| @@ -3448,33 +3448,33 @@ static void SvcWrap_ContinueDebugEvent64(Core::System& system) { | |||
| 3448 | uint64_t thread_ids{}; | 3448 | uint64_t thread_ids{}; |
| 3449 | int32_t num_thread_ids{}; | 3449 | int32_t num_thread_ids{}; |
| 3450 | 3450 | ||
| 3451 | debug_handle = Convert<Handle>(GetReg64(system, 0)); | 3451 | debug_handle = Convert<Handle>(GetArg64(args, 0)); |
| 3452 | flags = Convert<uint32_t>(GetReg64(system, 1)); | 3452 | flags = Convert<uint32_t>(GetArg64(args, 1)); |
| 3453 | thread_ids = Convert<uint64_t>(GetReg64(system, 2)); | 3453 | thread_ids = Convert<uint64_t>(GetArg64(args, 2)); |
| 3454 | num_thread_ids = Convert<int32_t>(GetReg64(system, 3)); | 3454 | num_thread_ids = Convert<int32_t>(GetArg64(args, 3)); |
| 3455 | 3455 | ||
| 3456 | ret = ContinueDebugEvent64(system, debug_handle, flags, thread_ids, num_thread_ids); | 3456 | ret = ContinueDebugEvent64(system, debug_handle, flags, thread_ids, num_thread_ids); |
| 3457 | 3457 | ||
| 3458 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 3458 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 3459 | } | 3459 | } |
| 3460 | 3460 | ||
| 3461 | static void SvcWrap_GetProcessList64(Core::System& system) { | 3461 | static void SvcWrap_GetProcessList64(Core::System& system, std::span<uint64_t, 8> args) { |
| 3462 | Result ret{}; | 3462 | Result ret{}; |
| 3463 | 3463 | ||
| 3464 | int32_t out_num_processes{}; | 3464 | int32_t out_num_processes{}; |
| 3465 | uint64_t out_process_ids{}; | 3465 | uint64_t out_process_ids{}; |
| 3466 | int32_t max_out_count{}; | 3466 | int32_t max_out_count{}; |
| 3467 | 3467 | ||
| 3468 | out_process_ids = Convert<uint64_t>(GetReg64(system, 1)); | 3468 | out_process_ids = Convert<uint64_t>(GetArg64(args, 1)); |
| 3469 | max_out_count = Convert<int32_t>(GetReg64(system, 2)); | 3469 | max_out_count = Convert<int32_t>(GetArg64(args, 2)); |
| 3470 | 3470 | ||
| 3471 | ret = GetProcessList64(system, std::addressof(out_num_processes), out_process_ids, max_out_count); | 3471 | ret = GetProcessList64(system, std::addressof(out_num_processes), out_process_ids, max_out_count); |
| 3472 | 3472 | ||
| 3473 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 3473 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 3474 | SetReg64(system, 1, Convert<uint64_t>(out_num_processes)); | 3474 | SetArg64(args, 1, Convert<uint64_t>(out_num_processes)); |
| 3475 | } | 3475 | } |
| 3476 | 3476 | ||
| 3477 | static void SvcWrap_GetThreadList64(Core::System& system) { | 3477 | static void SvcWrap_GetThreadList64(Core::System& system, std::span<uint64_t, 8> args) { |
| 3478 | Result ret{}; | 3478 | Result ret{}; |
| 3479 | 3479 | ||
| 3480 | int32_t out_num_threads{}; | 3480 | int32_t out_num_threads{}; |
| @@ -3482,17 +3482,17 @@ static void SvcWrap_GetThreadList64(Core::System& system) { | |||
| 3482 | int32_t max_out_count{}; | 3482 | int32_t max_out_count{}; |
| 3483 | Handle debug_handle{}; | 3483 | Handle debug_handle{}; |
| 3484 | 3484 | ||
| 3485 | out_thread_ids = Convert<uint64_t>(GetReg64(system, 1)); | 3485 | out_thread_ids = Convert<uint64_t>(GetArg64(args, 1)); |
| 3486 | max_out_count = Convert<int32_t>(GetReg64(system, 2)); | 3486 | max_out_count = Convert<int32_t>(GetArg64(args, 2)); |
| 3487 | debug_handle = Convert<Handle>(GetReg64(system, 3)); | 3487 | debug_handle = Convert<Handle>(GetArg64(args, 3)); |
| 3488 | 3488 | ||
| 3489 | ret = GetThreadList64(system, std::addressof(out_num_threads), out_thread_ids, max_out_count, debug_handle); | 3489 | ret = GetThreadList64(system, std::addressof(out_num_threads), out_thread_ids, max_out_count, debug_handle); |
| 3490 | 3490 | ||
| 3491 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 3491 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 3492 | SetReg64(system, 1, Convert<uint64_t>(out_num_threads)); | 3492 | SetArg64(args, 1, Convert<uint64_t>(out_num_threads)); |
| 3493 | } | 3493 | } |
| 3494 | 3494 | ||
| 3495 | static void SvcWrap_GetDebugThreadContext64(Core::System& system) { | 3495 | static void SvcWrap_GetDebugThreadContext64(Core::System& system, std::span<uint64_t, 8> args) { |
| 3496 | Result ret{}; | 3496 | Result ret{}; |
| 3497 | 3497 | ||
| 3498 | uint64_t out_context{}; | 3498 | uint64_t out_context{}; |
| @@ -3500,17 +3500,17 @@ static void SvcWrap_GetDebugThreadContext64(Core::System& system) { | |||
| 3500 | uint64_t thread_id{}; | 3500 | uint64_t thread_id{}; |
| 3501 | uint32_t context_flags{}; | 3501 | uint32_t context_flags{}; |
| 3502 | 3502 | ||
| 3503 | out_context = Convert<uint64_t>(GetReg64(system, 0)); | 3503 | out_context = Convert<uint64_t>(GetArg64(args, 0)); |
| 3504 | debug_handle = Convert<Handle>(GetReg64(system, 1)); | 3504 | debug_handle = Convert<Handle>(GetArg64(args, 1)); |
| 3505 | thread_id = Convert<uint64_t>(GetReg64(system, 2)); | 3505 | thread_id = Convert<uint64_t>(GetArg64(args, 2)); |
| 3506 | context_flags = Convert<uint32_t>(GetReg64(system, 3)); | 3506 | context_flags = Convert<uint32_t>(GetArg64(args, 3)); |
| 3507 | 3507 | ||
| 3508 | ret = GetDebugThreadContext64(system, out_context, debug_handle, thread_id, context_flags); | 3508 | ret = GetDebugThreadContext64(system, out_context, debug_handle, thread_id, context_flags); |
| 3509 | 3509 | ||
| 3510 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 3510 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 3511 | } | 3511 | } |
| 3512 | 3512 | ||
| 3513 | static void SvcWrap_SetDebugThreadContext64(Core::System& system) { | 3513 | static void SvcWrap_SetDebugThreadContext64(Core::System& system, std::span<uint64_t, 8> args) { |
| 3514 | Result ret{}; | 3514 | Result ret{}; |
| 3515 | 3515 | ||
| 3516 | Handle debug_handle{}; | 3516 | Handle debug_handle{}; |
| @@ -3518,17 +3518,17 @@ static void SvcWrap_SetDebugThreadContext64(Core::System& system) { | |||
| 3518 | uint64_t context{}; | 3518 | uint64_t context{}; |
| 3519 | uint32_t context_flags{}; | 3519 | uint32_t context_flags{}; |
| 3520 | 3520 | ||
| 3521 | debug_handle = Convert<Handle>(GetReg64(system, 0)); | 3521 | debug_handle = Convert<Handle>(GetArg64(args, 0)); |
| 3522 | thread_id = Convert<uint64_t>(GetReg64(system, 1)); | 3522 | thread_id = Convert<uint64_t>(GetArg64(args, 1)); |
| 3523 | context = Convert<uint64_t>(GetReg64(system, 2)); | 3523 | context = Convert<uint64_t>(GetArg64(args, 2)); |
| 3524 | context_flags = Convert<uint32_t>(GetReg64(system, 3)); | 3524 | context_flags = Convert<uint32_t>(GetArg64(args, 3)); |
| 3525 | 3525 | ||
| 3526 | ret = SetDebugThreadContext64(system, debug_handle, thread_id, context, context_flags); | 3526 | ret = SetDebugThreadContext64(system, debug_handle, thread_id, context, context_flags); |
| 3527 | 3527 | ||
| 3528 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 3528 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 3529 | } | 3529 | } |
| 3530 | 3530 | ||
| 3531 | static void SvcWrap_QueryDebugProcessMemory64(Core::System& system) { | 3531 | static void SvcWrap_QueryDebugProcessMemory64(Core::System& system, std::span<uint64_t, 8> args) { |
| 3532 | Result ret{}; | 3532 | Result ret{}; |
| 3533 | 3533 | ||
| 3534 | PageInfo out_page_info{}; | 3534 | PageInfo out_page_info{}; |
| @@ -3536,17 +3536,17 @@ static void SvcWrap_QueryDebugProcessMemory64(Core::System& system) { | |||
| 3536 | Handle process_handle{}; | 3536 | Handle process_handle{}; |
| 3537 | uint64_t address{}; | 3537 | uint64_t address{}; |
| 3538 | 3538 | ||
| 3539 | out_memory_info = Convert<uint64_t>(GetReg64(system, 0)); | 3539 | out_memory_info = Convert<uint64_t>(GetArg64(args, 0)); |
| 3540 | process_handle = Convert<Handle>(GetReg64(system, 2)); | 3540 | process_handle = Convert<Handle>(GetArg64(args, 2)); |
| 3541 | address = Convert<uint64_t>(GetReg64(system, 3)); | 3541 | address = Convert<uint64_t>(GetArg64(args, 3)); |
| 3542 | 3542 | ||
| 3543 | ret = QueryDebugProcessMemory64(system, out_memory_info, std::addressof(out_page_info), process_handle, address); | 3543 | ret = QueryDebugProcessMemory64(system, out_memory_info, std::addressof(out_page_info), process_handle, address); |
| 3544 | 3544 | ||
| 3545 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 3545 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 3546 | SetReg64(system, 1, Convert<uint64_t>(out_page_info)); | 3546 | SetArg64(args, 1, Convert<uint64_t>(out_page_info)); |
| 3547 | } | 3547 | } |
| 3548 | 3548 | ||
| 3549 | static void SvcWrap_ReadDebugProcessMemory64(Core::System& system) { | 3549 | static void SvcWrap_ReadDebugProcessMemory64(Core::System& system, std::span<uint64_t, 8> args) { |
| 3550 | Result ret{}; | 3550 | Result ret{}; |
| 3551 | 3551 | ||
| 3552 | uint64_t buffer{}; | 3552 | uint64_t buffer{}; |
| @@ -3554,17 +3554,17 @@ static void SvcWrap_ReadDebugProcessMemory64(Core::System& system) { | |||
| 3554 | uint64_t address{}; | 3554 | uint64_t address{}; |
| 3555 | uint64_t size{}; | 3555 | uint64_t size{}; |
| 3556 | 3556 | ||
| 3557 | buffer = Convert<uint64_t>(GetReg64(system, 0)); | 3557 | buffer = Convert<uint64_t>(GetArg64(args, 0)); |
| 3558 | debug_handle = Convert<Handle>(GetReg64(system, 1)); | 3558 | debug_handle = Convert<Handle>(GetArg64(args, 1)); |
| 3559 | address = Convert<uint64_t>(GetReg64(system, 2)); | 3559 | address = Convert<uint64_t>(GetArg64(args, 2)); |
| 3560 | size = Convert<uint64_t>(GetReg64(system, 3)); | 3560 | size = Convert<uint64_t>(GetArg64(args, 3)); |
| 3561 | 3561 | ||
| 3562 | ret = ReadDebugProcessMemory64(system, buffer, debug_handle, address, size); | 3562 | ret = ReadDebugProcessMemory64(system, buffer, debug_handle, address, size); |
| 3563 | 3563 | ||
| 3564 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 3564 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 3565 | } | 3565 | } |
| 3566 | 3566 | ||
| 3567 | static void SvcWrap_WriteDebugProcessMemory64(Core::System& system) { | 3567 | static void SvcWrap_WriteDebugProcessMemory64(Core::System& system, std::span<uint64_t, 8> args) { |
| 3568 | Result ret{}; | 3568 | Result ret{}; |
| 3569 | 3569 | ||
| 3570 | Handle debug_handle{}; | 3570 | Handle debug_handle{}; |
| @@ -3572,33 +3572,33 @@ static void SvcWrap_WriteDebugProcessMemory64(Core::System& system) { | |||
| 3572 | uint64_t address{}; | 3572 | uint64_t address{}; |
| 3573 | uint64_t size{}; | 3573 | uint64_t size{}; |
| 3574 | 3574 | ||
| 3575 | debug_handle = Convert<Handle>(GetReg64(system, 0)); | 3575 | debug_handle = Convert<Handle>(GetArg64(args, 0)); |
| 3576 | buffer = Convert<uint64_t>(GetReg64(system, 1)); | 3576 | buffer = Convert<uint64_t>(GetArg64(args, 1)); |
| 3577 | address = Convert<uint64_t>(GetReg64(system, 2)); | 3577 | address = Convert<uint64_t>(GetArg64(args, 2)); |
| 3578 | size = Convert<uint64_t>(GetReg64(system, 3)); | 3578 | size = Convert<uint64_t>(GetArg64(args, 3)); |
| 3579 | 3579 | ||
| 3580 | ret = WriteDebugProcessMemory64(system, debug_handle, buffer, address, size); | 3580 | ret = WriteDebugProcessMemory64(system, debug_handle, buffer, address, size); |
| 3581 | 3581 | ||
| 3582 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 3582 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 3583 | } | 3583 | } |
| 3584 | 3584 | ||
| 3585 | static void SvcWrap_SetHardwareBreakPoint64(Core::System& system) { | 3585 | static void SvcWrap_SetHardwareBreakPoint64(Core::System& system, std::span<uint64_t, 8> args) { |
| 3586 | Result ret{}; | 3586 | Result ret{}; |
| 3587 | 3587 | ||
| 3588 | HardwareBreakPointRegisterName name{}; | 3588 | HardwareBreakPointRegisterName name{}; |
| 3589 | uint64_t flags{}; | 3589 | uint64_t flags{}; |
| 3590 | uint64_t value{}; | 3590 | uint64_t value{}; |
| 3591 | 3591 | ||
| 3592 | name = Convert<HardwareBreakPointRegisterName>(GetReg64(system, 0)); | 3592 | name = Convert<HardwareBreakPointRegisterName>(GetArg64(args, 0)); |
| 3593 | flags = Convert<uint64_t>(GetReg64(system, 1)); | 3593 | flags = Convert<uint64_t>(GetArg64(args, 1)); |
| 3594 | value = Convert<uint64_t>(GetReg64(system, 2)); | 3594 | value = Convert<uint64_t>(GetArg64(args, 2)); |
| 3595 | 3595 | ||
| 3596 | ret = SetHardwareBreakPoint64(system, name, flags, value); | 3596 | ret = SetHardwareBreakPoint64(system, name, flags, value); |
| 3597 | 3597 | ||
| 3598 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 3598 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 3599 | } | 3599 | } |
| 3600 | 3600 | ||
| 3601 | static void SvcWrap_GetDebugThreadParam64(Core::System& system) { | 3601 | static void SvcWrap_GetDebugThreadParam64(Core::System& system, std::span<uint64_t, 8> args) { |
| 3602 | Result ret{}; | 3602 | Result ret{}; |
| 3603 | 3603 | ||
| 3604 | uint64_t out_64{}; | 3604 | uint64_t out_64{}; |
| @@ -3607,18 +3607,18 @@ static void SvcWrap_GetDebugThreadParam64(Core::System& system) { | |||
| 3607 | uint64_t thread_id{}; | 3607 | uint64_t thread_id{}; |
| 3608 | DebugThreadParam param{}; | 3608 | DebugThreadParam param{}; |
| 3609 | 3609 | ||
| 3610 | debug_handle = Convert<Handle>(GetReg64(system, 2)); | 3610 | debug_handle = Convert<Handle>(GetArg64(args, 2)); |
| 3611 | thread_id = Convert<uint64_t>(GetReg64(system, 3)); | 3611 | thread_id = Convert<uint64_t>(GetArg64(args, 3)); |
| 3612 | param = Convert<DebugThreadParam>(GetReg64(system, 4)); | 3612 | param = Convert<DebugThreadParam>(GetArg64(args, 4)); |
| 3613 | 3613 | ||
| 3614 | ret = GetDebugThreadParam64(system, std::addressof(out_64), std::addressof(out_32), debug_handle, thread_id, param); | 3614 | ret = GetDebugThreadParam64(system, std::addressof(out_64), std::addressof(out_32), debug_handle, thread_id, param); |
| 3615 | 3615 | ||
| 3616 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 3616 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 3617 | SetReg64(system, 1, Convert<uint64_t>(out_64)); | 3617 | SetArg64(args, 1, Convert<uint64_t>(out_64)); |
| 3618 | SetReg64(system, 2, Convert<uint64_t>(out_32)); | 3618 | SetArg64(args, 2, Convert<uint64_t>(out_32)); |
| 3619 | } | 3619 | } |
| 3620 | 3620 | ||
| 3621 | static void SvcWrap_GetSystemInfo64(Core::System& system) { | 3621 | static void SvcWrap_GetSystemInfo64(Core::System& system, std::span<uint64_t, 8> args) { |
| 3622 | Result ret{}; | 3622 | Result ret{}; |
| 3623 | 3623 | ||
| 3624 | uint64_t out{}; | 3624 | uint64_t out{}; |
| @@ -3626,17 +3626,17 @@ static void SvcWrap_GetSystemInfo64(Core::System& system) { | |||
| 3626 | Handle handle{}; | 3626 | Handle handle{}; |
| 3627 | uint64_t info_subtype{}; | 3627 | uint64_t info_subtype{}; |
| 3628 | 3628 | ||
| 3629 | info_type = Convert<SystemInfoType>(GetReg64(system, 1)); | 3629 | info_type = Convert<SystemInfoType>(GetArg64(args, 1)); |
| 3630 | handle = Convert<Handle>(GetReg64(system, 2)); | 3630 | handle = Convert<Handle>(GetArg64(args, 2)); |
| 3631 | info_subtype = Convert<uint64_t>(GetReg64(system, 3)); | 3631 | info_subtype = Convert<uint64_t>(GetArg64(args, 3)); |
| 3632 | 3632 | ||
| 3633 | ret = GetSystemInfo64(system, std::addressof(out), info_type, handle, info_subtype); | 3633 | ret = GetSystemInfo64(system, std::addressof(out), info_type, handle, info_subtype); |
| 3634 | 3634 | ||
| 3635 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 3635 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 3636 | SetReg64(system, 1, Convert<uint64_t>(out)); | 3636 | SetArg64(args, 1, Convert<uint64_t>(out)); |
| 3637 | } | 3637 | } |
| 3638 | 3638 | ||
| 3639 | static void SvcWrap_CreatePort64(Core::System& system) { | 3639 | static void SvcWrap_CreatePort64(Core::System& system, std::span<uint64_t, 8> args) { |
| 3640 | Result ret{}; | 3640 | Result ret{}; |
| 3641 | 3641 | ||
| 3642 | Handle out_server_handle{}; | 3642 | Handle out_server_handle{}; |
| @@ -3645,48 +3645,48 @@ static void SvcWrap_CreatePort64(Core::System& system) { | |||
| 3645 | bool is_light{}; | 3645 | bool is_light{}; |
| 3646 | uint64_t name{}; | 3646 | uint64_t name{}; |
| 3647 | 3647 | ||
| 3648 | max_sessions = Convert<int32_t>(GetReg64(system, 2)); | 3648 | max_sessions = Convert<int32_t>(GetArg64(args, 2)); |
| 3649 | is_light = Convert<bool>(GetReg64(system, 3)); | 3649 | is_light = Convert<bool>(GetArg64(args, 3)); |
| 3650 | name = Convert<uint64_t>(GetReg64(system, 4)); | 3650 | name = Convert<uint64_t>(GetArg64(args, 4)); |
| 3651 | 3651 | ||
| 3652 | ret = CreatePort64(system, std::addressof(out_server_handle), std::addressof(out_client_handle), max_sessions, is_light, name); | 3652 | ret = CreatePort64(system, std::addressof(out_server_handle), std::addressof(out_client_handle), max_sessions, is_light, name); |
| 3653 | 3653 | ||
| 3654 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 3654 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 3655 | SetReg64(system, 1, Convert<uint64_t>(out_server_handle)); | 3655 | SetArg64(args, 1, Convert<uint64_t>(out_server_handle)); |
| 3656 | SetReg64(system, 2, Convert<uint64_t>(out_client_handle)); | 3656 | SetArg64(args, 2, Convert<uint64_t>(out_client_handle)); |
| 3657 | } | 3657 | } |
| 3658 | 3658 | ||
| 3659 | static void SvcWrap_ManageNamedPort64(Core::System& system) { | 3659 | static void SvcWrap_ManageNamedPort64(Core::System& system, std::span<uint64_t, 8> args) { |
| 3660 | Result ret{}; | 3660 | Result ret{}; |
| 3661 | 3661 | ||
| 3662 | Handle out_server_handle{}; | 3662 | Handle out_server_handle{}; |
| 3663 | uint64_t name{}; | 3663 | uint64_t name{}; |
| 3664 | int32_t max_sessions{}; | 3664 | int32_t max_sessions{}; |
| 3665 | 3665 | ||
| 3666 | name = Convert<uint64_t>(GetReg64(system, 1)); | 3666 | name = Convert<uint64_t>(GetArg64(args, 1)); |
| 3667 | max_sessions = Convert<int32_t>(GetReg64(system, 2)); | 3667 | max_sessions = Convert<int32_t>(GetArg64(args, 2)); |
| 3668 | 3668 | ||
| 3669 | ret = ManageNamedPort64(system, std::addressof(out_server_handle), name, max_sessions); | 3669 | ret = ManageNamedPort64(system, std::addressof(out_server_handle), name, max_sessions); |
| 3670 | 3670 | ||
| 3671 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 3671 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 3672 | SetReg64(system, 1, Convert<uint64_t>(out_server_handle)); | 3672 | SetArg64(args, 1, Convert<uint64_t>(out_server_handle)); |
| 3673 | } | 3673 | } |
| 3674 | 3674 | ||
| 3675 | static void SvcWrap_ConnectToPort64(Core::System& system) { | 3675 | static void SvcWrap_ConnectToPort64(Core::System& system, std::span<uint64_t, 8> args) { |
| 3676 | Result ret{}; | 3676 | Result ret{}; |
| 3677 | 3677 | ||
| 3678 | Handle out_handle{}; | 3678 | Handle out_handle{}; |
| 3679 | Handle port{}; | 3679 | Handle port{}; |
| 3680 | 3680 | ||
| 3681 | port = Convert<Handle>(GetReg64(system, 1)); | 3681 | port = Convert<Handle>(GetArg64(args, 1)); |
| 3682 | 3682 | ||
| 3683 | ret = ConnectToPort64(system, std::addressof(out_handle), port); | 3683 | ret = ConnectToPort64(system, std::addressof(out_handle), port); |
| 3684 | 3684 | ||
| 3685 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 3685 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 3686 | SetReg64(system, 1, Convert<uint64_t>(out_handle)); | 3686 | SetArg64(args, 1, Convert<uint64_t>(out_handle)); |
| 3687 | } | 3687 | } |
| 3688 | 3688 | ||
| 3689 | static void SvcWrap_SetProcessMemoryPermission64(Core::System& system) { | 3689 | static void SvcWrap_SetProcessMemoryPermission64(Core::System& system, std::span<uint64_t, 8> args) { |
| 3690 | Result ret{}; | 3690 | Result ret{}; |
| 3691 | 3691 | ||
| 3692 | Handle process_handle{}; | 3692 | Handle process_handle{}; |
| @@ -3694,17 +3694,17 @@ static void SvcWrap_SetProcessMemoryPermission64(Core::System& system) { | |||
| 3694 | uint64_t size{}; | 3694 | uint64_t size{}; |
| 3695 | MemoryPermission perm{}; | 3695 | MemoryPermission perm{}; |
| 3696 | 3696 | ||
| 3697 | process_handle = Convert<Handle>(GetReg64(system, 0)); | 3697 | process_handle = Convert<Handle>(GetArg64(args, 0)); |
| 3698 | address = Convert<uint64_t>(GetReg64(system, 1)); | 3698 | address = Convert<uint64_t>(GetArg64(args, 1)); |
| 3699 | size = Convert<uint64_t>(GetReg64(system, 2)); | 3699 | size = Convert<uint64_t>(GetArg64(args, 2)); |
| 3700 | perm = Convert<MemoryPermission>(GetReg64(system, 3)); | 3700 | perm = Convert<MemoryPermission>(GetArg64(args, 3)); |
| 3701 | 3701 | ||
| 3702 | ret = SetProcessMemoryPermission64(system, process_handle, address, size, perm); | 3702 | ret = SetProcessMemoryPermission64(system, process_handle, address, size, perm); |
| 3703 | 3703 | ||
| 3704 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 3704 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 3705 | } | 3705 | } |
| 3706 | 3706 | ||
| 3707 | static void SvcWrap_MapProcessMemory64(Core::System& system) { | 3707 | static void SvcWrap_MapProcessMemory64(Core::System& system, std::span<uint64_t, 8> args) { |
| 3708 | Result ret{}; | 3708 | Result ret{}; |
| 3709 | 3709 | ||
| 3710 | uint64_t dst_address{}; | 3710 | uint64_t dst_address{}; |
| @@ -3712,17 +3712,17 @@ static void SvcWrap_MapProcessMemory64(Core::System& system) { | |||
| 3712 | uint64_t src_address{}; | 3712 | uint64_t src_address{}; |
| 3713 | uint64_t size{}; | 3713 | uint64_t size{}; |
| 3714 | 3714 | ||
| 3715 | dst_address = Convert<uint64_t>(GetReg64(system, 0)); | 3715 | dst_address = Convert<uint64_t>(GetArg64(args, 0)); |
| 3716 | process_handle = Convert<Handle>(GetReg64(system, 1)); | 3716 | process_handle = Convert<Handle>(GetArg64(args, 1)); |
| 3717 | src_address = Convert<uint64_t>(GetReg64(system, 2)); | 3717 | src_address = Convert<uint64_t>(GetArg64(args, 2)); |
| 3718 | size = Convert<uint64_t>(GetReg64(system, 3)); | 3718 | size = Convert<uint64_t>(GetArg64(args, 3)); |
| 3719 | 3719 | ||
| 3720 | ret = MapProcessMemory64(system, dst_address, process_handle, src_address, size); | 3720 | ret = MapProcessMemory64(system, dst_address, process_handle, src_address, size); |
| 3721 | 3721 | ||
| 3722 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 3722 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 3723 | } | 3723 | } |
| 3724 | 3724 | ||
| 3725 | static void SvcWrap_UnmapProcessMemory64(Core::System& system) { | 3725 | static void SvcWrap_UnmapProcessMemory64(Core::System& system, std::span<uint64_t, 8> args) { |
| 3726 | Result ret{}; | 3726 | Result ret{}; |
| 3727 | 3727 | ||
| 3728 | uint64_t dst_address{}; | 3728 | uint64_t dst_address{}; |
| @@ -3730,17 +3730,17 @@ static void SvcWrap_UnmapProcessMemory64(Core::System& system) { | |||
| 3730 | uint64_t src_address{}; | 3730 | uint64_t src_address{}; |
| 3731 | uint64_t size{}; | 3731 | uint64_t size{}; |
| 3732 | 3732 | ||
| 3733 | dst_address = Convert<uint64_t>(GetReg64(system, 0)); | 3733 | dst_address = Convert<uint64_t>(GetArg64(args, 0)); |
| 3734 | process_handle = Convert<Handle>(GetReg64(system, 1)); | 3734 | process_handle = Convert<Handle>(GetArg64(args, 1)); |
| 3735 | src_address = Convert<uint64_t>(GetReg64(system, 2)); | 3735 | src_address = Convert<uint64_t>(GetArg64(args, 2)); |
| 3736 | size = Convert<uint64_t>(GetReg64(system, 3)); | 3736 | size = Convert<uint64_t>(GetArg64(args, 3)); |
| 3737 | 3737 | ||
| 3738 | ret = UnmapProcessMemory64(system, dst_address, process_handle, src_address, size); | 3738 | ret = UnmapProcessMemory64(system, dst_address, process_handle, src_address, size); |
| 3739 | 3739 | ||
| 3740 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 3740 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 3741 | } | 3741 | } |
| 3742 | 3742 | ||
| 3743 | static void SvcWrap_QueryProcessMemory64(Core::System& system) { | 3743 | static void SvcWrap_QueryProcessMemory64(Core::System& system, std::span<uint64_t, 8> args) { |
| 3744 | Result ret{}; | 3744 | Result ret{}; |
| 3745 | 3745 | ||
| 3746 | PageInfo out_page_info{}; | 3746 | PageInfo out_page_info{}; |
| @@ -3748,17 +3748,17 @@ static void SvcWrap_QueryProcessMemory64(Core::System& system) { | |||
| 3748 | Handle process_handle{}; | 3748 | Handle process_handle{}; |
| 3749 | uint64_t address{}; | 3749 | uint64_t address{}; |
| 3750 | 3750 | ||
| 3751 | out_memory_info = Convert<uint64_t>(GetReg64(system, 0)); | 3751 | out_memory_info = Convert<uint64_t>(GetArg64(args, 0)); |
| 3752 | process_handle = Convert<Handle>(GetReg64(system, 2)); | 3752 | process_handle = Convert<Handle>(GetArg64(args, 2)); |
| 3753 | address = Convert<uint64_t>(GetReg64(system, 3)); | 3753 | address = Convert<uint64_t>(GetArg64(args, 3)); |
| 3754 | 3754 | ||
| 3755 | ret = QueryProcessMemory64(system, out_memory_info, std::addressof(out_page_info), process_handle, address); | 3755 | ret = QueryProcessMemory64(system, out_memory_info, std::addressof(out_page_info), process_handle, address); |
| 3756 | 3756 | ||
| 3757 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 3757 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 3758 | SetReg64(system, 1, Convert<uint64_t>(out_page_info)); | 3758 | SetArg64(args, 1, Convert<uint64_t>(out_page_info)); |
| 3759 | } | 3759 | } |
| 3760 | 3760 | ||
| 3761 | static void SvcWrap_MapProcessCodeMemory64(Core::System& system) { | 3761 | static void SvcWrap_MapProcessCodeMemory64(Core::System& system, std::span<uint64_t, 8> args) { |
| 3762 | Result ret{}; | 3762 | Result ret{}; |
| 3763 | 3763 | ||
| 3764 | Handle process_handle{}; | 3764 | Handle process_handle{}; |
| @@ -3766,17 +3766,17 @@ static void SvcWrap_MapProcessCodeMemory64(Core::System& system) { | |||
| 3766 | uint64_t src_address{}; | 3766 | uint64_t src_address{}; |
| 3767 | uint64_t size{}; | 3767 | uint64_t size{}; |
| 3768 | 3768 | ||
| 3769 | process_handle = Convert<Handle>(GetReg64(system, 0)); | 3769 | process_handle = Convert<Handle>(GetArg64(args, 0)); |
| 3770 | dst_address = Convert<uint64_t>(GetReg64(system, 1)); | 3770 | dst_address = Convert<uint64_t>(GetArg64(args, 1)); |
| 3771 | src_address = Convert<uint64_t>(GetReg64(system, 2)); | 3771 | src_address = Convert<uint64_t>(GetArg64(args, 2)); |
| 3772 | size = Convert<uint64_t>(GetReg64(system, 3)); | 3772 | size = Convert<uint64_t>(GetArg64(args, 3)); |
| 3773 | 3773 | ||
| 3774 | ret = MapProcessCodeMemory64(system, process_handle, dst_address, src_address, size); | 3774 | ret = MapProcessCodeMemory64(system, process_handle, dst_address, src_address, size); |
| 3775 | 3775 | ||
| 3776 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 3776 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 3777 | } | 3777 | } |
| 3778 | 3778 | ||
| 3779 | static void SvcWrap_UnmapProcessCodeMemory64(Core::System& system) { | 3779 | static void SvcWrap_UnmapProcessCodeMemory64(Core::System& system, std::span<uint64_t, 8> args) { |
| 3780 | Result ret{}; | 3780 | Result ret{}; |
| 3781 | 3781 | ||
| 3782 | Handle process_handle{}; | 3782 | Handle process_handle{}; |
| @@ -3784,17 +3784,17 @@ static void SvcWrap_UnmapProcessCodeMemory64(Core::System& system) { | |||
| 3784 | uint64_t src_address{}; | 3784 | uint64_t src_address{}; |
| 3785 | uint64_t size{}; | 3785 | uint64_t size{}; |
| 3786 | 3786 | ||
| 3787 | process_handle = Convert<Handle>(GetReg64(system, 0)); | 3787 | process_handle = Convert<Handle>(GetArg64(args, 0)); |
| 3788 | dst_address = Convert<uint64_t>(GetReg64(system, 1)); | 3788 | dst_address = Convert<uint64_t>(GetArg64(args, 1)); |
| 3789 | src_address = Convert<uint64_t>(GetReg64(system, 2)); | 3789 | src_address = Convert<uint64_t>(GetArg64(args, 2)); |
| 3790 | size = Convert<uint64_t>(GetReg64(system, 3)); | 3790 | size = Convert<uint64_t>(GetArg64(args, 3)); |
| 3791 | 3791 | ||
| 3792 | ret = UnmapProcessCodeMemory64(system, process_handle, dst_address, src_address, size); | 3792 | ret = UnmapProcessCodeMemory64(system, process_handle, dst_address, src_address, size); |
| 3793 | 3793 | ||
| 3794 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 3794 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 3795 | } | 3795 | } |
| 3796 | 3796 | ||
| 3797 | static void SvcWrap_CreateProcess64(Core::System& system) { | 3797 | static void SvcWrap_CreateProcess64(Core::System& system, std::span<uint64_t, 8> args) { |
| 3798 | Result ret{}; | 3798 | Result ret{}; |
| 3799 | 3799 | ||
| 3800 | Handle out_handle{}; | 3800 | Handle out_handle{}; |
| @@ -3802,17 +3802,17 @@ static void SvcWrap_CreateProcess64(Core::System& system) { | |||
| 3802 | uint64_t caps{}; | 3802 | uint64_t caps{}; |
| 3803 | int32_t num_caps{}; | 3803 | int32_t num_caps{}; |
| 3804 | 3804 | ||
| 3805 | parameters = Convert<uint64_t>(GetReg64(system, 1)); | 3805 | parameters = Convert<uint64_t>(GetArg64(args, 1)); |
| 3806 | caps = Convert<uint64_t>(GetReg64(system, 2)); | 3806 | caps = Convert<uint64_t>(GetArg64(args, 2)); |
| 3807 | num_caps = Convert<int32_t>(GetReg64(system, 3)); | 3807 | num_caps = Convert<int32_t>(GetArg64(args, 3)); |
| 3808 | 3808 | ||
| 3809 | ret = CreateProcess64(system, std::addressof(out_handle), parameters, caps, num_caps); | 3809 | ret = CreateProcess64(system, std::addressof(out_handle), parameters, caps, num_caps); |
| 3810 | 3810 | ||
| 3811 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 3811 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 3812 | SetReg64(system, 1, Convert<uint64_t>(out_handle)); | 3812 | SetArg64(args, 1, Convert<uint64_t>(out_handle)); |
| 3813 | } | 3813 | } |
| 3814 | 3814 | ||
| 3815 | static void SvcWrap_StartProcess64(Core::System& system) { | 3815 | static void SvcWrap_StartProcess64(Core::System& system, std::span<uint64_t, 8> args) { |
| 3816 | Result ret{}; | 3816 | Result ret{}; |
| 3817 | 3817 | ||
| 3818 | Handle process_handle{}; | 3818 | Handle process_handle{}; |
| @@ -3820,601 +3820,601 @@ static void SvcWrap_StartProcess64(Core::System& system) { | |||
| 3820 | int32_t core_id{}; | 3820 | int32_t core_id{}; |
| 3821 | uint64_t main_thread_stack_size{}; | 3821 | uint64_t main_thread_stack_size{}; |
| 3822 | 3822 | ||
| 3823 | process_handle = Convert<Handle>(GetReg64(system, 0)); | 3823 | process_handle = Convert<Handle>(GetArg64(args, 0)); |
| 3824 | priority = Convert<int32_t>(GetReg64(system, 1)); | 3824 | priority = Convert<int32_t>(GetArg64(args, 1)); |
| 3825 | core_id = Convert<int32_t>(GetReg64(system, 2)); | 3825 | core_id = Convert<int32_t>(GetArg64(args, 2)); |
| 3826 | main_thread_stack_size = Convert<uint64_t>(GetReg64(system, 3)); | 3826 | main_thread_stack_size = Convert<uint64_t>(GetArg64(args, 3)); |
| 3827 | 3827 | ||
| 3828 | ret = StartProcess64(system, process_handle, priority, core_id, main_thread_stack_size); | 3828 | ret = StartProcess64(system, process_handle, priority, core_id, main_thread_stack_size); |
| 3829 | 3829 | ||
| 3830 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 3830 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 3831 | } | 3831 | } |
| 3832 | 3832 | ||
| 3833 | static void SvcWrap_TerminateProcess64(Core::System& system) { | 3833 | static void SvcWrap_TerminateProcess64(Core::System& system, std::span<uint64_t, 8> args) { |
| 3834 | Result ret{}; | 3834 | Result ret{}; |
| 3835 | 3835 | ||
| 3836 | Handle process_handle{}; | 3836 | Handle process_handle{}; |
| 3837 | 3837 | ||
| 3838 | process_handle = Convert<Handle>(GetReg64(system, 0)); | 3838 | process_handle = Convert<Handle>(GetArg64(args, 0)); |
| 3839 | 3839 | ||
| 3840 | ret = TerminateProcess64(system, process_handle); | 3840 | ret = TerminateProcess64(system, process_handle); |
| 3841 | 3841 | ||
| 3842 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 3842 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 3843 | } | 3843 | } |
| 3844 | 3844 | ||
| 3845 | static void SvcWrap_GetProcessInfo64(Core::System& system) { | 3845 | static void SvcWrap_GetProcessInfo64(Core::System& system, std::span<uint64_t, 8> args) { |
| 3846 | Result ret{}; | 3846 | Result ret{}; |
| 3847 | 3847 | ||
| 3848 | int64_t out_info{}; | 3848 | int64_t out_info{}; |
| 3849 | Handle process_handle{}; | 3849 | Handle process_handle{}; |
| 3850 | ProcessInfoType info_type{}; | 3850 | ProcessInfoType info_type{}; |
| 3851 | 3851 | ||
| 3852 | process_handle = Convert<Handle>(GetReg64(system, 1)); | 3852 | process_handle = Convert<Handle>(GetArg64(args, 1)); |
| 3853 | info_type = Convert<ProcessInfoType>(GetReg64(system, 2)); | 3853 | info_type = Convert<ProcessInfoType>(GetArg64(args, 2)); |
| 3854 | 3854 | ||
| 3855 | ret = GetProcessInfo64(system, std::addressof(out_info), process_handle, info_type); | 3855 | ret = GetProcessInfo64(system, std::addressof(out_info), process_handle, info_type); |
| 3856 | 3856 | ||
| 3857 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 3857 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 3858 | SetReg64(system, 1, Convert<uint64_t>(out_info)); | 3858 | SetArg64(args, 1, Convert<uint64_t>(out_info)); |
| 3859 | } | 3859 | } |
| 3860 | 3860 | ||
| 3861 | static void SvcWrap_CreateResourceLimit64(Core::System& system) { | 3861 | static void SvcWrap_CreateResourceLimit64(Core::System& system, std::span<uint64_t, 8> args) { |
| 3862 | Result ret{}; | 3862 | Result ret{}; |
| 3863 | 3863 | ||
| 3864 | Handle out_handle{}; | 3864 | Handle out_handle{}; |
| 3865 | 3865 | ||
| 3866 | ret = CreateResourceLimit64(system, std::addressof(out_handle)); | 3866 | ret = CreateResourceLimit64(system, std::addressof(out_handle)); |
| 3867 | 3867 | ||
| 3868 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 3868 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 3869 | SetReg64(system, 1, Convert<uint64_t>(out_handle)); | 3869 | SetArg64(args, 1, Convert<uint64_t>(out_handle)); |
| 3870 | } | 3870 | } |
| 3871 | 3871 | ||
| 3872 | static void SvcWrap_SetResourceLimitLimitValue64(Core::System& system) { | 3872 | static void SvcWrap_SetResourceLimitLimitValue64(Core::System& system, std::span<uint64_t, 8> args) { |
| 3873 | Result ret{}; | 3873 | Result ret{}; |
| 3874 | 3874 | ||
| 3875 | Handle resource_limit_handle{}; | 3875 | Handle resource_limit_handle{}; |
| 3876 | LimitableResource which{}; | 3876 | LimitableResource which{}; |
| 3877 | int64_t limit_value{}; | 3877 | int64_t limit_value{}; |
| 3878 | 3878 | ||
| 3879 | resource_limit_handle = Convert<Handle>(GetReg64(system, 0)); | 3879 | resource_limit_handle = Convert<Handle>(GetArg64(args, 0)); |
| 3880 | which = Convert<LimitableResource>(GetReg64(system, 1)); | 3880 | which = Convert<LimitableResource>(GetArg64(args, 1)); |
| 3881 | limit_value = Convert<int64_t>(GetReg64(system, 2)); | 3881 | limit_value = Convert<int64_t>(GetArg64(args, 2)); |
| 3882 | 3882 | ||
| 3883 | ret = SetResourceLimitLimitValue64(system, resource_limit_handle, which, limit_value); | 3883 | ret = SetResourceLimitLimitValue64(system, resource_limit_handle, which, limit_value); |
| 3884 | 3884 | ||
| 3885 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 3885 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 3886 | } | 3886 | } |
| 3887 | 3887 | ||
| 3888 | static void SvcWrap_MapInsecureMemory64(Core::System& system) { | 3888 | static void SvcWrap_MapInsecureMemory64(Core::System& system, std::span<uint64_t, 8> args) { |
| 3889 | Result ret{}; | 3889 | Result ret{}; |
| 3890 | 3890 | ||
| 3891 | uint64_t address{}; | 3891 | uint64_t address{}; |
| 3892 | uint64_t size{}; | 3892 | uint64_t size{}; |
| 3893 | 3893 | ||
| 3894 | address = Convert<uint64_t>(GetReg64(system, 0)); | 3894 | address = Convert<uint64_t>(GetArg64(args, 0)); |
| 3895 | size = Convert<uint64_t>(GetReg64(system, 1)); | 3895 | size = Convert<uint64_t>(GetArg64(args, 1)); |
| 3896 | 3896 | ||
| 3897 | ret = MapInsecureMemory64(system, address, size); | 3897 | ret = MapInsecureMemory64(system, address, size); |
| 3898 | 3898 | ||
| 3899 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 3899 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 3900 | } | 3900 | } |
| 3901 | 3901 | ||
| 3902 | static void SvcWrap_UnmapInsecureMemory64(Core::System& system) { | 3902 | static void SvcWrap_UnmapInsecureMemory64(Core::System& system, std::span<uint64_t, 8> args) { |
| 3903 | Result ret{}; | 3903 | Result ret{}; |
| 3904 | 3904 | ||
| 3905 | uint64_t address{}; | 3905 | uint64_t address{}; |
| 3906 | uint64_t size{}; | 3906 | uint64_t size{}; |
| 3907 | 3907 | ||
| 3908 | address = Convert<uint64_t>(GetReg64(system, 0)); | 3908 | address = Convert<uint64_t>(GetArg64(args, 0)); |
| 3909 | size = Convert<uint64_t>(GetReg64(system, 1)); | 3909 | size = Convert<uint64_t>(GetArg64(args, 1)); |
| 3910 | 3910 | ||
| 3911 | ret = UnmapInsecureMemory64(system, address, size); | 3911 | ret = UnmapInsecureMemory64(system, address, size); |
| 3912 | 3912 | ||
| 3913 | SetReg64(system, 0, Convert<uint64_t>(ret)); | 3913 | SetArg64(args, 0, Convert<uint64_t>(ret)); |
| 3914 | } | 3914 | } |
| 3915 | 3915 | ||
| 3916 | static void Call32(Core::System& system, u32 imm) { | 3916 | static void Call32(Core::System& system, u32 imm, std::span<uint64_t, 8> args) { |
| 3917 | switch (static_cast<SvcId>(imm)) { | 3917 | switch (static_cast<SvcId>(imm)) { |
| 3918 | case SvcId::SetHeapSize: | 3918 | case SvcId::SetHeapSize: |
| 3919 | return SvcWrap_SetHeapSize64From32(system); | 3919 | return SvcWrap_SetHeapSize64From32(system, args); |
| 3920 | case SvcId::SetMemoryPermission: | 3920 | case SvcId::SetMemoryPermission: |
| 3921 | return SvcWrap_SetMemoryPermission64From32(system); | 3921 | return SvcWrap_SetMemoryPermission64From32(system, args); |
| 3922 | case SvcId::SetMemoryAttribute: | 3922 | case SvcId::SetMemoryAttribute: |
| 3923 | return SvcWrap_SetMemoryAttribute64From32(system); | 3923 | return SvcWrap_SetMemoryAttribute64From32(system, args); |
| 3924 | case SvcId::MapMemory: | 3924 | case SvcId::MapMemory: |
| 3925 | return SvcWrap_MapMemory64From32(system); | 3925 | return SvcWrap_MapMemory64From32(system, args); |
| 3926 | case SvcId::UnmapMemory: | 3926 | case SvcId::UnmapMemory: |
| 3927 | return SvcWrap_UnmapMemory64From32(system); | 3927 | return SvcWrap_UnmapMemory64From32(system, args); |
| 3928 | case SvcId::QueryMemory: | 3928 | case SvcId::QueryMemory: |
| 3929 | return SvcWrap_QueryMemory64From32(system); | 3929 | return SvcWrap_QueryMemory64From32(system, args); |
| 3930 | case SvcId::ExitProcess: | 3930 | case SvcId::ExitProcess: |
| 3931 | return SvcWrap_ExitProcess64From32(system); | 3931 | return SvcWrap_ExitProcess64From32(system, args); |
| 3932 | case SvcId::CreateThread: | 3932 | case SvcId::CreateThread: |
| 3933 | return SvcWrap_CreateThread64From32(system); | 3933 | return SvcWrap_CreateThread64From32(system, args); |
| 3934 | case SvcId::StartThread: | 3934 | case SvcId::StartThread: |
| 3935 | return SvcWrap_StartThread64From32(system); | 3935 | return SvcWrap_StartThread64From32(system, args); |
| 3936 | case SvcId::ExitThread: | 3936 | case SvcId::ExitThread: |
| 3937 | return SvcWrap_ExitThread64From32(system); | 3937 | return SvcWrap_ExitThread64From32(system, args); |
| 3938 | case SvcId::SleepThread: | 3938 | case SvcId::SleepThread: |
| 3939 | return SvcWrap_SleepThread64From32(system); | 3939 | return SvcWrap_SleepThread64From32(system, args); |
| 3940 | case SvcId::GetThreadPriority: | 3940 | case SvcId::GetThreadPriority: |
| 3941 | return SvcWrap_GetThreadPriority64From32(system); | 3941 | return SvcWrap_GetThreadPriority64From32(system, args); |
| 3942 | case SvcId::SetThreadPriority: | 3942 | case SvcId::SetThreadPriority: |
| 3943 | return SvcWrap_SetThreadPriority64From32(system); | 3943 | return SvcWrap_SetThreadPriority64From32(system, args); |
| 3944 | case SvcId::GetThreadCoreMask: | 3944 | case SvcId::GetThreadCoreMask: |
| 3945 | return SvcWrap_GetThreadCoreMask64From32(system); | 3945 | return SvcWrap_GetThreadCoreMask64From32(system, args); |
| 3946 | case SvcId::SetThreadCoreMask: | 3946 | case SvcId::SetThreadCoreMask: |
| 3947 | return SvcWrap_SetThreadCoreMask64From32(system); | 3947 | return SvcWrap_SetThreadCoreMask64From32(system, args); |
| 3948 | case SvcId::GetCurrentProcessorNumber: | 3948 | case SvcId::GetCurrentProcessorNumber: |
| 3949 | return SvcWrap_GetCurrentProcessorNumber64From32(system); | 3949 | return SvcWrap_GetCurrentProcessorNumber64From32(system, args); |
| 3950 | case SvcId::SignalEvent: | 3950 | case SvcId::SignalEvent: |
| 3951 | return SvcWrap_SignalEvent64From32(system); | 3951 | return SvcWrap_SignalEvent64From32(system, args); |
| 3952 | case SvcId::ClearEvent: | 3952 | case SvcId::ClearEvent: |
| 3953 | return SvcWrap_ClearEvent64From32(system); | 3953 | return SvcWrap_ClearEvent64From32(system, args); |
| 3954 | case SvcId::MapSharedMemory: | 3954 | case SvcId::MapSharedMemory: |
| 3955 | return SvcWrap_MapSharedMemory64From32(system); | 3955 | return SvcWrap_MapSharedMemory64From32(system, args); |
| 3956 | case SvcId::UnmapSharedMemory: | 3956 | case SvcId::UnmapSharedMemory: |
| 3957 | return SvcWrap_UnmapSharedMemory64From32(system); | 3957 | return SvcWrap_UnmapSharedMemory64From32(system, args); |
| 3958 | case SvcId::CreateTransferMemory: | 3958 | case SvcId::CreateTransferMemory: |
| 3959 | return SvcWrap_CreateTransferMemory64From32(system); | 3959 | return SvcWrap_CreateTransferMemory64From32(system, args); |
| 3960 | case SvcId::CloseHandle: | 3960 | case SvcId::CloseHandle: |
| 3961 | return SvcWrap_CloseHandle64From32(system); | 3961 | return SvcWrap_CloseHandle64From32(system, args); |
| 3962 | case SvcId::ResetSignal: | 3962 | case SvcId::ResetSignal: |
| 3963 | return SvcWrap_ResetSignal64From32(system); | 3963 | return SvcWrap_ResetSignal64From32(system, args); |
| 3964 | case SvcId::WaitSynchronization: | 3964 | case SvcId::WaitSynchronization: |
| 3965 | return SvcWrap_WaitSynchronization64From32(system); | 3965 | return SvcWrap_WaitSynchronization64From32(system, args); |
| 3966 | case SvcId::CancelSynchronization: | 3966 | case SvcId::CancelSynchronization: |
| 3967 | return SvcWrap_CancelSynchronization64From32(system); | 3967 | return SvcWrap_CancelSynchronization64From32(system, args); |
| 3968 | case SvcId::ArbitrateLock: | 3968 | case SvcId::ArbitrateLock: |
| 3969 | return SvcWrap_ArbitrateLock64From32(system); | 3969 | return SvcWrap_ArbitrateLock64From32(system, args); |
| 3970 | case SvcId::ArbitrateUnlock: | 3970 | case SvcId::ArbitrateUnlock: |
| 3971 | return SvcWrap_ArbitrateUnlock64From32(system); | 3971 | return SvcWrap_ArbitrateUnlock64From32(system, args); |
| 3972 | case SvcId::WaitProcessWideKeyAtomic: | 3972 | case SvcId::WaitProcessWideKeyAtomic: |
| 3973 | return SvcWrap_WaitProcessWideKeyAtomic64From32(system); | 3973 | return SvcWrap_WaitProcessWideKeyAtomic64From32(system, args); |
| 3974 | case SvcId::SignalProcessWideKey: | 3974 | case SvcId::SignalProcessWideKey: |
| 3975 | return SvcWrap_SignalProcessWideKey64From32(system); | 3975 | return SvcWrap_SignalProcessWideKey64From32(system, args); |
| 3976 | case SvcId::GetSystemTick: | 3976 | case SvcId::GetSystemTick: |
| 3977 | return SvcWrap_GetSystemTick64From32(system); | 3977 | return SvcWrap_GetSystemTick64From32(system, args); |
| 3978 | case SvcId::ConnectToNamedPort: | 3978 | case SvcId::ConnectToNamedPort: |
| 3979 | return SvcWrap_ConnectToNamedPort64From32(system); | 3979 | return SvcWrap_ConnectToNamedPort64From32(system, args); |
| 3980 | case SvcId::SendSyncRequestLight: | 3980 | case SvcId::SendSyncRequestLight: |
| 3981 | return SvcWrap_SendSyncRequestLight64From32(system); | 3981 | return SvcWrap_SendSyncRequestLight64From32(system, args); |
| 3982 | case SvcId::SendSyncRequest: | 3982 | case SvcId::SendSyncRequest: |
| 3983 | return SvcWrap_SendSyncRequest64From32(system); | 3983 | return SvcWrap_SendSyncRequest64From32(system, args); |
| 3984 | case SvcId::SendSyncRequestWithUserBuffer: | 3984 | case SvcId::SendSyncRequestWithUserBuffer: |
| 3985 | return SvcWrap_SendSyncRequestWithUserBuffer64From32(system); | 3985 | return SvcWrap_SendSyncRequestWithUserBuffer64From32(system, args); |
| 3986 | case SvcId::SendAsyncRequestWithUserBuffer: | 3986 | case SvcId::SendAsyncRequestWithUserBuffer: |
| 3987 | return SvcWrap_SendAsyncRequestWithUserBuffer64From32(system); | 3987 | return SvcWrap_SendAsyncRequestWithUserBuffer64From32(system, args); |
| 3988 | case SvcId::GetProcessId: | 3988 | case SvcId::GetProcessId: |
| 3989 | return SvcWrap_GetProcessId64From32(system); | 3989 | return SvcWrap_GetProcessId64From32(system, args); |
| 3990 | case SvcId::GetThreadId: | 3990 | case SvcId::GetThreadId: |
| 3991 | return SvcWrap_GetThreadId64From32(system); | 3991 | return SvcWrap_GetThreadId64From32(system, args); |
| 3992 | case SvcId::Break: | 3992 | case SvcId::Break: |
| 3993 | return SvcWrap_Break64From32(system); | 3993 | return SvcWrap_Break64From32(system, args); |
| 3994 | case SvcId::OutputDebugString: | 3994 | case SvcId::OutputDebugString: |
| 3995 | return SvcWrap_OutputDebugString64From32(system); | 3995 | return SvcWrap_OutputDebugString64From32(system, args); |
| 3996 | case SvcId::ReturnFromException: | 3996 | case SvcId::ReturnFromException: |
| 3997 | return SvcWrap_ReturnFromException64From32(system); | 3997 | return SvcWrap_ReturnFromException64From32(system, args); |
| 3998 | case SvcId::GetInfo: | 3998 | case SvcId::GetInfo: |
| 3999 | return SvcWrap_GetInfo64From32(system); | 3999 | return SvcWrap_GetInfo64From32(system, args); |
| 4000 | case SvcId::FlushEntireDataCache: | 4000 | case SvcId::FlushEntireDataCache: |
| 4001 | return SvcWrap_FlushEntireDataCache64From32(system); | 4001 | return SvcWrap_FlushEntireDataCache64From32(system, args); |
| 4002 | case SvcId::FlushDataCache: | 4002 | case SvcId::FlushDataCache: |
| 4003 | return SvcWrap_FlushDataCache64From32(system); | 4003 | return SvcWrap_FlushDataCache64From32(system, args); |
| 4004 | case SvcId::MapPhysicalMemory: | 4004 | case SvcId::MapPhysicalMemory: |
| 4005 | return SvcWrap_MapPhysicalMemory64From32(system); | 4005 | return SvcWrap_MapPhysicalMemory64From32(system, args); |
| 4006 | case SvcId::UnmapPhysicalMemory: | 4006 | case SvcId::UnmapPhysicalMemory: |
| 4007 | return SvcWrap_UnmapPhysicalMemory64From32(system); | 4007 | return SvcWrap_UnmapPhysicalMemory64From32(system, args); |
| 4008 | case SvcId::GetDebugFutureThreadInfo: | 4008 | case SvcId::GetDebugFutureThreadInfo: |
| 4009 | return SvcWrap_GetDebugFutureThreadInfo64From32(system); | 4009 | return SvcWrap_GetDebugFutureThreadInfo64From32(system, args); |
| 4010 | case SvcId::GetLastThreadInfo: | 4010 | case SvcId::GetLastThreadInfo: |
| 4011 | return SvcWrap_GetLastThreadInfo64From32(system); | 4011 | return SvcWrap_GetLastThreadInfo64From32(system, args); |
| 4012 | case SvcId::GetResourceLimitLimitValue: | 4012 | case SvcId::GetResourceLimitLimitValue: |
| 4013 | return SvcWrap_GetResourceLimitLimitValue64From32(system); | 4013 | return SvcWrap_GetResourceLimitLimitValue64From32(system, args); |
| 4014 | case SvcId::GetResourceLimitCurrentValue: | 4014 | case SvcId::GetResourceLimitCurrentValue: |
| 4015 | return SvcWrap_GetResourceLimitCurrentValue64From32(system); | 4015 | return SvcWrap_GetResourceLimitCurrentValue64From32(system, args); |
| 4016 | case SvcId::SetThreadActivity: | 4016 | case SvcId::SetThreadActivity: |
| 4017 | return SvcWrap_SetThreadActivity64From32(system); | 4017 | return SvcWrap_SetThreadActivity64From32(system, args); |
| 4018 | case SvcId::GetThreadContext3: | 4018 | case SvcId::GetThreadContext3: |
| 4019 | return SvcWrap_GetThreadContext364From32(system); | 4019 | return SvcWrap_GetThreadContext364From32(system, args); |
| 4020 | case SvcId::WaitForAddress: | 4020 | case SvcId::WaitForAddress: |
| 4021 | return SvcWrap_WaitForAddress64From32(system); | 4021 | return SvcWrap_WaitForAddress64From32(system, args); |
| 4022 | case SvcId::SignalToAddress: | 4022 | case SvcId::SignalToAddress: |
| 4023 | return SvcWrap_SignalToAddress64From32(system); | 4023 | return SvcWrap_SignalToAddress64From32(system, args); |
| 4024 | case SvcId::SynchronizePreemptionState: | 4024 | case SvcId::SynchronizePreemptionState: |
| 4025 | return SvcWrap_SynchronizePreemptionState64From32(system); | 4025 | return SvcWrap_SynchronizePreemptionState64From32(system, args); |
| 4026 | case SvcId::GetResourceLimitPeakValue: | 4026 | case SvcId::GetResourceLimitPeakValue: |
| 4027 | return SvcWrap_GetResourceLimitPeakValue64From32(system); | 4027 | return SvcWrap_GetResourceLimitPeakValue64From32(system, args); |
| 4028 | case SvcId::CreateIoPool: | 4028 | case SvcId::CreateIoPool: |
| 4029 | return SvcWrap_CreateIoPool64From32(system); | 4029 | return SvcWrap_CreateIoPool64From32(system, args); |
| 4030 | case SvcId::CreateIoRegion: | 4030 | case SvcId::CreateIoRegion: |
| 4031 | return SvcWrap_CreateIoRegion64From32(system); | 4031 | return SvcWrap_CreateIoRegion64From32(system, args); |
| 4032 | case SvcId::KernelDebug: | 4032 | case SvcId::KernelDebug: |
| 4033 | return SvcWrap_KernelDebug64From32(system); | 4033 | return SvcWrap_KernelDebug64From32(system, args); |
| 4034 | case SvcId::ChangeKernelTraceState: | 4034 | case SvcId::ChangeKernelTraceState: |
| 4035 | return SvcWrap_ChangeKernelTraceState64From32(system); | 4035 | return SvcWrap_ChangeKernelTraceState64From32(system, args); |
| 4036 | case SvcId::CreateSession: | 4036 | case SvcId::CreateSession: |
| 4037 | return SvcWrap_CreateSession64From32(system); | 4037 | return SvcWrap_CreateSession64From32(system, args); |
| 4038 | case SvcId::AcceptSession: | 4038 | case SvcId::AcceptSession: |
| 4039 | return SvcWrap_AcceptSession64From32(system); | 4039 | return SvcWrap_AcceptSession64From32(system, args); |
| 4040 | case SvcId::ReplyAndReceiveLight: | 4040 | case SvcId::ReplyAndReceiveLight: |
| 4041 | return SvcWrap_ReplyAndReceiveLight64From32(system); | 4041 | return SvcWrap_ReplyAndReceiveLight64From32(system, args); |
| 4042 | case SvcId::ReplyAndReceive: | 4042 | case SvcId::ReplyAndReceive: |
| 4043 | return SvcWrap_ReplyAndReceive64From32(system); | 4043 | return SvcWrap_ReplyAndReceive64From32(system, args); |
| 4044 | case SvcId::ReplyAndReceiveWithUserBuffer: | 4044 | case SvcId::ReplyAndReceiveWithUserBuffer: |
| 4045 | return SvcWrap_ReplyAndReceiveWithUserBuffer64From32(system); | 4045 | return SvcWrap_ReplyAndReceiveWithUserBuffer64From32(system, args); |
| 4046 | case SvcId::CreateEvent: | 4046 | case SvcId::CreateEvent: |
| 4047 | return SvcWrap_CreateEvent64From32(system); | 4047 | return SvcWrap_CreateEvent64From32(system, args); |
| 4048 | case SvcId::MapIoRegion: | 4048 | case SvcId::MapIoRegion: |
| 4049 | return SvcWrap_MapIoRegion64From32(system); | 4049 | return SvcWrap_MapIoRegion64From32(system, args); |
| 4050 | case SvcId::UnmapIoRegion: | 4050 | case SvcId::UnmapIoRegion: |
| 4051 | return SvcWrap_UnmapIoRegion64From32(system); | 4051 | return SvcWrap_UnmapIoRegion64From32(system, args); |
| 4052 | case SvcId::MapPhysicalMemoryUnsafe: | 4052 | case SvcId::MapPhysicalMemoryUnsafe: |
| 4053 | return SvcWrap_MapPhysicalMemoryUnsafe64From32(system); | 4053 | return SvcWrap_MapPhysicalMemoryUnsafe64From32(system, args); |
| 4054 | case SvcId::UnmapPhysicalMemoryUnsafe: | 4054 | case SvcId::UnmapPhysicalMemoryUnsafe: |
| 4055 | return SvcWrap_UnmapPhysicalMemoryUnsafe64From32(system); | 4055 | return SvcWrap_UnmapPhysicalMemoryUnsafe64From32(system, args); |
| 4056 | case SvcId::SetUnsafeLimit: | 4056 | case SvcId::SetUnsafeLimit: |
| 4057 | return SvcWrap_SetUnsafeLimit64From32(system); | 4057 | return SvcWrap_SetUnsafeLimit64From32(system, args); |
| 4058 | case SvcId::CreateCodeMemory: | 4058 | case SvcId::CreateCodeMemory: |
| 4059 | return SvcWrap_CreateCodeMemory64From32(system); | 4059 | return SvcWrap_CreateCodeMemory64From32(system, args); |
| 4060 | case SvcId::ControlCodeMemory: | 4060 | case SvcId::ControlCodeMemory: |
| 4061 | return SvcWrap_ControlCodeMemory64From32(system); | 4061 | return SvcWrap_ControlCodeMemory64From32(system, args); |
| 4062 | case SvcId::SleepSystem: | 4062 | case SvcId::SleepSystem: |
| 4063 | return SvcWrap_SleepSystem64From32(system); | 4063 | return SvcWrap_SleepSystem64From32(system, args); |
| 4064 | case SvcId::ReadWriteRegister: | 4064 | case SvcId::ReadWriteRegister: |
| 4065 | return SvcWrap_ReadWriteRegister64From32(system); | 4065 | return SvcWrap_ReadWriteRegister64From32(system, args); |
| 4066 | case SvcId::SetProcessActivity: | 4066 | case SvcId::SetProcessActivity: |
| 4067 | return SvcWrap_SetProcessActivity64From32(system); | 4067 | return SvcWrap_SetProcessActivity64From32(system, args); |
| 4068 | case SvcId::CreateSharedMemory: | 4068 | case SvcId::CreateSharedMemory: |
| 4069 | return SvcWrap_CreateSharedMemory64From32(system); | 4069 | return SvcWrap_CreateSharedMemory64From32(system, args); |
| 4070 | case SvcId::MapTransferMemory: | 4070 | case SvcId::MapTransferMemory: |
| 4071 | return SvcWrap_MapTransferMemory64From32(system); | 4071 | return SvcWrap_MapTransferMemory64From32(system, args); |
| 4072 | case SvcId::UnmapTransferMemory: | 4072 | case SvcId::UnmapTransferMemory: |
| 4073 | return SvcWrap_UnmapTransferMemory64From32(system); | 4073 | return SvcWrap_UnmapTransferMemory64From32(system, args); |
| 4074 | case SvcId::CreateInterruptEvent: | 4074 | case SvcId::CreateInterruptEvent: |
| 4075 | return SvcWrap_CreateInterruptEvent64From32(system); | 4075 | return SvcWrap_CreateInterruptEvent64From32(system, args); |
| 4076 | case SvcId::QueryPhysicalAddress: | 4076 | case SvcId::QueryPhysicalAddress: |
| 4077 | return SvcWrap_QueryPhysicalAddress64From32(system); | 4077 | return SvcWrap_QueryPhysicalAddress64From32(system, args); |
| 4078 | case SvcId::QueryIoMapping: | 4078 | case SvcId::QueryIoMapping: |
| 4079 | return SvcWrap_QueryIoMapping64From32(system); | 4079 | return SvcWrap_QueryIoMapping64From32(system, args); |
| 4080 | case SvcId::CreateDeviceAddressSpace: | 4080 | case SvcId::CreateDeviceAddressSpace: |
| 4081 | return SvcWrap_CreateDeviceAddressSpace64From32(system); | 4081 | return SvcWrap_CreateDeviceAddressSpace64From32(system, args); |
| 4082 | case SvcId::AttachDeviceAddressSpace: | 4082 | case SvcId::AttachDeviceAddressSpace: |
| 4083 | return SvcWrap_AttachDeviceAddressSpace64From32(system); | 4083 | return SvcWrap_AttachDeviceAddressSpace64From32(system, args); |
| 4084 | case SvcId::DetachDeviceAddressSpace: | 4084 | case SvcId::DetachDeviceAddressSpace: |
| 4085 | return SvcWrap_DetachDeviceAddressSpace64From32(system); | 4085 | return SvcWrap_DetachDeviceAddressSpace64From32(system, args); |
| 4086 | case SvcId::MapDeviceAddressSpaceByForce: | 4086 | case SvcId::MapDeviceAddressSpaceByForce: |
| 4087 | return SvcWrap_MapDeviceAddressSpaceByForce64From32(system); | 4087 | return SvcWrap_MapDeviceAddressSpaceByForce64From32(system, args); |
| 4088 | case SvcId::MapDeviceAddressSpaceAligned: | 4088 | case SvcId::MapDeviceAddressSpaceAligned: |
| 4089 | return SvcWrap_MapDeviceAddressSpaceAligned64From32(system); | 4089 | return SvcWrap_MapDeviceAddressSpaceAligned64From32(system, args); |
| 4090 | case SvcId::UnmapDeviceAddressSpace: | 4090 | case SvcId::UnmapDeviceAddressSpace: |
| 4091 | return SvcWrap_UnmapDeviceAddressSpace64From32(system); | 4091 | return SvcWrap_UnmapDeviceAddressSpace64From32(system, args); |
| 4092 | case SvcId::InvalidateProcessDataCache: | 4092 | case SvcId::InvalidateProcessDataCache: |
| 4093 | return SvcWrap_InvalidateProcessDataCache64From32(system); | 4093 | return SvcWrap_InvalidateProcessDataCache64From32(system, args); |
| 4094 | case SvcId::StoreProcessDataCache: | 4094 | case SvcId::StoreProcessDataCache: |
| 4095 | return SvcWrap_StoreProcessDataCache64From32(system); | 4095 | return SvcWrap_StoreProcessDataCache64From32(system, args); |
| 4096 | case SvcId::FlushProcessDataCache: | 4096 | case SvcId::FlushProcessDataCache: |
| 4097 | return SvcWrap_FlushProcessDataCache64From32(system); | 4097 | return SvcWrap_FlushProcessDataCache64From32(system, args); |
| 4098 | case SvcId::DebugActiveProcess: | 4098 | case SvcId::DebugActiveProcess: |
| 4099 | return SvcWrap_DebugActiveProcess64From32(system); | 4099 | return SvcWrap_DebugActiveProcess64From32(system, args); |
| 4100 | case SvcId::BreakDebugProcess: | 4100 | case SvcId::BreakDebugProcess: |
| 4101 | return SvcWrap_BreakDebugProcess64From32(system); | 4101 | return SvcWrap_BreakDebugProcess64From32(system, args); |
| 4102 | case SvcId::TerminateDebugProcess: | 4102 | case SvcId::TerminateDebugProcess: |
| 4103 | return SvcWrap_TerminateDebugProcess64From32(system); | 4103 | return SvcWrap_TerminateDebugProcess64From32(system, args); |
| 4104 | case SvcId::GetDebugEvent: | 4104 | case SvcId::GetDebugEvent: |
| 4105 | return SvcWrap_GetDebugEvent64From32(system); | 4105 | return SvcWrap_GetDebugEvent64From32(system, args); |
| 4106 | case SvcId::ContinueDebugEvent: | 4106 | case SvcId::ContinueDebugEvent: |
| 4107 | return SvcWrap_ContinueDebugEvent64From32(system); | 4107 | return SvcWrap_ContinueDebugEvent64From32(system, args); |
| 4108 | case SvcId::GetProcessList: | 4108 | case SvcId::GetProcessList: |
| 4109 | return SvcWrap_GetProcessList64From32(system); | 4109 | return SvcWrap_GetProcessList64From32(system, args); |
| 4110 | case SvcId::GetThreadList: | 4110 | case SvcId::GetThreadList: |
| 4111 | return SvcWrap_GetThreadList64From32(system); | 4111 | return SvcWrap_GetThreadList64From32(system, args); |
| 4112 | case SvcId::GetDebugThreadContext: | 4112 | case SvcId::GetDebugThreadContext: |
| 4113 | return SvcWrap_GetDebugThreadContext64From32(system); | 4113 | return SvcWrap_GetDebugThreadContext64From32(system, args); |
| 4114 | case SvcId::SetDebugThreadContext: | 4114 | case SvcId::SetDebugThreadContext: |
| 4115 | return SvcWrap_SetDebugThreadContext64From32(system); | 4115 | return SvcWrap_SetDebugThreadContext64From32(system, args); |
| 4116 | case SvcId::QueryDebugProcessMemory: | 4116 | case SvcId::QueryDebugProcessMemory: |
| 4117 | return SvcWrap_QueryDebugProcessMemory64From32(system); | 4117 | return SvcWrap_QueryDebugProcessMemory64From32(system, args); |
| 4118 | case SvcId::ReadDebugProcessMemory: | 4118 | case SvcId::ReadDebugProcessMemory: |
| 4119 | return SvcWrap_ReadDebugProcessMemory64From32(system); | 4119 | return SvcWrap_ReadDebugProcessMemory64From32(system, args); |
| 4120 | case SvcId::WriteDebugProcessMemory: | 4120 | case SvcId::WriteDebugProcessMemory: |
| 4121 | return SvcWrap_WriteDebugProcessMemory64From32(system); | 4121 | return SvcWrap_WriteDebugProcessMemory64From32(system, args); |
| 4122 | case SvcId::SetHardwareBreakPoint: | 4122 | case SvcId::SetHardwareBreakPoint: |
| 4123 | return SvcWrap_SetHardwareBreakPoint64From32(system); | 4123 | return SvcWrap_SetHardwareBreakPoint64From32(system, args); |
| 4124 | case SvcId::GetDebugThreadParam: | 4124 | case SvcId::GetDebugThreadParam: |
| 4125 | return SvcWrap_GetDebugThreadParam64From32(system); | 4125 | return SvcWrap_GetDebugThreadParam64From32(system, args); |
| 4126 | case SvcId::GetSystemInfo: | 4126 | case SvcId::GetSystemInfo: |
| 4127 | return SvcWrap_GetSystemInfo64From32(system); | 4127 | return SvcWrap_GetSystemInfo64From32(system, args); |
| 4128 | case SvcId::CreatePort: | 4128 | case SvcId::CreatePort: |
| 4129 | return SvcWrap_CreatePort64From32(system); | 4129 | return SvcWrap_CreatePort64From32(system, args); |
| 4130 | case SvcId::ManageNamedPort: | 4130 | case SvcId::ManageNamedPort: |
| 4131 | return SvcWrap_ManageNamedPort64From32(system); | 4131 | return SvcWrap_ManageNamedPort64From32(system, args); |
| 4132 | case SvcId::ConnectToPort: | 4132 | case SvcId::ConnectToPort: |
| 4133 | return SvcWrap_ConnectToPort64From32(system); | 4133 | return SvcWrap_ConnectToPort64From32(system, args); |
| 4134 | case SvcId::SetProcessMemoryPermission: | 4134 | case SvcId::SetProcessMemoryPermission: |
| 4135 | return SvcWrap_SetProcessMemoryPermission64From32(system); | 4135 | return SvcWrap_SetProcessMemoryPermission64From32(system, args); |
| 4136 | case SvcId::MapProcessMemory: | 4136 | case SvcId::MapProcessMemory: |
| 4137 | return SvcWrap_MapProcessMemory64From32(system); | 4137 | return SvcWrap_MapProcessMemory64From32(system, args); |
| 4138 | case SvcId::UnmapProcessMemory: | 4138 | case SvcId::UnmapProcessMemory: |
| 4139 | return SvcWrap_UnmapProcessMemory64From32(system); | 4139 | return SvcWrap_UnmapProcessMemory64From32(system, args); |
| 4140 | case SvcId::QueryProcessMemory: | 4140 | case SvcId::QueryProcessMemory: |
| 4141 | return SvcWrap_QueryProcessMemory64From32(system); | 4141 | return SvcWrap_QueryProcessMemory64From32(system, args); |
| 4142 | case SvcId::MapProcessCodeMemory: | 4142 | case SvcId::MapProcessCodeMemory: |
| 4143 | return SvcWrap_MapProcessCodeMemory64From32(system); | 4143 | return SvcWrap_MapProcessCodeMemory64From32(system, args); |
| 4144 | case SvcId::UnmapProcessCodeMemory: | 4144 | case SvcId::UnmapProcessCodeMemory: |
| 4145 | return SvcWrap_UnmapProcessCodeMemory64From32(system); | 4145 | return SvcWrap_UnmapProcessCodeMemory64From32(system, args); |
| 4146 | case SvcId::CreateProcess: | 4146 | case SvcId::CreateProcess: |
| 4147 | return SvcWrap_CreateProcess64From32(system); | 4147 | return SvcWrap_CreateProcess64From32(system, args); |
| 4148 | case SvcId::StartProcess: | 4148 | case SvcId::StartProcess: |
| 4149 | return SvcWrap_StartProcess64From32(system); | 4149 | return SvcWrap_StartProcess64From32(system, args); |
| 4150 | case SvcId::TerminateProcess: | 4150 | case SvcId::TerminateProcess: |
| 4151 | return SvcWrap_TerminateProcess64From32(system); | 4151 | return SvcWrap_TerminateProcess64From32(system, args); |
| 4152 | case SvcId::GetProcessInfo: | 4152 | case SvcId::GetProcessInfo: |
| 4153 | return SvcWrap_GetProcessInfo64From32(system); | 4153 | return SvcWrap_GetProcessInfo64From32(system, args); |
| 4154 | case SvcId::CreateResourceLimit: | 4154 | case SvcId::CreateResourceLimit: |
| 4155 | return SvcWrap_CreateResourceLimit64From32(system); | 4155 | return SvcWrap_CreateResourceLimit64From32(system, args); |
| 4156 | case SvcId::SetResourceLimitLimitValue: | 4156 | case SvcId::SetResourceLimitLimitValue: |
| 4157 | return SvcWrap_SetResourceLimitLimitValue64From32(system); | 4157 | return SvcWrap_SetResourceLimitLimitValue64From32(system, args); |
| 4158 | case SvcId::CallSecureMonitor: | 4158 | case SvcId::CallSecureMonitor: |
| 4159 | return SvcWrap_CallSecureMonitor64From32(system); | 4159 | return SvcWrap_CallSecureMonitor64From32(system, args); |
| 4160 | case SvcId::MapInsecureMemory: | 4160 | case SvcId::MapInsecureMemory: |
| 4161 | return SvcWrap_MapInsecureMemory64From32(system); | 4161 | return SvcWrap_MapInsecureMemory64From32(system, args); |
| 4162 | case SvcId::UnmapInsecureMemory: | 4162 | case SvcId::UnmapInsecureMemory: |
| 4163 | return SvcWrap_UnmapInsecureMemory64From32(system); | 4163 | return SvcWrap_UnmapInsecureMemory64From32(system, args); |
| 4164 | default: | 4164 | default: |
| 4165 | LOG_CRITICAL(Kernel_SVC, "Unknown SVC {:x}!", imm); | 4165 | LOG_CRITICAL(Kernel_SVC, "Unknown SVC {:x}!", imm); |
| 4166 | break; | 4166 | break; |
| 4167 | } | 4167 | } |
| 4168 | } | 4168 | } |
| 4169 | 4169 | ||
| 4170 | static void Call64(Core::System& system, u32 imm) { | 4170 | static void Call64(Core::System& system, u32 imm, std::span<uint64_t, 8> args) { |
| 4171 | switch (static_cast<SvcId>(imm)) { | 4171 | switch (static_cast<SvcId>(imm)) { |
| 4172 | case SvcId::SetHeapSize: | 4172 | case SvcId::SetHeapSize: |
| 4173 | return SvcWrap_SetHeapSize64(system); | 4173 | return SvcWrap_SetHeapSize64(system, args); |
| 4174 | case SvcId::SetMemoryPermission: | 4174 | case SvcId::SetMemoryPermission: |
| 4175 | return SvcWrap_SetMemoryPermission64(system); | 4175 | return SvcWrap_SetMemoryPermission64(system, args); |
| 4176 | case SvcId::SetMemoryAttribute: | 4176 | case SvcId::SetMemoryAttribute: |
| 4177 | return SvcWrap_SetMemoryAttribute64(system); | 4177 | return SvcWrap_SetMemoryAttribute64(system, args); |
| 4178 | case SvcId::MapMemory: | 4178 | case SvcId::MapMemory: |
| 4179 | return SvcWrap_MapMemory64(system); | 4179 | return SvcWrap_MapMemory64(system, args); |
| 4180 | case SvcId::UnmapMemory: | 4180 | case SvcId::UnmapMemory: |
| 4181 | return SvcWrap_UnmapMemory64(system); | 4181 | return SvcWrap_UnmapMemory64(system, args); |
| 4182 | case SvcId::QueryMemory: | 4182 | case SvcId::QueryMemory: |
| 4183 | return SvcWrap_QueryMemory64(system); | 4183 | return SvcWrap_QueryMemory64(system, args); |
| 4184 | case SvcId::ExitProcess: | 4184 | case SvcId::ExitProcess: |
| 4185 | return SvcWrap_ExitProcess64(system); | 4185 | return SvcWrap_ExitProcess64(system, args); |
| 4186 | case SvcId::CreateThread: | 4186 | case SvcId::CreateThread: |
| 4187 | return SvcWrap_CreateThread64(system); | 4187 | return SvcWrap_CreateThread64(system, args); |
| 4188 | case SvcId::StartThread: | 4188 | case SvcId::StartThread: |
| 4189 | return SvcWrap_StartThread64(system); | 4189 | return SvcWrap_StartThread64(system, args); |
| 4190 | case SvcId::ExitThread: | 4190 | case SvcId::ExitThread: |
| 4191 | return SvcWrap_ExitThread64(system); | 4191 | return SvcWrap_ExitThread64(system, args); |
| 4192 | case SvcId::SleepThread: | 4192 | case SvcId::SleepThread: |
| 4193 | return SvcWrap_SleepThread64(system); | 4193 | return SvcWrap_SleepThread64(system, args); |
| 4194 | case SvcId::GetThreadPriority: | 4194 | case SvcId::GetThreadPriority: |
| 4195 | return SvcWrap_GetThreadPriority64(system); | 4195 | return SvcWrap_GetThreadPriority64(system, args); |
| 4196 | case SvcId::SetThreadPriority: | 4196 | case SvcId::SetThreadPriority: |
| 4197 | return SvcWrap_SetThreadPriority64(system); | 4197 | return SvcWrap_SetThreadPriority64(system, args); |
| 4198 | case SvcId::GetThreadCoreMask: | 4198 | case SvcId::GetThreadCoreMask: |
| 4199 | return SvcWrap_GetThreadCoreMask64(system); | 4199 | return SvcWrap_GetThreadCoreMask64(system, args); |
| 4200 | case SvcId::SetThreadCoreMask: | 4200 | case SvcId::SetThreadCoreMask: |
| 4201 | return SvcWrap_SetThreadCoreMask64(system); | 4201 | return SvcWrap_SetThreadCoreMask64(system, args); |
| 4202 | case SvcId::GetCurrentProcessorNumber: | 4202 | case SvcId::GetCurrentProcessorNumber: |
| 4203 | return SvcWrap_GetCurrentProcessorNumber64(system); | 4203 | return SvcWrap_GetCurrentProcessorNumber64(system, args); |
| 4204 | case SvcId::SignalEvent: | 4204 | case SvcId::SignalEvent: |
| 4205 | return SvcWrap_SignalEvent64(system); | 4205 | return SvcWrap_SignalEvent64(system, args); |
| 4206 | case SvcId::ClearEvent: | 4206 | case SvcId::ClearEvent: |
| 4207 | return SvcWrap_ClearEvent64(system); | 4207 | return SvcWrap_ClearEvent64(system, args); |
| 4208 | case SvcId::MapSharedMemory: | 4208 | case SvcId::MapSharedMemory: |
| 4209 | return SvcWrap_MapSharedMemory64(system); | 4209 | return SvcWrap_MapSharedMemory64(system, args); |
| 4210 | case SvcId::UnmapSharedMemory: | 4210 | case SvcId::UnmapSharedMemory: |
| 4211 | return SvcWrap_UnmapSharedMemory64(system); | 4211 | return SvcWrap_UnmapSharedMemory64(system, args); |
| 4212 | case SvcId::CreateTransferMemory: | 4212 | case SvcId::CreateTransferMemory: |
| 4213 | return SvcWrap_CreateTransferMemory64(system); | 4213 | return SvcWrap_CreateTransferMemory64(system, args); |
| 4214 | case SvcId::CloseHandle: | 4214 | case SvcId::CloseHandle: |
| 4215 | return SvcWrap_CloseHandle64(system); | 4215 | return SvcWrap_CloseHandle64(system, args); |
| 4216 | case SvcId::ResetSignal: | 4216 | case SvcId::ResetSignal: |
| 4217 | return SvcWrap_ResetSignal64(system); | 4217 | return SvcWrap_ResetSignal64(system, args); |
| 4218 | case SvcId::WaitSynchronization: | 4218 | case SvcId::WaitSynchronization: |
| 4219 | return SvcWrap_WaitSynchronization64(system); | 4219 | return SvcWrap_WaitSynchronization64(system, args); |
| 4220 | case SvcId::CancelSynchronization: | 4220 | case SvcId::CancelSynchronization: |
| 4221 | return SvcWrap_CancelSynchronization64(system); | 4221 | return SvcWrap_CancelSynchronization64(system, args); |
| 4222 | case SvcId::ArbitrateLock: | 4222 | case SvcId::ArbitrateLock: |
| 4223 | return SvcWrap_ArbitrateLock64(system); | 4223 | return SvcWrap_ArbitrateLock64(system, args); |
| 4224 | case SvcId::ArbitrateUnlock: | 4224 | case SvcId::ArbitrateUnlock: |
| 4225 | return SvcWrap_ArbitrateUnlock64(system); | 4225 | return SvcWrap_ArbitrateUnlock64(system, args); |
| 4226 | case SvcId::WaitProcessWideKeyAtomic: | 4226 | case SvcId::WaitProcessWideKeyAtomic: |
| 4227 | return SvcWrap_WaitProcessWideKeyAtomic64(system); | 4227 | return SvcWrap_WaitProcessWideKeyAtomic64(system, args); |
| 4228 | case SvcId::SignalProcessWideKey: | 4228 | case SvcId::SignalProcessWideKey: |
| 4229 | return SvcWrap_SignalProcessWideKey64(system); | 4229 | return SvcWrap_SignalProcessWideKey64(system, args); |
| 4230 | case SvcId::GetSystemTick: | 4230 | case SvcId::GetSystemTick: |
| 4231 | return SvcWrap_GetSystemTick64(system); | 4231 | return SvcWrap_GetSystemTick64(system, args); |
| 4232 | case SvcId::ConnectToNamedPort: | 4232 | case SvcId::ConnectToNamedPort: |
| 4233 | return SvcWrap_ConnectToNamedPort64(system); | 4233 | return SvcWrap_ConnectToNamedPort64(system, args); |
| 4234 | case SvcId::SendSyncRequestLight: | 4234 | case SvcId::SendSyncRequestLight: |
| 4235 | return SvcWrap_SendSyncRequestLight64(system); | 4235 | return SvcWrap_SendSyncRequestLight64(system, args); |
| 4236 | case SvcId::SendSyncRequest: | 4236 | case SvcId::SendSyncRequest: |
| 4237 | return SvcWrap_SendSyncRequest64(system); | 4237 | return SvcWrap_SendSyncRequest64(system, args); |
| 4238 | case SvcId::SendSyncRequestWithUserBuffer: | 4238 | case SvcId::SendSyncRequestWithUserBuffer: |
| 4239 | return SvcWrap_SendSyncRequestWithUserBuffer64(system); | 4239 | return SvcWrap_SendSyncRequestWithUserBuffer64(system, args); |
| 4240 | case SvcId::SendAsyncRequestWithUserBuffer: | 4240 | case SvcId::SendAsyncRequestWithUserBuffer: |
| 4241 | return SvcWrap_SendAsyncRequestWithUserBuffer64(system); | 4241 | return SvcWrap_SendAsyncRequestWithUserBuffer64(system, args); |
| 4242 | case SvcId::GetProcessId: | 4242 | case SvcId::GetProcessId: |
| 4243 | return SvcWrap_GetProcessId64(system); | 4243 | return SvcWrap_GetProcessId64(system, args); |
| 4244 | case SvcId::GetThreadId: | 4244 | case SvcId::GetThreadId: |
| 4245 | return SvcWrap_GetThreadId64(system); | 4245 | return SvcWrap_GetThreadId64(system, args); |
| 4246 | case SvcId::Break: | 4246 | case SvcId::Break: |
| 4247 | return SvcWrap_Break64(system); | 4247 | return SvcWrap_Break64(system, args); |
| 4248 | case SvcId::OutputDebugString: | 4248 | case SvcId::OutputDebugString: |
| 4249 | return SvcWrap_OutputDebugString64(system); | 4249 | return SvcWrap_OutputDebugString64(system, args); |
| 4250 | case SvcId::ReturnFromException: | 4250 | case SvcId::ReturnFromException: |
| 4251 | return SvcWrap_ReturnFromException64(system); | 4251 | return SvcWrap_ReturnFromException64(system, args); |
| 4252 | case SvcId::GetInfo: | 4252 | case SvcId::GetInfo: |
| 4253 | return SvcWrap_GetInfo64(system); | 4253 | return SvcWrap_GetInfo64(system, args); |
| 4254 | case SvcId::FlushEntireDataCache: | 4254 | case SvcId::FlushEntireDataCache: |
| 4255 | return SvcWrap_FlushEntireDataCache64(system); | 4255 | return SvcWrap_FlushEntireDataCache64(system, args); |
| 4256 | case SvcId::FlushDataCache: | 4256 | case SvcId::FlushDataCache: |
| 4257 | return SvcWrap_FlushDataCache64(system); | 4257 | return SvcWrap_FlushDataCache64(system, args); |
| 4258 | case SvcId::MapPhysicalMemory: | 4258 | case SvcId::MapPhysicalMemory: |
| 4259 | return SvcWrap_MapPhysicalMemory64(system); | 4259 | return SvcWrap_MapPhysicalMemory64(system, args); |
| 4260 | case SvcId::UnmapPhysicalMemory: | 4260 | case SvcId::UnmapPhysicalMemory: |
| 4261 | return SvcWrap_UnmapPhysicalMemory64(system); | 4261 | return SvcWrap_UnmapPhysicalMemory64(system, args); |
| 4262 | case SvcId::GetDebugFutureThreadInfo: | 4262 | case SvcId::GetDebugFutureThreadInfo: |
| 4263 | return SvcWrap_GetDebugFutureThreadInfo64(system); | 4263 | return SvcWrap_GetDebugFutureThreadInfo64(system, args); |
| 4264 | case SvcId::GetLastThreadInfo: | 4264 | case SvcId::GetLastThreadInfo: |
| 4265 | return SvcWrap_GetLastThreadInfo64(system); | 4265 | return SvcWrap_GetLastThreadInfo64(system, args); |
| 4266 | case SvcId::GetResourceLimitLimitValue: | 4266 | case SvcId::GetResourceLimitLimitValue: |
| 4267 | return SvcWrap_GetResourceLimitLimitValue64(system); | 4267 | return SvcWrap_GetResourceLimitLimitValue64(system, args); |
| 4268 | case SvcId::GetResourceLimitCurrentValue: | 4268 | case SvcId::GetResourceLimitCurrentValue: |
| 4269 | return SvcWrap_GetResourceLimitCurrentValue64(system); | 4269 | return SvcWrap_GetResourceLimitCurrentValue64(system, args); |
| 4270 | case SvcId::SetThreadActivity: | 4270 | case SvcId::SetThreadActivity: |
| 4271 | return SvcWrap_SetThreadActivity64(system); | 4271 | return SvcWrap_SetThreadActivity64(system, args); |
| 4272 | case SvcId::GetThreadContext3: | 4272 | case SvcId::GetThreadContext3: |
| 4273 | return SvcWrap_GetThreadContext364(system); | 4273 | return SvcWrap_GetThreadContext364(system, args); |
| 4274 | case SvcId::WaitForAddress: | 4274 | case SvcId::WaitForAddress: |
| 4275 | return SvcWrap_WaitForAddress64(system); | 4275 | return SvcWrap_WaitForAddress64(system, args); |
| 4276 | case SvcId::SignalToAddress: | 4276 | case SvcId::SignalToAddress: |
| 4277 | return SvcWrap_SignalToAddress64(system); | 4277 | return SvcWrap_SignalToAddress64(system, args); |
| 4278 | case SvcId::SynchronizePreemptionState: | 4278 | case SvcId::SynchronizePreemptionState: |
| 4279 | return SvcWrap_SynchronizePreemptionState64(system); | 4279 | return SvcWrap_SynchronizePreemptionState64(system, args); |
| 4280 | case SvcId::GetResourceLimitPeakValue: | 4280 | case SvcId::GetResourceLimitPeakValue: |
| 4281 | return SvcWrap_GetResourceLimitPeakValue64(system); | 4281 | return SvcWrap_GetResourceLimitPeakValue64(system, args); |
| 4282 | case SvcId::CreateIoPool: | 4282 | case SvcId::CreateIoPool: |
| 4283 | return SvcWrap_CreateIoPool64(system); | 4283 | return SvcWrap_CreateIoPool64(system, args); |
| 4284 | case SvcId::CreateIoRegion: | 4284 | case SvcId::CreateIoRegion: |
| 4285 | return SvcWrap_CreateIoRegion64(system); | 4285 | return SvcWrap_CreateIoRegion64(system, args); |
| 4286 | case SvcId::KernelDebug: | 4286 | case SvcId::KernelDebug: |
| 4287 | return SvcWrap_KernelDebug64(system); | 4287 | return SvcWrap_KernelDebug64(system, args); |
| 4288 | case SvcId::ChangeKernelTraceState: | 4288 | case SvcId::ChangeKernelTraceState: |
| 4289 | return SvcWrap_ChangeKernelTraceState64(system); | 4289 | return SvcWrap_ChangeKernelTraceState64(system, args); |
| 4290 | case SvcId::CreateSession: | 4290 | case SvcId::CreateSession: |
| 4291 | return SvcWrap_CreateSession64(system); | 4291 | return SvcWrap_CreateSession64(system, args); |
| 4292 | case SvcId::AcceptSession: | 4292 | case SvcId::AcceptSession: |
| 4293 | return SvcWrap_AcceptSession64(system); | 4293 | return SvcWrap_AcceptSession64(system, args); |
| 4294 | case SvcId::ReplyAndReceiveLight: | 4294 | case SvcId::ReplyAndReceiveLight: |
| 4295 | return SvcWrap_ReplyAndReceiveLight64(system); | 4295 | return SvcWrap_ReplyAndReceiveLight64(system, args); |
| 4296 | case SvcId::ReplyAndReceive: | 4296 | case SvcId::ReplyAndReceive: |
| 4297 | return SvcWrap_ReplyAndReceive64(system); | 4297 | return SvcWrap_ReplyAndReceive64(system, args); |
| 4298 | case SvcId::ReplyAndReceiveWithUserBuffer: | 4298 | case SvcId::ReplyAndReceiveWithUserBuffer: |
| 4299 | return SvcWrap_ReplyAndReceiveWithUserBuffer64(system); | 4299 | return SvcWrap_ReplyAndReceiveWithUserBuffer64(system, args); |
| 4300 | case SvcId::CreateEvent: | 4300 | case SvcId::CreateEvent: |
| 4301 | return SvcWrap_CreateEvent64(system); | 4301 | return SvcWrap_CreateEvent64(system, args); |
| 4302 | case SvcId::MapIoRegion: | 4302 | case SvcId::MapIoRegion: |
| 4303 | return SvcWrap_MapIoRegion64(system); | 4303 | return SvcWrap_MapIoRegion64(system, args); |
| 4304 | case SvcId::UnmapIoRegion: | 4304 | case SvcId::UnmapIoRegion: |
| 4305 | return SvcWrap_UnmapIoRegion64(system); | 4305 | return SvcWrap_UnmapIoRegion64(system, args); |
| 4306 | case SvcId::MapPhysicalMemoryUnsafe: | 4306 | case SvcId::MapPhysicalMemoryUnsafe: |
| 4307 | return SvcWrap_MapPhysicalMemoryUnsafe64(system); | 4307 | return SvcWrap_MapPhysicalMemoryUnsafe64(system, args); |
| 4308 | case SvcId::UnmapPhysicalMemoryUnsafe: | 4308 | case SvcId::UnmapPhysicalMemoryUnsafe: |
| 4309 | return SvcWrap_UnmapPhysicalMemoryUnsafe64(system); | 4309 | return SvcWrap_UnmapPhysicalMemoryUnsafe64(system, args); |
| 4310 | case SvcId::SetUnsafeLimit: | 4310 | case SvcId::SetUnsafeLimit: |
| 4311 | return SvcWrap_SetUnsafeLimit64(system); | 4311 | return SvcWrap_SetUnsafeLimit64(system, args); |
| 4312 | case SvcId::CreateCodeMemory: | 4312 | case SvcId::CreateCodeMemory: |
| 4313 | return SvcWrap_CreateCodeMemory64(system); | 4313 | return SvcWrap_CreateCodeMemory64(system, args); |
| 4314 | case SvcId::ControlCodeMemory: | 4314 | case SvcId::ControlCodeMemory: |
| 4315 | return SvcWrap_ControlCodeMemory64(system); | 4315 | return SvcWrap_ControlCodeMemory64(system, args); |
| 4316 | case SvcId::SleepSystem: | 4316 | case SvcId::SleepSystem: |
| 4317 | return SvcWrap_SleepSystem64(system); | 4317 | return SvcWrap_SleepSystem64(system, args); |
| 4318 | case SvcId::ReadWriteRegister: | 4318 | case SvcId::ReadWriteRegister: |
| 4319 | return SvcWrap_ReadWriteRegister64(system); | 4319 | return SvcWrap_ReadWriteRegister64(system, args); |
| 4320 | case SvcId::SetProcessActivity: | 4320 | case SvcId::SetProcessActivity: |
| 4321 | return SvcWrap_SetProcessActivity64(system); | 4321 | return SvcWrap_SetProcessActivity64(system, args); |
| 4322 | case SvcId::CreateSharedMemory: | 4322 | case SvcId::CreateSharedMemory: |
| 4323 | return SvcWrap_CreateSharedMemory64(system); | 4323 | return SvcWrap_CreateSharedMemory64(system, args); |
| 4324 | case SvcId::MapTransferMemory: | 4324 | case SvcId::MapTransferMemory: |
| 4325 | return SvcWrap_MapTransferMemory64(system); | 4325 | return SvcWrap_MapTransferMemory64(system, args); |
| 4326 | case SvcId::UnmapTransferMemory: | 4326 | case SvcId::UnmapTransferMemory: |
| 4327 | return SvcWrap_UnmapTransferMemory64(system); | 4327 | return SvcWrap_UnmapTransferMemory64(system, args); |
| 4328 | case SvcId::CreateInterruptEvent: | 4328 | case SvcId::CreateInterruptEvent: |
| 4329 | return SvcWrap_CreateInterruptEvent64(system); | 4329 | return SvcWrap_CreateInterruptEvent64(system, args); |
| 4330 | case SvcId::QueryPhysicalAddress: | 4330 | case SvcId::QueryPhysicalAddress: |
| 4331 | return SvcWrap_QueryPhysicalAddress64(system); | 4331 | return SvcWrap_QueryPhysicalAddress64(system, args); |
| 4332 | case SvcId::QueryIoMapping: | 4332 | case SvcId::QueryIoMapping: |
| 4333 | return SvcWrap_QueryIoMapping64(system); | 4333 | return SvcWrap_QueryIoMapping64(system, args); |
| 4334 | case SvcId::CreateDeviceAddressSpace: | 4334 | case SvcId::CreateDeviceAddressSpace: |
| 4335 | return SvcWrap_CreateDeviceAddressSpace64(system); | 4335 | return SvcWrap_CreateDeviceAddressSpace64(system, args); |
| 4336 | case SvcId::AttachDeviceAddressSpace: | 4336 | case SvcId::AttachDeviceAddressSpace: |
| 4337 | return SvcWrap_AttachDeviceAddressSpace64(system); | 4337 | return SvcWrap_AttachDeviceAddressSpace64(system, args); |
| 4338 | case SvcId::DetachDeviceAddressSpace: | 4338 | case SvcId::DetachDeviceAddressSpace: |
| 4339 | return SvcWrap_DetachDeviceAddressSpace64(system); | 4339 | return SvcWrap_DetachDeviceAddressSpace64(system, args); |
| 4340 | case SvcId::MapDeviceAddressSpaceByForce: | 4340 | case SvcId::MapDeviceAddressSpaceByForce: |
| 4341 | return SvcWrap_MapDeviceAddressSpaceByForce64(system); | 4341 | return SvcWrap_MapDeviceAddressSpaceByForce64(system, args); |
| 4342 | case SvcId::MapDeviceAddressSpaceAligned: | 4342 | case SvcId::MapDeviceAddressSpaceAligned: |
| 4343 | return SvcWrap_MapDeviceAddressSpaceAligned64(system); | 4343 | return SvcWrap_MapDeviceAddressSpaceAligned64(system, args); |
| 4344 | case SvcId::UnmapDeviceAddressSpace: | 4344 | case SvcId::UnmapDeviceAddressSpace: |
| 4345 | return SvcWrap_UnmapDeviceAddressSpace64(system); | 4345 | return SvcWrap_UnmapDeviceAddressSpace64(system, args); |
| 4346 | case SvcId::InvalidateProcessDataCache: | 4346 | case SvcId::InvalidateProcessDataCache: |
| 4347 | return SvcWrap_InvalidateProcessDataCache64(system); | 4347 | return SvcWrap_InvalidateProcessDataCache64(system, args); |
| 4348 | case SvcId::StoreProcessDataCache: | 4348 | case SvcId::StoreProcessDataCache: |
| 4349 | return SvcWrap_StoreProcessDataCache64(system); | 4349 | return SvcWrap_StoreProcessDataCache64(system, args); |
| 4350 | case SvcId::FlushProcessDataCache: | 4350 | case SvcId::FlushProcessDataCache: |
| 4351 | return SvcWrap_FlushProcessDataCache64(system); | 4351 | return SvcWrap_FlushProcessDataCache64(system, args); |
| 4352 | case SvcId::DebugActiveProcess: | 4352 | case SvcId::DebugActiveProcess: |
| 4353 | return SvcWrap_DebugActiveProcess64(system); | 4353 | return SvcWrap_DebugActiveProcess64(system, args); |
| 4354 | case SvcId::BreakDebugProcess: | 4354 | case SvcId::BreakDebugProcess: |
| 4355 | return SvcWrap_BreakDebugProcess64(system); | 4355 | return SvcWrap_BreakDebugProcess64(system, args); |
| 4356 | case SvcId::TerminateDebugProcess: | 4356 | case SvcId::TerminateDebugProcess: |
| 4357 | return SvcWrap_TerminateDebugProcess64(system); | 4357 | return SvcWrap_TerminateDebugProcess64(system, args); |
| 4358 | case SvcId::GetDebugEvent: | 4358 | case SvcId::GetDebugEvent: |
| 4359 | return SvcWrap_GetDebugEvent64(system); | 4359 | return SvcWrap_GetDebugEvent64(system, args); |
| 4360 | case SvcId::ContinueDebugEvent: | 4360 | case SvcId::ContinueDebugEvent: |
| 4361 | return SvcWrap_ContinueDebugEvent64(system); | 4361 | return SvcWrap_ContinueDebugEvent64(system, args); |
| 4362 | case SvcId::GetProcessList: | 4362 | case SvcId::GetProcessList: |
| 4363 | return SvcWrap_GetProcessList64(system); | 4363 | return SvcWrap_GetProcessList64(system, args); |
| 4364 | case SvcId::GetThreadList: | 4364 | case SvcId::GetThreadList: |
| 4365 | return SvcWrap_GetThreadList64(system); | 4365 | return SvcWrap_GetThreadList64(system, args); |
| 4366 | case SvcId::GetDebugThreadContext: | 4366 | case SvcId::GetDebugThreadContext: |
| 4367 | return SvcWrap_GetDebugThreadContext64(system); | 4367 | return SvcWrap_GetDebugThreadContext64(system, args); |
| 4368 | case SvcId::SetDebugThreadContext: | 4368 | case SvcId::SetDebugThreadContext: |
| 4369 | return SvcWrap_SetDebugThreadContext64(system); | 4369 | return SvcWrap_SetDebugThreadContext64(system, args); |
| 4370 | case SvcId::QueryDebugProcessMemory: | 4370 | case SvcId::QueryDebugProcessMemory: |
| 4371 | return SvcWrap_QueryDebugProcessMemory64(system); | 4371 | return SvcWrap_QueryDebugProcessMemory64(system, args); |
| 4372 | case SvcId::ReadDebugProcessMemory: | 4372 | case SvcId::ReadDebugProcessMemory: |
| 4373 | return SvcWrap_ReadDebugProcessMemory64(system); | 4373 | return SvcWrap_ReadDebugProcessMemory64(system, args); |
| 4374 | case SvcId::WriteDebugProcessMemory: | 4374 | case SvcId::WriteDebugProcessMemory: |
| 4375 | return SvcWrap_WriteDebugProcessMemory64(system); | 4375 | return SvcWrap_WriteDebugProcessMemory64(system, args); |
| 4376 | case SvcId::SetHardwareBreakPoint: | 4376 | case SvcId::SetHardwareBreakPoint: |
| 4377 | return SvcWrap_SetHardwareBreakPoint64(system); | 4377 | return SvcWrap_SetHardwareBreakPoint64(system, args); |
| 4378 | case SvcId::GetDebugThreadParam: | 4378 | case SvcId::GetDebugThreadParam: |
| 4379 | return SvcWrap_GetDebugThreadParam64(system); | 4379 | return SvcWrap_GetDebugThreadParam64(system, args); |
| 4380 | case SvcId::GetSystemInfo: | 4380 | case SvcId::GetSystemInfo: |
| 4381 | return SvcWrap_GetSystemInfo64(system); | 4381 | return SvcWrap_GetSystemInfo64(system, args); |
| 4382 | case SvcId::CreatePort: | 4382 | case SvcId::CreatePort: |
| 4383 | return SvcWrap_CreatePort64(system); | 4383 | return SvcWrap_CreatePort64(system, args); |
| 4384 | case SvcId::ManageNamedPort: | 4384 | case SvcId::ManageNamedPort: |
| 4385 | return SvcWrap_ManageNamedPort64(system); | 4385 | return SvcWrap_ManageNamedPort64(system, args); |
| 4386 | case SvcId::ConnectToPort: | 4386 | case SvcId::ConnectToPort: |
| 4387 | return SvcWrap_ConnectToPort64(system); | 4387 | return SvcWrap_ConnectToPort64(system, args); |
| 4388 | case SvcId::SetProcessMemoryPermission: | 4388 | case SvcId::SetProcessMemoryPermission: |
| 4389 | return SvcWrap_SetProcessMemoryPermission64(system); | 4389 | return SvcWrap_SetProcessMemoryPermission64(system, args); |
| 4390 | case SvcId::MapProcessMemory: | 4390 | case SvcId::MapProcessMemory: |
| 4391 | return SvcWrap_MapProcessMemory64(system); | 4391 | return SvcWrap_MapProcessMemory64(system, args); |
| 4392 | case SvcId::UnmapProcessMemory: | 4392 | case SvcId::UnmapProcessMemory: |
| 4393 | return SvcWrap_UnmapProcessMemory64(system); | 4393 | return SvcWrap_UnmapProcessMemory64(system, args); |
| 4394 | case SvcId::QueryProcessMemory: | 4394 | case SvcId::QueryProcessMemory: |
| 4395 | return SvcWrap_QueryProcessMemory64(system); | 4395 | return SvcWrap_QueryProcessMemory64(system, args); |
| 4396 | case SvcId::MapProcessCodeMemory: | 4396 | case SvcId::MapProcessCodeMemory: |
| 4397 | return SvcWrap_MapProcessCodeMemory64(system); | 4397 | return SvcWrap_MapProcessCodeMemory64(system, args); |
| 4398 | case SvcId::UnmapProcessCodeMemory: | 4398 | case SvcId::UnmapProcessCodeMemory: |
| 4399 | return SvcWrap_UnmapProcessCodeMemory64(system); | 4399 | return SvcWrap_UnmapProcessCodeMemory64(system, args); |
| 4400 | case SvcId::CreateProcess: | 4400 | case SvcId::CreateProcess: |
| 4401 | return SvcWrap_CreateProcess64(system); | 4401 | return SvcWrap_CreateProcess64(system, args); |
| 4402 | case SvcId::StartProcess: | 4402 | case SvcId::StartProcess: |
| 4403 | return SvcWrap_StartProcess64(system); | 4403 | return SvcWrap_StartProcess64(system, args); |
| 4404 | case SvcId::TerminateProcess: | 4404 | case SvcId::TerminateProcess: |
| 4405 | return SvcWrap_TerminateProcess64(system); | 4405 | return SvcWrap_TerminateProcess64(system, args); |
| 4406 | case SvcId::GetProcessInfo: | 4406 | case SvcId::GetProcessInfo: |
| 4407 | return SvcWrap_GetProcessInfo64(system); | 4407 | return SvcWrap_GetProcessInfo64(system, args); |
| 4408 | case SvcId::CreateResourceLimit: | 4408 | case SvcId::CreateResourceLimit: |
| 4409 | return SvcWrap_CreateResourceLimit64(system); | 4409 | return SvcWrap_CreateResourceLimit64(system, args); |
| 4410 | case SvcId::SetResourceLimitLimitValue: | 4410 | case SvcId::SetResourceLimitLimitValue: |
| 4411 | return SvcWrap_SetResourceLimitLimitValue64(system); | 4411 | return SvcWrap_SetResourceLimitLimitValue64(system, args); |
| 4412 | case SvcId::CallSecureMonitor: | 4412 | case SvcId::CallSecureMonitor: |
| 4413 | return SvcWrap_CallSecureMonitor64(system); | 4413 | return SvcWrap_CallSecureMonitor64(system, args); |
| 4414 | case SvcId::MapInsecureMemory: | 4414 | case SvcId::MapInsecureMemory: |
| 4415 | return SvcWrap_MapInsecureMemory64(system); | 4415 | return SvcWrap_MapInsecureMemory64(system, args); |
| 4416 | case SvcId::UnmapInsecureMemory: | 4416 | case SvcId::UnmapInsecureMemory: |
| 4417 | return SvcWrap_UnmapInsecureMemory64(system); | 4417 | return SvcWrap_UnmapInsecureMemory64(system, args); |
| 4418 | default: | 4418 | default: |
| 4419 | LOG_CRITICAL(Kernel_SVC, "Unknown SVC {:x}!", imm); | 4419 | LOG_CRITICAL(Kernel_SVC, "Unknown SVC {:x}!", imm); |
| 4420 | break; | 4420 | break; |
| @@ -4424,15 +4424,20 @@ static void Call64(Core::System& system, u32 imm) { | |||
| 4424 | 4424 | ||
| 4425 | void Call(Core::System& system, u32 imm) { | 4425 | void Call(Core::System& system, u32 imm) { |
| 4426 | auto& kernel = system.Kernel(); | 4426 | auto& kernel = system.Kernel(); |
| 4427 | auto& process = GetCurrentProcess(kernel); | ||
| 4428 | |||
| 4429 | std::array<uint64_t, 8> args; | ||
| 4430 | kernel.CurrentPhysicalCore().SaveSvcArguments(process, args); | ||
| 4427 | kernel.EnterSVCProfile(); | 4431 | kernel.EnterSVCProfile(); |
| 4428 | 4432 | ||
| 4429 | if (GetCurrentProcess(system.Kernel()).Is64Bit()) { | 4433 | if (process.Is64Bit()) { |
| 4430 | Call64(system, imm); | 4434 | Call64(system, imm, args); |
| 4431 | } else { | 4435 | } else { |
| 4432 | Call32(system, imm); | 4436 | Call32(system, imm, args); |
| 4433 | } | 4437 | } |
| 4434 | 4438 | ||
| 4435 | kernel.ExitSVCProfile(); | 4439 | kernel.ExitSVCProfile(); |
| 4440 | kernel.CurrentPhysicalCore().LoadSvcArguments(process, args); | ||
| 4436 | } | 4441 | } |
| 4437 | 4442 | ||
| 4438 | } // namespace Kernel::Svc | 4443 | } // namespace Kernel::Svc |
diff --git a/src/core/hle/kernel/svc.h b/src/core/hle/kernel/svc.h index ac4696008..828f39611 100644 --- a/src/core/hle/kernel/svc.h +++ b/src/core/hle/kernel/svc.h | |||
| @@ -9,6 +9,8 @@ namespace Core { | |||
| 9 | class System; | 9 | class System; |
| 10 | } | 10 | } |
| 11 | 11 | ||
| 12 | #include <span> | ||
| 13 | |||
| 12 | #include "common/common_types.h" | 14 | #include "common/common_types.h" |
| 13 | #include "core/hle/kernel/svc_types.h" | 15 | #include "core/hle/kernel/svc_types.h" |
| 14 | #include "core/hle/result.h" | 16 | #include "core/hle/result.h" |
| @@ -520,15 +522,15 @@ void CallSecureMonitor64From32(Core::System& system, ilp32::SecureMonitorArgumen | |||
| 520 | void CallSecureMonitor64(Core::System& system, lp64::SecureMonitorArguments* args); | 522 | void CallSecureMonitor64(Core::System& system, lp64::SecureMonitorArguments* args); |
| 521 | 523 | ||
| 522 | // Defined in svc_light_ipc.cpp. | 524 | // Defined in svc_light_ipc.cpp. |
| 523 | void SvcWrap_ReplyAndReceiveLight64From32(Core::System& system); | 525 | void SvcWrap_ReplyAndReceiveLight64From32(Core::System& system, std::span<uint64_t, 8> args); |
| 524 | void SvcWrap_ReplyAndReceiveLight64(Core::System& system); | 526 | void SvcWrap_ReplyAndReceiveLight64(Core::System& system, std::span<uint64_t, 8> args); |
| 525 | 527 | ||
| 526 | void SvcWrap_SendSyncRequestLight64From32(Core::System& system); | 528 | void SvcWrap_SendSyncRequestLight64From32(Core::System& system, std::span<uint64_t, 8> args); |
| 527 | void SvcWrap_SendSyncRequestLight64(Core::System& system); | 529 | void SvcWrap_SendSyncRequestLight64(Core::System& system, std::span<uint64_t, 8> args); |
| 528 | 530 | ||
| 529 | // Defined in svc_secure_monitor_call.cpp. | 531 | // Defined in svc_secure_monitor_call.cpp. |
| 530 | void SvcWrap_CallSecureMonitor64From32(Core::System& system); | 532 | void SvcWrap_CallSecureMonitor64From32(Core::System& system, std::span<uint64_t, 8> args); |
| 531 | void SvcWrap_CallSecureMonitor64(Core::System& system); | 533 | void SvcWrap_CallSecureMonitor64(Core::System& system, std::span<uint64_t, 8> args); |
| 532 | 534 | ||
| 533 | // Perform a supervisor call by index. | 535 | // Perform a supervisor call by index. |
| 534 | void Call(Core::System& system, u32 imm); | 536 | void Call(Core::System& system, u32 imm); |
diff --git a/src/core/hle/kernel/svc/svc_exception.cpp b/src/core/hle/kernel/svc/svc_exception.cpp index c581c086b..47b756828 100644 --- a/src/core/hle/kernel/svc/svc_exception.cpp +++ b/src/core/hle/kernel/svc/svc_exception.cpp | |||
| @@ -103,9 +103,7 @@ void Break(Core::System& system, BreakReason reason, u64 info1, u64 info2) { | |||
| 103 | 103 | ||
| 104 | handle_debug_buffer(info1, info2); | 104 | handle_debug_buffer(info1, info2); |
| 105 | 105 | ||
| 106 | auto* const current_thread = GetCurrentThreadPointer(system.Kernel()); | 106 | system.CurrentPhysicalCore().LogBacktrace(); |
| 107 | const auto thread_processor_id = current_thread->GetActiveCore(); | ||
| 108 | system.ArmInterface(static_cast<std::size_t>(thread_processor_id)).LogBacktrace(); | ||
| 109 | } | 107 | } |
| 110 | 108 | ||
| 111 | const bool is_hbl = GetCurrentProcess(system.Kernel()).IsHbl(); | 109 | const bool is_hbl = GetCurrentProcess(system.Kernel()).IsHbl(); |
diff --git a/src/core/hle/kernel/svc/svc_light_ipc.cpp b/src/core/hle/kernel/svc/svc_light_ipc.cpp index b76ce984c..d757d5af2 100644 --- a/src/core/hle/kernel/svc/svc_light_ipc.cpp +++ b/src/core/hle/kernel/svc/svc_light_ipc.cpp | |||
| @@ -37,37 +37,36 @@ Result ReplyAndReceiveLight64From32(Core::System& system, Handle session_handle, | |||
| 37 | // Custom ABI implementation for light IPC. | 37 | // Custom ABI implementation for light IPC. |
| 38 | 38 | ||
| 39 | template <typename F> | 39 | template <typename F> |
| 40 | static void SvcWrap_LightIpc(Core::System& system, F&& cb) { | 40 | static void SvcWrap_LightIpc(Core::System& system, std::span<uint64_t, 8> args, F&& cb) { |
| 41 | auto& core = system.CurrentArmInterface(); | 41 | std::array<u32, 7> ipc_args{}; |
| 42 | std::array<u32, 7> arguments{}; | ||
| 43 | 42 | ||
| 44 | Handle session_handle = static_cast<Handle>(core.GetReg(0)); | 43 | Handle session_handle = static_cast<Handle>(args[0]); |
| 45 | for (int i = 0; i < 7; i++) { | 44 | for (int i = 0; i < 7; i++) { |
| 46 | arguments[i] = static_cast<u32>(core.GetReg(i + 1)); | 45 | ipc_args[i] = static_cast<u32>(args[i + 1]); |
| 47 | } | 46 | } |
| 48 | 47 | ||
| 49 | Result ret = cb(system, session_handle, arguments.data()); | 48 | Result ret = cb(system, session_handle, ipc_args.data()); |
| 50 | 49 | ||
| 51 | core.SetReg(0, ret.raw); | 50 | args[0] = ret.raw; |
| 52 | for (int i = 0; i < 7; i++) { | 51 | for (int i = 0; i < 7; i++) { |
| 53 | core.SetReg(i + 1, arguments[i]); | 52 | args[i + 1] = ipc_args[i]; |
| 54 | } | 53 | } |
| 55 | } | 54 | } |
| 56 | 55 | ||
| 57 | void SvcWrap_SendSyncRequestLight64(Core::System& system) { | 56 | void SvcWrap_SendSyncRequestLight64(Core::System& system, std::span<uint64_t, 8> args) { |
| 58 | SvcWrap_LightIpc(system, SendSyncRequestLight64); | 57 | SvcWrap_LightIpc(system, args, SendSyncRequestLight64); |
| 59 | } | 58 | } |
| 60 | 59 | ||
| 61 | void SvcWrap_ReplyAndReceiveLight64(Core::System& system) { | 60 | void SvcWrap_ReplyAndReceiveLight64(Core::System& system, std::span<uint64_t, 8> args) { |
| 62 | SvcWrap_LightIpc(system, ReplyAndReceiveLight64); | 61 | SvcWrap_LightIpc(system, args, ReplyAndReceiveLight64); |
| 63 | } | 62 | } |
| 64 | 63 | ||
| 65 | void SvcWrap_SendSyncRequestLight64From32(Core::System& system) { | 64 | void SvcWrap_SendSyncRequestLight64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 66 | SvcWrap_LightIpc(system, SendSyncRequestLight64From32); | 65 | SvcWrap_LightIpc(system, args, SendSyncRequestLight64From32); |
| 67 | } | 66 | } |
| 68 | 67 | ||
| 69 | void SvcWrap_ReplyAndReceiveLight64From32(Core::System& system) { | 68 | void SvcWrap_ReplyAndReceiveLight64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 70 | SvcWrap_LightIpc(system, ReplyAndReceiveLight64From32); | 69 | SvcWrap_LightIpc(system, args, ReplyAndReceiveLight64From32); |
| 71 | } | 70 | } |
| 72 | 71 | ||
| 73 | } // namespace Kernel::Svc | 72 | } // namespace Kernel::Svc |
diff --git a/src/core/hle/kernel/svc/svc_secure_monitor_call.cpp b/src/core/hle/kernel/svc/svc_secure_monitor_call.cpp index 62c781551..48b564ec8 100644 --- a/src/core/hle/kernel/svc/svc_secure_monitor_call.cpp +++ b/src/core/hle/kernel/svc/svc_secure_monitor_call.cpp | |||
| @@ -22,31 +22,29 @@ void CallSecureMonitor64From32(Core::System& system, ilp32::SecureMonitorArgumen | |||
| 22 | 22 | ||
| 23 | // Custom ABI for CallSecureMonitor. | 23 | // Custom ABI for CallSecureMonitor. |
| 24 | 24 | ||
| 25 | void SvcWrap_CallSecureMonitor64(Core::System& system) { | 25 | void SvcWrap_CallSecureMonitor64(Core::System& system, std::span<uint64_t, 8> args) { |
| 26 | auto& core = system.CurrentPhysicalCore().ArmInterface(); | 26 | lp64::SecureMonitorArguments smc_args{}; |
| 27 | lp64::SecureMonitorArguments args{}; | ||
| 28 | for (int i = 0; i < 8; i++) { | 27 | for (int i = 0; i < 8; i++) { |
| 29 | args.r[i] = core.GetReg(i); | 28 | smc_args.r[i] = args[i]; |
| 30 | } | 29 | } |
| 31 | 30 | ||
| 32 | CallSecureMonitor64(system, std::addressof(args)); | 31 | CallSecureMonitor64(system, std::addressof(smc_args)); |
| 33 | 32 | ||
| 34 | for (int i = 0; i < 8; i++) { | 33 | for (int i = 0; i < 8; i++) { |
| 35 | core.SetReg(i, args.r[i]); | 34 | args[i] = smc_args.r[i]; |
| 36 | } | 35 | } |
| 37 | } | 36 | } |
| 38 | 37 | ||
| 39 | void SvcWrap_CallSecureMonitor64From32(Core::System& system) { | 38 | void SvcWrap_CallSecureMonitor64From32(Core::System& system, std::span<uint64_t, 8> args) { |
| 40 | auto& core = system.CurrentPhysicalCore().ArmInterface(); | 39 | ilp32::SecureMonitorArguments smc_args{}; |
| 41 | ilp32::SecureMonitorArguments args{}; | ||
| 42 | for (int i = 0; i < 8; i++) { | 40 | for (int i = 0; i < 8; i++) { |
| 43 | args.r[i] = static_cast<u32>(core.GetReg(i)); | 41 | smc_args.r[i] = static_cast<u32>(args[i]); |
| 44 | } | 42 | } |
| 45 | 43 | ||
| 46 | CallSecureMonitor64From32(system, std::addressof(args)); | 44 | CallSecureMonitor64From32(system, std::addressof(smc_args)); |
| 47 | 45 | ||
| 48 | for (int i = 0; i < 8; i++) { | 46 | for (int i = 0; i < 8; i++) { |
| 49 | core.SetReg(i, args.r[i]); | 47 | args[i] = smc_args.r[i]; |
| 50 | } | 48 | } |
| 51 | } | 49 | } |
| 52 | 50 | ||
diff --git a/src/core/hle/kernel/svc/svc_thread.cpp b/src/core/hle/kernel/svc/svc_thread.cpp index 755fd62b5..7681afa33 100644 --- a/src/core/hle/kernel/svc/svc_thread.cpp +++ b/src/core/hle/kernel/svc/svc_thread.cpp | |||
| @@ -90,8 +90,6 @@ Result StartThread(Core::System& system, Handle thread_handle) { | |||
| 90 | 90 | ||
| 91 | /// Called when a thread exits | 91 | /// Called when a thread exits |
| 92 | void ExitThread(Core::System& system) { | 92 | void ExitThread(Core::System& system) { |
| 93 | LOG_DEBUG(Kernel_SVC, "called, pc=0x{:08X}", system.CurrentArmInterface().GetPC()); | ||
| 94 | |||
| 95 | auto* const current_thread = GetCurrentThreadPointer(system.Kernel()); | 93 | auto* const current_thread = GetCurrentThreadPointer(system.Kernel()); |
| 96 | system.GlobalSchedulerContext().RemoveThread(current_thread); | 94 | system.GlobalSchedulerContext().RemoveThread(current_thread); |
| 97 | current_thread->Exit(); | 95 | current_thread->Exit(); |
| @@ -147,47 +145,19 @@ Result GetThreadContext3(Core::System& system, u64 out_context, Handle thread_ha | |||
| 147 | R_UNLESS(thread.IsNotNull(), ResultInvalidHandle); | 145 | R_UNLESS(thread.IsNotNull(), ResultInvalidHandle); |
| 148 | 146 | ||
| 149 | // Require the handle be to a non-current thread in the current process. | 147 | // Require the handle be to a non-current thread in the current process. |
| 150 | const auto* current_process = GetCurrentProcessPointer(kernel); | 148 | R_UNLESS(thread->GetOwnerProcess() == GetCurrentProcessPointer(kernel), ResultInvalidHandle); |
| 151 | R_UNLESS(current_process == thread->GetOwnerProcess(), ResultInvalidId); | 149 | R_UNLESS(thread.GetPointerUnsafe() != GetCurrentThreadPointer(kernel), ResultBusy); |
| 152 | |||
| 153 | // Verify that the thread isn't terminated. | ||
| 154 | R_UNLESS(thread->GetState() != ThreadState::Terminated, ResultTerminationRequested); | ||
| 155 | |||
| 156 | /// Check that the thread is not the current one. | ||
| 157 | /// NOTE: Nintendo does not check this, and thus the following loop will deadlock. | ||
| 158 | R_UNLESS(thread.GetPointerUnsafe() != GetCurrentThreadPointer(kernel), ResultInvalidId); | ||
| 159 | |||
| 160 | // Try to get the thread context until the thread isn't current on any core. | ||
| 161 | while (true) { | ||
| 162 | KScopedSchedulerLock sl{kernel}; | ||
| 163 | |||
| 164 | // TODO(bunnei): Enforce that thread is suspended for debug here. | ||
| 165 | |||
| 166 | // If the thread's raw state isn't runnable, check if it's current on some core. | ||
| 167 | if (thread->GetRawState() != ThreadState::Runnable) { | ||
| 168 | bool current = false; | ||
| 169 | for (auto i = 0; i < static_cast<s32>(Core::Hardware::NUM_CPU_CORES); ++i) { | ||
| 170 | if (thread.GetPointerUnsafe() == kernel.Scheduler(i).GetSchedulerCurrentThread()) { | ||
| 171 | current = true; | ||
| 172 | break; | ||
| 173 | } | ||
| 174 | } | ||
| 175 | 150 | ||
| 176 | // If the thread is current, retry until it isn't. | 151 | // Get the thread context. |
| 177 | if (current) { | 152 | Svc::ThreadContext context{}; |
| 178 | continue; | 153 | R_TRY(thread->GetThreadContext3(std::addressof(context))); |
| 179 | } | ||
| 180 | } | ||
| 181 | 154 | ||
| 182 | // Get the thread context. | 155 | // Copy the thread context to user space. |
| 183 | static thread_local Common::ScratchBuffer<u8> context; | 156 | R_UNLESS( |
| 184 | R_TRY(thread->GetThreadContext3(context)); | 157 | GetCurrentMemory(kernel).WriteBlock(out_context, std::addressof(context), sizeof(context)), |
| 158 | ResultInvalidPointer); | ||
| 185 | 159 | ||
| 186 | // Copy the thread context to user space. | 160 | R_SUCCEED(); |
| 187 | GetCurrentMemory(kernel).WriteBlock(out_context, context.data(), context.size()); | ||
| 188 | |||
| 189 | R_SUCCEED(); | ||
| 190 | } | ||
| 191 | } | 161 | } |
| 192 | 162 | ||
| 193 | /// Gets the priority for the specified thread | 163 | /// Gets the priority for the specified thread |
diff --git a/src/core/hle/kernel/svc_generator.py b/src/core/hle/kernel/svc_generator.py index 5531faac6..786189ab7 100644 --- a/src/core/hle/kernel/svc_generator.py +++ b/src/core/hle/kernel/svc_generator.py | |||
| @@ -374,11 +374,11 @@ def get_registers(parse_result, bitness): | |||
| 374 | 374 | ||
| 375 | # Collects possibly multiple source registers into the named C++ value. | 375 | # Collects possibly multiple source registers into the named C++ value. |
| 376 | def emit_gather(sources, name, type_name, reg_size): | 376 | def emit_gather(sources, name, type_name, reg_size): |
| 377 | get_fn = f"GetReg{reg_size*8}" | 377 | get_fn = f"GetArg{reg_size*8}" |
| 378 | 378 | ||
| 379 | if len(sources) == 1: | 379 | if len(sources) == 1: |
| 380 | s, = sources | 380 | s, = sources |
| 381 | line = f"{name} = Convert<{type_name}>({get_fn}(system, {s}));" | 381 | line = f"{name} = Convert<{type_name}>({get_fn}(args, {s}));" |
| 382 | return [line] | 382 | return [line] |
| 383 | 383 | ||
| 384 | var_type = f"std::array<uint{reg_size*8}_t, {len(sources)}>" | 384 | var_type = f"std::array<uint{reg_size*8}_t, {len(sources)}>" |
| @@ -387,7 +387,7 @@ def emit_gather(sources, name, type_name, reg_size): | |||
| 387 | ] | 387 | ] |
| 388 | for i in range(0, len(sources)): | 388 | for i in range(0, len(sources)): |
| 389 | lines.append( | 389 | lines.append( |
| 390 | f"{name}_gather[{i}] = {get_fn}(system, {sources[i]});") | 390 | f"{name}_gather[{i}] = {get_fn}(args, {sources[i]});") |
| 391 | 391 | ||
| 392 | lines.append(f"{name} = Convert<{type_name}>({name}_gather);") | 392 | lines.append(f"{name} = Convert<{type_name}>({name}_gather);") |
| 393 | return lines | 393 | return lines |
| @@ -396,12 +396,12 @@ def emit_gather(sources, name, type_name, reg_size): | |||
| 396 | # Produces one or more statements which assign the named C++ value | 396 | # Produces one or more statements which assign the named C++ value |
| 397 | # into possibly multiple registers. | 397 | # into possibly multiple registers. |
| 398 | def emit_scatter(destinations, name, reg_size): | 398 | def emit_scatter(destinations, name, reg_size): |
| 399 | set_fn = f"SetReg{reg_size*8}" | 399 | set_fn = f"SetArg{reg_size*8}" |
| 400 | reg_type = f"uint{reg_size*8}_t" | 400 | reg_type = f"uint{reg_size*8}_t" |
| 401 | 401 | ||
| 402 | if len(destinations) == 1: | 402 | if len(destinations) == 1: |
| 403 | d, = destinations | 403 | d, = destinations |
| 404 | line = f"{set_fn}(system, {d}, Convert<{reg_type}>({name}));" | 404 | line = f"{set_fn}(args, {d}, Convert<{reg_type}>({name}));" |
| 405 | return [line] | 405 | return [line] |
| 406 | 406 | ||
| 407 | var_type = f"std::array<{reg_type}, {len(destinations)}>" | 407 | var_type = f"std::array<{reg_type}, {len(destinations)}>" |
| @@ -411,7 +411,7 @@ def emit_scatter(destinations, name, reg_size): | |||
| 411 | 411 | ||
| 412 | for i in range(0, len(destinations)): | 412 | for i in range(0, len(destinations)): |
| 413 | lines.append( | 413 | lines.append( |
| 414 | f"{set_fn}(system, {destinations[i]}, {name}_scatter[{i}]);") | 414 | f"{set_fn}(args, {destinations[i]}, {name}_scatter[{i}]);") |
| 415 | 415 | ||
| 416 | return lines | 416 | return lines |
| 417 | 417 | ||
| @@ -433,7 +433,7 @@ def emit_lines(lines, indent=' '): | |||
| 433 | def emit_wrapper(wrapped_fn, suffix, register_info, arguments, byte_size): | 433 | def emit_wrapper(wrapped_fn, suffix, register_info, arguments, byte_size): |
| 434 | return_write, output_writes, input_reads = register_info | 434 | return_write, output_writes, input_reads = register_info |
| 435 | lines = [ | 435 | lines = [ |
| 436 | f"static void SvcWrap_{wrapped_fn}{suffix}(Core::System& system) {{" | 436 | f"static void SvcWrap_{wrapped_fn}{suffix}(Core::System& system, std::span<uint64_t, 8> args) {{" |
| 437 | ] | 437 | ] |
| 438 | 438 | ||
| 439 | # Get everything ready. | 439 | # Get everything ready. |
| @@ -498,6 +498,8 @@ namespace Core { | |||
| 498 | class System; | 498 | class System; |
| 499 | } | 499 | } |
| 500 | 500 | ||
| 501 | #include <span> | ||
| 502 | |||
| 501 | #include "common/common_types.h" | 503 | #include "common/common_types.h" |
| 502 | #include "core/hle/kernel/svc_types.h" | 504 | #include "core/hle/kernel/svc_types.h" |
| 503 | #include "core/hle/result.h" | 505 | #include "core/hle/result.h" |
| @@ -524,15 +526,15 @@ void CallSecureMonitor64From32(Core::System& system, ilp32::SecureMonitorArgumen | |||
| 524 | void CallSecureMonitor64(Core::System& system, lp64::SecureMonitorArguments* args); | 526 | void CallSecureMonitor64(Core::System& system, lp64::SecureMonitorArguments* args); |
| 525 | 527 | ||
| 526 | // Defined in svc_light_ipc.cpp. | 528 | // Defined in svc_light_ipc.cpp. |
| 527 | void SvcWrap_ReplyAndReceiveLight64From32(Core::System& system); | 529 | void SvcWrap_ReplyAndReceiveLight64From32(Core::System& system, std::span<uint64_t, 8> args); |
| 528 | void SvcWrap_ReplyAndReceiveLight64(Core::System& system); | 530 | void SvcWrap_ReplyAndReceiveLight64(Core::System& system, std::span<uint64_t, 8> args); |
| 529 | 531 | ||
| 530 | void SvcWrap_SendSyncRequestLight64From32(Core::System& system); | 532 | void SvcWrap_SendSyncRequestLight64From32(Core::System& system, std::span<uint64_t, 8> args); |
| 531 | void SvcWrap_SendSyncRequestLight64(Core::System& system); | 533 | void SvcWrap_SendSyncRequestLight64(Core::System& system, std::span<uint64_t, 8> args); |
| 532 | 534 | ||
| 533 | // Defined in svc_secure_monitor_call.cpp. | 535 | // Defined in svc_secure_monitor_call.cpp. |
| 534 | void SvcWrap_CallSecureMonitor64From32(Core::System& system); | 536 | void SvcWrap_CallSecureMonitor64From32(Core::System& system, std::span<uint64_t, 8> args); |
| 535 | void SvcWrap_CallSecureMonitor64(Core::System& system); | 537 | void SvcWrap_CallSecureMonitor64(Core::System& system, std::span<uint64_t, 8> args); |
| 536 | 538 | ||
| 537 | // Perform a supervisor call by index. | 539 | // Perform a supervisor call by index. |
| 538 | void Call(Core::System& system, u32 imm); | 540 | void Call(Core::System& system, u32 imm); |
| @@ -550,20 +552,20 @@ PROLOGUE_CPP = """ | |||
| 550 | 552 | ||
| 551 | namespace Kernel::Svc { | 553 | namespace Kernel::Svc { |
| 552 | 554 | ||
| 553 | static uint32_t GetReg32(Core::System& system, int n) { | 555 | static uint32_t GetArg32(std::span<uint64_t, 8> args, int n) { |
| 554 | return static_cast<uint32_t>(system.CurrentArmInterface().GetReg(n)); | 556 | return static_cast<uint32_t>(args[n]); |
| 555 | } | 557 | } |
| 556 | 558 | ||
| 557 | static void SetReg32(Core::System& system, int n, uint32_t result) { | 559 | static void SetArg32(std::span<uint64_t, 8> args, int n, uint32_t result) { |
| 558 | system.CurrentArmInterface().SetReg(n, static_cast<uint64_t>(result)); | 560 | args[n] = result; |
| 559 | } | 561 | } |
| 560 | 562 | ||
| 561 | static uint64_t GetReg64(Core::System& system, int n) { | 563 | static uint64_t GetArg64(std::span<uint64_t, 8> args, int n) { |
| 562 | return system.CurrentArmInterface().GetReg(n); | 564 | return args[n]; |
| 563 | } | 565 | } |
| 564 | 566 | ||
| 565 | static void SetReg64(Core::System& system, int n, uint64_t result) { | 567 | static void SetArg64(std::span<uint64_t, 8> args, int n, uint64_t result) { |
| 566 | system.CurrentArmInterface().SetReg(n, result); | 568 | args[n] = result; |
| 567 | } | 569 | } |
| 568 | 570 | ||
| 569 | // Like bit_cast, but handles the case when the source and dest | 571 | // Like bit_cast, but handles the case when the source and dest |
| @@ -590,15 +592,20 @@ EPILOGUE_CPP = """ | |||
| 590 | 592 | ||
| 591 | void Call(Core::System& system, u32 imm) { | 593 | void Call(Core::System& system, u32 imm) { |
| 592 | auto& kernel = system.Kernel(); | 594 | auto& kernel = system.Kernel(); |
| 595 | auto& process = GetCurrentProcess(kernel); | ||
| 596 | |||
| 597 | std::array<uint64_t, 8> args; | ||
| 598 | kernel.CurrentPhysicalCore().SaveSvcArguments(process, args); | ||
| 593 | kernel.EnterSVCProfile(); | 599 | kernel.EnterSVCProfile(); |
| 594 | 600 | ||
| 595 | if (GetCurrentProcess(system.Kernel()).Is64Bit()) { | 601 | if (process.Is64Bit()) { |
| 596 | Call64(system, imm); | 602 | Call64(system, imm, args); |
| 597 | } else { | 603 | } else { |
| 598 | Call32(system, imm); | 604 | Call32(system, imm, args); |
| 599 | } | 605 | } |
| 600 | 606 | ||
| 601 | kernel.ExitSVCProfile(); | 607 | kernel.ExitSVCProfile(); |
| 608 | kernel.CurrentPhysicalCore().LoadSvcArguments(process, args); | ||
| 602 | } | 609 | } |
| 603 | 610 | ||
| 604 | } // namespace Kernel::Svc | 611 | } // namespace Kernel::Svc |
| @@ -609,13 +616,13 @@ def emit_call(bitness, names, suffix): | |||
| 609 | bit_size = REG_SIZES[bitness]*8 | 616 | bit_size = REG_SIZES[bitness]*8 |
| 610 | indent = " " | 617 | indent = " " |
| 611 | lines = [ | 618 | lines = [ |
| 612 | f"static void Call{bit_size}(Core::System& system, u32 imm) {{", | 619 | f"static void Call{bit_size}(Core::System& system, u32 imm, std::span<uint64_t, 8> args) {{", |
| 613 | f"{indent}switch (static_cast<SvcId>(imm)) {{" | 620 | f"{indent}switch (static_cast<SvcId>(imm)) {{" |
| 614 | ] | 621 | ] |
| 615 | 622 | ||
| 616 | for _, name in names: | 623 | for _, name in names: |
| 617 | lines.append(f"{indent}case SvcId::{name}:") | 624 | lines.append(f"{indent}case SvcId::{name}:") |
| 618 | lines.append(f"{indent*2}return SvcWrap_{name}{suffix}(system);") | 625 | lines.append(f"{indent*2}return SvcWrap_{name}{suffix}(system, args);") |
| 619 | 626 | ||
| 620 | lines.append(f"{indent}default:") | 627 | lines.append(f"{indent}default:") |
| 621 | lines.append( | 628 | lines.append( |