kernel: A bit of refactoring and fix GetThreadContext3 correctness (#3042)
* Start refactoring kernel a bit and import some changes from kernel decoupling PR * kernel: Put output always at the start in Syscall functions * kernel: Rewrite GetThreadContext3 to use a structure and to be accurate * kernel: make KernelTransfer use generic types and simplify * Fix some warning and do not use getters on MemoryInfo * Address gdkchan's comment * GetThreadContext3: use correct pause flag
This commit is contained in:
parent
c52158b733
commit
20ce37dee6
17 changed files with 386 additions and 321 deletions
|
@ -87,7 +87,7 @@ namespace Ryujinx.HLE.HOS.Services
|
|||
|
||||
if (SmObjectFactory != null)
|
||||
{
|
||||
_context.Syscall.ManageNamedPort("sm:", 50, out int serverPortHandle);
|
||||
_context.Syscall.ManageNamedPort(out int serverPortHandle, "sm:", 50);
|
||||
|
||||
AddPort(serverPortHandle, SmObjectFactory);
|
||||
}
|
||||
|
@ -96,7 +96,7 @@ namespace Ryujinx.HLE.HOS.Services
|
|||
|
||||
KThread thread = KernelStatic.GetCurrentThread();
|
||||
ulong messagePtr = thread.TlsAddress;
|
||||
_context.Syscall.SetHeapSize(0x200000, out ulong heapAddr);
|
||||
_context.Syscall.SetHeapSize(out ulong heapAddr, 0x200000);
|
||||
|
||||
_selfProcess.CpuMemory.Write(messagePtr + 0x0, 0);
|
||||
_selfProcess.CpuMemory.Write(messagePtr + 0x4, 2 << 10);
|
||||
|
@ -114,7 +114,7 @@ namespace Ryujinx.HLE.HOS.Services
|
|||
sessionHandles.CopyTo(handles, portHandles.Length);
|
||||
|
||||
// We still need a timeout here to allow the service to pick up and listen new sessions...
|
||||
var rc = _context.Syscall.ReplyAndReceive(handles, replyTargetHandle, 1000000L, out int signaledIndex);
|
||||
var rc = _context.Syscall.ReplyAndReceive(out int signaledIndex, handles, replyTargetHandle, 1000000L);
|
||||
|
||||
thread.HandlePostSyscall();
|
||||
|
||||
|
@ -140,7 +140,7 @@ namespace Ryujinx.HLE.HOS.Services
|
|||
if (rc == KernelResult.Success)
|
||||
{
|
||||
// We got a new connection, accept the session to allow servicing future requests.
|
||||
if (_context.Syscall.AcceptSession(handles[signaledIndex], out int serverSessionHandle) == KernelResult.Success)
|
||||
if (_context.Syscall.AcceptSession(out int serverSessionHandle, handles[signaledIndex]) == KernelResult.Success)
|
||||
{
|
||||
IpcService obj = _ports[handles[signaledIndex]].Invoke();
|
||||
|
||||
|
@ -247,7 +247,7 @@ namespace Ryujinx.HLE.HOS.Services
|
|||
case 4:
|
||||
int unknown = reqReader.ReadInt32();
|
||||
|
||||
_context.Syscall.CreateSession(false, 0, out int dupServerSessionHandle, out int dupClientSessionHandle);
|
||||
_context.Syscall.CreateSession(out int dupServerSessionHandle, out int dupClientSessionHandle, false, 0);
|
||||
|
||||
AddSessionObj(dupServerSessionHandle, _sessions[serverSessionHandle]);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue