[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:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user