diff options
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/kernel/svc/svc_device_address_space.cpp | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/src/core/hle/kernel/svc/svc_device_address_space.cpp b/src/core/hle/kernel/svc/svc_device_address_space.cpp index cdc453c35..f68c0e6a9 100644 --- a/src/core/hle/kernel/svc/svc_device_address_space.cpp +++ b/src/core/hle/kernel/svc/svc_device_address_space.cpp @@ -37,15 +37,16 @@ Result CreateDeviceAddressSpace(Core::System& system, Handle* out, uint64_t das_ KDeviceAddressSpace::Register(system.Kernel(), das); // Add to the handle table. - R_TRY(system.CurrentProcess()->GetHandleTable().Add(out, das)); + R_TRY(GetCurrentProcess(system.Kernel()).GetHandleTable().Add(out, das)); R_SUCCEED(); } Result AttachDeviceAddressSpace(Core::System& system, DeviceName device_name, Handle das_handle) { // Get the device address space. - KScopedAutoObject das = - system.CurrentProcess()->GetHandleTable().GetObject<KDeviceAddressSpace>(das_handle); + KScopedAutoObject das = GetCurrentProcess(system.Kernel()) + .GetHandleTable() + .GetObject<KDeviceAddressSpace>(das_handle); R_UNLESS(das.IsNotNull(), ResultInvalidHandle); // Attach. @@ -54,8 +55,9 @@ Result AttachDeviceAddressSpace(Core::System& system, DeviceName device_name, Ha Result DetachDeviceAddressSpace(Core::System& system, DeviceName device_name, Handle das_handle) { // Get the device address space. - KScopedAutoObject das = - system.CurrentProcess()->GetHandleTable().GetObject<KDeviceAddressSpace>(das_handle); + KScopedAutoObject das = GetCurrentProcess(system.Kernel()) + .GetHandleTable() + .GetObject<KDeviceAddressSpace>(das_handle); R_UNLESS(das.IsNotNull(), ResultInvalidHandle); // Detach. @@ -94,13 +96,14 @@ Result MapDeviceAddressSpaceByForce(Core::System& system, Handle das_handle, Han R_UNLESS(reserved == 0, ResultInvalidEnumValue); // Get the device address space. - KScopedAutoObject das = - system.CurrentProcess()->GetHandleTable().GetObject<KDeviceAddressSpace>(das_handle); + KScopedAutoObject das = GetCurrentProcess(system.Kernel()) + .GetHandleTable() + .GetObject<KDeviceAddressSpace>(das_handle); R_UNLESS(das.IsNotNull(), ResultInvalidHandle); // Get the process. KScopedAutoObject process = - system.CurrentProcess()->GetHandleTable().GetObject<KProcess>(process_handle); + GetCurrentProcess(system.Kernel()).GetHandleTable().GetObject<KProcess>(process_handle); R_UNLESS(process.IsNotNull(), ResultInvalidHandle); // Validate that the process address is within range. @@ -134,13 +137,14 @@ Result MapDeviceAddressSpaceAligned(Core::System& system, Handle das_handle, Han R_UNLESS(reserved == 0, ResultInvalidEnumValue); // Get the device address space. - KScopedAutoObject das = - system.CurrentProcess()->GetHandleTable().GetObject<KDeviceAddressSpace>(das_handle); + KScopedAutoObject das = GetCurrentProcess(system.Kernel()) + .GetHandleTable() + .GetObject<KDeviceAddressSpace>(das_handle); R_UNLESS(das.IsNotNull(), ResultInvalidHandle); // Get the process. KScopedAutoObject process = - system.CurrentProcess()->GetHandleTable().GetObject<KProcess>(process_handle); + GetCurrentProcess(system.Kernel()).GetHandleTable().GetObject<KProcess>(process_handle); R_UNLESS(process.IsNotNull(), ResultInvalidHandle); // Validate that the process address is within range. @@ -165,13 +169,14 @@ Result UnmapDeviceAddressSpace(Core::System& system, Handle das_handle, Handle p ResultInvalidCurrentMemory); // Get the device address space. - KScopedAutoObject das = - system.CurrentProcess()->GetHandleTable().GetObject<KDeviceAddressSpace>(das_handle); + KScopedAutoObject das = GetCurrentProcess(system.Kernel()) + .GetHandleTable() + .GetObject<KDeviceAddressSpace>(das_handle); R_UNLESS(das.IsNotNull(), ResultInvalidHandle); // Get the process. KScopedAutoObject process = - system.CurrentProcess()->GetHandleTable().GetObject<KProcess>(process_handle); + GetCurrentProcess(system.Kernel()).GetHandleTable().GetObject<KProcess>(process_handle); R_UNLESS(process.IsNotNull(), ResultInvalidHandle); // Validate that the process address is within range. |