mirror of
https://git.743378673.xyz/MeloNX/MeloNX.git
synced 2025-08-02 18:17:10 +02:00
[WIP] Add support for events (#60)
* Add support for events, move concept of domains to IpcService * Support waiting for KThread, remove some test code, other tweaks * Use move handle on NIFM since I can't test that now, it's better to leave it how it was
This commit is contained in:
parent
4940cf0ea5
commit
4314a8f3e5
101 changed files with 1120 additions and 836 deletions
|
@ -1,13 +1,17 @@
|
|||
using Ryujinx.Core.OsHle.Handles;
|
||||
using Ryujinx.Core.OsHle.Ipc;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Ryujinx.Core.OsHle.IpcServices.Nifm
|
||||
{
|
||||
class IRequest : IIpcService
|
||||
class IRequest : IpcService, IDisposable
|
||||
{
|
||||
private Dictionary<int, ServiceProcessRequest> m_Commands;
|
||||
|
||||
public IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands;
|
||||
public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands;
|
||||
|
||||
private KEvent Event;
|
||||
|
||||
public IRequest()
|
||||
{
|
||||
|
@ -17,9 +21,10 @@ namespace Ryujinx.Core.OsHle.IpcServices.Nifm
|
|||
{ 1, GetResult },
|
||||
{ 2, GetSystemEventReadableHandles }
|
||||
};
|
||||
|
||||
Event = new KEvent();
|
||||
}
|
||||
|
||||
// -> i32
|
||||
public long GetRequestState(ServiceCtx Context)
|
||||
{
|
||||
Context.ResponseData.Write(0);
|
||||
|
@ -39,11 +44,25 @@ namespace Ryujinx.Core.OsHle.IpcServices.Nifm
|
|||
//GetSystemEventReadableHandles() -> (KObject, KObject)
|
||||
public long GetSystemEventReadableHandles(ServiceCtx Context)
|
||||
{
|
||||
Context.Response.HandleDesc = IpcHandleDesc.MakeMove(0xbadcafe);
|
||||
//FIXME: Is this supposed to return 2 events?
|
||||
int Handle = Context.Process.HandleTable.OpenHandle(Event);
|
||||
|
||||
//Todo: Stub
|
||||
Context.Response.HandleDesc = IpcHandleDesc.MakeMove(Handle);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Dispose(true);
|
||||
}
|
||||
|
||||
protected virtual void Dispose(bool Disposing)
|
||||
{
|
||||
if (Disposing)
|
||||
{
|
||||
Event.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue