mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2024-08-19 21:52:22 +00:00
am: IApplicationFunctions GetGpuErrorDetectedSystemEvent implementation (#775)
This commit is contained in:
parent
f48df486e2
commit
92e5e3c505
|
@ -1,12 +1,21 @@
|
|||
using Ryujinx.Common.Logging;
|
||||
using Ryujinx.HLE.HOS.Ipc;
|
||||
using Ryujinx.HLE.HOS.Kernel.Common;
|
||||
using Ryujinx.HLE.HOS.Kernel.Threading;
|
||||
using Ryujinx.HLE.HOS.Services.Am.AppletAE;
|
||||
using Ryujinx.HLE.HOS.Services.Am.AppletAE.Storage;
|
||||
using System;
|
||||
|
||||
namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.ApplicationProxy
|
||||
{
|
||||
class IApplicationFunctions : IpcService
|
||||
{
|
||||
public IApplicationFunctions() { }
|
||||
private KEvent _gpuErrorDetectedSystemEvent;
|
||||
|
||||
public IApplicationFunctions(Horizon system)
|
||||
{
|
||||
_gpuErrorDetectedSystemEvent = new KEvent(system);
|
||||
}
|
||||
|
||||
[Command(1)]
|
||||
// PopLaunchParameter(u32) -> object<nn::am::service::IStorage>
|
||||
|
@ -113,5 +122,23 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati
|
|||
|
||||
return ResultCode.Success;
|
||||
}
|
||||
|
||||
[Command(130)] // 8.0.0+
|
||||
// GetGpuErrorDetectedSystemEvent() -> handle<copy>
|
||||
public ResultCode GetGpuErrorDetectedSystemEvent(ServiceCtx context)
|
||||
{
|
||||
if (context.Process.HandleTable.GenerateHandle(_gpuErrorDetectedSystemEvent.ReadableEvent, out int gpuErrorDetectedSystemEventHandle) != KernelResult.Success)
|
||||
{
|
||||
throw new InvalidOperationException("Out of handles!");
|
||||
}
|
||||
|
||||
context.Response.HandleDesc = IpcHandleDesc.MakeCopy(gpuErrorDetectedSystemEventHandle);
|
||||
|
||||
// NOTE: This is used by "sdk" NSO during applet-application initialization.
|
||||
// A seperate thread is setup where event-waiting is handled.
|
||||
// When the Event is signaled, official sw will assert.
|
||||
|
||||
return ResultCode.Success;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -65,7 +65,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService
|
|||
// GetApplicationFunctions() -> object<nn::am::service::IApplicationFunctions>
|
||||
public ResultCode GetApplicationFunctions(ServiceCtx context)
|
||||
{
|
||||
MakeObject(context, new IApplicationFunctions());
|
||||
MakeObject(context, new IApplicationFunctions(context.Device.System));
|
||||
|
||||
return ResultCode.Success;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
using Ryujinx.HLE.HOS.Services.Am.AppletAE;
|
||||
using Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService;
|
||||
|
||||
namespace Ryujinx.HLE.HOS.Services.Am
|
||||
|
|
Loading…
Reference in a new issue