diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2020-12-01 20:23:43 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-12-02 00:23:43 +0100 |
| commit | cf6cd714884c41e9550757e364c2f4f5b04fc7f3 (patch) | |
| tree | bea748b4d1a350e5b8075d63ec9d39d49693829d /Ryujinx.HLE/HOS/Kernel/Ipc/KServerSession.cs | |
| parent | 461c24092ae6e148d896c18aa3e86220c89981f8 (diff) | |
IPC refactor part 2: Use ReplyAndReceive on HLE services and remove special handling from kernel (#1458)
* IPC refactor part 2: Use ReplyAndReceive on HLE services and remove special handling from kernel
* Fix for applet transfer memory + some nits
* Keep handles if possible to avoid server handle table exhaustion
* Fix IPC ZeroFill bug
* am: Correctly implement CreateManagedDisplayLayer and implement CreateManagedDisplaySeparableLayer
CreateManagedDisplaySeparableLayer is requires since 10.x+ when appletResourceUserId != 0
* Make it exit properly
* Make ServiceNotImplementedException show the full message again
* Allow yielding execution to avoid starving other threads
* Only wait if active
* Merge IVirtualMemoryManager and IAddressSpaceManager
* Fix Ro loading data from the wrong process
Co-authored-by: Thog <me@thog.eu>
Diffstat (limited to 'Ryujinx.HLE/HOS/Kernel/Ipc/KServerSession.cs')
| -rw-r--r-- | Ryujinx.HLE/HOS/Kernel/Ipc/KServerSession.cs | 34 |
1 files changed, 13 insertions, 21 deletions
diff --git a/Ryujinx.HLE/HOS/Kernel/Ipc/KServerSession.cs b/Ryujinx.HLE/HOS/Kernel/Ipc/KServerSession.cs index 48669832..e9c6127f 100644 --- a/Ryujinx.HLE/HOS/Kernel/Ipc/KServerSession.cs +++ b/Ryujinx.HLE/HOS/Kernel/Ipc/KServerSession.cs @@ -430,7 +430,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Ipc descriptor.BufferAddress, MemoryState.IsPoolAllocated, MemoryState.IsPoolAllocated, - MemoryPermission.Read, + KMemoryPermission.Read, MemoryAttribute.Uncached, MemoryAttribute.None); @@ -473,9 +473,9 @@ namespace Ryujinx.HLE.HOS.Kernel.Ipc bool notReceiveDesc = isSendDesc || isExchangeDesc; bool isReceiveDesc = !notReceiveDesc; - MemoryPermission permission = index >= clientHeader.SendBuffersCount - ? MemoryPermission.ReadAndWrite - : MemoryPermission.Read; + KMemoryPermission permission = index >= clientHeader.SendBuffersCount + ? KMemoryPermission.ReadAndWrite + : KMemoryPermission.Read; uint sizeHigh4 = (descWord2 >> 24) & 0xf; @@ -559,9 +559,9 @@ namespace Ryujinx.HLE.HOS.Kernel.Ipc if (serverMsg.IsCustom || clientMsg.IsCustom) { - MemoryPermission permission = clientMsg.IsCustom - ? MemoryPermission.None - : MemoryPermission.Read; + KMemoryPermission permission = clientMsg.IsCustom + ? KMemoryPermission.None + : KMemoryPermission.Read; clientResult = clientProcess.MemoryManager.CopyDataToCurrentProcess( copyDst, @@ -795,7 +795,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Ipc descriptor.BufferSize, MemoryState.IsPoolAllocated, MemoryState.IsPoolAllocated, - MemoryPermission.Read, + KMemoryPermission.Read, MemoryAttribute.Uncached, MemoryAttribute.None, descriptor.BufferAddress); @@ -849,9 +849,9 @@ namespace Ryujinx.HLE.HOS.Kernel.Ipc if (serverMsg.IsCustom || clientMsg.IsCustom) { - MemoryPermission permission = clientMsg.IsCustom - ? MemoryPermission.None - : MemoryPermission.Read; + KMemoryPermission permission = clientMsg.IsCustom + ? KMemoryPermission.None + : KMemoryPermission.Read; clientResult = clientProcess.MemoryManager.CopyDataFromCurrentProcess( copyDst, @@ -898,11 +898,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Ipc return new MessageHeader(word0, word1, word2); } - private KernelResult GetCopyObjectHandle( - KThread srcThread, - KProcess dstProcess, - int srcHandle, - out int dstHandle) + private KernelResult GetCopyObjectHandle(KThread srcThread, KProcess dstProcess, int srcHandle, out int dstHandle) { dstHandle = 0; @@ -933,11 +929,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Ipc } } - private KernelResult GetMoveObjectHandle( - KProcess srcProcess, - KProcess dstProcess, - int srcHandle, - out int dstHandle) + private KernelResult GetMoveObjectHandle(KProcess srcProcess, KProcess dstProcess, int srcHandle, out int dstHandle) { dstHandle = 0; |
